manio / vdr-plugin-dvbapi

VDR dvbapi plugin for use with OSCam
http://www.streamboard.tv/wbb2/thread.php?threadid=40060
GNU General Public License v2.0
58 stars 25 forks source link

Segmentation fault with FFdecsa #109

Closed raccoon4me closed 8 years ago

raccoon4me commented 8 years ago

Hi,

I'm usually compiling VDR plugins on debian testing x64 but today i tried on old AMD sempron 2600+ and debian 8.0.4 32 bit.

I always install the same way and this time it fail with segmentation fault. The compilation went perfect, perfect until the tests:

g++ -g -O3 -Wall -Werror=overloaded-virtual -Wno-parentheses -fPIC -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE  -fexpensive-optimizations -funroll-loops -mmmx -msse -msse2 -msse3 -o FFdecsa_test FFdecsa_test.o FFdecsa.o
FFdecsa 1.0: testing correctness and speed
FAILED!
FAILED!
FAILED!
FAILED!
FAILED!
Makefile:52: recipe for target 'FFdecsa_test.done' failed
make[1]: *** [FFdecsa_test.done] Segmentation fault
make[1]: Leaving directory '/usr/local/src/vdr-2.2.0/PLUGINS/src/vdr-plugin-dvbapi/FFdecsa'
Makefile:127: recipe for target 'FFdecsa/FFdecsa.o' failed
make: *** [FFdecsa/FFdecsa.o] Error 2

dmesg

[ 258.836175] FFdecsa_test[1172]: segfault at 8 ip 080509af sp bfc6f210 error 4 in FFdecsa_test[8048000+b000]

Any idea what would generate this segmentation fault ?

Dziękuje bardzo :)

Steve

manio commented 8 years ago

No idea, you may try different compilation flags (read here: https://github.com/manio/vdr-plugin-dvbapi/blob/master/INSTALL#L27) or you can also try libdvbcsa instead...

raccoon4me commented 8 years ago

HI Manio,

Thanks for your answer, usin this program you mentionned, i got advised those flags

### VDR-SC Makefile FFdeCSA OPTS ###
CPUOPT     ?= native
PARALLEL   ?= PARALLEL_64_MMX
CSAFLAGS   ?= -O2 -fexpensive-optimizations -fomit-frame-pointer -funroll-loops

But then the compilation fails :

make[1]: Entering directory '/usr/local/src/vdr-2.2.0/PLUGINS/src/vdr-plugin-dvbapi/FFdecsa'
g++ -g -O3 -Wall -Werror=overloaded-virtual -Wno-parentheses -fPIC -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE  -O2 -fexpensive-optimizations -fomit-frame-pointer -funroll-loops -DPARALLEL_MODE=PARALLEL_64_MMX -c FFdecsa.c
In file included from FFdecsa.c:199:0:
stream.c: In function ‘void stream_cypher_group_init(stream_regs*, group (*)[4], group (*)[4], unsigned char*)’:
stream.c:575:118: warning: MMX vector return without MMX enabled changes the ABI [-Wpsabi]
 /* 1000 1110  1110 0001   : lev  7: */ tmp0=FFXOR(fa,FFXOR(fb,FFXOR(FFOR(FFXOR(FFOR(fa,fb),fc),FFXOR(fc,fd)),FF1())));
                                                                                                                      ^
In file included from parallel_064_mmx.h:21:0,
                 from FFdecsa.c:80:
/usr/lib/gcc/i586-linux-gnu/4.9/include/mmintrin.h: In function ‘void XOREQ_BEST_BY(unsigned char*, unsigned char*)’:
/usr/lib/gcc/i586-linux-gnu/4.9/include/mmintrin.h:778:1: error: inlining failed in call to always_inline ‘__m64 _mm_xor_si64(__m64, __m64)’: target specific option mismatch
 _mm_xor_si64 (__m64 __m1, __m64 __m2)
 ^
In file included from FFdecsa.c:80:0:
parallel_064_mmx.h:69:89: error: called from here
 #define XOR_8_BY(d,s1,s2)    do { *(__m64*)d = _mm_xor_si64(*(__m64*)(s1), *(__m64*)(s2)); } while(0)
                                                                                         ^
parallel_064_mmx.h:81:30: note: in expansion of macro ‘XOR_8_BY’
 #define XOR_BEST_BY(d,s1,s2) XOR_8_BY(d,s1,s2)
                              ^
fftable.h:52:2: note: in expansion of macro ‘XOR_BEST_BY’
  XOR_BEST_BY(d, d, s);
  ^
Makefile:43: recipe for target 'FFdecsa.o' failed
make[1]: *** [FFdecsa.o] Error 1

SO i guess, i will use libdvbcsa instead.

Thanks for your support

MegaV0lt commented 8 years ago

Or just give PARALLEL_128_SSE2 a try...

raccoon4me commented 8 years ago

@MegaV0lt @manio Thanks for your suggestions, i tried but it fails. In any case, even though libdvbcsa works, i believe vdr plugin, and more specifically dvbsddevice is not compatible with dvbapi plugin.

With patched firmware dvb-ttpci01.fw installed

[ 7.012175] av7110 0000:00:0b.0: firmware: direct-loading firmware dvb-ttpci-01.fw
[ 7.463711] dvb-ttpci: info @ card 0: firm f0240009, rtsl b0250018, vid 71010068, app 80f12623
[ 7.463720] dvb-ttpci: firmware @ card 0 supports CI link layer interface
[ 7.521541] dvb-ttpci: Crystal audio DAC @ card 0 detected
[ 8.383537] dvb-ttpci: found av7110-0.

Oscam receive properly the request from dvbapi plugin, the logs show that its get the ECM, nothing to complain on Oscam level, but VDR logs keep saying:

Apr 4 21:15:37 debiantv vdr: [911] CAM 3: activated!
Apr 4 21:15:37 debiantv vdr: [911] detaching receiver - won't decrypt channel -0-0-0 with CAM 3

I tried my chance on vdrportal.de, but they don't want to help me because i'm using a phoenix Interface, so my guess is that there is no way to use a Full Hauppauge dvbs with vdr-2.2.0 and dvbapi because of some incompatibility that my level in C++ is far away from being enough for this task.

It's sad but i will have to give up on using VDR with my old dvbs card.

manio commented 8 years ago

I didn't have any problem using my plugin with my old TT1.3 :) Maybe you are doing something wrong. Paste a full vdr log on pastebin.

raccoon4me commented 8 years ago

@manio

Thanks a lot for trying to help me, for me i have a TT rv2.1 :)

