[mythtv-users] UDEV rules

Yianni yiannividalis at hotmail.com
Wed Jan 22 06:59:55 UTC 2014


>> KERNEL=="video?",SUBSYSTEM=="video4linux",ATTRS{subsystem_vendor}=="0x0070",ATTRS{device}=="0x0016",SYMLINK+="videopvr150",GROUP="video"
>>
> Thanks Yanni, that did do it!
> 
I'm glad!

Basically, what it means is:
Search for a device assigned as "video{0,1,2,etc}, that belongs to the subsystem "video4linux", that its subsystem_vendor attribute has the value of "0x0070", and its device attribute is "0x0016", and then create a symbolic link named videopvr150 and assign it to the user group video (as all such devices should be).


> daryl at daryl-A780L3C:~$ ls -lah /dev/video*
> crw-rw----+ 1 root video 81, 0 Jan 21 15:17 /dev/video0
> crw-rw----+ 1 root video 81, 5 Jan 21 15:16 /dev/video1
> crw-rw----+ 1 root video 81, 7 Jan 21 15:17 /dev/video2
> crw-rw----+ 1 root video 81, 3 Jan 21 15:17 /dev/video24
> crw-rw----+ 1 root video 81, 1 Jan 21 15:17 /dev/video32
> lrwxrwxrwx  1 root root      6 Jan 21 15:17 /dev/videopvr150 -> video0
> daryl at daryl-A780L3C:~$
> 
> One thing I noticed is that in your rule the commas come after a space
> whereas in the other one I tried the commas are before the space.
> Would that nullify the previous rule?

No, I thought about the commas, too but I searched the default udev rules and their commas were different than mine.

> 
> Do you think I should create further rules for the other cards in my box?
> 
I'd recommend it, because it is worth the time you'll spend setting it up. Once you get your rules working you won't have to worry about device naming anymore.

Use the udevadm info -a -p $(udevadm info -q path -n /dev/videoX) for each X of your devices and try to use values that are specific to each one. The best is the serial, if it's available, then pairs of vendor (or subsystem_vendor) and device (or subsystem_device). Try also to stick to attributes listed near the top of the output, as they belong to the device itself, rather than its parents.

There is an excellent guide at http://www.reactivated.net/writing_udev_rules.html, which I'd recommend reading.

If you decide you don't want to try yourself, let me know and I'll try to come up with udev lines.

Regards,

Yianni. 		 	   		  


More information about the mythtv-users mailing list