[Solved] tuner card device file order control with udev

For discussion related to MythTV which doesn't belong in another forum.

Moderator: Forum Moderators

Post Reply
User avatar
diyhouse
Senior
Posts: 223
Joined: Mon Mar 31, 2014 9:42 am
Great Britain

[Solved] tuner card device file order control with udev

Post by diyhouse »

Greeting all,..
I have just upgraded my system with a new quad SAT tuner,.. to add to my quad Freeview tuner.
By default when the kernel installs, the devices appear in a random order,..
1 sat tuner,.. followed by 4 FView tuners, and then the remaining 3 SAT tuners.

I have seen the udev stuff using the output of the udevadm command to differentiate tuners and cards,.. but unless I'm missing something the TBS6904/6285 only differentiate themselves by their vendor-name,.. and each tuner whether SAT or Fview produces the same parameter list, so no way of identifying each tuner.

Has anyone else out there using TBS ( or similar ) cards already solved this issue,.. or are there other resources I have missed, as the udev/mythtv wiki will take some serious head-scratching to work through.

Many Tx
Last edited by diyhouse on Fri Mar 19, 2021 10:23 am, edited 1 time in total.
User avatar
paulh
Developer
Posts: 909
Joined: Thu Feb 06, 2014 6:09 pm
Great Britain

Re: tuner card device file order control with udev

Post by paulh »

If your linux module driver for your cards supports the 'adapter_nr' parameter you can tell it to use a specific number for each adapter when it boots up.

So if you pass 1,2,3,4 for the 'adapter_nr' parameter for one card it will always have /dev/dvb/adapter1 to /dev/dvb/adapter4.
And for the other you could use 5,6,7,8 so you get /dev/dvb/adapter5 to /dev/dvb/adapter8. The number can be anything you like not necessarily in order like that.

Have a look for something like /sys/module/MODULE_NAME/parameters/adapter_nr to see if the module driver supports the adapter_nr parameter. Obviously substitute MODULE_NAME for the module your cards use.
User avatar
diyhouse
Senior
Posts: 223
Joined: Mon Mar 31, 2014 9:42 am
Great Britain

Re: tuner card device file order control with udev

Post by diyhouse »

Many tx Paul,..

adapter_nr,.. was the solution,... ( light bulb moment you might say ),... as I had seen this else where and not twigged, as they say.

For the TBS cards 6285 & 6904 the solution is as follows:-

vi /etc/modprobe.d/dvb.conf
options tbsecp3 adapter_nr=1,2,3,4
options saa716x_core adapter_nr=10,11,12,13

This then created the device files as expected in the order expected with the numbers given,... so much easier when setting mythtv backend up.

This also probably explains why the wiki udev-mythtv stuff has not been edited for the last 5yrs or so, as adapter_nr fixes it so simply.
Post Reply