Project

General

Profile

Forcing Linux to assign the same tv card to the same /dev/dvb/adaptorN device...

Added by Kev S almost 12 years ago

On my Media Centre setup I started with an MSI Digivox on /dev/dvb/adaptor0 and this worked well for quite a while, but the single tuner proved more and more limiting as time went on and my PVR started gathering dust.

As I wanted to add Freesat I got a "DM04" for £15 from eBay (£15 - but seriously don't bother - waited nine weeks for shipping and it's pants, gives up working after a while and requires service tvheadend stop; unplug usb; plug usb; service tvheadend start at least once a day - annoyingly if you leave the channel you want to record playing it WILL work, if you don't there's a 50:50 chance...) - anyway when I got this it appeared on /dev/dvb/adaptor1 and happily stayed there through reboots.

This tuner being so rubbish prompted me to get a a Kworld UB499-2T which (once you turned "Disable PMT monitoring" on) works wonderfully on /dev/dvb/adaptor2 and /dev/dvb/adaptor3 ....

So in summary...
/dev/dvb/adaptor0 = Twinhan VP7045/46 USB DVB-T (MSI Digivox) - USB Bus 2 Port 3 (Renamed Freeview - MSI Digivox)
/dev/dvb/adaptor1 = Freesat DM04_LME2510C_DVB-S RS2000 (DM04) - USB Bus 2 Port 2 (Renamed Freesat - DM04)
/dev/dvb/adaptor2 = Kworld UB499-2T T09_1 (KWorld UB499-2T Tuner 1) - USB Bus 2 Port 1 (Renamed Freeview - Kworld 1)
/dev/dvb/adaptor3 = Kworld UB499-2T T09_1 (KWorld UB499-2T Tuner 2) - USB Bus 2 Port 1 (Renamed Freeview - Kworld 2)

Then I rebooted the machine and for some reason Ubuntu decided to put them on the following adaptors
/dev/dvb/adaptor0 = Kworld UB499-2T T09_1 (KWorld UB499-2T Tuner 1) - USB Bus 2 Port 1
/dev/dvb/adaptor1 = Kworld UB499-2T T09_1 (KWorld UB499-2T Tuner 2) - USB Bus 2 Port 1
/dev/dvb/adaptor2 = Twinhan VP7045/46 USB DVB-T (MSI Digivox) - USB Bus 2 Port 3
/dev/dvb/adaptor3 = Freesat DM04_LME2510C_DVB-S RS2000 (DM04) - USB Bus 2 Port 2

Is there any way to either a) force Ubuntu to always leave them on the same port (/etc/modules has the modules entered in the order I added the cards - i.e. the tope one), or ensure TVHeadend copes with Ubuntu doing daft things.

Don't particularly fancy getting 13 tuners listed when I eventually add a DVB-S2 tuner (already got 8 when only (3 physical) 4 (logical) tuners exist)!

Fortunately copying the multiplexes also copied the enabled channels which saved me a while, was a bit surpised when East Midlands Today suddenly started bursting out the TV!

Tuners.png (83.3 KB) Tuners.png Tuner Dropdown :(

Replies (6)

RE: Forcing Linux to assign the same tv card to the same /dev/dvb/adaptorN device... - Added by Prof Yaffle almost 12 years ago

I came across this post recently - I haven't explored it at all, so I've no idea how easy/practical it is - but I'l mention it anyway...

http://www.mythtv.org/wiki/Device_Filenames_and_udev

RE: Forcing Linux to assign the same tv card to the same /dev/dvb/adaptorN device... - Added by Alex . almost 12 years ago

Prof Yaffle wrote:

I came across this post recently - I haven't explored it at all, so I've no idea how easy/practical it is - but I'l mention it anyway...

http://www.mythtv.org/wiki/Device_Filenames_and_udev

I used the same tutorial from the mythtv-wiki as refered to to make UDEV renumber my devices ( had simialr problems of my usb-stick sometimes coming first, sometimes after hdhomerun).

Took sometime figuring it out though at the time.

The three lines in the file " /etc/udev/rules.d/50-udev.rules I use are ( maybe it helps as an example):

SUBSYSTEM=="dvb", ATTRS{idProduct}=="0236", PROGRAM="/bin/sh -c 'K=%k; K=$${K#dvb}; printf dvb/adapter9/%%s $${K#*.}'", NAME+="%c", GROUP="video"
KERNELS=="HDHomeRun.0", PROGRAM="/bin/sh -c 'K=%k; K=$${K#dvb}; printf dvb/adapter6/%%s $${K#*.}'", NAME+="%c", GROUP="video"
KERNELS=="HDHomeRun.1", PROGRAM="/bin/sh -c 'K=%k; K=$${K#dvb}; printf dvb/adapter7/%%s $${K#*.}'", NAME+="%c", GROUP="video"

Basically, everything before "PROGRAM="/bin/sh" is used to identify the devices.

The first line identifies my USB-stick and puts it at adapter 9 (/dev/dvb/adapter9) .
The second and third line identify a HDHomerun tuner and put them at 6 and 7 respecively.

Devices can be identified in a number of ways, and as you can see the first line uses the idproducts and the subsystem to identify this specific usb-device as my adapter. The last two lines use some kernel-parameter(the name of the virtual adapters in this case) , as in the case of hd-homerun, they are virtual adapters).

