Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 112921 - media-libs/xine-lib: interposing makes xine crash when libfaad is brought in
Summary: media-libs/xine-lib: interposing makes xine crash when libfaad is brought in
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: High critical (vote)
Assignee: Diego Elio Pettenò (RETIRED)
Depends on:
Reported: 2005-11-18 08:05 UTC by Andrew Dorney
Modified: 2006-04-25 08:15 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---

Updated DEPENDs (bmpx-0.12.9-r2.ebuild,2.60 KB, text/plain)
2005-12-07 13:53 UTC, dynamotwain

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Dorney 2005-11-18 08:05:32 UTC
I'm running bmpx-, xine-lib-1.1.1, faad2-2.0-r7, and faac-1.24, and I'm
having some problems.

Everything was working *okay* when I had xine-lib 1.1.0, and used mpeg4ip
instead of faad2. But since all my multimedia apps use faad2 instead of mpeg4ip,
I switched back to remove the annoying blocker between mpeg4ip and faad2. So I
emerged the latest, unstable faad2 and faac (versions above). At the same time,
xine-lib-1.1.1 came out, so I compiled that against faad2 and flac.

Now, BMPx uses xine-lib for its back-end. I'm getting random crashes due to the
library - here's the backtrace I'm getting.

#0 0x00002aaab5edba95 in NeAACDecInit2 ()
from /usr/lib64/xine/plugins/1.1.1/
#1 0x00002aaab5efecbd in faad_open_dec ()
from /usr/lib64/xine/plugins/1.1.1/
#2 0x00002aaab5efefb3 in faad_decode_data ()
from /usr/lib64/xine/plugins/1.1.1/
#3 0x00002aaaab34c4d1 in audio_decoder_loop () from /usr/lib/
#4 0x00002aaaabd510fa in start_thread () from /lib/
#5 0x00002aaaae7b2a73 in clone () from /lib/
#214 0x00002aaaae91b520 in __check_rhosts_file () from /lib/
#349 0x00002aaaab34bbc0 in _x_waveformatex_le2me () from /usr/lib/

Apparently xine-lib doesn't have a debug symbols, so I can't really compile it
with USE="debug" and get more information, but if you have any suggestions, I'll
take it and run with it.

Downgrading to xine-lib-1.1.0 does fix the crashing problem, but then xine-lib
doesn't integrate with faad2 and flac, and thus won't play my .m4a files.

So I'm in a bind - either use a crashing media player, or don't get any sound at
all from my .m4as (all other media files work fine).

Suggestions would be great. :)

~~ Andrew D.

Reproducible: Always
Steps to Reproduce:
1. emerge faad2-2.0-r7 faac-1.24 xine-lib-1.1.1 bmpx-
2. Play an .m4a file in BMPx


1. emerge faad2-2.0-r7 faac-1.24 xine-lib-1.1.0 bmpx-
2. Play an .m4a file in BMPx

Actual Results:  
With xine-lib 1.1.1, BMPx crashes. With xine-lib 1.1.0, the .m4a files don't
play at all.

