Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: MythTV: Users

UDev rules for Dual Tuner Cards

 

 

MythTV users RSS feed   Index | Next | Previous | View Threaded


steven at openmedia

Apr 3, 2010, 10:46 PM

Post #1 of 6 (1722 views)
Permalink
UDev rules for Dual Tuner Cards

I'm having some issues getting a UDEV rule to work correctly for a
Hauppauge HVR-2200 card. My box has multiple DVB T + S cards and I want
to make sure they get mapped to the same device numbers on each boot.

Using the tips on the MythTV Wiki
-
http://www.mythtv.org/wiki/Device_Filenames_and_udev#Example_for_twin_tuner_cards_with_no_difference_in_udevinfo_output

I came up with the following rules

SUBSYSTEM=="dvb", ATTRS{vendor}=="0x1131", ATTRS{device}=="0x7164", ENV{hvr2200}!="two", ENV{hvr2200}="two", PROGRAM="/bin/sh -c
'K=%k; K=$${K#dvb}; printf dvb/adapter170/%%s $${K#*.}'", SYMLINK+="%c"
SUBSYSTEM=="dvb", ATTRS{vendor}=="0x1131", ATTRS{device}=="0x7164", ENV{hvr2200}=="two", ENV{hvr2200}="one", PROGRAM="/bin/sh -c
'K=%k; K=$${K#dvb}; printf dvb/adapter171/%%s $${K#*.}'", SYMLINK+="%c"


The idea being that the two tuners always get mapped as devices 170 and 171.

It looks like there is some sort of race condition as after a reboot I
end up with the following

/dev/dvb/adapter170:
total 0
lrwxrwxrwx 1 root root 18 2010-04-03 18:10 demux0 -> ../adapter2/demux0
lrwxrwxrwx 1 root root 16 2010-04-03 18:10 dvr0 -> ../adapter1/dvr0
lrwxrwxrwx 1 root root 21 2010-04-03 18:10 frontend0 -> ../adapter1/frontend0
lrwxrwxrwx 1 root root 16 2010-04-03 18:10 net0 -> ../adapter2/net0

/dev/dvb/adapter171:
total 0
lrwxrwxrwx 1 root root 18 2010-04-03 18:10 demux0 -> ../adapter2/demux0
lrwxrwxrwx 1 root root 16 2010-04-03 18:10 dvr0 -> ../adapter1/dvr0
lrwxrwxrwx 1 root root 21 2010-04-03 18:10 frontend0 -> ../adapter1/frontend0
lrwxrwxrwx 1 root root 16 2010-04-03 18:10 net0 -> ../adapter2/net0

With this neither of the adapters work as the symlinks are a mess.

Has anyone managed to come up with a sensible udev rule for a HVR-2200
or HVR-2250 card?

Thanks

Steve
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


mythtv-list at dinkum

Apr 4, 2010, 1:13 AM

Post #2 of 6 (1693 views)
Permalink
Re: UDev rules for Dual Tuner Cards [In reply to]

On 4 Apr 2010, at 06:46, Steven Ellis wrote:

> I'm having some issues getting a UDEV rule to work correctly for a
> Hauppauge HVR-2200 card. My box has multiple DVB T + S cards and I want
> to make sure they get mapped to the same device numbers on each boot.

There is another way, most of the v4l-dvb modules have a option parameter to specify the adapter numbers, for example:

I have a /etc/modprobe.d/SatixS2.conf file containing:

options ngene adapter_nr=10,11

Then you need to depmod and rebuild initrd so that the correct options are set on boot, for Ubuntu the easiest way is:

dpkg-reconfigure linux-image-2.6.31-20-generic

or similar.

modinfo modulename will tell you if your adaptor's module supports the adapter_nr parameter.

Andre


