Autor Thema: Problems with OpenWRT + TP-Link TL-WR1043ND and native DVB software  (Gelesen 23678 mal)

mrkb

  • Newbie
  • *
  • Beiträge: 3
    • Profil anzeigen
Problems with OpenWRT + TP-Link TL-WR1043ND and native DVB software
« am: Juli 16, 2011, 04:04:34 Nachmittag »
I'm currently experimenting with a MediaTV Home stick on a TP-Link TL-WR1043ND router running OpenWRT Backfire 10.03.1 RC5. My end goal is getting the stick and tvheadend running natively on the router. I'm having some problems, short version: driver works, DVB software doesn't.

I've installed the latest driver by unpacking it on my Linux dev box and copying over /opt/bin/mediaclient, /opt/bin/mediasrv, /opt/lib/*.so. The driver seems to be working fine, I can tune and lock using mediaclient.

I've also compiled and installed w_scan and tvheadend. Both applications cannot access /dev/dvb/adapter0/frontend0. w_scan example:

root@OpenWrt:/# w_scan -f c -c NL -X > channels-`date +%Y%m%d`.conf
w_scan version 20110306 (compiled for DVB API 5.2)
using settings for NETHERLANDS
DVB cable
DVB-C
frontend_type DVB-C, channellist 7
output format czap/tzap/szap/xine
Info: using DVB adapter auto detection.
main:3078: FATAL: ***** NO USEABLE DVB CARD FOUND. *****
Please check wether dvb driver is loaded and
verify that no dvb application (i.e. vdr) is running.

I've tried LD_PRELOAD=/opt/lib/libmediaclient.so w_scan ... but this produces the same result. I've run strace and it seems that libmediaclient.so is not preloaded, i.e. the dynamic linker ignores LD_PRELOAD. As the driver needs this lib to intercept syscalls to the device tree it seems that running DVB apps is a no-go.

I've also tried this on a OpenWRT bleeding edge trunk image, with the same result.

Does anyone have positive experiences getting DVB apps to run on OpenWRT on this router or a similar router (e.g. WNDR-3700)?

marnixdv

  • Newbie
  • *
  • Beiträge: 7
    • Profil anzeigen
Re:Problems with OpenWRT + TP-Link TL-WR1043ND and native DVB software
« Antwort #1 am: Juli 19, 2011, 12:03:18 Nachmittag »
Hi Mrkb!

I've been trying the exact same thing and had the same problems with accessing frontend0. I have the same router and OpenWRT installed, but gave up in the end because I couldn't get it going. Another problem I faced was that Tvheadend crashed with presumably a memory issue (segmentation error?).
You're in the Netherlands, right (perhaps Ziggo as well)? I wouldn't mind giving it another shot though, because I would really love to have the router work solo as a kind of decoder.
« Letzte Änderung: Juli 19, 2011, 12:05:36 Nachmittag von marnixdv »

mrkb

  • Newbie
  • *
  • Beiträge: 3
    • Profil anzeigen
Re:Problems with OpenWRT + TP-Link TL-WR1043ND and native DVB software
« Antwort #2 am: Juli 19, 2011, 06:47:54 Nachmittag »
You guessed right :-)

Good news: I've done some more tinkering and I've got the driver working in conjunction with w_scan. The culprit? uClibc is not configured to be built with dynamic preloading support in OpenWRT.

A quick 'n dirty tutorial, for people that are somewhat familiar with OpenWRT and building stuff themselves on Linux:

0. Set up a Linux build environment. I use Ubuntu 10.04 LTS in a VirtualBox.

1. Check out the latest bleeding edge OpenWRT version from Subversion.

2. In /trunk/toolchain/uClibc/config-x.x.x/, edit common and find the following lines:
#LDSO_PRELOAD_FILE_SUPPORT is not set
#LDSO_PRELOAD_ENV_SUPPORT is not set
and change them to:
LDSO_PRELOAD_FILE_SUPPORT=y
LDSO_PRELOAD_ENV_SUPPORT=y
Note that enabling preload support is generally not recommended on hardened systems since it *could* pose a security risk. However, the Sundtek driver doesn't work without it. For me, I've left the first line as it is, which means I can't use /etc/ld.so.preload to automatically preload the driver, and have to manually preload before running any stuff that uses the driver.

3. Configure and build OpenWRT: make menuconfig, select all the packages you want and make.

4. Flash your router at your own risk! Saying it worked for me doesn't imply that I'm responsible for bricks.

5. On your development environment, get the latest Sundtek drivers, extract them (use the -e switch) and find the driver archive for OpenWRT. Copy to router, and extract the essentials: /opt/bin/mediaclient, /opt/bin/mediasrv and /opt/lib/libmediaclient.so.

6. Enable the driver with /opt/bin/mediaclient --start. If you want to enable it permanently, make an init script.

Run any TV-related stuff with LD_PRELOAD=/opt/lib/libmediaclient.so or add /opt/lib/libmediaclient.so to /etc/ld.so.preload.

As a side note, I'm currently using the mediawrt feed for tvheadend and other TV-related packages. I've also got an ancient 128MB USB stick attached for some memory breathing room (swap and overlay).

Note that I haven't tested performance and stability with tvheadend yet. After I test some more I might put a prebuilt image up for the TL-WR1043ND with everything included for a Sundtek / tvheadend setup.

Also, it would be really nice if Sundtek could provide us with a feed for the driver ;)
« Letzte Änderung: Juli 19, 2011, 07:07:30 Nachmittag von mrkb »

marnixdv

  • Newbie
  • *
  • Beiträge: 7
    • Profil anzeigen
Re:Problems with OpenWRT + TP-Link TL-WR1043ND and native DVB software
« Antwort #3 am: Juli 19, 2011, 11:19:49 Nachmittag »

Note that I haven't tested performance and stability with tvheadend yet. After I test some more I might put a prebuilt image up for the TL-WR1043ND with everything included for a Sundtek / tvheadend setup.


That would be awesome! I'll see what I can try out, although my tinkering skills aren't far as good as yours I see.

mrkb

  • Newbie
  • *
  • Beiträge: 3
    • Profil anzeigen
Re:Problems with OpenWRT + TP-Link TL-WR1043ND and native DVB software
« Antwort #4 am: Juli 27, 2011, 08:06:42 Nachmittag »
An update:

  • w_scan hangs on the first transponder it finds which actually contains services.
  • I can get tvheadend to scan transponders and services, but the transponder and service names turn up blank. This is the exact same problem I had with tvheadend and a Sundtek stick on another embedded platform (PowerPC-based Synology NAS), so I am starting to think this could be a driver issue.

I hope someone from Sundtek could get in touch with me to troubleshoot this issue, since I feel that a working router / stick streaming solution could be amazing.