Rene Bredlau wrote:
Hi,
even if i do not like the way vdr tries to find the v4l device it can use for his grab command i adjusted its handling to work under kernel 2.6.
If somebody can show me a way to determinate which v4l device belongs to a DVB driver instance i will build a better patch. But up to this, this patch will do the work under 2.6 (2.4 handling still in, but not tested from my side - reports, if i didnt break anything are welcome).
The patch should cleanly apply to vdr-1.3.5 (plain and elchi)
Klaus: if the patch did not break anything, could you please but it into the your version too? Maybe it is ok for stable to, but dont know ;-).
I just found this old thread while cleaning up my inbox. Is this still a problem, or have things gotten better due to other changes (VDR or driver) in the meantime?
Sorry for having lost sight of this one...
Klaus
--- dvbdevice.c 2004-02-24 11:12:13.000000000 +0100 +++ ../../vdr/dvbdevice.c 2004-03-13 18:07:39.000000000 +0100 @@ -24,6 +24,7 @@ #include <linux/dvb/video.h> #include <sys/ioctl.h> #include <sys/mman.h> +#include <sys/utsname.h> #include "channels.h" #include "diseqc.h" #include "dvbosd.h" @@ -326,11 +327,37 @@ if (devVideoOffset < 0) { // the first one checks this FILE *f = NULL; char buffer[PATH_MAX];
char *path_template = "/proc/video/dev/video%d"; // default is 2.4 - maybe this should be 2.6
utsname uname_data;
// get kernel version
if (uname(&uname_data)) {
- dsyslog("! Could not get info about kernel version !");
} else {
- dsyslog("kernel version %s", uname_data.release);
- // adjust path template
- if (!strncmp(uname_data.release,"2.4",3)) {
dsyslog("Running on Kernel version 2.4");
path_template = "/proc/video/dev/video%d";
- } else if (!strncmp(uname_data.release,"2.6",3)) {
dsyslog("Running on Kernel version 2.6");
path_template = "/sys/class/video4linux/video%d/name";
- } else {
dsyslog("! Unknown kernel version falling back to 2.4 behavior !");
- } // endif kernel version
} // endif uname
for (int ofs = 0; ofs < 100; ofs++) {
snprintf(buffer, sizeof(buffer), "/proc/video/dev/video%d", ofs);
// the path depend on the kernel version
snprintf(buffer, sizeof(buffer), path_template, ofs); if ((f = fopen(buffer, "r")) != NULL) { if (fgets(buffer, sizeof(buffer), f)) {
if (strstr(buffer, "DVB Board")) { // found the _first_ DVB card
// here all devices which support output should be listed (aka DVB backends)
if (strstr(buffer, "av7110") || // ttpci backend
strstr(buffer, "some-other-frontend") || // fill in your backend
strstr(buffer, "DVB Board") // this is for kernel 2.4
) { // found the _first_ DVB card devVideoOffset = ofs; dsyslog("video device offset is %d", devVideoOffset); break;