Linux DVB driver = success

HDHomeRun development

Moderator: Moderators

Postby 321liftoff » Thu Feb 16, 2012 7:01 am

Glad to see another NAS user trying to do the same things we are! I'm certainly not an expert on linux or the dvbhdhomerun drivers, but your output for the dmesg certainly looks good. Here are some things that stick out to me:

(1) run:
Code: Select all
ls -l /dev/hdhome*

to see what you have before doing any of the suggestions below. Save results and post for us to see also.

(2) the order in which you load the last two kernel modules (dvb_hdhomerun.ko and dvb_hdhomerun_fe.ko) are reverse from the way I load them. My order is:
dvb-core.ko
dvb_hdhomerun_core.ko
dvb_hdhomerun_fe.ko
dvb_hdhomerun.ko
I found that dvb_hdhomerun.ko is dependent on dvb_hdhomerun_fe.ko and needs to be loaded after it.

(2) try running:
Code: Select all
groups root

and make sure that rood is in the "users" group, since that is the group you are specifying for running userhdhomerun. I'm using user "admin" which is in the group "administrators" so my parameters are -u admin -g administrators.

(4) After making changes above, get the results of:
Code: Select all
ls -l /dev/hdhome*

and see if there are any changes.[/code]
321liftoff
 
Posts: 29
Joined: Sat Apr 17, 2010 4:22 am

Postby hoontune » Thu Feb 16, 2012 2:37 pm

321liftoff wrote:(1) run:
Code: Select all
ls -l /dev/hdhome*

to see what you have before doing any of the suggestions below. Save results and post for us to see also.

Code: Select all
DiskStation>  ls -l /dev/hdhome*
crw-rw-rw- 1 root video  10, 57 Feb 17 06:56 /dev/hdhomerun_control
crw-rw-rw- 1 root video 253,  0 Feb 17 06:56 /dev/hdhomerun_data0
crw-rw-rw- 1 root video 253,  1 Feb 17 06:56 /dev/hdhomerun_data1


321liftoff wrote:(2) the order in which you load the last two kernel modules (dvb_hdhomerun.ko and dvb_hdhomerun_fe.ko) are reverse from the way I load them. My order is:
dvb-core.ko
dvb_hdhomerun_core.ko
dvb_hdhomerun_fe.ko
dvb_hdhomerun.ko
I found that dvb_hdhomerun.ko is dependent on dvb_hdhomerun_fe.ko and needs to be loaded after it.


OK, have changed the order

321liftoff wrote:(3) try running:
Code: Select all
groups root

and make sure that rood is in the "users" group, since that is the group you are specifying for running userhdhomerun. I'm using user "admin" which is in the group "administrators" so my parameters are -u admin -g administrators.


I had changed the group to run under "video"
Code: Select all
DiskStation>  groups root
root : root


so i have changed both the user and group to root

321liftoff wrote:(4) After making changes above, get the results of:
Code: Select all
ls -l /dev/hdhome*

and see if there are any changes.


Code: Select all
DiskStation>  ls -l /dev/hdhome*
crw-rw-rw- 1 root root  10, 57 Feb 17 07:12 /dev/hdhomerun_control
crw-rw-rw- 1 root root 253,  0 Feb 17 07:12 /dev/hdhomerun_data0
crw-rw-rw- 1 root root 253,  1 Feb 17 07:12 /dev/hdhomerun_data1

DiskStation>  ls -l /dev/dvb/adapter0/fro*
crw-rw-rw- 1 root root 212, 3 Feb 17 07:12 /dev/dvb/adapter0/frontend0


tvheadend still gives
Code: Select all
[ALERT]:dvb: /dev/dvb/adapter0/frontend0: Unable to query adapter
[ALERT]:dvb: Unable to open /dev/dvb/adapter1/frontend0 -- No such device
[INFO]:dvr: Creating new configuration ''
[WARNING]:dvr: Output directory for video recording is not yet configured for DVR configuration "". Defaulting to to "/root". This can be changed from the web user interface.
[INFO]:CSA: Using 32bit parallel descrambling
[NOTICE]:START: HTS Tvheadend version git-fdf89b2 started, running as PID:7179 UID:0 GID:0, settings located in '/root/.hts/tvheadend'