emerge info
Portage (default-linux/amd64/2005.1, gcc-3.4.4, glibc-2.3.5-r2,
2.6.13-gentoo-r5 x86_64)
System uname: 2.6.13-gentoo-r5 x86_64 AMD Athlon(tm) 64 Processor 3200+
Gentoo Base System version 1.6.13
dev-lang/python:     2.3.5-r2, 2.4.2
sys-apps/sandbox:    1.2.12
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/libtool:   1.5.20
virtual/os-headers:  2.6.11-r2
CFLAGS="-march=k8 -O2 -pipe"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.3/env
/usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3.4/env
/usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config
/usr/lib/X11/xkb /usr/lib64/mozilla/defaults/pref /usr/share/config
CONFIG_PROTECT_MASK="/etc/gconf /etc/splash /etc/terminfo /etc/env.d"
CXXFLAGS="-march=k8 -O2 -pipe"
FEATURES="autoconfig distlocks fixpackages sandbox sfperms strict"
USE="X Xaw3d aac aalib accessibility acpi aim alsa amd64 apm arts audiofile avi
bash-completion berkdb bitmap-fonts bluetooth bmp bonobo bzip2 bzlib cdparanoia
cdr cjk crypt cups curl curlwrappers dbus ddbm dga dio divx4linux dts dvd dvdr
dvdread eds emboss emul-linux-x86 encode esd ethereal exif expat f77 faad fam
fbcon ffmpeg flac flash font-server foomaticdb fortran ftp gd gdbm ggi gif glut
gnome gnutls gphoto2 gpm gstreamer gtk gtk2 gtkhtml hal icq idn imagemagick imap
imlib inifile ipv6 jabber jack java javascript joystick jp2 jpeg kde ladcca lcms
ldap lesstif libcaca libg++ libwww lm_sensors lmcs lzw lzw-tiff mad mbox mikmod
mng motif mozilla mp3 mpeg msn nas ncurses nls nptl nptlonly ogg oggvorbis
openal opengl oss pam pcre pdds pdflib perl png portaudio ppds python qt
quicktime readline recode ruby samba sambasasl scanner sdl slang sndfile snmp
sockets sox speex spell ssl svg tcltk tcpd theora threads tidy tiff truetype
truetype-fonts type1-fonts udev unicode usb userlocales utf8 vcd videos vorbis
wifi wmf xine xinerama xml xml-rpc xml2 xmms xosd xpm xprint xrandr xv xvid
yahoo zlib userland_GNU kernel_linux elibc_glibc"
Comment 1 Andrew Dorney 2005-11-18 08:06:30 UTC
Just a note - here's the BMPx bug I filed, in case anyone wants to look at that
(it doesn't give much, but I figured I'd include it).
Comment 2 Martin Schlemmer (RETIRED) gentoo-dev 2005-11-28 01:33:38 UTC
Its a xine-lib/faad (flac?) bug.
Comment 3 Diego Elio Pettenò (RETIRED) gentoo-dev 2005-11-28 02:04:42 UTC
xine-lib uses an internal copy of faad2, which was updated before release 
1.1.1, so there the issue might be. 
Can you provide a sample of file crashing, so that I can try to reproduce and 
contact upstream about it? 
Comment 4 Andrew Dorney 2005-11-28 23:05:47 UTC
I'll try and get a m4a file up on my webserver ASAP - hope you like Dave Brubeck. :)

On a related note - xine-lib 1.1.0-r5 is perfect. No crashes, and it still plays
m4a files without making clicking noises, so I'm set. But I'd still like to get
this resolved. :)

And to ditto the comment by Martin, yes, it is an xine-lib bug.

~~ Andrew D.
Comment 5 Andrew Dorney 2005-12-01 16:27:27 UTC
Here it is. I couldn't upload it to Bugzilla because it was too big.

~~ Andrew D.
Comment 6 Diego Elio Pettenò (RETIRED) gentoo-dev 2005-12-02 09:38:44 UTC
Does it crash with xine-ui, too? 
Comment 7 Andrew Dorney 2005-12-02 17:23:05 UTC
I upgraded back to 1.1.1, and BMPx still crashes. Xine-ui, however, has not
crashed yet. I'll upgrade to 1.1.1-r1 later and see if that fixes anything.

~~ Andrew D.
Comment 8 Andrew Dorney 2005-12-02 17:50:59 UTC
Yeah, BMPx still crashes with 1.1.1-r1, but xine-ui hasn't crashed so far, and
I've set it on a pretty long playlist.

So... this might suggest an issue with BMPx's handling of the xine library? Or... ?

I can also upgrade to BMPx .12.9-r1 tonight, as it just hit portage. I'll pull
it down in my latest websync (stupid school firewall) and post.

~~ Andrew D.
Comment 9 Diego Elio Pettenò (RETIRED) gentoo-dev 2005-12-03 02:00:47 UTC
Seems like it's bmpx that does something nasty when playing the file, if 
xine-ui plays it fine, it means that the library is able to decode it... 
Comment 10 Martin Schlemmer (RETIRED) gentoo-dev 2005-12-07 01:03:56 UTC
Cannot really see bmpx doing anything funny xine related .. do:

  # ebuild <path to latest or whatever version bmpx ebuild you use> clean unpack