Alex.

RE: Forcing Linux to assign the same tv card to the same /dev/dvb/adaptorN device... - Added by Kev S over 10 years ago

Just came across this thread while Googling for something else so thought I'd reply with my findings!

Initially I simply changed /etc/modules to read as follows (note the tuners have changed since my original post - the DM04 being binned thanks to a burning smell coming from the PSU and it being useless)

dvb-usb-vp7045 adapter_nr=5
dvb-usb-it913x adapter_nr=6,7 pid=1
dvb-usb-ttusb2 adapter_nr=3

This worked most of the time, but occasionally would boot up with the devices on the wrong ports - a reboot or two always fixed it.

However by editing
/etc/modprobe.d/dvbt.conf
in the following manner it's sticky

options dvb-usb-ttusb2 adapter_nr=3
options dvb-usb-vp7045 adapter_nr=5
options dvb-usb-it913x adapter_nr=6,7
options em28xx-dvb adapter_nr=4
options dvb-usb-rtl28xxu adapter_nr=2

Could never get the UDEV stuff to work

:)

RE: Forcing Linux to assign the same tv card to the same /dev/dvb/adaptorN device... - Added by Prof Yaffle over 10 years ago

I never fought with udev - like Kev, this fixed it for me:

ian@Server:/etc/modprobe.d$ more options-dvb.conf

# Hauppauge Nova-T DVB-T, plus low noise amplifier
options dvb_usb_dib0700 adapter_nr=0 force_lna_activation=1

# PCTV 460e
options em28xx_dvb adapter_nr=1,3

# PCTV 290e
# Doesn't support any options on adapter_nr, so I have to hope that it defaults
# to the same number every time!
ian@Server:/etc/modprobe.d$

Note that where you put the options seems to wander around between Linux distros and even versions.

RE: Forcing Linux to assign the same tv card to the same /dev/dvb/adaptorN device... - Added by Kev S over 10 years ago

"PCTV 290e
  1. Doesn't support any options on adapter_nr, so I have to hope that it defaults"

Interesting - has always stuck on adapter nr 4 for me with the following line

options em28xx-dvb adapter_nr=4

Distributor ID: Ubuntu
Description: Ubuntu 12.04 LTS
Release: 12.04
Codename: precise
3.10.1-031001-generic

[quote][ 14.701791] DVB: registering new adapter (em28174 #0)
[ 14.701816] usb 1-1.4: DVB: registering adapter 4 frontend 0 (Sony CXD2820R)...
[ 14.703361] em28174 #0: Successfully loaded em28xx-dvb
[ 14.703375] Em28xx: Initialized (Em28xx dvb Extension) extension[/quote]

(Funny how both our numbering schemes are a bit random - guessing yours grew organically too?)

RE: Forcing Linux to assign the same tv card to the same /dev/dvb/adaptorN device... - Added by Prof Yaffle over 10 years ago

Yup, pretty much the order in which I bought the tuners, so that's how they got installed. The 290e was the last one, and it landed at 4, so that's where it stayed and I've never worried about the lack of adapter_nr support (if it's even true). If I ever change my DVB-T stick (the Win-Nova-T) then I'm sure it'll all fall apart and I'll be back to staring at udev (<... cue evil trepidation music ...>).

What's interesting is that your extract above suggests the 290e and 460e use the same driver - em28xx-dvb - so I need to think about that, as that module clearly does support adapter-nr. Checking dmesg confirms that - they're both em28174 as above. Head scratch time as to how I get away with that one...

    (1-6/6)