ADAM'S WEB PRESENCE

1 February 2008

IVTV Device Node Problems - Solved

Filed under: Nerd Notes — adam @ 1:06 pm

I’ve got a Debian machine here which is set up for TV recording. It is fully stacked with 2 x cx88 DTV cards and 3 x PVR150 cards using the IVTV driver. I’m running Debian Etch which comes with version 0.8.2 of the ivtv driver at the time of writing.

The problem is that the PVR150 cards sometimes register themselves as /dev/video0, 1 and 2 but other times, after a reboot they register themselves as /dev/video2, 3 and 4. I needed some way to make them stay on the same device nodes.

Enter this little UDEV rules file I wrote. It creates new device nodes called /dev/ivtvenc0, /dev/ivtvenc1 etc. up to however many cards you have. These will symlink to the correct device nodes every time. Here’s the script. Call it 010_ivtv.rules and put it in /etc/udev/rules.d/

# Rule to sort out those pesky IVTV cards which never
# seem to load in the correct order when DTV cards are
# also installed.
# by Adam Pierce 01-Feb-2008

ATTR{name}=="ivtv0 encoder MPEG",SYMLINK+="ivtvenc0"
ATTR{name}=="ivtv1 encoder MPEG",SYMLINK+="ivtvenc1"
ATTR{name}=="ivtv2 encoder MPEG",SYMLINK+="ivtvenc2"
ATTR{name}=="ivtv3 encoder MPEG",SYMLINK+="ivtvenc3"
ATTR{name}=="ivtv4 encoder MPEG",SYMLINK+="ivtvenc4"
ATTR{name}=="ivtv5 encoder MPEG",SYMLINK+="ivtvenc5"
ATTR{name}=="ivtv6 encoder MPEG",SYMLINK+="ivtvenc6"
ATTR{name}=="ivtv7 encoder MPEG",SYMLINK+="ivtvenc7"

Watch it in action. Here it is after one reboot:

# ls -l /dev/ivtv*
lrwxrwxrwx 1 root root 6 2008-02-01 13:54 /dev/ivtvenc0 -> video0
lrwxrwxrwx 1 root root 6 2008-02-01 13:54 /dev/ivtvenc1 -> video1
lrwxrwxrwx 1 root root 6 2008-02-01 13:54 /dev/ivtvenc2 -> video2

And again after the next reboot

# ls -l /dev/ivtv*
lrwxrwxrwx 1 root root 6 2008-02-01 13:54 /dev/ivtvenc0 -> video2
lrwxrwxrwx 1 root root 6 2008-02-01 13:54 /dev/ivtvenc1 -> video3
lrwxrwxrwx 1 root root 6 2008-02-01 13:54 /dev/ivtvenc2 -> video4

Now I can always rely on the ivtvenc device nodes to point at the right cards.

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment


Powered by WordPress