English > Drivers

QNAP 64-bit drivers development question

(1/3) > >>

virtualdj:
Hi, I'm the same virtualdj user of the QNAP forum.
If you follow the main TVHeadend thread on the QNAP forums you may have known that TVHeadend application is now a fully 64-bit application.

So, thanks to QNAP that provided me a 64-bit NAS to test, I'm trying to develop a further version of the Sundtek QPKG to support TVHeadend in 64-bit mode. In fact, at the moment the only possible way is running TVHeadend 32-bit with the 32-bit flavour of the Sundtek drivers.

Now I understand because you asked me to update the script to support DVBLink package!

At first I tried installing the latest TVH_Dev_Sundtek QPKG and I found I cannot run mediaclient or the other bins.

--- Code: ---[/share/CACHEDEV1_DATA/.qpkg/TVH_Dev_Sundtek/opt/bin] # mediaclient
mediaclient: error while loading shared libraries: librt.so.1: wrong ELF class: ELFCLASS32
--- Ende Code ---

That's due to QNAP which does not supply all the complete 64-bit libraries:

--- Code: ---[/share/CACHEDEV1_DATA/.qpkg/TVH_Dev_Sundtek/opt/bin] # ldd mediasrv
        linux-vdso.so.1 =>  (0x00007fff1cdfe000)
        libdl.so.2 => not found
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fd4cfff9000)
        librt.so.1 => not found
        libc.so.6 => /lib64/libc.so.6 (0x00007fd4cfc76000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fd4d0216000)
[/share/CACHEDEV1_DATA/.qpkg/TVH_Dev_Sundtek/opt/bin] # ls /lib64/
ld-2.11.1.so*         libc.so.6*
ld-linux-x86-64.so.2@ libpthread.so.0*
--- Ende Code ---

So, to run mediaclient or mediasrv both libdl.so.2 and librt.so.1 are needed, hence you used LD_LIBRARY_PATH to borrow them from the DVBLink package.
I also had to ship those libraries (and actually the complete libc) with TVHeadend as it didn't run without them. We can use the same principle with TVHeadend, but I don't like this very much. ;)

So I'm asking: what do you think if we build a QPKG specifically for 64-bit with the two libraries shipped with the QPKG, so that mediaclient can use them and TVH_Dev_Suntek will became standalone again?

I'm asking here because I can of course create a script that sets LD_LIBRARY_PATH before running mediaclient or mediasrv, but I prefer to not use LD_LIBRARY_PATH if possible.
So, do you think you can build the mediaclient, mediasrv and libmediaclient.so files (and others as well) compiled with:

--- Code: ---LD_RUN_PATH='$ORIGIN/../libc'
--- Ende Code ---

In the future-version QPKG, I can create a libc folder inside the opt directory and place the libraries there and then the binaries should work from every path. Of course, if there is no libc folder, they should work as usual, looking for libraries in the system.

I tried with patchelf and it's working correctly with '$ORIGIN/../libc', at least for the binary files.
While preloading the libraries on 64-bit NAS gives me always this error:

--- Code: ---[~] # LD_PRELOAD=/opt/lib/libmediaclient.so ls
ERROR: ld.so: object '/opt/lib/libmediaclient.so' from LD_PRELOAD cannot be preloaded: ignored.
index_default.html
--- Ende Code ---
The same on the 32-bit QNAP doesn't give any error:

--- Code: ---[~] # LD_PRELOAD=/opt/lib/libmediaclient.so ls
index_default.html
--- Ende Code ---
I cannot explain this behaviour, maybe it's due to the missing libraries too? We'll see!

Sundtek:
There are 2 versions of libmediaclient.so one is 32bit the other one has 64bit.
You can pull the specific drivers from our server as you might know:
http://sundtek.de/media/netinst/32bit/installer.tar.gz
http://sundtek.de/media/netinst/64bit/installer.tar.gz

The only important thing is that you match the target application with it (usually the installer will take care about that).

I don't think that we can compile the drivers with a special path for the libraries because it would break the generic support of the driver, so the only way to get around that is to use LD_LIBRARY_PATH to the libraries which are missing.

Aside of that we're also working on our own VCR software for the NAS systems the ETA will be around 3 months, first we are going to implement a player (ETA for the first beta should be within next month).

virtualdj:

--- Zitat von: Sundtek am April 25, 2015, 05:25:01 Nachmittag ---There are 2 versions of libmediaclient.so one is 32bit the other one has 64bit.
You can pull the specific drivers from our server as you might know:
http://sundtek.de/media/netinst/32bit/installer.tar.gz
http://sundtek.de/media/netinst/64bit/installer.tar.gz
--- Ende Zitat ---
That's what I just do, otherwise the 32bit libmediaclient.so would not run on the 64bit TVHeadend at all.
I'm just asking if you know why the 64bit spits out that message on every command (in the example, when running "ls").


--- Zitat von: Sundtek am April 25, 2015, 05:25:01 Nachmittag ---I don't think that we can compile the drivers with a special path for the libraries because it would break the generic support of the driver, so the only way to get around that is to use LD_LIBRARY_PATH to the libraries which are missing.
--- Ende Zitat ---
Just for my info, why would it break the support if the binaries look for a folder which does not exists (because it's a subfolder of your installation path, "libc" in this case)?
Isn't "$ORIGIN" supported by all the platforms?


--- Zitat von: Sundtek am April 25, 2015, 05:25:01 Nachmittag ---Aside of that we're also working on our own VCR software for the NAS systems the ETA will be around 3 months, first we are going to implement a player (ETA for the first beta should be within next month).
--- Ende Zitat ---
Cool! ;D

Sundtek:
Let me back-check the ORIGIN option with the developer on Monday.

virtualdj:
Thanks, exporting LD_LIBRARY_PATH is always an hassle and I removed it from TVHeadend QPKG too.

Navigation

[0] Themen-Index

[#] Nächste Seite

Zur normalen Ansicht wechseln