then edit in $S src/play.c, and comment following line (around line 202):

     xine_set_param( self->private->stream, XINE_PARAM_METRONOM_PREBUFFER, 6000 );

then do:
   # ebuild <path to latest or whatever version bmpx ebuild you use> compile
install qmerge

and see if that makes any difference.
Comment 11 Milosz Derezynski 2005-12-07 02:33:23 UTC
Hi umm i'm one of the other lead devels of BMPx (IRC: deadchip)

I've just built libxine 1.1.1 and BMPx SVN HEAD (r1639) and i can play all the
m4a's i have allright without crashes

I'm going to "acquire" some few more for further testing (and delete them after
24 hours, of course...), but so far i can't confirm this, it needs further testing.

Comment 12 Milosz Derezynski 2005-12-07 02:34:30 UTC
Another question how is this related to FLAC? FAAD is responsible for decoding
only M4A/MP4/AAC formats, or does the latest ebuild crash with xine-lib 1.1.1
and FLACs as well? 

If yes, then that would qualify as another (different/seperate) bug report i
guess :P 
Comment 13 Milosz Derezynski 2005-12-07 02:37:49 UTC
Oh yeah sorry another thing, libxine includes actually it's own copy of FAAD, so
if the libxine ebuild doesn't have a dependency on FAAD it's pointless to put
this in context with a FAAD ebuild.

In the case the libxine ebuild _does_ have a dependency on fadd it would mean
Gentoo had cut out the libxine FAAD and instead somehow patched in a 'live' copy
of FAAD into the xine build, in which case it might be somewhat cleared that it
crashes for you and not for me e.g., as i don't use Gentoo and my libxine is
built with the FAAD that comes with it.

(Note that this is just a hypothetical case, i don't know how the deps of the
Gentoo libxine ebuild..)
Comment 14 Diego Elio Pettenò (RETIRED) gentoo-dev 2005-12-07 02:46:08 UTC
Faad is one of the things I leave up to xine-lib sources, it's too twisted to 
be handled correctly from outside. 
Comment 15 dynamotwain 2005-12-07 13:53:12 UTC
Created attachment 74251 [details]
Updated DEPENDs

I just updated DEPEND to require pkgconfig 0.18, since that's when
PKG_CHECK_EXISTS was added. I just installed pkgconfig '~x86' over here, so I
know it works for me with pkgconfig-0.19
Comment 16 Jory A. Pratt 2005-12-13 20:55:13 UTC
#0  0x00002aaab0f6be90 in avcodec_open () from /usr/lib/
#1  0x00002aaab0e396b2 in ff_audio_decode_data ()
   from /usr/lib64/xine/plugins/1.1.1/
#2  0x00002aaaaae04668 in audio_decoder_loop () from /usr/lib/
#3  0x00002aaaac1ebfac in start_thread () from /lib/
#4  0x00002aaaae6c3473 in clone () from /lib/
#5  0x0000000000000000 in ?? ()

As you can see from latest bt, still not working. Everything is fine until you
actually go to open a file. I have even disabled xine support.
Comment 17 Jory A. Pratt 2005-12-13 20:56:33 UTC
errr stupid me forgot emerge info and bmpx version hahaha :)

[ebuild   R   ] media-sound/bmpx-0.12.9-r1  -a52 +dbus -debug -flac -irssi -mad
+ogg +perl +python -theora -vorbis +xchat -xine

