Project

General

Profile

Mixup of tuners after reboot?

Added by renne - about 13 years ago

Hi,

on a TVHE system 3 PCI- and one USB-tuner are used. After every reboot the sequence of the adapters changes (/dev/dvb/adapterX). So there a often 6 devices listed but only the first two work. The others have mixed up mux/service relations. Is this a bug or is there any way to identify the adapers correctly?


Replies (11)

RE: Mixup of tuners after reboot? - Added by Hein Rigolo about 13 years ago

This has to do with the logic that the linux kernel is using the assign dvb adapter numbers to device on start up. You might be able to use udev rules to make sure that each device is always assigned the same dvb adapter number. You might be able to use the MAC address of an adapter, or the serial number to create a udev rule with a fixed adapter number.

RE: Mixup of tuners after reboot? - Added by Andy Brown about 13 years ago

Hi,
Did you manage to make any progress with this? I'm having the same thing and almost everytime I reboot the machine I have to go back in, setup the transponders and let TVHeadend get itself back in the right order.

What I did was created a udev rule by doing this:

# Create a symlink /dev/dvb/adapter101 pointing to ST STV0299 DVB-S - BTM CARD
SUBSYSTEM=="dvb", ATTRS{vendor}=="0x1131", ATTRS{device}=="0x7146", PROGRAM="/bin/sh -c 'K=%k; K=$${K#dvb}; printf dvb/adapter101/%%s $${K#*.}'", SYMLINK+="%c" 

# Create a symlink /dev/dvb/adapter102 pointing to Philips TDA10046H DVB-T
SUBSYSTEM=="dvb", ATTRS{vendor}=="0x1131", ATTRS{device}=="0x7133", PROGRAM="/bin/sh -c 'K=%k; K=$${K#dvb}; printf dvb/adapter102/%%s $${K#*.}'", SYMLINK+="%c" 

# Create a symlink /dev/dvb/adapter103 pointing to Conexant CX24116/CX24118
SUBSYSTEM=="dvb", ATTRS{subsystem_vendor}=="0x0070", ATTRS{subsystem_device}=="0x6906", PROGRAM="/bin/sh -c 'K=%k; K=$${K#dvb}; printf dvb/adapter103/%%s $${K#*.}'", SYMLINK+="%c" 

This creates the /dev/dvb/adapter101 adapter102 and adapter103 devices correctly, however TVHeadend doesn't see these devices at all which I'm guessing is because it doesn't like the symlinks I'm creating.

Does anyone have a solution to this or a way I can resolve this as I think it may also solve Renne's problem too?

RE: Mixup of tuners after reboot? - Added by Hein Rigolo about 13 years ago

tvheadend only looks at adapters with a major number lower that 32 (so adapter0 -> adapter31). So if you make sure your symlinks are using one of these numbers they will be found.

Currently there is a kernel limitation on how many actual DVB adapters a system can contain and that is currently set to 8 (see the kernel dvbdev.c for the max_adapters define). So I would suggest to use adapter10, adapter20 and adapter30 for your cards .. and it should work.

RE: Mixup of tuners after reboot? - Added by Hein Rigolo about 13 years ago

btw ... check if it is possible to specify an adapternumber as part of the adapter kernel module options. Some dvb kernel modules support that. Have a look at your specific kernel module if it is supported.

here is an example that I found: (different adapter but the basics are the same)

http://ubuntuforums.org/showthread.php?t=1311795

you could create a /etc/modprobe.d/options-dvb.conf file containing :-

#set Philips TDA10046H DVB-T
options saa7134-dvb adapter_nr=0

# just add the other dvb cards below

So set this for each dvb module that you need to load for your device.

Remember that here you need to stick to numbers below the max_adapters setting, so use a number between 0 and 7.

RE: Mixup of tuners after reboot? - Added by Andy Brown about 13 years ago

Hi Hein,
Thank you for those updates, I think thats done what I needed. I've done both those options, changed the symlink aliases to be adapter10 adapter20 and adapter30. Again these weren't detected by TVHeadend but I think thats my fault, as I already had the adapters setup, so think that was correct:

Oct  4 08:33:43 tvserver tvheadend[1427]: dvb: Found adapter /dev/dvb/adapter2 (Philips TDA10046H DVB-T) via PCI
Oct  4 08:33:43 tvserver tvheadend[1427]: dvb: Unable to open /dev/dvb/adapter10/frontend0 -- Device or resource busy
Oct  4 08:33:43 tvserver tvheadend[1427]: dvb: Unable to open /dev/dvb/adapter20/frontend0 -- Device or resource busy
Oct  4 08:33:43 tvserver tvheadend[1427]: dvb: Unable to open /dev/dvb/adapter30/frontend0 -- Device or resource busy

Which makes sense, as I've already got the adapters setup in their primary locations of adapter0 adapter1 and adapter2.

Anyway, I also set my modprobe options on the two cards that I could :

#set Philips TDA10046H DVB-T
options saa7134_dvb adapter_nr=2
#set Conexant CX24116/CX24118
options cx88_dvb adapter_nr=1

And those seem to have stuck, so I think thats done the trick. Thank you for your help :-)

RE: Mixup of tuners after reboot? - Added by Hein Rigolo about 13 years ago

both at the same time might be contradicting ... so I would stick to one option .. not both.

RE: Mixup of tuners after reboot? - Added by saen acro over 10 years ago

Is there an option TVHeadend to recognize adapters by MAC address,
not by "/dev/dvb/adapter*" location.
Тhis will solve tons of headaches

RE: Mixup of tuners after reboot? - Added by steve parry over 10 years ago

Hi all,

I'm struggling from the same problem, I've read about the modprobe fix, but I cant get it to work
I have
1 x USB PCTV Systems DVB-T2 290e nanoStick HD TV Tuner
1 x USB TBS QboxS2 DVB-S2

But I cant seem to get the names of the devices. I've tried the following commands
  • dmesg
  • udevadm
  • lsmod

I'm not sure what im looking for.
Can anyone help?

sources
http://www.mythtv.org/wiki?title=Device_Filenames_and_udev&oldid=42208#Alternatives_to_udev_for_naming_for_DVB_cards_.28The_adapter_nr_module_option.29
http://ubuntuforums.org/showthread.php?t=1311795

RE: Mixup of tuners after reboot? - Added by saen acro over 10 years ago

In this two links maby there is a solution for two different by brand tuners.
But what happens with 4 quad tuners with same brand ex. TBS6985?
best solution is to skip kernel buggy recognition and use MAC address of tuners

RE: Mixup of tuners after reboot? - Added by steve parry over 10 years ago

How do I use the mac address's

RE: Mixup of tuners after reboot? - Added by saen acro over 10 years ago

steve parry wrote:

How do I use the mac address's

this is developer job not your's

    (1-11/11)