[vdr] sparse DVB adapter numbers

Klaus Schmidinger Klaus.Schmidinger at cadsoft.de
Sun Mar 22 14:21:07 CET 2009


On 21.03.2009 14:17, Artur Skawina wrote:
> Patrick Rother wrote:
>> For a reason not to go in details too much here, I would like to make
>> vdr recognise sparse DVB adapter numbers.
>>
>> I have:
>>
>> root at vdr:/dev/dvb# ls -l
>> total 0
>> drwxr-xr-x 2 root root 200 Mar 19 11:59 adapter0/
>> drwxr-xr-x 2 root root 120 Mar 19 11:59 adapter1/
>> drwxr-xr-x 2 root root 120 Mar 19 11:59 adapter5/
>> drwxr-xr-x 2 root root 120 Mar 19 11:59 adapter6/
>> drwxr-xr-x 2 root root 120 Mar 19 11:59 adapter7/
>> root at vdr:/dev/dvb# 
>>
>> But vdr uses only the first two devices.
>>
>> Is there any easy possibility to patch the code accordingly?
> 
> ./vdr -D 0 -D 1 -D 5 -D 6 -D 7

I'm afraid this won't work, because VDR stops scaning for DVB devices
as soon as it hits a gap.

You might want to try changing this function:

bool cDvbDevice::Initialize(void)
{
  int found = 0;
  int i;
  for (i = 0; i < MAXDVBDEVICES; i++) {
      if (UseDevice(NextCardIndex())) {
         if (Probe(*cDvbName(DEV_DVB_FRONTEND, i))) {
            new cDvbDevice(i);
            found++;
            }
         else
            NextCardIndex(1); // skips this one  <=========== changed line
         }
      else
         NextCardIndex(1); // skips this one
      }
  NextCardIndex(MAXDVBDEVICES - i); // skips the rest
  if (found > 0)
     isyslog("found %d video device%s", found, found > 1 ? "s" : "");
  else
     isyslog("no DVB device found");
  return found > 0;
}

Untested, don't know if it will actually work as expected.

Klaus



More information about the vdr mailing list