Portage 2.0.53 (default-linux/amd64/2005.1, gcc-4.0.2, glibc-2.3.6-r1,
2.6.14-gentoo-r4 x86_64)
System uname: 2.6.14-gentoo-r4 x86_64 AMD Sempron(tm) Processor 3200+
Gentoo Base System version 1.12.0_pre11
ccache version 2.4 [enabled]
dev-lang/python:     2.4.2
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1-r1
sys-devel/libtool:   1.5.20-r1
virtual/os-headers:  2.6.11-r3
ACCEPT_KEYWORDS="amd64 ~amd64"
CFLAGS="-O2 -march=athlon64 -mtune=athlon64 -fomit-frame-pointer -ftracer
-fprefetch-loop-arrays -pipe"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config
/usr/share/X11/xkb /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -march=athlon64 -mtune=athlon64 -fomit-frame-pointer -ftracer
-fprefetch-loop-arrays -pipe"
FEATURES="autoaddcvs autoconfig candy ccache cvs distlocks multilib-strict
sandbox sfperms strict stricter userpriv usersandbox"
LDFLAGS="-Wl,-O1 -Wl,--sort-common"
USE="amd64 X acpi alsa audiofile avi berkdb bitmap-fonts bzip2 canvas crypt cups
curl dbus dri dvd dvdr dvdread emboss encode exif expat fam ffmpeg firefox
foomaticdb gif glut gmp gnome gpm gtk gtk2 hal imlib ipv6 java jpeg lcms lzw
lzw-tiff mng motif mozdevelop mozsvg mp3 mpeg ncurses nls nptl nptlonly nsplugin
nss objc ogg opengl pam pdflib perl pic png python quicktime readline sdl spell
ssl tcpd tiff truetype truetype-fonts type1-fonts udev usb userlocales xine
xinerama xml2 xpm xv zlib userland_GNU kernel_linux elibc_glibc"
Comment 18 Andrew Dorney 2006-01-08 00:07:43 UTC
Good news - I may have moved forward in this! :)

After running:

emerge -C faad2 && USE="-aac" emerge ffmpeg && emerge xine-lib

It all works! I'm thinking the faad2 libs that were required for ffmpeg's aac flag were competing with xine-lib's new ones.

Here's the versions if anyone else wants to try it.

[ebuild   R   ] media-video/ffmpeg-0.4.9_p20051216
[ebuild   R   ] media-libs/xine-lib-1.1.1-r3
[ebuild   R   ] media-sound/bmpx-0.12.9-r2

~~ Andrew D.
Comment 19 Andy Neitzke 2006-01-18 17:49:19 UTC
I was having a very similar problem with amarok using the xine backend -- it would play everything except m4a great, but with m4a it would crash.  Playing m4a in xine directly didn't work either.  Running

emerge -C faad2 && USE="-aac" emerge ffmpeg && emerge xine-lib