my tvh_start script looks like:
tvh_start wrote:# Create device nodes for HDHomerun
mkdir -p /dev/dvb/adapter0
mknod /dev/dvb/adapter0/frontend0 c 212 3
mknod /dev/dvb/adapter0/demux0 c 212 4
mknod /dev/dvb/adapter0/dvr0 c 212 5
mkdir -p /dev/dvb/adapter1
mknod /dev/dvb/adapter1/frontend0 c 212 67
mknod /dev/dvb/adapter1/demux0 c 212 68
mknod /dev/dvb/adapter1/dvr0 c 212 69
# Set permissions
chmod 755 /dev/dvb/adapter*
chmod 666 /dev/dvb/adapter*/*
chown root:root /dev/dvb/adapter*/*
#
insmod /opt/dvb-core/dvb-core.ko
insmod /opt/dvb-core/dvb_hdhomerun_core.ko
insmod /opt/dvb-core/dvb_hdhomerun_fe.ko
insmod /opt/dvb-core/dvb_hdhomerun.ko
#
#lsmod to check if everything is running
#grep -i dvb /proc/devices
#
DYNAMIC_ID=$(grep hdhomerun_control /proc/misc | awk "{print \$1}")
if [ "$DYNAMIC_ID" != "" ]; then
echo "making node hdhomerun_control" $DYNAMIC_ID
mknod /dev/hdhomerun_control c 10 $DYNAMIC_ID
else
echo "Unable to detect hdhomerun_control inside /proc/misc."
fi
# Set permissions
chmod 666 /dev/hdhomerun_control
chown root:root /dev/hdhomerun_control
#
# Clear userhdhomerun log
rm -f "/opt/dvbhdhomerun/dvbhdhomerun.log"
#
# Run userhdhomerun with LD_PRELOAD
# (because libhdhomerun.so is inside QPKG folder)
/opt/dvbhdhomerun/userhdhomerun/build/userhdhomerun \
-f -u root -g root -l "/opt/dvbhdhomerun/dvbhdhomerun.log"
#
sleep 1
#
DYNAMIC_ID=$(grep hdhomerun_data /proc/devices | awk "{print \$1}")
if [ "$DYNAMIC_ID" != "" ]; then
echo "making node hdhomerun_data" $DYNAMIC_ID
mknod /dev/hdhomerun_data0 c $DYNAMIC_ID 0
mknod /dev/hdhomerun_data1 c $DYNAMIC_ID 1
else
echo "Unable to detect hdhomerun_data inside /proc/devices."
fi
#
# Set permissions
chmod 666 /dev/hdhomerun_data*
chown root:root /dev/hdhomerun_data*

hoontune
 
Posts: 14
Joined: Fri Feb 10, 2012 3:56 am

Postby 321liftoff » Thu Feb 16, 2012 6:46 pm

Maybe one other thing to check...run
Code: Select all
grep DVB /proc/devices

and see what number you get. Mine is 212, but yours may be different.

That, too, may be dynamically assigned by linux and could change with each reboot. If it's different from 212, you could first try by hard coding your number by replacing 212 with your number.

Or you could replace 212 with $DYNAMIC_ID and copy and paste the following code at the beginning of the script:
Code: Select all
DYNAMIC_ID=$(grep DVB /proc/devices | awk "{print \$1}")
if [ "$DYNAMIC_ID" != "" ]; then
echo "making node dvb adapters " $DYNAMIC_ID

to try to make it dynamic like the other nodes.

EDIT: Whoops! if you do the dynamic code above, you also have to move the "insmod /opt/dvb-core/dvb-core.ko" line to be before the code I gave you above, so that the DVB kernel driver is loaded prior to you searching for it!

Hope this works because I'm running out of ideas! :)
321liftoff
 
Posts: 29
Joined: Sat Apr 17, 2010 4:22 am

Postby hoontune » Fri Feb 17, 2012 3:56 am

321liftoff wrote:Maybe one other thing to check...run
Code: Select all
grep DVB /proc/devices

and see what number you get. Mine is 212, but yours may be different.


mine is 212 too :cry:

321liftoff wrote:Hope this works because I'm running out of ideas! :)


it's gotta be close...
hoontune
 
Posts: 14
Joined: Fri Feb 10, 2012 3:56 am

Postby 321liftoff » Fri Feb 17, 2012 6:17 am

What kernel version are you running on the Synology? Are you compiling dvb-core directly on the Synology or on another machine? How about the dvbhdhomerun drivers?

The author of the dvbhdhomerun drivers suggested a last resort option:
There is already scripts + instructions for building the dvbhdhomerun drivers from within a linuxtv.org tree - that would at least make certain that the build is 100% consistent with the dvb_core being build.

http://dvbhdhomerun.cvs.sourceforge.net ... lianin.txt

