[vdr] VDR needs some way to detect new tuners on runtime...

VDR User user.vdr at gmail.com
Tue Aug 20 18:13:19 CEST 2013


On Tue, Aug 20, 2013 at 1:20 AM, Manuel Reimer <manuel.reimer at gmx.de> wrote:

>    NUMADAPTERS=3
>
>>    while [[ `find /dev/dvb -name 'adapter*' | wc -l` -lt $NUMADAPTERS
>> ]]; do sleep 1; done
>>    runvdr ...
>>
>> could be used to count the number of adapters, and check that number in
>> a loop
>> against the expected number of adapters.
>>
>
> This works for *one* system and only if the user manually sets the number
> of adapters. How could this be done in a "automagic" way to allow users to
> just plug the tuner and reboot?
>

I don't think you can automate that in a very reliable way, especially if
you're using usb dvb devices and/or devices with field values that aren't
set correctly. The only reliable way is to have the user define how many
dvb devices are expected to init, and then wait for that to happen during
boot. Something like:

dvbcount=3
until (($dvbcount == $(ls -d /dev/dvb/adapter* |wc -l))); do sleep 1; done

Additionally I would add a timeout if you plan on doing this during boot:

dvbcount=3
timeout=60
until (($dvbcount == $(ls -d /dev/dvb/adapter* |wc -l) || timeout == 0));
do sleep 1; ((timeout--)); done
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.linuxtv.org/pipermail/vdr/attachments/20130820/4ce66cf2/attachment.html>


More information about the vdr mailing list