I have a machine with multiple capture cards in PCI express slots. For ease of trouble shooting stuff, I would like for the devices to appear on the OS in order of their physical position when I'm plugging them in or unplugging them from the machine. Here is a list of the devices I get from the command lspci | grep lackmagic
0a:00.0 Multimedia video controller: Blackmagic Design Device a117
0d:00.0 Multimedia video controller: Blackmagic Design Device a117
10:00.0 Multimedia video controller: Blackmagic Design Device a117
18:00.0 Multimedia video controller: Blackmagic Design Device a117
1b:00.0 Multimedia video controller: Blackmagic Design Device a117
1e:00.0 Multimedia video controller: Blackmagic Design Device a117
21:00.0 Multimedia video controller: Blackmagic Design Device a117
24:00.0 Multimedia video controller: Blackmagic Design Device a117
and here is the relevant stuff from my dmesg | grep lackmagic
.
[ 16.105068] blackmagic: module license 'Proprietary' taints kernel.
[ 16.110742] blackmagic: Loading driver (version: 8.0.1rc4)
[ 16.111152] blackmagic_driver 0000:0a:00.0: PCI INT A -> GSI 28 (level, low) -> IRQ 28
[ 16.111163] blackmagic_driver 0000:0a:00.0: setting latency timer to 64
[ 16.111215] blackmagic_driver 0000:0a:00.0: setting latency timer to 64
[ 18.248018] blackmagic: Successfully loaded device "blackmagic0" [pci@0000:0a:00.0]
[ 18.248136] blackmagic_driver 0000:10:00.0: PCI INT A -> GSI 26 (level, low) -> IRQ 26
[ 18.248142] blackmagic_driver 0000:10:00.0: setting latency timer to 64
[ 18.248175] blackmagic_driver 0000:10:00.0: setting latency timer to 64
[ 20.372321] blackmagic: Successfully loaded device "blackmagic1" [pci@0000:10:00.0]
[ 20.372483] blackmagic_driver 0000:0d:00.0: PCI INT A -> GSI 30 (level, low) -> IRQ 30
[ 20.372489] blackmagic_driver 0000:0d:00.0: setting latency timer to 64
[ 20.372520] blackmagic_driver 0000:0d:00.0: setting latency timer to 64
[ 22.497786] blackmagic: Successfully loaded device "blackmagic2" [pci@0000:0d:00.0]
[ 22.497929] blackmagic_driver 0000:18:00.0: PCI INT A -> GSI 52 (level, low) -> IRQ 52
[ 22.497937] blackmagic_driver 0000:18:00.0: setting latency timer to 64
[ 22.497976] blackmagic_driver 0000:18:00.0: setting latency timer to 64
[ 24.621774] blackmagic: Successfully loaded device "blackmagic3" [pci@0000:18:00.0]
[ 24.621906] blackmagic_driver 0000:21:00.0: PCI INT A -> GSI 48 (level, low) -> IRQ 48
[ 24.621912] blackmagic_driver 0000:21:00.0: setting latency timer to 64
[ 24.621946] blackmagic_driver 0000:21:00.0: setting latency timer to 64
[ 26.745616] blackmagic: Successfully loaded device "blackmagic4" [pci@0000:21:00.0]
[ 26.745737] blackmagic_driver 0000:24:00.0: PCI INT A -> GSI 54 (level, low) -> IRQ 54
[ 26.745742] blackmagic_driver 0000:24:00.0: setting latency timer to 64
[ 26.745775] blackmagic_driver 0000:24:00.0: setting latency timer to 64
[ 28.870874] blackmagic: Successfully loaded device "blackmagic5" [pci@0000:24:00.0]
[ 28.870994] blackmagic_driver 0000:1e:00.0: PCI INT A -> GSI 55 (level, low) -> IRQ 55
[ 28.871001] blackmagic_driver 0000:1e:00.0: setting latency timer to 64
[ 28.871036] blackmagic_driver 0000:1e:00.0: setting latency timer to 64
[ 30.995130] blackmagic: Successfully loaded device "blackmagic6" [pci@0000:1e:00.0]
[ 30.995277] blackmagic_driver 0000:1b:00.0: PCI INT A -> GSI 56 (level, low) -> IRQ 56
[ 30.995284] blackmagic_driver 0000:1b:00.0: setting latency timer to 64
[ 30.995326] blackmagic_driver 0000:1b:00.0: setting latency timer to 64
[ 33.118817] blackmagic: Successfully loaded device "blackmagic7" [pci@0000:1b:00.0]
currently if i take out, say, card 3, then i will not have
blackmagic0 blackmagic1 blackmagic2 blackmagic4 blackmagic5 blackmagic6 blackmagic7
, but rather they be remapped so that i have the 7 remaining devices on blackmagic0-6
.
what are these numbers like 0a:00.0 ? Are they related to physical addresses of the PCI slots, i.e. can I reasonably expect those numbers not to change when I muck around with other PCI devices or changing things in the boot process of the OS?
can i control where the cards are mounted, so that
/dev/blackmagic3
would correspond to the device located fourth from the back when i'm looking at the machine? and preferably so that when i remove a card the addresses of the other ones will not be remapped to lower numbers? i have heard this might be possible with udev rules.failing 2, is it possible to reliably and repeatably determine the mapping of the device names to their physical locations, so that i can use symbolic links to reorder them?
i'm using Ubuntu 11.04.
edit: some further information, here are the current contents of the file /etc/udev/rules.d/20-blackmagic.rules
KERNEL=="blackmagic[0-9]*", NAME="blackmagic/card%n", MODE="0666", GROUP="video", RUN+="/usr/lib64/blackmagic/BlackmagicPreferencesStartup %n", OPTIONS="last_rule"
KERNEL=="blackmagic_serial[0-9]*", NAME="blackmagic/serial%n", MODE="0666", GROUP="video", OPTIONS="last_rule"