>
> Using the tips on the MythTV Wiki
> -
> http://www.mythtv.org/wiki/Device_Filenames_and_udev#Example_for_twin_tuner_cards_with_no_difference_in_udevinfo_output
>
> I came up with the following rules
>
> SUBSYSTEM=="dvb", ATTRS{vendor}=="0x1131", ATTRS{device}=="0x7164", ENV{hvr2200}!="two", ENV{hvr2200}="two", PROGRAM="/bin/sh -c
> 'K=%k; K=$${K#dvb}; printf dvb/adapter170/%%s $${K#*.}'", SYMLINK+="%c"
> SUBSYSTEM=="dvb", ATTRS{vendor}=="0x1131", ATTRS{device}=="0x7164", ENV{hvr2200}=="two", ENV{hvr2200}="one", PROGRAM="/bin/sh -c
> 'K=%k; K=$${K#dvb}; printf dvb/adapter171/%%s $${K#*.}'", SYMLINK+="%c"
>
>
> The idea being that the two tuners always get mapped as devices 170 and 171.
>
> It looks like there is some sort of race condition as after a reboot I
> end up with the following
>
> /dev/dvb/adapter170:
> total 0
> lrwxrwxrwx 1 root root 18 2010-04-03 18:10 demux0 -> ../adapter2/demux0
> lrwxrwxrwx 1 root root 16 2010-04-03 18:10 dvr0 -> ../adapter1/dvr0
> lrwxrwxrwx 1 root root 21 2010-04-03 18:10 frontend0 -> ../adapter1/frontend0
> lrwxrwxrwx 1 root root 16 2010-04-03 18:10 net0 -> ../adapter2/net0
>
> /dev/dvb/adapter171:
> total 0
> lrwxrwxrwx 1 root root 18 2010-04-03 18:10 demux0 -> ../adapter2/demux0
> lrwxrwxrwx 1 root root 16 2010-04-03 18:10 dvr0 -> ../adapter1/dvr0
> lrwxrwxrwx 1 root root 21 2010-04-03 18:10 frontend0 -> ../adapter1/frontend0
> lrwxrwxrwx 1 root root 16 2010-04-03 18:10 net0 -> ../adapter2/net0
>
> With this neither of the adapters work as the symlinks are a mess.
>
> Has anyone managed to come up with a sensible udev rule for a HVR-2200
> or HVR-2250 card?
>
> Thanks
>
> Steve
> _______________________________________________
> mythtv-users mailing list
> mythtv-users [at] mythtv
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
>

_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


mythtv-list at dinkum

Apr 4, 2010, 1:40 AM

Post #3 of 6 (1695 views)
Permalink
Re: UDev rules for Dual Tuner Cards [In reply to]

On 4 Apr 2010, at 09:13, Andre wrote:

>
> On 4 Apr 2010, at 06:46, Steven Ellis wrote:
>
>> I'm having some issues getting a UDEV rule to work correctly for a
>> Hauppauge HVR-2200 card. My box has multiple DVB T + S cards and I want
>> to make sure they get mapped to the same device numbers on each boot.
>
> There is another way, most of the v4l-dvb modules have a option parameter to specify the adapter numbers, for example:
>
> I have a /etc/modprobe.d/SatixS2.conf file containing:
>
> options ngene adapter_nr=10,11
>
> Then you need to depmod and rebuild initrd so that the correct options are set on boot, for Ubuntu the easiest way is:
>
> dpkg-reconfigure linux-image-2.6.31-20-generic
>
> or similar.
>
> modinfo modulename will tell you if your adaptor's module supports the adapter_nr parameter.

