Is adapter (re)-order on reboot still an issue?
Added by c128 m over 9 years ago
Hi,
Read quite a bit in (mostly older) posts about adapter re-ordering on reboot.
I've not tried one of the workarounds for this, although I do see it, as I've yet to identify an issue related to it...
Is this still something to be concerned about?
How does the issue manifest itself with tvheadend 3.9+ ?
Thanks.
Replies (9)
RE: Is adapter (re)-order on reboot still an issue? - Added by Mark Clarkstone over 9 years ago
c128 m wrote:
Hi,
Read quite a bit in (mostly older) posts about adapter re-ordering on reboot.
I've not tried one of the workarounds for this, although I do see it, as I've yet to identify an issue related to it...
Is this still something to be concerned about?
How does the issue manifest itself with tvheadend 3.9+ ?Thanks.
The solution to this is to either set the adapter_nr or setup udev rules. However I think you can change the name of the adapters within tvheadend & it should remember what network is attached I think.
RE: Is adapter (re)-order on reboot still an issue? - Added by c128 m over 9 years ago
Mark Clarkstone wrote:
The solution to this is to either set the adapter_nr or setup udev rules
I've seen mention of udev rules - what does setting the "adapter nr" refer to?
Scratch that - Googling throws up the goods ;-)
Mark Clarkstone wrote:
I think you can change the name of the adapters within tvheadend & it should remember what network is attached I think.
That's what I was kind of wondering, although I don't know the ins and outs.
I didn't know whether there was an underlying reason why fixing the adapter ordering was still required and/or desirable.
RE: Is adapter (re)-order on reboot still an issue? - Added by c128 m over 9 years ago
Actually, ordering might be a problem for my future plans...
When I say I hadn't noticed an issue, I don't think I'd joined up the dots with seeing adapters re-ordered and becoming disabled on reboot - I have seen that.
As a result, I'm now ordering the T9580s as follows:
root@tv:~# cat /etc/modprobe.d/dvb-adapter-order.conf # DVBSky T9580 DVB-S and DVB-T options smipcie adapter_nr=0,1,2,3
adapter_nr
is only supported, by the looks of it, by the top-level smipcie
- hence I can only enumerate the adapters there, for the 4 tuners that 2xT9580s support. However...the 4 adapters I get as a result of the above always seem to order themselves as 0:DVB-T / 1:DVB-S / 2:DVB-T / 3:DVB-S.
That's fine (I think) as the DVB-T adapters are all setup for the same network, as are the DVB-S adapters. So - if they actually swap in terms of the cards, but keep that ordering, it shouldn't matter to tvheadend?
If that's the case, that's OK, but I was thinking of adding a third T9580.
On this new card DVB-T would be the same network as the others I already have, but DVB-S would be a different network.
Were any of the DVB-S adapters to swap, I guess that would be a problem...
Not sure how to workaround that.
AIUI, if I go the udev
rules route to order adapters, as adapter_nr
won't cut it with the third card, I need to find distinguishing udevadm info
attributes that identify each adapter separately. Thing is...dumping stuff for my two current T9580s, I can find pcie id stuff that differs between DVB-T/S on one card and DVB-S/T on another, but nothing that differentiates between DVB-T and DVB-S on the same card. Well, nothing that I think I can use, as what differs seems to based on the current adapter assignment e.g.:
< looking at device '/devices/pci0000:00/0000:00:01.0/0000:01:00.0/dvb/dvb0.frontend0': < KERNEL=="dvb0.frontend0" --- > looking at device '/devices/pci0000:00/0000:00:01.0/0000:01:00.0/dvb/dvb1.frontend0': > KERNEL=="dvb1.frontend0"
Dunno if I'm reading this wrong or not though - any ideas on how 3 T9580s might have their 6 adapters fixed in terms of order?
RE: Is adapter (re)-order on reboot still an issue? - Added by c128 m over 9 years ago
mmm...so, I've come round to thinking that the only way to really do this with is with the MAC address.
That isn't unique between cards (e.g. the DVB-T tuner on one card has the same MAC address as the DVB-T tuner on another), but it is different between DVB-S and DVB-T tuners on the same card.
Found a useful looking script here:
http://lists.mythtv.org/pipermail/mythtv-users/2008-January/208509.html
It'll need modifying to incorporate PCI ID though...
So, if my logic is OK, across all 3 T9580s:
- All DVB-T default adapters can be identified and assigned new adapters (10, 11 and 12) based on MAC address
- All DVB-S default adapters can be identified based on MAC address
- 2 DVB-S default adapters can be assigned new adapters (13, 14) based on PCI ID
- 1 DVB-S default adapter can be assigned new adapter (15) based on PCI ID
This seems mental :-( - hadn't realised this was such of a dodgy area for DVB cards on Linux (and seems to have been so for years).
I suppose it's complicated a bit, in this case, by the fact that a single PCI ID covers both a DVB-S and DVB-T tuner, and the fact that the MAC addresses of the tuners aren't really unique between cards.
I feel like I'm missing something obvious that would make this much easier though...any suggestions?
RE: Is adapter (re)-order on reboot still an issue? - Added by c128 m over 9 years ago
Well, the following test script (ripped off from the one in the link ;-) ) seems to work with the 2 cards I have at the moment (it doesn't do anything, but could create the symlinks that would form the fixed, known, adapters):
#!/bin/bash T9580_DVBT="00:XX:XX:XX:XX:XX" T9580_DVBS="00:YY:YY:YY:YY:YY" i=0 while [ $i -lt 4 ]; do dev="/dev/dvb/adapter"$i if [ -d $dev ] ; then dvbnet -a $i -p 1 > /dev/null 2>&1 if `ifconfig -a | grep dvb | grep -q $T9580_DVBT` ; then echo "$dev is DVBT" fi if `ifconfig -a | grep dvb | grep -q $T9580_DVBS` ; then echo "$dev is DVBS" fi dvbnet -a $i -d 0 > /dev/null 2>&1 fi let i=i+1 done
...that won't deal with one of the DVB-S adapters (the one using a different network to the others) needing to be at a static adapter number though - that would need some PCI ID knowledge not yet added.
As this would be much easier if the MAC addresses for all DVBSky tuners on the system were unique, and DVBSky seem to have a Windows tool for download that looks like it's for configuring MAC addresses on their cards, I've mailed their tech support to see if this is possible on Linux.
RE: Is adapter (re)-order on reboot still an issue? - Added by c128 m over 9 years ago
So - I have a full, hacky, script that looks like it does the right thing.
On that basis I've ordered a new T9580 and I'll give it a spin on the weekend; I'll post the final script here when/if it's all working in case it helps anyone else.
One question though:
The original adapters that I'll be sym-linking too - is there a way to get them to be non-visible in tvheadend e.g. by giving them "odd" adapter numbers, or naming them in a way tvheadend won't recognise, before creating the sym-link adapters that will link to them that tvheadend will recognise and use?
RE: Is adapter (re)-order on reboot still an issue? - Added by Prof Yaffle over 9 years ago
You could use /etc/default/tvheadend (or equivalent) to limit tvheadend to the 'new' adapters, I think - that way it would exclude the pre-symlinked ones? By definition, though, the symlinked ones won't exist when tvh starts unless you delay the startup... I don't think that's an issue, but keep an eye on it.
RE: Is adapter (re)-order on reboot still an issue? - Added by c128 m over 9 years ago
Ah, interesting - thanks, will have a butchers :-)
Yeah, this will all have to be pre-tvheadend start at boot, so I'll have to "organise" that.
I've already experienced some crashing when testing the script whilst tvheadend was still "up".
mmm...thinking about it, do adapters potentially re-order on resume too, or is it just cold boot?
RE: Is adapter (re)-order on reboot still an issue? - Added by c128 m over 9 years ago
So - I'm kind of wondering whether I'm trying to solve an issue that doesn't actually exist...
The adapter re-ordering I original saw was with 2 x T9580s and 1 x HVR4000.
Now I have just 3 x T9580s, and using:
root@tv:~# cat /etc/modprobe.d/dvb-adapter-order.conf # DVBSky T9580 DVB-S and DVB-T options smipcie adapter_nr=0,1,2,3,4,5
...every boot so far has lead to:
root@tv:/# dmesg | grep "registering adapter" [ 7.397881] SMI PCIe driver 0000:01:00.0: DVB: registering adapter 0 frontend 0 (Silicon Labs Si2168)... [ 7.506824] SMI PCIe driver 0000:01:00.0: DVB: registering adapter 1 frontend 0 (Montage M88DS3103)... [ 7.622503] SMI PCIe driver 0000:03:00.0: DVB: registering adapter 2 frontend 0 (Silicon Labs Si2168)... [ 7.676559] SMI PCIe driver 0000:03:00.0: DVB: registering adapter 3 frontend 0 (Montage M88DS3103)... [ 7.790506] SMI PCIe driver 0000:04:00.0: DVB: registering adapter 4 frontend 0 (Silicon Labs Si2168)... [ 7.871642] SMI PCIe driver 0000:04:00.0: DVB: registering adapter 5 frontend 0 (Montage M88DS3103)...
Might just monitor this for a bit - wasn't expecting the PCI -> adapter mappings to remain constant, but if they do...