(s2-liplianin is fork of the linuxtv.org tree with newer drivers, but the direcetory structure is the same)


Maybe that could help you also?
321liftoff
 
Posts: 29
Joined: Sat Apr 17, 2010 4:22 am

Postby hoontune » Fri Feb 17, 2012 6:44 am

321liftoff wrote:What kernel version are you running on the Synology? Are you compiling dvb-core directly on the Synology or on another machine? How about the dvbhdhomerun drivers?

The author of the dvbhdhomerun drivers suggested a last resort option:
There is already scripts + instructions for building the dvbhdhomerun drivers from within a linuxtv.org tree - that would at least make certain that the build is 100% consistent with the dvb_core being build.

http://dvbhdhomerun.cvs.sourceforge.net ... lianin.txt

(s2-liplianin is fork of the linuxtv.org tree with newer drivers, but the direcetory structure is the same)


Maybe that could help you also?


Code: Select all
 
DiskStation> uname -r
2.6.32.12


I cross-compiled dvb-core and dvbhdhomerun on a Ubuntu machine.

I'll try to compile the drivers as suggested and report back
hoontune
 
Posts: 14
Joined: Fri Feb 10, 2012 3:56 am

Postby hoontune » Fri Feb 17, 2012 4:46 pm

321liftoff wrote:The author of the dvbhdhomerun drivers suggested a last resort option:
There is already scripts + instructions for building the dvbhdhomerun drivers from within a linuxtv.org tree - that would at least make certain that the build is 100% consistent with the dvb_core being build.

http://dvbhdhomerun.cvs.sourceforge.net ... lianin.txt

(s2-liplianin is fork of the linuxtv.org tree with newer drivers, but the direcetory structure is the same)


OK, trying to do this natively on the synology box

Code: Select all

# install hg
# http://ash-ride.blogspot.com.au/search/label/hg

cd /opt
ipkg install py26-mercurial

# install s2-liplianin source
# http://linuxtv.org/wiki/index.php/S2-liplianin
hg clone http://mercurial.intuxication.org/hg/s2-liplianin/

# Build modules
# http://dvbhdhomerun.cvs.sourceforge.net/viewvc/dvbhdhomerun/dvbhdhomerun/v4l-dvb/readme_s2_liplianin.txt?revision=1.1&view=markup

cd /opt/dvbhdhomerun/v4l-dvb

nano make_links.sh
chmod 777 make_links.sh
./make_links.sh

cd /opt/s2-liplianin

patch -p1 < /opt/dvbhdhomerun/v4l-dvb/dvbhdhomerun_s2_liplianin.patch


then time to try and build the modules

Code: Select all
make menuconfig


complains that a few directories don't exist:
Code: Select all
make: Entering an unknown directory
make: *** /lib/modules/2.6.32.12/build: No such file or directory.  Stop.
make: Leaving an unknown directory
make[1]: *** [/lib/modules/2.6.32.12/build/scripts/kconfig/mconf] Error 2


so i ran

Code: Select all
mkdir -p /lib/modules/2.6.32.12/build/scripts/kconfig/mconf


make menuconfig

Code: Select all
DiskStation> make menuconfig
make -C /opt/s2-liplianin/v4l menuconfig
make[1]: Entering directory `/opt/s2-liplianin/v4l'
/lib/modules/2.6.32.12/build/scripts/kconfig/mconf ./Kconfig
make[1]: execvp: /lib/modules/2.6.32.12/build/scripts/kconfig/mconf: Permission denied
make[1]: *** [menuconfig] Error 127
make[1]: Leaving directory `/opt/s2-liplianin/v4l'
make: *** [menuconfig] Error 2


not quite sure where to go from here...
Code: Select all
DiskStation> ls -l /lib/modules/2.6.32.12/build/scripts/kconfig/mconf
total 0
hoontune
 
Posts: 14
Joined: Fri Feb 10, 2012 3:56 am

Postby 321liftoff » Sat Feb 18, 2012 10:42 am

To help out, I was trying to do the same steps you were. I did the "ipkg install py26-mercurial" and got that installed. Then when I run "hg clone http://mercurial.intuxication.org/hg/s2-liplianin/", it takes about 5 minutes, uses nearly all the CPU, and has the following response:

Code: Select all
destination directory: s2-liplianin
requesting all changes
adding changesets
adding manifests
adding file changes
transaction abort!
rollback completed
abort: stream ended unexpectedly (got 11464 bytes, expected 13084)


