Hi to all, sorry for the long post but I've a lot of friends on the QNAP forum owning an x86_64 NAS that asked for my help about the TVHeadend version that I compile as QPKG. But I cannot help them because I don't know how to do that, so I'm asking here.
I've compiled 2 versions of TVHeadend, in this case the build
3.9.2293~g74c563f, one for ARM and another for x86 (32 bit); I use two Debian Squeeze VMs to build them with these parameters:
./configure --disable-avahi --enable-bundle --disable-libav --disable-dbus_1 --release
People running ARM do not have any issue; the same is for people running the Intel version on x86 NASes (32 bit). The QNAP kernel version is v3.4.6.
Unfortunately, people running the same binary on
x86_64 are not able to tune any frequency and instead get this error continuosly:
2015-01-08 19:31:31.117 mpegts: 578MHz in Durris - tuning on DiBcom 7000PC : DVB-T #0
2015-01-08 19:31:31.117 linuxdvb: DiBcom 7000PC : DVB-T #0 - DTV_CLEAR failed [e=Inappropriate ioctl for device]
I said "the same binary" because actually the QNAPs with 64-bit do not have the whole libraries and cannot run the application if I compile TVHeadend in 64-bit mode (they get
permission denied errors even though the permissions are correct).
So I actually load the 64-bit kernel modules and then run TVHeadend 32-bit.
Another thing to say is that this behaviour happens
when using any tuner that loads the
dvb-core.ko module I think, because
it happens even with the HDHomerun which uses only
dvb-core.ko,
dvbhdhomerun.ko_,
dvbhdhomerun_core.ko_ and
dvbhdhomerun_fe.ko_.
Those on 64-bit that have the Sundtek tuner (which doesn't use any kernel module) do not have this error and TVHeadend works perfectly.
This, at first, let me think it was a kernel module issue, but it shouldn't, because we've tried running some older TVHeadend versions (always 32-bit) that I compiled in the past withthe same kernel modules loaded.
For example, the version
3.9.422~gc84bc2b still fails, but with a different error (a generic
failed to start):
2015-01-12 19:27:41.000 [ INFO] mpegts: 538000 - starting for 'initscan' (weight 2)
2015-01-12 19:27:41.000 [ INFO] mpegts: 538000 - tuning on DiBcom 3000MC/P : DVB-T #0
2015-01-12 19:27:41.000 [ DEBUG] linuxdvb: DiBcom 3000MC/P : DVB-T #0 - starting 538000
2015-01-12 19:27:41.000 [WARNING] mpegts: 538000 - failed to start, try another
When trying the older version
v3.5.126~g8c5f9af, again with the same modules, +it works correctly+:
Jan 12 18:51:16.688 [ DEBUG] dvb: /dev/dvb/adapter0 opened frontend /dev/dvb/adapter0/frontend0
Jan 12 18:51:16.688 [ DEBUG] dvb: "/dev/dvb/adapter0" tuning to "CESKE RADIOKOMUNIKACE: 626,000 kHz" (Initial autoscan)
Jan 12 18:51:17.051 [ DEBUG] dvb: /dev/dvb/adapter0 started dvr thread
Jan 12 18:51:17.053 [ DEBUG] viasat_baltic: install table handlers
Jan 12 18:51:17.053 [ DEBUG] uk_freesat: install table handlers
Jan 12 18:51:17.053 [ DEBUG] eit: install table handlers
Jan 12 18:51:17.070 [ DEBUG] eit: begin processing
Jan 12 18:51:17.568 [ DEBUG] PSI: Service "DiBcom 3000MC/P/CESKE RADIOKOMUNIKACE: 626,000 kHz/NOVA" PMT (version 12) updated
Jan 12 18:51:17.720 [ DEBUG] PSI: Service "DiBcom 3000MC/P/CESKE RADIOKOMUNIKACE: 626,000 kHz/Prima" PMT (version 19) updated
Jan 12 18:51:17.942 [ DEBUG] PSI: Service "DiBcom 3000MC/P/CESKE RADIOKOMUNIKACE: 626,000 kHz/BARRANDOV TV" PMT (version 5) updated
Jan 12 18:51:18.002 [ DEBUG] dvb: "CESKE RADIOKOMUNIKACE: 626,000 kHz" on adapter "DiBcom 3000MC/P", status changed to Bursty FEC
Jan 12 18:51:19.001 [ DEBUG] dvb: DiBcom 3000MC/P: FE_READ_UNCORRECTED_BLOCKS returns delta updates (delta=-82)
Jan 12 18:51:27.047 [ DEBUG] eit: processing complete
Jan 12 18:51:28.002 [ DEBUG] dvb: "CESKE RADIOKOMUNIKACE: 626,000 kHz" on adapter "DiBcom 3000MC/P", status changed to OK
My gcc version on the VM is 4.4.5 and, to make the binary run on the QNAP which has 4.2.1, I've copied the libc libraries and run TVHeadend with the ld-linux trick (for the v3.9.2293 version, while v3.9.422 and v3.5.126 where run directly as the gcc version was enough to compile them).
I've also tried to compare the two versions (non working v3.9.422 and working v3.5.125) using GitHub:
https://github.com/tvheadend/tvheadend/compare/8c5f9af...c84bc2b?diff=split&name=c84bc2b
... but there are a lot of differences and I'm not able to isolate the problem, probably becase I'm not very comfortable with C programming.
Finally,
/usr/include/linux/dvb/version.h on the VM that I use for compiling is:
#ifndef _DVBVERSION_H_
#define _DVBVERSION_H_
#define DVB_API_VERSION 5
#define DVB_API_VERSION_MINOR 1
#endif /*_DVBVERSION_H_*/
Please, anyone, if you have some suggestions on what to try please post.
By the way, on my 32-bit NAS all is working correctly, so I'll need to submit the test to the QNAP forum community.