Hi All,

I am trying to run vdr-plugin-sc on my D-link DNS323 running debian. This NAS has an ARM processor, so FFdecsa fails to compile.
I am however able to compile and run vdr-plugin-dvb-api. (I cannot connect to OSCAM yet, but that's another discussion)
vdr-plugin-dvb-api has code to use both FFdecsa and dvbcsa.

I have changed the source of vdr-plugin-sc to use dvbcsa. This compiles and installs fine, but I see the following error in /var/log/syslog when I start VDR
vdr: [8061] ERROR: /usr/lib/vdr/plugins/libvdr-sc.so.1.7.28: undefined symbol: _Z18dvbcsa_bs_key_freeP15dvbcsa_bs_key_s
vdr: [8118] VDR version 1.7.28 started

I see a strange thing with ldd, libdvbcsa.so.1 has not been linked in. I guess I have forgot to tell the linker to use that library:
# ldd /usr/lib/vdr/plugins/libsc-cardclient-30.so.1.7.28
    libcrypto.so.1.0.0 => /usr/lib/arm-linux-gnueabi/libcrypto.so.1.0.0 (0xb6da5000)
    libcrypt.so.1 => /lib/arm-linux-gnueabi/libcrypt.so.1 (0xb6d73000)
    libstdc++.so.6 => /usr/lib/arm-linux-gnueabi/libstdc++.so.6 (0xb6ca4000)
    libm.so.6 => /lib/arm-linux-gnueabi/libm.so.6 (0xb6bfb000)
    libgcc_s.so.1 => /lib/arm-linux-gnueabi/libgcc_s.so.1 (0xb6bd1000)
    libc.so.6 => /lib/arm-linux-gnueabi/libc.so.6 (0xb6a9b000)
    libdl.so.2 => /lib/arm-linux-gnueabi/libdl.so.2 (0xb6a8f000)
    libz.so.1 => /lib/arm-linux-gnueabi/libz.so.1 (0xb6a71000)
    /lib/ld-linux.so.3 (0xb6f47000)

# ldd /usr/lib/vdr/plugins/libvdr-sc.so.1.7.28          
    libcrypto.so.1.0.0 => /usr/lib/arm-linux-gnueabi/libcrypto.so.1.0.0 (0xb6d31000)
    libstdc++.so.6 => /usr/lib/arm-linux-gnueabi/libstdc++.so.6 (0xb6c61000)
    libm.so.6 => /lib/arm-linux-gnueabi/libm.so.6 (0xb6bb8000)
    libgcc_s.so.1 => /lib/arm-linux-gnueabi/libgcc_s.so.1 (0xb6b8e000)
    libc.so.6 => /lib/arm-linux-gnueabi/libc.so.6 (0xb6a58000)
    libdl.so.2 => /lib/arm-linux-gnueabi/libdl.so.2 (0xb6a4d000)
    libz.so.1 => /lib/arm-linux-gnueabi/libz.so.1 (0xb6a2e000)
    /lib/ld-linux.so.3 (0xb6f08000)

# ldd /usr/lib/vdr/plugins/libvdr-dvbapi.so   
    libdvbcsa.so.1 => /usr/lib/arm-linux-gnueabi/libdvbcsa.so.1 (0xb6f9b000)
    libstdc++.so.6 => /usr/lib/arm-linux-gnueabi/libstdc++.so.6 (0xb6ecb000)
    libm.so.6 => /lib/arm-linux-gnueabi/libm.so.6 (0xb6e22000)
    libgcc_s.so.1 => /lib/arm-linux-gnueabi/libgcc_s.so.1 (0xb6df8000)
    libc.so.6 => /lib/arm-linux-gnueabi/libc.so.6 (0xb6cc2000)
    /lib/ld-linux.so.3 (0xb6fe1000)

Could somebody have a look at my Makefile (attached)? I suspect I made a mistake there

Best regards,
Cedric

I have  added -ldvbcsa to the makefile, but this did not solve the problem:
### Includes and Defines

INCLUDES      = -I$(VDRDIR)
DEFINES       = -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
SHAREDDEFINES = -DAPIVERSNUM=$(APIVERSNUM) -D_GNU_SOURCE
LIBS          = -lcrypto -ldvbcsa
SHAREDLIBS    =

ldd now indeed reports the library being linked in:
# ldd /usr/lib/vdr/plugins/libvdr-sc.so.1.7.28          
    libcrypto.so.1.0.0 => /usr/lib/arm-linux-gnueabi/libcrypto.so.1.0.0 (0xb6dfb000)
    libdvbcsa.so.1 => /usr/lib/arm-linux-gnueabi/libdvbcsa.so.1 (0xb6dd8000)
    libstdc++.so.6 => /usr/lib/arm-linux-gnueabi/libstdc++.so.6 (0xb6d09000)
    libm.so.6 => /lib/arm-linux-gnueabi/libm.so.6 (0xb6c60000)
    libgcc_s.so.1 => /lib/arm-linux-gnueabi/libgcc_s.so.1 (0xb6c36000)
    libc.so.6 => /lib/arm-linux-gnueabi/libc.so.6 (0xb6b00000)
    libdl.so.2 => /lib/arm-linux-gnueabi/libdl.so.2 (0xb6af4000)
    libz.so.1 => /lib/arm-linux-gnueabi/libz.so.1 (0xb6ad6000)
    /lib/ld-linux.so.3 (0xb6fd2000)

But VDR still reports the error:
vdr: [10991] ERROR: /usr/lib/vdr/plugins/libvdr-sc.so.1.7.28: undefined symbol: _Z18dvbcsa_bs_key_freeP15dvbcsa_bs_key_s
vdr: [11048] VDR version 1.7.28 started

And during the build, I got a warning that no symbold are used:
g++ -g -Wall -Woverloaded-virtual -Wno-parentheses -O2 -fPIC -fno-strict-aliasing -shared sc.o data.o filter.o system.o misc.o cam.o device.o version.o smartcard.o network.o crypto.o system-common.o parse.o log.o override.o -lcrypto -ldvbcsa  -o libvdr-sc.so
...
dh_shlibdeps -pvdr-plugin-sc   
dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/vdr-plugin-sc/usr/lib/vdr/plugins/libvdr-sc.so.1.7.28 was not linked against libdvbcsa.so.1 (it uses none of the library's symbols)
dh_installdeb -plibvdr-sc-cardclient

I find this odd, because /usr/include/dvbcsa/dvbcsa.h contains the function prototypes for both dvbcsa_bs_key_free and dvbcsa_bs_key_s :
void dvbcsa_bs_key_free(struct dvbcsa_bs_key_s *key);
struct dvbcsa_bs_key_s * dvbcsa_bs_key_alloc(void);

But why are they concatenated into one symbol?

Best regards,
Cedric