Just checked (it's raining out) and:

root [at] sayfai:/home/andre# modinfo saa7164
filename: /lib/modules/2.6.31-20-generic/kernel/drivers/media/video/saa7164/saa7164.ko
license: GPL
author: Steven Toth <stoth [at] kernellabs>
description: Driver for NXP SAA7164 based TV cards
srcversion: 1F4BCC26D2D3BC0BBCFADB7
alias: pci:v00001131d00007164sv*sd*bc*sc*i*
depends: dvb-core,tveeprom
vermagic: 2.6.31-20-generic SMP mod_unload modversions 586
parm: adapter_nr:DVB adapter numbers (array of short)
parm: waitsecs:int
parm: debug:enable debug messages (int)
parm: card:card type (array of int)
root [at] sayfai:/home/andre#


So

options saa7164 adapter_nr=170,171

Should do what you want.

Andre
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


anothersname at googlemail

Apr 4, 2010, 1:41 AM

Post #4 of 6 (1697 views)
Permalink
Re: UDev rules for Dual Tuner Cards [In reply to]

On 4 April 2010 08:13, Andre <mythtv-list [at] dinkum> wrote:
>
> On 4 Apr 2010, at 06:46, Steven Ellis wrote:
>
>> I'm having some issues getting a UDEV rule to work correctly for a
>> Hauppauge HVR-2200 card. My box has multiple DVB T + S cards and I want
>> to make sure they get mapped to the same device numbers on each boot.
>
> There is another way, most of the v4l-dvb modules have a option parameter to specify the adapter numbers, for example:
>
> I have a /etc/modprobe.d/SatixS2.conf  file containing:
>
> options ngene adapter_nr=10,11
>
> Then you need to depmod and rebuild initrd so that the correct options are set on boot, for Ubuntu the easiest way is:
>
> dpkg-reconfigure linux-image-2.6.31-20-generic
>
> or similar.
>
> modinfo modulename will tell you if your adaptor's module supports the adapter_nr parameter.
>
> Andre
>
>
>>
>> Using the tips on the MythTV Wiki
>> -
>> http://www.mythtv.org/wiki/Device_Filenames_and_udev#Example_for_twin_tuner_cards_with_no_difference_in_udevinfo_output
>>
>> I came up with the following rules
>>
>> SUBSYSTEM=="dvb", ATTRS{vendor}=="0x1131", ATTRS{device}=="0x7164", ENV{hvr2200}!="two", ENV{hvr2200}="two", PROGRAM="/bin/sh -c
>> 'K=%k; K=$${K#dvb}; printf dvb/adapter170/%%s $${K#*.}'", SYMLINK+="%c"
>> SUBSYSTEM=="dvb", ATTRS{vendor}=="0x1131", ATTRS{device}=="0x7164", ENV{hvr2200}=="two", ENV{hvr2200}="one", PROGRAM="/bin/sh -c
>> 'K=%k; K=$${K#dvb}; printf dvb/adapter171/%%s $${K#*.}'", SYMLINK+="%c"
>>
>>
>> The idea being that the two tuners always get mapped as devices 170 and 171.
>>
>> It looks like there is some sort of race condition as after a reboot I
>> end up with the following
>>
>> /dev/dvb/adapter170:
>> total 0
>> lrwxrwxrwx 1 root root 18 2010-04-03 18:10 demux0 -> ../adapter2/demux0
>> lrwxrwxrwx 1 root root 16 2010-04-03 18:10 dvr0 -> ../adapter1/dvr0
>> lrwxrwxrwx 1 root root 21 2010-04-03 18:10 frontend0 -> ../adapter1/frontend0
>> lrwxrwxrwx 1 root root 16 2010-04-03 18:10 net0 -> ../adapter2/net0
>>
>> /dev/dvb/adapter171:
>> total 0
>> lrwxrwxrwx 1 root root 18 2010-04-03 18:10 demux0 -> ../adapter2/demux0
>> lrwxrwxrwx 1 root root 16 2010-04-03 18:10 dvr0 -> ../adapter1/dvr0
>> lrwxrwxrwx 1 root root 21 2010-04-03 18:10 frontend0 -> ../adapter1/frontend0
>> lrwxrwxrwx 1 root root 16 2010-04-03 18:10 net0 -> ../adapter2/net0
>>
>> With this neither of the adapters work as the symlinks are a mess.
>>
>> Has anyone managed to come up with a sensible udev rule for a HVR-2200
>> or HVR-2250 card?
>>
>> Thanks
>>
>> Steve
>> _______________________________________________
>> mythtv-users mailing list
>> mythtv-users [at] mythtv
>> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
>>
>
> _______________________________________________
> mythtv-users mailing list
> mythtv-users [at] mythtv
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
>

Are you just setup with HVR 2200 or are you using other inputs as well?
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


anothersname at googlemail

Apr 4, 2010, 2:01 AM

Post #5 of 6 (1691 views)
Permalink
Re: UDev rules for Dual Tuner Cards [In reply to]

On 4 April 2010 08:41, Another Sillyname <anothersname [at] googlemail> wrote:
> On 4 April 2010 08:13, Andre <mythtv-list [at] dinkum> wrote:
>>
>> On 4 Apr 2010, at 06:46, Steven Ellis wrote:
>>
>>> I'm having some issues getting a UDEV rule to work correctly for a
>>> Hauppauge HVR-2200 card. My box has multiple DVB T + S cards and I want
>>> to make sure they get mapped to the same device numbers on each boot.
>>
>> There is another way, most of the v4l-dvb modules have a option parameter to specify the adapter numbers, for example:
>>
>> I have a /etc/modprobe.d/SatixS2.conf  file containing:
>>
>> options ngene adapter_nr=10,11
>>
>> Then you need to depmod and rebuild initrd so that the correct options are set on boot, for Ubuntu the easiest way is:
>>
>> dpkg-reconfigure linux-image-2.6.31-20-generic
>>
>> or similar.
>>
>> modinfo modulename will tell you if your adaptor's module supports the adapter_nr parameter.
>>
>> Andre
>>
>>
>>>
>>> Using the tips on the MythTV Wiki
>>> -
>>> http://www.mythtv.org/wiki/Device_Filenames_and_udev#Example_for_twin_tuner_cards_with_no_difference_in_udevinfo_output
>>>
>>> I came up with the following rules
>>>
>>> SUBSYSTEM=="dvb", ATTRS{vendor}=="0x1131", ATTRS{device}=="0x7164", ENV{hvr2200}!="two", ENV{hvr2200}="two", PROGRAM="/bin/sh -c
>>> 'K=%k; K=$${K#dvb}; printf dvb/adapter170/%%s $${K#*.}'", SYMLINK+="%c"
>>> SUBSYSTEM=="dvb", ATTRS{vendor}=="0x1131", ATTRS{device}=="0x7164", ENV{hvr2200}=="two", ENV{hvr2200}="one", PROGRAM="/bin/sh -c
>>> 'K=%k; K=$${K#dvb}; printf dvb/adapter171/%%s $${K#*.}'", SYMLINK+="%c"
>>>
>>>
>>> The idea being that the two tuners always get mapped as devices 170 and 171.
>>>
>>> It looks like there is some sort of race condition as after a reboot I
>>> end up with the following
>>>
>>> /dev/dvb/adapter170:
>>> total 0
>>> lrwxrwxrwx 1 root root 18 2010-04-03 18:10 demux0 -> ../adapter2/demux0
>>> lrwxrwxrwx 1 root root 16 2010-04-03 18:10 dvr0 -> ../adapter1/dvr0
>>> lrwxrwxrwx 1 root root 21 2010-04-03 18:10 frontend0 -> ../adapter1/frontend0
>>> lrwxrwxrwx 1 root root 16 2010-04-03 18:10 net0 -> ../adapter2/net0
>>>
>>> /dev/dvb/adapter171:
>>> total 0
>>> lrwxrwxrwx 1 root root 18 2010-04-03 18:10 demux0 -> ../adapter2/demux0
>>> lrwxrwxrwx 1 root root 16 2010-04-03 18:10 dvr0 -> ../adapter1/dvr0
>>> lrwxrwxrwx 1 root root 21 2010-04-03 18:10 frontend0 -> ../adapter1/frontend0
>>> lrwxrwxrwx 1 root root 16 2010-04-03 18:10 net0 -> ../adapter2/net0
>>>
>>> With this neither of the adapters work as the symlinks are a mess.
>>>
>>> Has anyone managed to come up with a sensible udev rule for a HVR-2200
>>> or HVR-2250 card?
>>>
>>> Thanks
>>>
>>> Steve
>>> _______________________________________________
>>> mythtv-users mailing list
>>> mythtv-users [at] mythtv
>>> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
>>>
>>
>> _______________________________________________
>> mythtv-users mailing list
>> mythtv-users [at] mythtv
>> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
>>
>
> Are you just setup with HVR 2200 or are you using other inputs as well?
>

Sorry I missed a line in your original posting......

Rather then using a UDEV rule I did the following....

I blacklisted all the dvb devices in /etc/modprobe.d/blacklist.conf by
adding the following to the bottom of the file

---------------------------------------------------

# DVB Devices
# Required so we can force a specific load order for them

# This is the Hauppage DVB-S2 card
blacklist cx8800
blacklist cx8802
blacklist cx8802-alsa
blacklist cx8800

# This is the Hauppauge HVR2200 card
blacklist saa7164

# This is the Hauppauge NOVA 500 card
blacklist dvb_usb_dib0700

--------------------------------------------------------
I stopped mythbackend from starting automatically and then I then
created the following script and added it to /etc/rc.d/rc.local so
that it executes

/usr/local/bin/loaddvbcards

--------------------------------------------------------
# The DVB cards HAVE to be loaded in this specific order to ensure
the correct device is
# mapped against the correct profile in mythtv.
# Else you get a satellite card with a terrestrial profile and vice versa.
# Then mythbackend is started only when the cards are loaded and 'settled'.

modprobe dvb_usb_dib0700
sleep 3
modprobe saa7164
sleep 3
modprobe cx8800
sleep 3
modprobe cx8802
sleep 15
service mythbackend start

-----------------------------------------------------------

This has worked fine for me ever since and I've never had a problem
with a reboot causing a problem condition.
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


mikep at randomtraveller

Apr 4, 2010, 9:43 AM

Post #6 of 6 (1659 views)
Permalink
Re: UDev rules for Dual Tuner Cards [In reply to]

Steven Ellis wrote:
>
> SUBSYSTEM=="dvb", ATTRS{vendor}=="0x1131", ATTRS{device}=="0x7164",
> ENV{hvr2200}!="two", ENV{hvr2200}="two", PROGRAM="/bin/sh -c 'K=%k;
> K=$${K#dvb}; printf dvb/adapter170/%%s $${K#*.}'", SYMLINK+="%c"
> SUBSYSTEM=="dvb", ATTRS{vendor}=="0x1131", ATTRS{device}=="0x7164",
> ENV{hvr2200}=="two", ENV{hvr2200}="one", PROGRAM="/bin/sh -c 'K=%k;
> K=$${K#dvb}; printf dvb/adapter171/%%s $${K#*.}'", SYMLINK+="%c"
>
Looks like you have a typo in the first of these two lines if the second is a
sample of what you're aiming at:

ENV{hvr2200}!="two", ENV{hvr2200}="two"

I guess one of those should be a "one".

--

Mike Perkins

_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users

MythTV users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.