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