[mythtv-users] controlling order of tuner card detection?

Michael Thome mthome at bbn.com
Mon Mar 12 17:29:40 UTC 2007


I've had great success using udev to rearrange things - enough that I'm 
satisfied with my current setup - thanks again for the hints.  However, 
as I was working through things, a few questions/issues came to mind 
that I thought you might have some suggestions for:
1. one might have two identical video cards (say, two pvr-150s) 
connected to different sources, e.g. one connected just to cable, one to 
cable+video-in (for cable box). The only way to disambiguate here would 
be to use the physical slot information to create symlinks, say to 
/dev/pci/[0-4]/video.  The annoyance here is that KERNEL and SUBSYSTEM 
keys are in the first group of udevinfo, while the bus info is in the 
next attribute group.  At the moment, I'm using SYSFS{class} to key on, 
but I have no idea if this is ok (or merely terribly coincidental).
2. audio (oss dsp devices) have a similar problem - alsa offers better 
solutions I think, but it would be nice if there was also a udev option 
to symlink the sound devices to the video devices provided by the same 
card.  For instance, it would be great if a system with two hd5500s 
could look like:

    /dev/pci/0/video
    /dev/pci/0/dsp
    /dev/pci/0/dvb/*
    /dev/pci/1/video
    /dev/pci/1/dsp
    /dev/pci/1/dvb/*

Sysfs comes darn close to serving for this purpose, but there aren't any 
links to the kernel dev special files...

It still strikes me as a serious defect in linux that device assignments 
aren't stable across reboots... my personal experience is that it 
appears that something intentional is going on: as far as I can tell, 
video0 and video1 assignments swap on every reboot.

Rod Smith wrote:
> On Sunday 04 March 2007 14:19, Michael Thome wrote:
>   
>> Sometimes, my tuner cards are detected and thus assigned to /dev/videoX
>> numbers in different orders - this wouldn't be an issue except that they
>> have very different connections and features.  Right now, I've got a
>> pvr-150 with both cable and video-in and a hd5500 with qam and backup
>> cable in - if they get detected in the wrong order, /dev/video doesn't
>> have an mpeg encoder, doesn't have an attached cable box to video0, and
>> gets darn nasty reception.  I've been planning to replace the 150 with a
>> 500, but I'm nervous that it'll make things even worse...
>>
>> Is there any way to force detection to proceed in bus-order, presumably
>> not changing unless I swap cards?
>>     
>
> I replied to your query earlier; however, your question inspired me to write a 
> new wiki entry:
>
> http://www.mythtv.org/wiki/index.php/Device_Filenames_and_udev
>
> This entry only covers one method of approaching this problem (namely, using 
> udev to create unique device filenames). Other approaches are possible and 
> may be simpler to configure in some (perhaps many) cases. Still, the udev 
> approach is extremely flexible.
>
>   

-- 
*Michael Thome*
BBN Technologies 10 Moulton St, Cambridge MA 02138 USA
phone: +1 617 873 1853



More information about the mythtv-users mailing list