[mythtv-users] udev rules for two devices with the same name
john
jppoet at gmail.com
Thu Feb 19 07:58:03 UTC 2009
On Feb 19, 2009, at 12:42 AM, Nicolas Will wrote:
> On Thu, 2009-02-19 at 13:13 +1030, Barry Williams wrote:
>> Hi guys,
>> I am trying to get the dvico digital dual 4 remote to work with my
>> mythbuntu setup I have followed this guide
>> http://ubuntuforums.org/showthread.php?t=616103 with these exceptions
>> http://ubuntuforums.org/showpost.php?p=6232229&postcount=42 as I am
>> using a rev2 card except unlike tvars my /dev/input/eventx's do tend
>> to change, depending if I have my game pad plugged in or another
>> keyboard & mouse. I can get it to work by manually setting a simlink
>> to the first device and deleting the second device but is there a
>> way
>> to get udev to pick up the first
>> dKERNEL=="event*",SYSFS{name}=="IR-receiver inside an USB DVB
>> receiver",SYMLINK="input/irremote0"
>> KERNEL=="event*",SYSFS{name}=="IR-receiver inside an USB DVB
>> receiver",SYMLINK="input/irremote1" evice even thought they are both
>> labled exactly the same
>>
>> last two line of output of dmesg|grep IR
>> [ 11.007274] input: IR-receiver inside an USB DVB receiver as
>> /devices/pci0000:00/0000:00:14.4/0000:04:07.2/usb8/8-1/input/input8
>> [ 11.399469] input: IR-receiver inside an USB DVB receiver as
>> /devices/pci0000:00/0000:00:14.4/0000:04:07.2/usb8/8-2/input/input9
>>
>> I have tried something like this
>> in /etc/udev/rules.d/60-symlinks.rules
>> KERNEL=="event*",SYSFS{name}=="IR-receiver inside an USB DVB
>> receiver",SYMLINK="input/irremote0"
>> KERNEL=="event*",SYSFS{name}=="IR-receiver inside an USB DVB
>> receiver",SYMLINK="input/irremote1"
>> but I still only get a symlink on /dev/input/irremote1 for the second
>> unworking device.
>
> You will have to find something that is really different between
> your 2
> devices in order to sort them out properly.
>
> On my system I used the serial number.
>
> For exemple, the entry for my Nova-T-500 in lshal is looking like
> that:
>
> udi = '/org/freedesktop/Hal/devices/
> usb_device_2040_9950_4028166400'
> info.linux.driver = 'usb' (string)
> info.parent = '/org/freedesktop/Hal/devices/
> usb_device_1d6b_2_0000_07_01_2' (string)
> info.product = 'WinTV Nova-DT' (string)
> info.subsystem = 'usb_device' (string)
> info.udi = '/org/freedesktop/Hal/devices/
> usb_device_2040_9950_4028166400' (string)
> info.vendor = 'Hauppauge' (string)
> linux.device_file = '/dev/bus/usb/010/002' (string)
> linux.hotplug_type = 2 (0x2) (int)
> linux.subsystem = 'usb' (string)
> linux.sysfs_path = '/sys/devices/pci0000:00/0000:00:1e.
> 0/0000:07:01.2/usb10/10-1' (string)
> usb_device.bus_number = 10 (0xa) (int)
> usb_device.can_wake_up = true (bool)
> usb_device.configuration_value = 1 (0x1) (int)
> usb_device.device_class = 0 (0x0) (int)
> usb_device.device_protocol = 0 (0x0) (int)
> usb_device.device_revision_bcd = 256 (0x100) (int)
> usb_device.device_subclass = 0 (0x0) (int)
> usb_device.is_self_powered = false (bool)
> usb_device.linux.device_number = 2 (0x2) (int)
> usb_device.linux.sysfs_path = '/sys/devices/
> pci0000:00/0000:00:1e.0/0000:07:01.2/usb10/10-1' (string)
> usb_device.max_power = 500 (0x1f4) (int)
> usb_device.num_configurations = 1 (0x1) (int)
> usb_device.num_interfaces = 1 (0x1) (int)
> usb_device.num_ports = 0 (0x0) (int)
> usb_device.product = 'WinTV Nova-DT' (string)
> usb_device.product_id = 39248 (0x9950) (int)
> usb_device.serial = '4028166400' (string)
> usb_device.speed = 480.0 (480) (double)
> usb_device.vendor = 'Hauppauge' (string)
> usb_device.vendor_id = 8256 (0x2040) (int)
> usb_device.version = 2.0 (2) (double)
>
> This is the initial device declaration, there are then more sections
> about each sub-element (event, frontends, demux, etc...).
>
> I picked-up the card's serial number from that line, expecting it to
> be
> unique enough within my system:
>
> usb_device.serial = '4028166400' (string)
>
> and turned it into this udev rule for the event interface:
>
> KERNEL=="event*", ATTRS{serial}=="4028166400", SYMLINK
> +="input/dvb-ir"
>
> Hope this helps.
>
> Nico
I use a couple of pl2303 chip USB->serial adaptors to control my
directv STB. They do not have anything to distinguish one from the
other, so I have to use the USB *port* they are plugged into to tell
them apart:
SUBSYSTEMS=="usb",KERNELS=="5-1:1.0",DRIVERS=="pl2303",SYMLINK
+="hdpvrChannel0"
SUBSYSTEMS=="usb",KERNELS=="5-2:1.0",DRIVERS=="pl2303",SYMLINK
+="hdpvrChannel1"
If nothing else works, you could try that.
John
More information about the mythtv-users
mailing list