Mplayer will not run and crashes with audio output set to jack with bio2jack-0.7 installed. Reproducible: Always Steps to Reproduce: 1.bio2jack-0.7 installed 2.set mplayer audio output to jack 3.attempt to play video Actual Results: MPlayer interrupted by signal 11 in module: ao2_init - MPlayer crashed by bad usage of CPU/FPU/RAM. Expected Results: should run fine downgrading to bio2jack-0.4 allows mplayer to work
I also created ebuilds for versions 0.5 and 0.6 (not in portage) and discovered that bio2jack-0.6 causes mplayer to crash as well while 0.5 seems to be OK.
Can you provide a backtrace? I just tried with bio2jack 0.7 (but compiled myself under debian), and it works (although there are some bugs with 1 channel and 8 bit audio). Maybe I should mention that I didn't install the libbio2jack.so* files though, only the static .a lib...
Not sure of my gdb skills but I get this: Program received signal SIGSEGV, Segmentation fault. [Switching to Thread -1232419120 (LWP 23346)] 0xb73ca611 in JACK_Init () from /usr/lib/libbio2jack.so.0 (gdb) bt #0 0xb73ca611 in JACK_Init () from /usr/lib/libbio2jack.so.0 #1 0x080f1b59 in init (rate_hz=-1215051172, channels=2, format=-1220759288, flags=0) at ao_jack.c:139 #2 0x080ef2b2 in init_best_audio_out (ao_list=0x87090b0, use_plugin=0, rate=16000, channels=2, format=9, flags=0) at audio_out.c:165 #3 0x080a8b39 in main (argc=2, argv=0xbfffedd4) at mplayer.c:2144
>Maybe I should mention that I didn't install the libbio2jack.so* files though, only the static .a lib... I created an overlay ebuild adding a "shared" use flag and built only the static lib, had to remerge mplayer but the crash was identical. As a side note, xmms-jack, which uses bio2jack works fine.
The gdb output is okay, but it doesn't show any line number for the crash in libbio2jack... At least the stack seems to be corrupted: rate_hz=-1215051172 etc. If you want you can try valgrind, but I'm not certain it will help much further (if you do, make sure you use an audio-only file, too much output otherwise). Anyway, I saw that 0.7 has quite a few bugs, one of them making MPlayer hang on low-quality audio (e.g. mono). They have been fixed in libbio2jack cvs, but it now depends on libsamplerate with its really slow conversions :-((
> (gdb) bt full > #0 0xb73ca611 in JACK_Init () at bio2jack.c:1618 > x = 10 > y = -1215051172 > #1 0x080f1b59 in init (rate_hz=-1215051172, channels=2, format=9, flags=0) > at ao_jack.c:139 > err = -1215051172 This is from bt that Chris sent me. Line 1618 is 'client_name = 0;' where client_name is a global char *. I'm not sure why this would cause any kind of segfault given that its the exact same code called from xmms-jack. I wonder if it has anything to do with how the library is being loaded by mplayer but I'm not sure how to debug the issue since I don't see it here with any other apps that use bio2jack. Reimar, "and it works (although there are some bugs with 1 channel and 8 bit audio). Maybe I should mention that I didn't install the libbio2jack.so* files though, only the static .a lib..." You mention issues with 1 channel and 8 bit audio. These issues haven't been reported on the bio2jack sf page so I wasn't even aware that they existed. Have you tried with cvs bio2jack? It should correctly handle these cases. If not I can try to get some media that has these audio settings and try to reproduce under mplayer. Chris
@Chris Morgan Read my comment again *g* : "They have been fixed in libbio2jack cvs, but it now depends on libsamplerate with its really slow conversions :-((" It was caused by a broken JACK_GetBytesFreeSpace implementation (the value returned was bigger than the actual buffer size, so MPlayer would hang forever trying to push that amount of data in the buffer) P.S.: This bug could be caused my a myriad of reasons, I can't really tell without being able to reproduce, but since the stack is quite obviously corrupted, valgrind should be most helpful..
Yes, I'm mixing two things together ;-) Chris, can you run things under valgrind to see if that produces any more useful output? As far as libsamplerate goes I thought the conversion functions are well optimized. How do you know that the slowness of this library is affecting you? Are you seeing a major increase in cpu usage? You can call void JACK_SetSampleRateConversionFunction(int converter) to use a less cpu intensive encoder. Chris
As a note this isn't a "one off", someone else has posted to the Gentoo forum with the same problem. Valgrind, hmmm...have to figure out how to use that one. In the meantime here's some additioanl output from gdb: ========================================================== Checking audio filter chain for 16000Hz/1ch/s16le -> 16000Hz/2ch/s16le... AF_pre: 16000Hz/1ch/s16le AO: [Jack] Initialising library. Program received signal SIGSEGV, Segmentation fault. [Switching to Thread -1232419120 (LWP 24019)] 0xb73c9611 in JACK_Init () at bio2jack.c:1618 1618 bio2jack.c: No such file or directory. in bio2jack.c ========================================================== ========================================================== (gdb) bt full #0 0xb73c9611 in JACK_Init () at bio2jack.c:1618 x = 10 y = -1215051172 #1 0x080f1b59 in init (rate_hz=-1215051172, channels=2, format=9, flags=0) at ao_jack.c:139 err = -1215051172 m = 143209912 rate = 143209976 bits_per_sample = 139535699 jack_port_flags = 4 jack_port_name_count = 0 jack_port_name = 0x0 #2 0x080ef2b2 in init_best_audio_out (ao_list=0x87090b0, use_plugin=0, rate=16000, channels=2, format=9, flags=0) at audio_out.c:165 ao_len = 4 i = 5 #3 0x080a8b39 in main (argc=2, argv=0xbfffed44) at mplayer.c:2144 osd_text_buffer = "\000\004\017\000\017\000\004\000\000\000\003\000\000\000\037\b\000\000\000$\000\000\000\017\000F$\000\000\000�PXX�\204�x\035" next_frame_time = 0 frame_time_remaining = 0 time_frame = 0 osd_show_text_buffer = "\030zη�227H <\000\000\000\000P��201\000\000\000\000\000\000\017\000pHpH�\225X\000\000\000\000\000\000\002\000\b\000\000" drop_frame = 0 dropped_frames = 0 AV_delay = 1200 blit_frame = 0 mem_ptr = 0x87201f8 "P�\bsr\bWMV2\001" d_audio = (demux_stream_t *) 0x871f5e8 d_video = (demux_stream_t *) 0x871f650 d_dvdsub = (demux_stream_t *) 0x87200c0 file_format = 0 osd_function = 1 osd_last_pts = -303 osd_show_av_delay = 0 osd_show_text = 0 osd_show_speed = 0 osd_show_sub_delay = 0 osd_show_sub_pos = 0 osd_show_sub_visibility = 0 osd_show_sub_alignment = 0 osd_show_vobsub_changed = 0 osd_show_sub_changed = 0 osd_show_percentage = 0 osd_show_tv_channel = 25 osd_show_ontop = 0 osd_show_rootwin = 0 osd_show_framedropping = 0 rtc_fd = 6 i = 141689336 tmp = 0x87201f8 "P�\bsr\bWMV2\001" gui_no_filename = 0 ========================================================== (gdb) disass $pc-32 $pc+32 Dump of assembler code from 0xb73c95f1 to 0xb73c9631: 0xb73c95f1 <JACK_Init+209>: add %al,(%eax) 0xb73c95f3 <JACK_Init+211>: add %al,0xe0c6(%ecx) 0xb73c95f9 <JACK_Init+217>: add %cl,0x4ee82404(%ecx) 0xb73c95ff <JACK_Init+223>: fdivrp %st,%st(7) 0xb73c9601 <JACK_Init+225>: incl 0x8e0f09ff(%ebx) 0xb73c9607 <JACK_Init+231>: xor %edi,%edi 0xb73c9609 <JACK_Init+233>: (bad) 0xb73c960a <JACK_Init+234>: decl 0xffffec83(%ebx) 0xb73c9610 <JACK_Init+240>: inc %edi 0xb73c9612 <JACK_Init+242>: add %al,(%eax) 0xb73c9614 <JACK_Init+244>: add %al,(%eax) 0xb73c9616 <JACK_Init+246>: add %cl,0xfff63f83(%ebp) 0xb73c961c <JACK_Init+252>: decl 0xbbe82404(%ecx) 0xb73c9622 <JACK_Init+258>: (bad) 0xb73c9624 <JACK_Init+260>: incl 0x5e5b0cc4(%ebx) 0xb73c962a <JACK_Init+266>: pop %edi 0xb73c962b <JACK_Init+267>: pop %ebp 0xb73c962c <JACK_Init+268>: ret 0xb73c962d <__i686.get_pc_thunk.cx+0>: mov (%esp),%ecx 0xb73c9630 <__i686.get_pc_thunk.cx+3>: ret End of assembler dump. ========================================================== (gdb) info all-registers eax 0xb793ca5c -1215051172 ecx 0xb73caabc -1220760900 edx 0x0 0 ebx 0xb73ca108 -1220763384 esp 0xbfffc8e0 0xbfffc8e0 ebp 0xbfffc8f8 0xbfffc8f8 esi 0xb73caae0 -1220760864 edi 0xa 10 eip 0xb73c9611 0xb73c9611 eflags 0x210202 2163202 cs 0x73 115 ss 0x7b 123 ds 0x7b 123 es 0x7b 123 fs 0x8f 143 gs 0x33 51 st0 0 (raw 0x00000000000000000000) st1 -1.472915931085998253653214506986302 (raw 0xbfffbc88825ce2c8c735) st2 13366.984375 (raw 0x400cd0dbf00000000000) st3 13366.984375 (raw 0x400cd0dbf00000000000) st4 -13366.213932878337800502777099609375 (raw 0xc00cd0d8db1138700000) st5 1200 (raw 0x40099600000000000000) st6 16000 (raw 0x400cfa00000000000000) st7 16000 (raw 0x400cfa00000000000000) fctrl 0x37f 895 fstat 0x20 32 ftag 0xffff 65535 fiseg 0x73 115 fioff 0x80a8aa8 134908584 foseg 0x7b 123 fooff 0xbfffc9cc -1073755700 fop 0x150 336 xmm0 {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = { 0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 = 0x00000000000000000000000000000000} xmm1 {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = { 0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 = 0x00000000000000000000000000000000} xmm2 {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = { 0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 = 0x00000000000000000000000000000000} xmm3 {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = { 0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 = 0x00000000000000000000000000000000} xmm4 {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = { 0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 = 0x00000000000000000000000000000000} ---Type <return> to continue, or q <return> to quit--- xmm5 {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = { 0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 = 0x00000000000000000000000000000000} xmm6 {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = { 0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 = 0x00000000000000000000000000000000} xmm7 {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = { 0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 = 0x00000000000000000000000000000000} mxcsr 0x1f80 8064 mm0 {uint64 = 0x0, v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, 0x0, 0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}} mm1 {uint64 = 0xbc88825ce2c8c735, v2_int32 = {0xe2c8c735, 0xbc88825c}, v4_int16 = {0xc735, 0xe2c8, 0x825c, 0xbc88}, v8_int8 = {0x35, 0xc7, 0xc8, 0xe2, 0x5c, 0x82, 0x88, 0xbc}} mm2 {uint64 = 0xd0dbf00000000000, v2_int32 = {0x0, 0xd0dbf000}, v4_int16 = {0x0, 0x0, 0xf000, 0xd0db}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0xf0, 0xdb, 0xd0}} mm3 {uint64 = 0xd0dbf00000000000, v2_int32 = {0x0, 0xd0dbf000}, v4_int16 = {0x0, 0x0, 0xf000, 0xd0db}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0xf0, 0xdb, 0xd0}} mm4 {uint64 = 0xd0d8db1138700000, v2_int32 = {0x38700000, 0xd0d8db11}, v4_int16 = {0x0, 0x3870, 0xdb11, 0xd0d8}, v8_int8 = {0x0, 0x0, 0x70, 0x38, 0x11, 0xdb, 0xd8, 0xd0}} mm5 {uint64 = 0x9600000000000000, v2_int32 = {0x0, 0x96000000}, v4_int16 = {0x0, 0x0, 0x0, 0x9600}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x96}} mm6 {uint64 = 0xfa00000000000000, v2_int32 = {0x0, 0xfa000000}, v4_int16 = {0x0, 0x0, 0x0, 0xfa00}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xfa}} mm7 {uint64 = 0xfa00000000000000, v2_int32 = {0x0, 0xfa000000}, v4_int16 = {0x0, 0x0, 0x0, 0xfa00}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xfa}} ==========================================================
I guess I should either backport the new jack ao or prepare an mplayer snapshot.
> I guess I should either backport the new jack ao or prepare an mplayer snapshot. Would be nice to get the new ao_jack some testing *g* To Chris concerning libsamplerate (sorry, somehow missed that part): As far as I can tell it is floating-point only - that can get very slow on some architectures/CPUs (not to mention the extreme opinions on it by some MPlayer developers *g*). Would be interesting to see some real comparisons against our lavcresample though (quality and speed wise). Also the int/floating point conversion have been a bit unreliable in MPlayer - though last time I checked bio2jack only supported int input anyway.
>To Chris concerning libsamplerate (sorry, somehow missed that part): >As far as I can tell it is floating-point only - that can get very slow on some >architectures/CPUs (not to mention the extreme opinions on it by some MPlayer >developers *g*). Would be interesting to see some real comparisons against our >lavcresample though (quality and speed wise). >Also the int/floating point conversion have been a bit unreliable in MPlayer - >though last time I checked bio2jack only supported int input anyway. The addition of the libsamplerate support was a huge gain for bio2jack in terms of flexibility. For most people using a floating point conversion library shouldn't be an issue but I would welcome patches to add support for libraries that did fixed point sample rate conversion because as you've mentioned it would improve performance on some architectures. I'm not sure what the issue with int/floating point conversion has been with mplayer, can you clarify? Bio2jack only supports int input because it is intended to act as an interface layer between alsa/oss/arts and jack and afaik none of those systems support floating point samples. Chris
Still a bug in newer versions? Thanks all