Debian stable v8.4 Fresh install, no X installed

i got the bootcode.bin installing the firmware-linux-free package

apt-get install firmware-linux-free

dvb-ttpci firmware downloaded from here

http://download.mn-home.fr/VDR/DVB/dvb-ttpci-01-f12623-patched.fw.gz

I always install VDR this way:

apt-get install vim git gettext g++ libfreetype6-dev libfontconfig1-dev libjpeg-dev 
libcap-dev libncurses5-dev libncursesw5-dev libavcodec-dev libavformat-dev libavutil-dev 
libdvbcsa-dev make

cd /usr/local/src/
wget ftp://ftp.tvdr.de/vdr/vdr-2.2.0.tar.bz2
tar xvf vdr-2.2.0.tar.bz2
ln -s vdr-2.2.0 vdr
cd /usr/local/src/vdr/PLUGINS/src
git clone git://github.com/manio/vdr-plugin-dvbapi.git
ln -s vdr-plugin-dvbapi dvbapi
cd /usr/local/src/vdr
make
make install

For oscam, i use compile the latest from svn:

svn co http://www.streamboard.tv/svn/oscam/trunk oscam-svn

I run vdr the more simplest way

vdr ... -P dvbsddevice -P dvbapi

Here the logs, switching to TVP 2, VDR level log 3, dvbapi log 3

http://pastebin.com/k0D7SgR4

It's odd, because the oscam logs look perfects and works fine with my Cine S2 card

(ecm) vdr (0100:000068:12C8): found TVP2
(ecm) vdr (0100:000068:12C8): found TVP2
(ecm) vdr (0100:000068:12C8): found TVP2

Thanks again for taking some time for helping me, that's very nice :)

pozdrawiam

PS: here i was trying with vdr-2.3.1, but with 2.2.0 is the very same

MegaV0lt commented 8 years ago

Not sure, but does dvbapi not have to be the first at startup? Can you try to start it bevore dvbsddevice? vdr ... -P dvbapi -P dvbsddevice

manio commented 8 years ago

@raccoon4me Wejdz na IRCa to pogadamy jak ludzie :) https://webchat.freenode.net/ - kanal dvbapi

raccoon4me commented 8 years ago

@MegaV0lt Yes I thought about it too, even thought with other card, the order doesn't make any difference, but I tried changing the order , no difference unfortunately.

manio commented 8 years ago

Closing this issue for now; after a research with @raccoon4me we found out that a plugin seems to working ok, but the card (maybe due to firmware) is not properly using the passed keys.