LinHES Forums
http://forum.linhes.org/

Adding more than 4 DVB cards
http://forum.linhes.org/viewtopic.php?f=15&t=14437
Page 1 of 1

Author:  bigB [ Sat Mar 03, 2007 9:15 pm ]
Post subject:  Adding more than 4 DVB cards

Hi,

I recently added a dual tuner to my HTPC now totalling 5. I discovered that i could not add any extra /dev/dvb/adapter branches with mknod, the minor number appeared to be limited to 8 bits (0 - 255 range) and would wrap causing the major number to increment. I fixed this problem by updateing my coreutils package (there were some dependencey issues, but i just ignored these), this updated mknod which allows for 24bit minor number (i think).


Code:
#!/bin/bash

function create_adapter() {
        local nr="$1" major="$2" minor="$3"

        mkdir /dev/dvb/adapter${nr}
        mknod /dev/dvb/adapter${nr}/video0      c $major $(( $minor ))
        mknod /dev/dvb/adapter${nr}/audio0      c $major $(( $minor +1 ))
        mknod /dev/dvb/adapter${nr}/frontend0 c $major $(( $minor +3 ))
        mknod /dev/dvb/adapter${nr}/demux0      c $major $(( $minor +4 ))
        mknod /dev/dvb/adapter${nr}/dvr0        c $major $(( $minor +5 ))
        mknod /dev/dvb/adapter${nr}/ca0 c $major $(( $minor +6 ))
        mknod /dev/dvb/adapter${nr}/net0        c $major $(( $minor +7 ))
        mknod /dev/dvb/adapter${nr}/osd0        c $major $(( $minor +8 ))
}

major=$(awk '/DVB/ { print $1 }' /proc/devices)
if test "$major" = ""; then
        echo "can't figure dvb major number, dvb modules not loaded yet?"
        exit 1
fi

echo "creating dvb device nodes for major $major"
rm -rf /dev/dvb/adapter*
create_adapter 0 $major 0
create_adapter 1 $major 64
create_adapter 2 $major 128
create_adapter 3 $major 192
create_adapter 4 $major 256
create_adapter 5 $major 320
create_adapter 6 $major 384
create_adapter 7 $major 448
chmod 755 /dev/dvb/adapter*
chmod 660 /dev/dvb/adapter*/*
chown root:video /dev/dvb/adapter*/*



BigB

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/