[mythtv-users] UDEV rules

Hika van den Hoven hikavdh at gmail.com
Tue Jan 28 16:51:22 UTC 2014


Hoi Daryl,

I don't know, I just did. But then They are all analog.
I just used udevadm to get the info. Put it in a script to not all the
time type it

!/bin/bash
udevadm info --attribute-walk --path $(udevadm info --query path --name=$1)

and piped the output to my rules file, so I could copy and past them.
I found the difference between ATTR and ATTRS.
ATTR is in the node itself (basicaly kernel, subsystem, name and
index) and ATTRS is higher up the tree (which didn't exist with the
Winfast) The index by the way is an index of the nodes on one device,
so unusable to distinguish between identical cards. Maybe '[0]' in the
name is an usable enumerator. Else you have to use something like
path-id (the physical pci location) to distinguish.
The distinguising of the different devices on one card I do, as you
can see, on the name and partially on KERNEL, but I don't want to use
the counter in there, for that can change.

About the backend setup. I initially just typed them in the database
with phpmysql. On going to setup only one of the vbi's disappeared
once, but not a second time. It obviously had to learn. And they all
work (as before, the Winfst has no sound in Mythtv, but that's a bug I
filled. Mythtv tries to open a nonexisting dma-audio channel, closing
the cable connection on the way). Oh by the way I use 0.26 on gentoo
systems.

Tot mails,
  Hika                            mailto:hikavdh at gmail.com

"Zonder hoop kun je niet leven
Zonder leven is er geen hoop
Het eeuwige dilemma
Zeker als je hoop moet vernietigen om te kunnen overleven!"

De lerende Mens
--

Tuesday, January 28, 2014, 4:58:19 PM, you wrote:

