LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Custom udev rule not creating device node. DVB related (https://www.linuxquestions.org/questions/slackware-14/custom-udev-rule-not-creating-device-node-dvb-related-925098/)

vdemuth 01-22-2012 10:48 AM

Custom udev rule not creating device node. DVB related
 
I have a Kworld 355u dvd-t usb device which has worked previously in Slackware from about version 12.1. In fact I had a previous thread about it back in 2008 where I was able to get it working. But even following my own previous way has not worked.
Having decided to resurrect the hardware, I find that I am not able to get it working in 13.37.
This is what I have so far:

Code:

lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 064e:a103 Suyin Corp. Acer/HP Integrated Webcam [CN0314]
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 019: ID eb1a:e357 eMPIA Technology, Inc.

Code:

usb 1-2: new high speed USB device using ehci_hcd and address 19
[26321.861512] usb 1-2: New USB device found, idVendor=eb1a, idProduct=e357
[26321.861521] usb 1-2: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[26321.861528] usb 1-2: Product: USB 2870 Device
[26321.863035] em28xx: New device USB 2870 Device @ 480 Mbps (eb1a:e357, interface 0, class 0)
[26321.863981] em28xx #0: chip ID is em2870
[26321.940930] em28xx #0: i2c eeprom 00: 1a eb 67 95 1a eb 57 e3 c0 12 62 40 6a 22 00 00
[26321.940950] em28xx #0: i2c eeprom 10: 00 00 04 57 6a 0d 00 00 60 00 00 00 02 00 00 00
[26321.940968] em28xx #0: i2c eeprom 20: 54 00 00 00 f0 10 01 00 00 00 00 00 5b 00 00 00
[26321.940984] em28xx #0: i2c eeprom 30: 00 00 20 40 20 80 02 20 01 01 00 00 00 00 00 00
[26321.941000] em28xx #0: i2c eeprom 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[26321.941046] em28xx #0: i2c eeprom 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[26321.941084] em28xx #0: i2c eeprom 60: 00 00 00 00 00 00 00 00 00 00 22 03 55 00 53 00
[26321.941134] em28xx #0: i2c eeprom 70: 42 00 20 00 32 00 38 00 37 00 30 00 20 00 44 00
[26321.941182] em28xx #0: i2c eeprom 80: 65 00 76 00 69 00 63 00 65 00 00 00 00 00 00 00
[26321.941230] em28xx #0: i2c eeprom 90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[26321.941278] em28xx #0: i2c eeprom a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[26321.941327] em28xx #0: i2c eeprom b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[26321.941375] em28xx #0: i2c eeprom c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[26321.941423] em28xx #0: i2c eeprom d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[26321.941471] em28xx #0: i2c eeprom e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[26321.941520] em28xx #0: i2c eeprom f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[26321.941571] em28xx #0: EEPROM ID= 0x9567eb1a, EEPROM hash = 0x32317d02
[26321.941577] em28xx #0: EEPROM info:
[26321.941582] em28xx #0:      No audio on board.
[26321.941587] em28xx #0:      500mA max power
[26321.941593] em28xx #0:      Table at 0x04, strings=0x226a, 0x0000, 0x0000
[26321.943060] em28xx #0: Identified as Kworld 355 U DVB-T (card=42)
[26321.943067] em28xx #0:
[26321.943069]
[26321.943072] em28xx #0: The support for this board weren't valid yet.
[26321.943077] em28xx #0: Please send a report of having this working
[26321.943081] em28xx #0: not to V4L mailing list (and/or to other addresses)
[26321.943083]
[26321.950793] tuner 1-0062: chip found @ 0xc4 (em28xx #0)
[26321.950807] tuner 1-0062: tuner type not set
[26321.950815] em28xx #0: v4l2 driver version 0.1.2
[26321.950820] tuner 1-0062: tuner type not set
[26321.956193] em28xx #0: V4L2 video device registered as video1

My custom rule at /etc/udev/rules.d named 30-kworld.rules:

Code:

BUS=="usb",KERNEL=="video[0-9]*,"SUBSYSTEM="video4linux",ATTRS{idVendor}=="eb1a",ATTRS{idProduct}=="e357",GROUP="plugdev",MODE="0666", RUN+="/etc/udev/scripts/dvb.sh %k", NAME=="%c"
the dvb.sh script at /etc/udev/scripts

Code:

#!/bin/sh
/bin/echo $1 | /bin/sed -e 's,dvb\([0-9]\)\.\([^0-9]*\)\([0-9]\),dvb/adapter\1/\2\3,'

I have been trying to follow the how to on writing udev rules at http://www.reactivated.net/writing_udev_rules.html but it seems to be very out of date.

You will see from the info here that udev is creating a device node at /dev/video1. I think this means that the device is not being recognised by udev as being a dvb device. (maybe a bug in udev perhaps), but is instead being configured as some sort of v4l device which it isn't.

Not sure where to go from here, so some advice would be most welcome.
BTW, this is on both a laptop running 64 bit and a notebook running 32 bit.

Thanks.

Ser Olmy 01-22-2012 12:59 PM

There seems to be an odd number of double quotes in your udev rule:
BUS=="usb",KERNEL=="video[0-9]*,"SUBSYSTEM="video4linux", ...

vdemuth 01-23-2012 10:40 AM

corrected the odd No. of quotes. Still not working

Ser Olmy 01-23-2012 03:12 PM

The rule ends with NAME=="%c". Perhaps that was supposed to be an assignment (NAME="%c") rather than a test?

vdemuth 01-24-2012 12:33 PM

The rule was taken from the udev.txt file taken from the kernel docs so I am assuming that it is correctly terminated with the NAME assignment

Ser Olmy 01-24-2012 12:53 PM

Since it isn't working, I'd wouldn't be assuming too much.

This is how the udev rule should look with the quotes issue resolved:
Code:

BUS=="usb",KERNEL=="video[0-9]*",SUBSYSTEM="video4linux",ATTRS{idVendor}=="eb1a",ATTRS{idProduct}=="e357",GROUP="plugdev",MODE="0666", RUN+="/etc/udev/scripts/dvb.sh %k", NAME=="%c"
Do you know if the dvb.sh script gets called or not when you plug in the receiver? You could add another echo statement or something similar to the top of the script (like "echo dvb.sh is running | logger").

Edit: I'm pretty sure the NAME statement is supposed to be NAME="%c", as that means "give the device node in /dev the name returned by the previous program" (the script), while NAME=="%c" would mean "this line is only valid if the kernel name matches whatever the script returned", and that doesn't really make sense in this context.


All times are GMT -5. The time now is 08:00 PM.