as suggested in the last comment fixed the problem for me.  After emerging xine-lib I can emerge faad2 again and everything still works.
Comment 20 Luca Barbato gentoo-dev 2006-03-18 18:28:58 UTC
hopefully ffmpeg will provide an internal aac implementation soon, could you please check fi ffplay can run those files?
Comment 21 Andrew Dorney 2006-04-06 00:29:05 UTC
After installing the most recent ffmpeg *with* aac support, I am able to play those files via ffplay. However xine still crashes.
Comment 22 Diego Elio Pettenò (RETIRED) gentoo-dev 2006-04-06 01:22:56 UTC
Can you try with xine-lib-1.1.1-r5 or later?
Comment 23 Andrew Dorney 2006-04-06 05:38:08 UTC
I have. No change.
Comment 24 Andrew Dorney 2006-04-06 05:47:52 UTC
(In reply to comment #23)
> I have. No change.

Sorry. Horrible post. I need to stop writing bug comments right after crawling out of bed. It has changed - xine now refuses to start. Not sure if it's an xine thing or an ffmpeg dependency... but the bug report for *that* is 124779.

I'm going to update to the latest of everything... BMPx 0.12.9-r2, xine-lib-1.1.1-r5 and ffmpeg-0.4.9_p20060302 and see if BMPx crashes on aac playing. As mentioned before, though, the new ffmpeg (20060302) *DOES* play aac files now.

(if this *still* doesn't make a whole lot of sense, poke me and I'll post again later, after my coffee)

~~ Andrew D.
Comment 25 wyvern5 2006-04-11 19:52:39 UTC
The 'emerge -C faad2 && USE="-aac" emerge ffmpeg && emerge xine-lib' incantation doesn't work for me. 

[ebuild   R   ] media-libs/xine-lib-1.1.1-r5
[ebuild   R   ] media-video/ffmpeg-0.4.9_p20051216
[ebuild   R   ] media-libs/faad2-2.0-r11

ffplay works fine when playing a .m4a file. xine complains that "The audio device is unavailable. Please verify if another program already use it." whether or not there is anything else audio-related open at the time. Amarok says the same thing when I try to play an m4a with it (using the xine backend).
Comment 26 Andrew Dorney 2006-04-11 22:52:09 UTC
Okay. Ignore my previous post - that no longer applies. I fixed the Xine crashing thing, as it was my fault for not re-emerging xine-ui.

I am able to play .m4a files in Xine with the following combination of media files.

StubbornAesthetics ~ # emerge -pv xine-lib ffmpeg faad2

These are the packages that I would merge, in order:

Calculating dependencies ...done!
[ebuild   R   ] media-libs/xine-lib-1.1.1-r5  +X +a52 +aac +aalib +alsa (-altivec) +arts +asf +debug +directfb +dts +dvd +dxr3 +esd +fbcon +ffmpeg +flac +gnome +imagemagick +ipv6 +libcaca +mad +mng -modplug +nls +opengl +oss +samba +sdl +speex +theora -v4l +vcd -video_cards_i810 +video_cards_nvidia -video_cards_via (-vidix) +vorbis (-win32codecs) +xinerama +xv -xvmc 0 kB

[ebuild   R   ] media-video/ffmpeg-0.4.9_p20060302  -a52 -aac (-altivec) -amr +debug -doc +dts +encode -ieee1394 +imlib (-mmx) -network +ogg +oss +sdl -test +theora +threads +truetype -v4l +vorbis -x264 +xvid +zlib 0 kB

[ebuild   R   ] media-libs/faad2-2.0-r7  +xmms 0 kB

This effectively causes ffplay to not work (as with the -aac flag, the aac codec isn't installed), but Xine can play it just fine. Xine is using faad2 to play the aac file and ffmpeg for everything else, as appropriate.

Hope that helps someone.

~~ Andrew D.
Comment 27 wyvern5 2006-04-12 10:17:33 UTC
Simpy recompiling ffmpeg without aac support let xine play aac's. Thanks for the tip!
Comment 28 Diego Elio Pettenò (RETIRED) gentoo-dev 2006-04-17 07:59:24 UTC
I think there's a way to leave ffmpeg having support for AAC and still have xine playing it by changing the priorities, but as I can't reproduce here, can someone please change the priority of the faad/aac decoder from xine settings to an higher value than ffmpegaudio and then report if that is enough? If that's the case I can do a revbump changing the priority.
Comment 29 Ian Monroe 2006-04-17 15:38:33 UTC
I talked to Diego in IRC and tried out his suggestion. While .m4a's did work with ffmpeg set to "-aac", it does not work with aac in ffmpeg set on and the xine configuration change to give a higher priority to faad (the behavior is the same regardless of priority).
Comment 30 Diego Elio Pettenò (RETIRED) gentoo-dev 2006-04-25 05:35:55 UTC
The problem seems to be caused by interposing issues, that's why I wasn't able to reproduce (as I'm using -Bdirect). I've been able to reproduce and identify the problem, I'm trying to patch xine so that it hides internally the symbols that shouldn't be replaced.

Wow sometimes the work done for sandbox on Gentoo/FreeBSD and the reading for -Bdirect description come out useful.
Comment 31 Andrew Dorney 2006-04-25 05:52:26 UTC
*cheer*  :)
Comment 32 Diego Elio Pettenò (RETIRED) gentoo-dev 2006-04-25 08:15:43 UTC
And now.... fixed! :) try 1.1.2_pre20060328-r2: that version applies a huge patch to hide all the extra symbols, and finally you can have ffmpeg +aac and still being able to play m4a files! :)