I've tried running the hg command multiple times, and always get a "transaction abort!" message. I'll post if I get past this...
321liftoff
 
Posts: 29
Joined: Sat Apr 17, 2010 4:22 am

Postby 321liftoff » Sat Feb 18, 2012 2:12 pm

I rebooted, and had success running "hg clone". Now, I'm at the same point you are...

Code: Select all
[/share/MD0_DATA/src/s2-liplianin] # make menuconfig
make -C /share/MD0_DATA/src/s2-liplianin/v4l menuconfig
make[1]: Entering directory `/share/MD0_DATA/src/s2-liplianin/v4l'
make -C /lib/modules//build -f /share/MD0_DATA/src/s2-liplianin/v4l/Makefile.kernel config-targets=1 mixed-targets=0 dot-config=0 SRCDIR=/lib/modules//build v4l-mconf
make: Entering an unknown directory
make: *** /lib/modules//build: No such file or directory.  Stop.
make: Leaving an unknown directory
make[1]: *** [/lib/modules//build/scripts/kconfig/mconf] Error 2
make[1]: Leaving directory `/share/MD0_DATA/src/s2-liplianin/v4l'
make: *** [menuconfig] Error 2


except it looks like it's not getting my kernel version number...
321liftoff
 
Posts: 29
Joined: Sat Apr 17, 2010 4:22 am

Postby hoontune » Sat Feb 18, 2012 4:16 pm

Thanks for helping out ! I take it you're running this on your QNAP ?

321liftoff wrote:except it looks like it's not getting my kernel version number...


OK, in the /share/MD0_DATA/src/s2-liplianin/v4l directory you could edit the Makefile, look for:

Code: Select all
OUTDIR ?= /lib/modules/$(KERNELRELEASE)/build
SRCDIR ?= /lib/modules/$(KERNELRELEASE)/source


And hardcode the KERNELRELEASE variable.
hoontune
 
Posts: 14
Joined: Fri Feb 10, 2012 3:56 am

Postby 321liftoff » Tue Feb 21, 2012 10:44 am

In the /lib/modules directory, I only have "misc" and "others" so even if I hardcode the kernel number, there is nothing there to read. I'm not smart enough on linux to know what is supposed to be there, but I suspect it's the vanilla kernel modules that are not on the QNAP. Maybe another step needs to be to compile the kernel on the QNAP?
321liftoff
 
Posts: 29
Joined: Sat Apr 17, 2010 4:22 am

Postby hoontune » Wed Feb 29, 2012 3:43 am

321liftoff wrote: I'm not smart enough on linux to know what is supposed to be there, but I suspect it's the vanilla kernel modules that are not on the QNAP.


I've installed the kernel headers etc in that directory, but I'm still getting errors - not sure this is helping much. I could probably cross compile it on a Ubuntu box I guess...
hoontune
 
Posts: 14
Joined: Fri Feb 10, 2012 3:56 am

Postby jjm1982 » Thu Mar 01, 2012 9:42 am

I've been tracking this for sometime but haven't played around with it but I was wondering, could this be used on Android?
jjm1982
 
Posts: 100
Joined: Wed Sep 21, 2011 5:07 am

Postby hoontune » Sun Mar 11, 2012 12:39 am

I'm begging to suspect that the drivers I cross compiled are the issue, even though they seem to be doing the right thing.

To double check, I compiled the scan tool from dvb-apps:
http://www.mythtv.org/wiki/Dvb-apps#Source

Code: Select all
wget http://linuxtv.org/downloads/legacy/linuxtv-dvb-apps-1.1.1.tar.bz2
tar xvjf linuxtv-dvb-apps-1.1.1.tar.bz2
cd linuxtv-dvb-apps-1.1.1/util/scan
make
./scan -v au-Brisbane


Which gave the following error
Code: Select all
scanning au-Brisbane
using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0'
main:2250: FATAL: FE_GET_INFO failed: 22 Invalid argument


Anyone want to help me try and build the s2 drivers :-(
hoontune
 
Posts: 14
Joined: Fri Feb 10, 2012 3:56 am

Postby 321liftoff » Mon Mar 12, 2012 3:08 pm

We have had some recent luck with the hdhomerun over on the QNAP forum. Have a look there and keep posted, as you may be able to apply the same things that fixed our problems...
321liftoff
 
Posts: 29
Joined: Sat Apr 17, 2010 4:22 am

PreviousNext

Return to Development - HDHomeRun

Who is online

Users browsing this forum: netant and 2 guests