Skip to contentSkip to conversation

Order of DVB devices

DISCUSSION Andreas Besse 3 participants 4 messages Jan 26, 2010 – Jan 27, 2010

lore
Share & tools
lore
#0 lore raw

Hello,

i have a system with multiple DVB cards of the same type and want to specify the order of the devices /dev/dvb/adapterX. The device plugged into the physical PCI slot 1 on the mainboard should be assigned to /dev/dvb/adapter0 and the card in PCI slot 2 should be assigned to /dev/dvb/adapter1.

To identify a DVB card I looked at the output of udevinfo for 2 DVB devices. The devices don't provide a serial, so the difference is only in the KERNELS parameter (e.g. KERNELS="0000:02:00.0" vs. KERNELS="0000:03:00.0"). The Kernels parameter seem to reflect the PCI Bus ID.

According to the thread http://thread.gmane.org/gmane.linux.kernel.pci/7446/focust47 on the linux-pci mailinglist, the PCI Bus ID is *not* deterministic and totally random determined at boot.

In the following post http://thread.gmane.org/gmane.linux.kernel.pci/7446/focust67 there is mentioned that the order of the devices can be specified by using udev rules.

But how this can be done? Which information in /sys can be used to determine which DVB device is connected to which specific slot?

regards,
Andreas Besse

#1 lore raw
Quoted 19 lines · Andreas Besse

Hello,

i have a system with multiple DVB cards of the same type and want to specify the order of the devices /dev/dvb/adapterX. The device plugged into the physical PCI slot 1 on the mainboard should be assigned to /dev/dvb/adapter0 and the card in PCI slot 2 should be assigned to /dev/dvb/adapter1.

To identify a DVB card I looked at the output of udevinfo for 2 DVB devices. The devices don't provide a serial, so the difference is only in the KERNELS parameter (e.g. KERNELS="0000:02:00.0" vs. KERNELS="0000:03:00.0"). The Kernels parameter seem to reflect the PCI Bus ID.

According to the thread
http://thread.gmane.org/gmane.linux.kernel.pci/7446/focust47 on the linux-pci mailinglist, the PCI Bus ID is *not* deterministic and totally random determined at boot.

Quoted 7 lines

In the following post
http://thread.gmane.org/gmane.linux.kernel.pci/7446/focust67 there is mentioned that the order of the devices can be specified by using udev rules.

But how this can be done? Which information in /sys can be used to determine which DVB device is connected to which specific slot?

Did you try the latest version of udev that has the persistant rules for the v4l devices in it and look at the symlinks that are created to see if they solve the problem for you?

thanks,

greg k-h

#2 lore raw
In reply to Andreas Besse
Quoted 6 lines · Greg KH
Quoted 5 lines · Andreas Besse

i have a system with multiple DVB cards of the same type and want to specify the order of the devices /dev/dvb/adapterX. The device plugged into the physical PCI slot 1 on the mainboard should be assigned to /dev/dvb/adapter0 and the card in PCI slot 2 should be assigned to /dev/dvb/adapter1.

We usually do not change kernel names, but create meaningful named symlinks to them. Stuff gets confused when /sys and /dev get out-of-sync.

Quoted 4 lines
Quoted 4 lines

In the following post
http://thread.gmane.org/gmane.linux.kernel.pci/7446/focust67 there is mentioned that the order of the devices can be specified by using udev rules.

The order can usually only specified by unconditionally loading kernel driver modules in a defined order. This usually works fine for PCI devices, but can obviously not work if there are USB devices involved.

Quoted 6 lines
Quoted 2 lines

But how this can be done? Which information in /sys can be used to determine which DVB device is connected to which specific slot?

Did you try the latest version of udev that has the persistant rules for the v4l devices in it and look at the symlinks that are created to see if they solve the problem for you?

Looking at it now, I think we only do video4linux, not the DVB stuff, which has its own class. But it should be possible to implement a similar model for /dev/dvb/by-id, /dev/dvb/by-path without much problems. It's just, that nobody really cared so far.

Thanks,
Kay

#3 lore raw
In reply to Andreas Besse
Quoted 35 lines · Kay Sievers
Quoted 8 lines · Greg KH
Quoted 6 lines · Andreas Besse

i have a system with multiple DVB cards of the same type and want to specify the order of the devices /dev/dvb/adapterX. The device plugged into the physical PCI slot 1 on the mainboard should be assigned to /dev/dvb/adapter0 and the card in PCI slot 2 should be assigned to /dev/dvb/adapter1.

We usually do not change kernel names, but create meaningful named symlinks to them. Stuff gets confused when /sys and /dev get out-of-sync.

Quoted 5 lines
Quoted 5 lines

In the following post
http://thread.gmane.org/gmane.linux.kernel.pci/7446/focust67 there is mentioned that the order of the devices can be specified by using udev rules.

The order can usually only specified by unconditionally loading kernel driver modules in a defined order. This usually works fine for PCI devices, but can obviously not work if there are USB devices involved.

Quoted 7 lines
Quoted 3 lines

But how this can be done? Which information in /sys can be used to determine which DVB device is connected to which specific slot?

Did you try the latest version of udev that has the persistant rules for the v4l devices in it and look at the symlinks that are created to see if they solve the problem for you?

Quoted 8 lines

Looking at it now, I think we only do video4linux, not the DVB stuff, which has its own class. But it should be possible to implement a similar model for /dev/dvb/by-id, /dev/dvb/by-path without much problems. It's just, that nobody really cared so far.

Thanks,
Kay

but how can these persistent rules solve the issue that the order of PCI Slots (PCI Bus IDs) is not deterministic and totally random determined at boot?

I think the udev rules only can use informations which are already available in /sys/ ?

regards,
Andreas Besse