> On Tue, Jan 28, 2014 at 10:12 AM, Hika van den Hoven <hikavdh at gmail.com> wrote:
>> Hoi Daryl,
>>
>> I did finally try it on my systems for all the devices:
>>
>> # OEM Winfast TV 2000XP expert analog
>> # pci/vendor id 14f1:8000 / 107d:6611
>> # driver cx8800 with external soundcard (ca0106)
>> SUBSYSTEM=="video4linux", \
>>         KERNEL=="video*", \
>>         ATTR{name}=="cx88?0? video (Leadtek Winfast ", \
>>         SYMLINK+="v4l/Winfast/video"
>> SUBSYSTEM=="video4linux", \
>>         KERNEL=="vbi*", \
>>         ATTR{name}=="cx88?0? vbi (Leadtek Winfast 20", \
>>         SYMLINK+="v4l/Winfast/vbi"
>> SUBSYSTEM=="video4linux", \
>>         KERNEL=="radio*", \
>>         ATTR{name}=="cx88?0? radio (Leadtek Winfast ", \
>>         SYMLINK+="v4l/Winfast/radio"
>> SUBSYSTEM=="sound", \
>>         KERNEL=="dsp*", \
>>         ATTRS{vendor}=="0x1102", \
>>         ATTRS{device}=="0x0007", \
>>         SYMLINK+="v4l/Winfast/audio"
>>
>> # ASUS TV-FM 7134 analog
>> # pci/vendor id 1131:7134 / 1043:4842
>> # driver saa7134 with dma-sound
>> SUBSYSTEM=="video4linux", \
>>         KERNEL=="video*", \
>>         ATTRS{vendor}=="0x1131", \
>>         ATTRS{device}=="0x7134", \
>>         SYMLINK+="v4l/TVFM71/video"
>> SUBSYSTEM=="video4linux", \
>>         KERNEL=="vbi*", \
>>         ATTRS{vendor}=="0x1131", \
>>         ATTRS{device}=="0x7134", \
>>         SYMLINK+="v4l/TVFM71/vbi"
>> SUBSYSTEM=="video4linux", \
>>         KERNEL=="radio*", \
>>         ATTRS{vendor}=="0x1131", \
>>         ATTRS{device}=="0x7134", \
>>         SYMLINK+="v4l/TVFM71/radio"
>> SUBSYSTEM=="sound", \
>>         KERNEL=="dsp*", \
>>         ATTRS{vendor}=="0x1131", \
>>         ATTRS{device}=="0x7134", \
>>         SYMLINK+="v4l/TVFM71/audio"
>>
>> # Hauppauge PVR350 mpeg2 encoder
>> # pci/vendor id 4444:0803 / 0070:4000
>> # driver ivtv
>> SUBSYSTEM=="video4linux", \
>>         KERNEL=="video*", \
>>         ATTR{name}=="ivtv0 encoder MPG", \
>>         ATTRS{vendor}=="0x4444", \
>>         ATTRS{device}=="0x0803", \
>>         SYMLINK+="v4l/PVR350-in/mpeg"
>> SUBSYSTEM=="video4linux", \
>>         KERNEL=="vbi*", \
>>         ATTR{name}=="ivtv0 encoder VBI", \
>>         ATTRS{vendor}=="0x4444", \
>>         ATTRS{device}=="0x0803", \
>>         SYMLINK+="v4l/PVR350-in/vbi"
>> SUBSYSTEM=="video4linux", \
>>         KERNEL=="radio*", \
>>         ATTRS{vendor}=="0x4444", \
>>         ATTRS{device}=="0x0803", \
>>         SYMLINK+="v4l/PVR350-in/radio"
>> SUBSYSTEM=="video4linux", \
>>         KERNEL=="video*", \
>>         ATTR{name}=="ivtv0 encoder YUV", \
>>         ATTRS{vendor}=="0x4444", \
>>         ATTRS{device}=="0x0803", \
>>         SYMLINK+="v4l/PVR350-in/raw-YUV"
>> SUBSYSTEM=="video4linux", \
>>         KERNEL=="video*", \
>>         ATTR{name}=="ivtv0 encoder PCM", \
>>         ATTRS{vendor}=="0x4444", \
>>         ATTRS{device}=="0x0803", \
>>         SYMLINK+="v4l/PVR350-in/raw-audio"
>>
>> SUBSYSTEM=="video4linux", \
>>         KERNEL=="video*", \
>>         ATTR{name}=="ivtv0 decoder MPG", \
>>         ATTRS{vendor}=="0x4444", \
>>         ATTRS{device}=="0x0803", \
>>         SYMLINK+="v4l/PVR350-out/mpeg"
>> SUBSYSTEM=="video4linux", \
>>         KERNEL=="vbi*", \
>>         ATTR{name}=="ivtv0 decoder VBI", \
>>         ATTRS{vendor}=="0x4444", \
>>         ATTRS{device}=="0x0803", \
>>         SYMLINK+="v4l/PVR350-out/vbi-feedback"
>> SUBSYSTEM=="video4linux", \
>>         KERNEL=="video*", \
>>         ATTR{name}=="ivtv0 decoder YUV", \
>>         ATTRS{vendor}=="0x4444", \
>>         ATTRS{device}=="0x0803", \
>>         SYMLINK+="v4l/PVR350-out/YUV"
>> SUBSYSTEM=="video4linux", \
>>         KERNEL=="vbi*", \
>>         ATTR{name}=="ivtv0 decoder VOUT", \
>>         ATTRS{vendor}=="0x4444", \
>>         ATTRS{device}=="0x0803", \
>>         SYMLINK+="v4l/PVR350-out/vbi"
>>
>> The first one is on my frontend and udev puts it in virtual, so I
>> can't use vendor or device. The weird thing is that I had to use the
>> name as coming from udevadm. If I typed it and didn't put an '*' at
>> the end it failed.
>>
>> /dev/v4l/Winfast:
>> lrwxrwxrwx 1 root root 10 28 jan 16:02 audio -> ../../dsp1
>> lrwxrwxrwx 1 root root 12 28 jan 16:02 radio -> ../../radio0
>> lrwxrwxrwx 1 root root 10 28 jan 16:02 vbi -> ../../vbi0
>> lrwxrwxrwx 1 root root 12 28 jan 16:02 video -> ../../video0
>>
>> /dev/v4l/PVR350-in:
>> lrwxrwxrwx 1 root root 12 28 jan 06:58 mpeg -> ../../video0
>> lrwxrwxrwx 1 root root 12 28 jan 06:58 radio -> ../../radio0
>> lrwxrwxrwx 1 root root 13 28 jan 06:58 raw-audio -> ../../video24
>> lrwxrwxrwx 1 root root 13 28 jan 06:58 raw-YUV -> ../../video32
>> lrwxrwxrwx 1 root root 10 28 jan 06:58 vbi -> ../../vbi0
>>
>> /dev/v4l/PVR350-out:
>> lrwxrwxrwx 1 root root 13 28 jan 06:58 mpeg -> ../../video16
>> lrwxrwxrwx 1 root root 11 28 jan 06:58 vbi -> ../../vbi16
>> lrwxrwxrwx 1 root root 10 28 jan 06:58 vbi-feedback -> ../../vbi8
>> lrwxrwxrwx 1 root root 13 28 jan 06:58 YUV -> ../../video48
>>
>> /dev/v4l/TVFM71:
>> lrwxrwxrwx 1 root root 10 28 jan 06:58 audio -> ../../dsp1
>> lrwxrwxrwx 1 root root 12 28 jan 06:58 radio -> ../../radio1
>> lrwxrwxrwx 1 root root 10 28 jan 06:58 vbi -> ../../vbi1
>> lrwxrwxrwx 1 root root 12 28 jan 06:58 video -> ../../video1
>>
>> Tot mails,
>>   Hika                            mailto:hikavdh at gmail.com
>>
>> "Zonder hoop kun je niet leven
>> Zonder leven is er geen hoop
>> Het eeuwige dilemma
>> Zeker als je hoop moet vernietigen om te kunnen overleven!"
>>
>> De lerende Mens
>> --
>>
>> Tuesday, January 28, 2014, 3:46:03 PM, you wrote:
>>
>>> On Tue, Jan 28, 2014 at 3:32 AM, Yianni <yiannividalis at hotmail.com> wrote:
>>>>> MY bad, The rules I have in place are:
>>>>> KERNEL=="video[0-9]", ATTR{name}=="ivtv[0-1] encoder MPG",
>>>>> ATTRS{subsystem_device}=="0x8801",SYMLINK+="videopvr150",GROUP="video"
>>>>> KERNEL=="video[0-9]", ATTR{name}=="saa7133[0] video (Kworld PC150-",
>>>>> ATTRS{subsystem_device}=="0xa135",SYMLINK+="videoKWd150",GROUP="video"
>>>>> KERNEL=="video[0-9]", ATTR{name}=="Hauppauge WinTV-HVR1250 (video)",
>>>>> ATTRS{subsystem_device}=="0x7911",SYMLINK+="videoHP1250",GROUP="video"
>>>>> KERNEL=="dvb?.frontend?",SUBSYSTEM=="dvb",ATTRS{subsystem_vendor}=="0x0070",ATTRS{subsystem_device}=="0x7911",SYMLINK+="dvbHP1250",GROUP="video"
>>>>> KERNEL=="dvb?.frontend?",SUBSYSTEM=="dvb",ATTRS{subsystem_vendor}=="0x17de",ATTRS{subsystem_device}=="0xa135",SYMLINK+="dvbKWd150",GROUP="video"
>>>>>
>>>>> Which results in:
>>>>> daryl at daryl-A780L3C:~$ ls -lah /dev/video*
>>>>> crw-rw----+ 1 root video 81, 0 Jan 27 15:18 /dev/video0
>>>>> crw-rw----+ 1 root video 81, 5 Jan 27 15:18 /dev/video1
>>>>> crw-rw----+ 1 root video 81, 7 Jan 27 15:18 /dev/video2
>>>>> crw-rw----+ 1 root video 81, 3 Jan 27 15:18 /dev/video24
>>>>> crw-rw----+ 1 root video 81, 1 Jan 27 15:18 /dev/video32
>>>>> lrwxrwxrwx 1 root root 6 Jan 27 15:18 /dev/videoHP1250 -> video1
>>>>> lrwxrwxrwx 1 root root 6 Jan 27 15:18 /dev/videopvr150 -> video0
>>>>> daryl at daryl-A780L3C:~$ ls -lah /dev/dvb*
>>>>> lrwxrwxrwx 1 root root 22 Jan 27 15:18 /dev/dvbHP1250 -> dvb/adapter0/frontend0
>>>>> lrwxrwxrwx 1 root root 22 Jan 27 15:18 /dev/dvbKWd150 -> dvb/adapter1/frontend0
>>>>>
>>>>> /dev/dvb:
>>>>> total 0
>>>>> drwxr-xr-x 4 root root 80 Jan 27 15:18 .
>>>>> drwxr-xr-x 16 root root 4.6K Jan 27 15:18 ..
>>>>> drwxr-xr-x 2 root root 120 Jan 27 15:18 adapter0
>>>>> drwxr-xr-x 2 root root 120 Jan 27 15:18 adapter1
>>>>> daryl at daryl-A780L3C:~$
>>>>>
>>>>> And all that looks good except for no "dvbKWd150" symlink
>>>>> Daryl
>>>>
>>>> Hi, Daryl
>>>>
>>>> Since there is a /dev/dvbKWd150 -> dvb/adapter1/frontend0 symlink, I assume you mean there's not a videoKWd150 symlink.
>>>>
>>>>
>>>> I'd like to suggest some things regarding the udev rules you have.
>>>>
>>>> - You'd better keep each rule in one line, and not spanned across 2 or three.
>>>>
>>>> KERNEL=="video[0-9]", ATTR{name}=="ivtv[0-1] encoder MPG",ATTRS{subsystem_device}=="0x8801",SYMLINK+="videopvr150",GROUP="video"
>>>> KERNEL=="video[0-9]", ATTR{name}=="saa7133[0] video (Kworld PC150-",ATTRS{subsystem_device}=="0xa135",SYMLINK+="videoKWd150",GROUP="video"
>>>> KERNEL=="video[0-9]", ATTR{name}=="Hauppauge WinTV-HVR1250 (video)",ATTRS{subsystem_device}=="0x7911",SYMLINK+="videoHP1250",GROUP="video"
>>>> KERNEL=="dvb?.frontend?",SUBSYSTEM=="dvb",ATTRS{subsystem_vendor}=="0x0070",ATTRS{subsystem_device}=="0x7911",SYMLINK+="dvbHP1250",GROUP="video"
>>>> KERNEL=="dvb?.frontend?",SUBSYSTEM=="dvb",ATTRS{subsystem_vendor}=="0x17de",ATTRS{subsystem_device}=="0xa135",SYMLINK+="dvbKWd150",GROUP="video"
>>>>
>>>> - The ATTR{name} for the cards is dynamically given by udev or by the kernel and in the case of the ivtv it contains the device number (ivtv0)
>>>> Because the analog saa7133 uses brackets in it's name, you have to follow Hika's advice (Post #96), i.e the rule will become:
>>>>
>>>> KERNEL=="video[0-9]", ATTR{name}=="saa7133\[0\] video (Kworld PC150-",ATTRS{subsystem_device}=="0xa135",SYMLINK+="videoKWd150",GROUP="video"
>>>>
>>>> or
>>>> KERNEL=="video[0-9]", ATTR{name}=="saa7133??? video ?Kworld PC150-",ATTRS{subsystem_device}=="0xa135",SYMLINK+="videoKWd150",GROUP="video"
>>>>
>>>> which is more flexible.
>>>>
>>>> Hoping we're not drowing you in too much advice, and trying to group the symlinks:
>>>>  - analog as video*
>>>>  - digital under /dev/dvb as adapter*,
>>>>
>>>> I suggest using:
>>>>
>>>> KERNEL=="video[0-9]", ATTR{name}=="ivtv[0-1] encoder MPG",ATTRS{subsystem_device}=="0x8801",SYMLINK+="videopvr150",GROUP="video"
>>>> KERNEL=="video[0-9]", ATTR{name}=="saa7133??? video ?Kworld PC150-",ATTRS{subsystem_device}=="0xa135",SYMLINK+="videoKWd150",GROUP="video"
>>>> KERNEL=="video[0-9]", ATTR{name}=="Hauppauge WinTV-HVR1250 (video)",ATTRS{subsystem_device}=="0x7911",SYMLINK+="videoHP1250",GROUP="video"
>>>> KERNEL=="dvb?.frontend?",SUBSYSTEM=="dvb",ATTRS{subsystem_vendor}=="0x0070",ATTRS{subsystem_device}=="0x7911",SYMLINK+="dvb/adapterHP1250",GROUP="video"
>>>> KERNEL=="dvb?.frontend?",SUBSYSTEM=="dvb",ATTRS{subsystem_vendor}=="0x17de",ATTRS{subsystem_device}=="0xa135",SYMLINK+="dvb/adapterKWd150",GROUP="video"
>>>>
>>>> Until next time ;)
>>>>
>>>> Yianni.
>>>> _______________________________________________
>>>> mythtv-users mailing list
>>>> mythtv-users at mythtv.org
>>>> http://www.mythtv.org/mailman/listinfo/mythtv-users
>>
>>> I did find success with Hika's suggestion, my interpretation was to
>>> replace "[0]" with "?0?", which created the missing link.
>>
>>> I refuse to drown, these are just swimming lessons, and all direction
>>> is greatly appreciated.    Daryl
>>> _______________________________________________
>>> mythtv-users mailing list
>>> mythtv-users at mythtv.org
>>> http://www.mythtv.org/mailman/listinfo/mythtv-users
>>
>> _______________________________________________
>> mythtv-users mailing list
>> mythtv-users at mythtv.org
>> http://www.mythtv.org/mailman/listinfo/mythtv-users

> Hoi Hika, How did you make out getting the symlink names to stick in
> the BE setup? For me the analog names stay put but the digital always
> revert to "adapter?.frontend?", when I revisit it in "Capture Cards".
>  Daryl



More information about the mythtv-users mailing list