# Udev rules for DVB cards, help please!

## dec

Hey all, I just installed two VisionPlus DVB-T HDTV cards in my PC and i've been trying to get them running for a couple of days now.

Udev creates these devices for them:

```
crw-rw----  1 root root 212,  4 Dec 28  2004 /dev/dvb0.demux0

crw-rw----  1 root root 212,  5 Dec 28  2004 /dev/dvb0.dvr0

crw-rw----  1 root root 212,  3 Dec 28  2004 /dev/dvb0.frontend0

crw-rw----  1 root root 212,  7 Dec 28  2004 /dev/dvb0.net0

crw-rw----  1 root root 212, 68 Dec 28  2004 /dev/dvb1.demux0

crw-rw----  1 root root 212, 69 Dec 28  2004 /dev/dvb1.dvr0

crw-rw----  1 root root 212, 67 Dec 28  2004 /dev/dvb1.frontend0

crw-rw----  1 root root 212, 71 Dec 28  2004 /dev/dvb1.net0
```

Where I need it to be using:

```
/dev/dvb/adapter0/frontend0

...

/dev/dvb/adapter1/frontend0

...
```

I found a udev rule on the forums which looks like this:

```
SYSFS{adap}="adapter*", NAME="dvb/adapter%n/%k"
```

But it doesn't seem to have any effect. I've used udevinfo on /sys/class/dvb/dvb0.frontend0 to try and find out what I should be using instead of SYSFS{adap}, but it doesn't show anything.

Oh and I'm using kernel 2.6.10-ck1 with a few misc patches.

Any ideas?

Thanks,

Tom

----------

## detroitx

you must create a rule for the dvb 

/etc/udev/rules.d/20-local.rules

 *Quote:*   

> 
> 
> KERNEL="dvb*", PROGRAM="/etc/udev/scripts/dvb.sh %k", NAME="%c"

 

and place the the dvb.sh  in /etc/udev/scripts 

 *Quote:*   

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

 

set the permissions in /etc/udev/permissions.d/20-local.permissions

 *Quote:*   

> 
> 
> dvb/adapter[0-3]*/*:root:video:0660

 

cu

----------

## oggialli

I'm having trouble getting the devnodes to show up at all with detroitx's rules and dvb.sh . There just isnt any /dev/dvb . 

I'm using budget_ci with tda1004x (and it detects the frontend correctly and so on. Newest UDEV from portage on ~amd64).

----------

## gentoo newbie

maybe you just forgot to chmod +x the dvb.sh script

----------

## oggialli

nah, been there, done that. Manually creating the nodes currently...

----------

## Weejoker

Having the same problems here:  :Sad: 

/etc/udev/rules.d/dvb.rule

```
KERNEL="dvb*", PROGRAM="/etc/udev/scripts/dvb.sh %k", NAME="%c"
```

/etc/udev/scripts/dvb.sh

```
#!/bin/sh

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

Permissions

```
# ls -l /etc/udev/scripts/

total 20

-rwxr-xr-x  1 root root 6590 Nov 19 20:25 cdsymlinks.sh

-rwxr-xr-x  1 root root   96 Jan 15 22:08 dvb.sh

-rwxr-xr-x  1 root root 1217 Nov 19 20:25 ide-devfs.sh

-rwxr-xr-x  1 root root 2386 Nov 19 20:25 scsi-devfs.sh
```

If anyone can help, it would be highly appreciated...  :Smile: 

John  :Sad: 

----------

## Weejoker

Heh... solved my particular issue in seconds.  :Rolling Eyes: 

Looks like the kernel documentation is wrong...

/usr/src/linux/Documentation/dvb/udev.txt

 *Quote:*   

> Create a new rule file in that directory called "dvb.rule" and add the following line:
> 
> [...]

 

Whereas the udev man page says this:

 *Quote:*   

> udev_rules
> 
>               The name of the udev rules file or directory to look for files with the  suffix .rules.

 

So I gave the file the correct suffix and put a number on the front, just so that it is done in the correct order:

```
# cd /etc/udev/rules.d/

# mv dvb.rule 51-dvb.rules
```

Now I am getting the original and correct structure.  :Very Happy: 

John

----------

## oggialli

Hmm, it works now. Tried udev again forcibly when 2.6.11-rc1-love1 didnt have devfs anymore.

----------

## golding

EDIT --  I was REALLY tired when I posted this, and now I will put it in the RIGHT thread  :Smile: 

Bumpety bump

Have also same card as others on this post and having sort of same problems.

From the kernel documentation *faq.txt wrote:*   

> If you have a card with a built-in hardware MPEG-decoder the
> 
> 	drivers create a video4linux device (/dev/v4l/video0) which
> 
> 	you can use to watch TV with any v4l application.

 

yet when TVTime is opened it fails to find the television input.  As mentioned above in the parent post, it finds Composite1 and S-video but then disallows any channel selection.

Anyone feeling like writing a blow by blow HowTo on getting this card from installation in the box to viewing it in SIMPLE steps?  Take it as a given that all modules are loading and the device nodes are appearing correctly under /etc/dvb and /dev/v4l.

Just need to know what is to be done to ACTUALLY VIEW some telly on this nightmare of a card ... yyaawwnn ... have been awake nearly two days trying to get this figured out and am now going to sleep for ten to twelve hours ... hope there is a reply when I wake up  :Smile: 

----------

