FAAD problem on AMD64: no sound
Hi, Short version: Distribution: Debian/SID, pure64 port for amd64 MPlayer-CVS : 2005-03-25, ~10:00am Problem : no sound when internal FAAD2 is used Sample data : ftp://mplayerhq.hu/MPlayer/incoming/zx.eva.renewal.01.divx511_first_5mb_amd64.mkv MPlayer -v : zx.eva.renewal.01.divx511_first_5mb_amd64.txt Bugzilla : nothing found Long version: There seems to be a problem with the internal libfaad on amd64. The sample file has two audio streams: AAC and Ogg/Vorbis. The playback of the 6-channel AAC stream [faad] is completely silent (but the volume is normal at 50%) while the playback of the 2-channel Ogg/Vorbis stream [libvorbis] works. Surround ist not the problem since wav-files with 6 channels work. Also, on my laptop (Pentium III, x86) faad works nicely with the same file and the /same/ relevant output: --------------------------- Opening audio decoder: [faad] AAC (MPEG2/4 Advanced Audio Coding) dec_audio: Allocating 4608 bytes for input buffer. dec_audio: Allocating 49152 + 65536 = 114688 bytes for output buffer. FAAD: Decoder init done (0Bytes)! FAAD: Negotiated samplerate: 44100Hz channels: 6 FAAD: compressed input bitrate missing, assuming 128kbit/s! AUDIO: 44100 Hz, 6 ch, s16le, 128.0 kbit/3.02% (ratio: 16000->529200) Selected audio codec: [faad] afm:faad (FAAD AAC (MPEG2/MPEG4 Audio) decoder) --------------------------- Interesting is that the Debian vlc (0.8.1) also uses FAAD and can play video and the AAC sound. I've tried all 26 files of Evangelion and also some others with 2-channel AAC audio. Same Result. I am on the list and would like to help to track this bug down. Hotti System Information: ----------------------------------------------------------------- Distribution: Debian/SID, pure64 port for amd64 Video card : Matrox G550 Dual-DVI Audio : VIA VT8233 (Alsa, no OSS emulation, surround works fine) $ uname -a Linux lafiel 2.6.10-9-amd64-k8 #1 Tue Mar 15 01:45:16 CET 2005 x86_64 GNU/Linux $ ls -l /lib/libc[.-]* -rw-r--r-- 1 root root 1294784 Jan 12 21:29 /lib/libc-2.3.2.so lrwxrwxrwx 1 root root 13 Jan 14 22:38 /lib/libc.so.6 -> libc-2.3.2.so $ gcc -v Reading specs from /usr/lib/gcc-lib/x86_64-linux/3.3.5/specs Configured with: ../src/configure -v --enable-languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared --enable-__cxa_atexit --with-system-zlib --enable-nls --without-included-gettext --enable-clocale=gnu --enable-debug --enable-java-gc=boehm --enable-java-awt=xlib --enable-objc-gc --disable-multilib x86_64-linux Thread model: posix gcc version 3.3.5 (Debian 1:3.3.5-12) $ ld -v GNU ld version 2.15 $ as --version GNU assembler 2.15 Copyright 2002 Free Software Foundation, Inc. This program is free software; you may redistribute it under the terms of the GNU General Public License. This program has absolutely no warranty. This assembler was configured for a target of `x86_64-linux'. $ cat /proc/cpuinfo processor : 0 vendor_id : AuthenticAMD cpu family : 15 model : 12 model name : AMD Athlon(tm) 64 Processor 3200+ stepping : 0 cpu MHz : 2199.871 cache size : 512 KB fpu : yes fpu_exception : yes cpuid level : 1 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 pni syscall nx mmxext lm 3dnowext 3dnow bogomips : 4308.99 TLB size : 1088 4K pages clflush size : 64 cache_alignment : 64 address sizes : 40 bits physical, 48 bits virtual power management: ts fid vid ttp ----------------------------------------------------------------- -- I was trained in the culture of mathematics, so I'm not used to charging people a penny every time they use a theorem I proved. But I charge somebody for the time I spend telling them which theorem to apply. -- D.E. Knuth
On Fri, Mar 25, 2005 at 01:27:08PM +0100, Daniel Hottinger wrote:
There seems to be a problem with the internal libfaad on amd64. The sample file has two audio streams: AAC and Ogg/Vorbis. The playback of the 6-channel AAC stream [faad] is completely silent (but the volume is normal at 50%) while the playback of the 2-channel Ogg/Vorbis stream [libvorbis] works. Surround ist not the problem since wav-files with 6 channels work. Also, on my laptop (Pentium III, x86) faad works nicely with the same file and the /same/ relevant output:
Hmm, the first thing we need to find out is whether older versions of libfaad that were included in MPlayer before have this problem or not and whether this occurs with external libfaad. Please try 1.0pre5, which contains libfaad 2.0 and 1.0pre4, which comes with a pre-2.0 CVS snapshot and report back. Also please try compiling your own libfaad as described in http://mplayerhq.hu/DOCS/HTML/en/codecs.html#aac or install the Debian package of FAAD (Marillat packages it, just ask apt-get.org, or go directly to http://hpisi.nerim.net/) and configure MPlayer with --enable-external-faad. Diego
Thanks for your quick answer. * On the 84th day of the year MMV a.d., Diego Biurrun wrote:
On Fri, Mar 25, 2005 at 01:27:08PM +0100, Daniel Hottinger wrote:
There seems to be a problem with the internal libfaad on amd64. The sample file has two audio streams: AAC and Ogg/Vorbis. The playback of the 6-channel AAC stream [faad] is completely silent (but the volume is normal at 50%) while the playback of the 2-channel Ogg/Vorbis stream [libvorbis] works. Surround ist not the problem since wav-files with 6 channels work. Also, on my laptop (Pentium III, x86) faad works nicely with the same file and the /same/ relevant output:
Hmm, the first thing we need to find out is whether older versions of libfaad that were included in MPlayer before have this problem or not and whether this occurs with external libfaad. Please try 1.0pre5, which contains libfaad 2.0 and 1.0pre4, which comes with a pre-2.0 CVS snapshot and report back. Also please try compiling your own libfaad as described in
Ok, I have tried them. Full output of mplayer -v is attached. 1.0pre4, internal libfaad: zx.eva.renewal.01.divx511.mkv_pre4.txt -> FAAD: Failed to decode frame: Unable to find ADTS syncword -> ds_fill_buffer: EOF reached (stream: audio) -> No sound with faad -> Second audio track with Ogg/Vorbis works fine. 1.0pre5, internal libfaad: zx.eva.renewal.01.divx511.mkv_pre5.txt -> FAAD: Failed to decode frame: Unable to find ADTS syncword -> ds_fill_buffer: EOF reached (stream: audio) -> No sound with faad -> Second audio track with Ogg/Vorbis works fine. libfaad from http://www.audiocoding.com/modules/mydownloads/: -> Latest CVS Snapshot is 2004-09-15. sh bootstrap fails to generate ./configure. (with automake 1.4-p6 and autoconf 2.13) -> FAAD2 2.0 Source (also 2004-09-15). sh bootstrap gives some warnings, Makefile must be fixed by hand. Compiles but cannot be linked against mplayer (undefined symbols `raw_data_block' `can_decode_ot' `filter_bank_init' `sbrDecodeEnd' `get_sample_rate' `faad_free' `output_to_PCM' `AudioSpecificConfig2' `filter_bank_end' `faad_malloc' `adts_frame' `get_sr_index' `get_adif_header' `err_msg' while linking). Maybe I fixed the Makefile the wrong way.
or install the Debian package of FAAD (Marillat packages it, just ask apt-get.org, or go directly to http://hpisi.nerim.net/) and configure MPlayer with --enable-external-faad.
cvs-version, external libfaad (precompiled deb's): zx.eva.renewal.01.divx511.mkv_external_faad_debs.txt -> FAAD: Failed to decode frame: Unable to find ADTS syncword -> ds_fill_buffer: EOF reached (stream: audio) -> No sound with faad -> Second audio track with Ogg/Vorbis works fine. Any ideas? ;-) Hotti -- I was trained in the culture of mathematics, so I'm not used to charging people a penny every time they use a theorem I proved. But I charge somebody for the time I spend telling them which theorem to apply. -- D.E. Knuth
[update] First: sorry for the big attachments. * On the 84th day of the year MMV a.d., Daniel Hottinger wrote:
* On the 84th day of the year MMV a.d., Diego Biurrun wrote:
On Fri, Mar 25, 2005 at 01:27:08PM +0100, Daniel Hottinger wrote:
There seems to be a problem with the internal libfaad on amd64. The sample file has two audio streams: AAC and Ogg/Vorbis. The playback of the 6-channel AAC stream [faad] is completely silent (but the volume is normal at 50%) while the playback of the 2-channel Ogg/Vorbis stream [libvorbis] works. Surround ist not the problem since wav-files with 6 channels work. Also, on my laptop (Pentium III, x86) faad works nicely with the same file and the /same/ relevant output:
Hmm, the first thing we need to find out is whether older versions of libfaad that were included in MPlayer before have this problem or not and whether this occurs with external libfaad. Please try 1.0pre5, which contains libfaad 2.0 and 1.0pre4, which comes with a pre-2.0 CVS snapshot and report back. Also please try compiling your own libfaad as described in
libfaad from http://www.audiocoding.com/modules/mydownloads/: -> Latest CVS Snapshot is 2004-09-15. sh bootstrap fails to generate ./configure. (with automake 1.4-p6 and autoconf 2.13)
Attila pointed out that Debian uses an old version of automake by default. With 1.6 I got the latest snapshot to compile. This is an improvement since now I get sound (sort of). It sounds choppy and plays too slow. I'll have a deeper look at it tomorrow and will report my progress. So long, Hotti -- I was trained in the culture of mathematics, so I'm not used to charging people a penny every time they use a theorem I proved. But I charge somebody for the time I spend telling them which theorem to apply. -- D.E. Knuth
Hi After two evenings of bug-hunting I have made some progress. * On the 84th day of the year MMV a.d., Daniel Hottinger wrote:
Attila pointed out that Debian uses an old version of automake by default. With 1.6 I got the latest snapshot to compile. This is an improvement since now I get sound (sort of). It sounds choppy and plays too slow. I'll have a deeper look at it tomorrow and will report my progress.
I've tried another file with only two channels (44100 Hz, 2 ch, s16le, 128.0 kbit) Result: - no sound with internal libfaad on amd64 but plays ok on x86 - plays perfect with external libfaad on amd64 and x86 For ftp://ftp.mplayerhq.hu/MPlayer/incoming/zx.eva.renewal.01.divx511_first_5mb_amd64.mkv (6 channels): - plays with internal libfaad on x86 - no sound with internal libfaad on amd64 - external libfaad provides (recognizable) sound on x86 /and/ amd64 (but it's very choppy) I have tracked the last point down to the function raw_data_block() in libfaad/syntax.c in the cvs-snapshot of libfaad. The loop | while ((id_syn_ele = (uint8_t)faad_getbits(ld, LEN_SE_ID | DEBUGVAR(1,4,"NeAACDecDecode(): id_syn_ele"))) != ID_END) | { is traversed four(!) times for the 6 channel file. The value of in_syn_ele is 0, 1, 1, 0 (ID_SCE, ID_CPE, ID_CPE, ID_SCE). As a consequence hDecoder->fr_channels has the value 8 (should probably be 6!). Inserting | if (hDecoder->fr_channels == 6) | break; just after the quoted source above eliminates the noise and the sound is played correctly for the center/lfe-channel (i think, i have to downmix to four channels because my hardware is 4.0 and not 5.1). The other channels are silent. I do not know where to search further. The bug with 8 instead of 6 channels seems to be fixed in the internal libfaad but the fix does not seem to be 64 bit clean. So long, Hotti -- I was trained in the culture of mathematics, so I'm not used to charging people a penny every time they use a theorem I proved. But I charge somebody for the time I spend telling them which theorem to apply. -- D.E. Knuth
On Mon, Mar 28, 2005 at 04:04:43PM +0200, Daniel Hottinger wrote:
I do not know where to search further. The bug with 8 instead of 6 channels seems to be fixed in the internal libfaad but the fix does not seem to be 64 bit clean.
Could you please retry with latest CVS? Rich did some fixes to downmixing. Diego
On Fri, Apr 01, 2005 at 12:03:05AM +0200, Diego Biurrun wrote:
On Mon, Mar 28, 2005 at 04:04:43PM +0200, Daniel Hottinger wrote:
I do not know where to search further. The bug with 8 instead of 6 channels seems to be fixed in the internal libfaad but the fix does not seem to be 64 bit clean.
Could you please retry with latest CVS? Rich did some fixes to downmixing.
It shouldn't make a difference. Before there was no downmixing for mplayer; I added it. Rich
Hi Diego * On the 91th day of the year MMV a.d., Diego Biurrun wrote:
On Mon, Mar 28, 2005 at 04:04:43PM +0200, Daniel Hottinger wrote:
I do not know where to search further. The bug with 8 instead of 6 channels seems to be fixed in the internal libfaad but the fix does not seem to be 64 bit clean.
Could you please retry with latest CVS? Rich did some fixes to downmixing.
I tried the latest CVS (2005-04-03, ~12:00) but unfortunately the problem is still there. The internal libfaad is silent for the 2 and 6 channel files. The external libfaad plays at least the 2 channel file correct, but for the 6 channel file libfaad decodes 8 channels. The good news is that I've just figured out that the hack in the external libfaad: | if (hDecoder->fr_channels == 6) | break; (libfaad/syntax.c) from a previous mail actually solved the problem completely! With external libfaad and -channels 6 I get 3 different stereo streams (front, rear, center/lfe). I must have been too tired that evening to play with -channels and swap the surround slot... Hotti -- I was trained in the culture of mathematics, so I'm not used to charging people a penny every time they use a theorem I proved. But I charge somebody for the time I spend telling them which theorem to apply. -- D.E. Knuth
On Sun, Apr 03, 2005 at 02:40:30PM +0200, Daniel Hottinger wrote:
* On the 91th day of the year MMV a.d., Diego Biurrun wrote:
Could you please retry with latest CVS? Rich did some fixes to downmixing.
I tried the latest CVS (2005-04-03, ~12:00) but unfortunately the problem is still there. The internal libfaad is silent for the 2 and 6 channel files. The external libfaad plays at least the 2 channel file correct, but for the 6 channel file libfaad decodes 8 channels.
The good news is that I've just figured out that the hack in the external libfaad:
| if (hDecoder->fr_channels == 6) | break; (libfaad/syntax.c)
from a previous mail actually solved the problem completely! With external libfaad and -channels 6 I get 3 different stereo streams (front, rear, center/lfe). I must have been too tired that evening to play with -channels and swap the surround slot...
Could you make a patch out of this? If it fixes AMD64 while not breaking i386 and PPC I will most likely apply it.
-- I was trained in the culture of mathematics, so I'm not used to charging people a penny every time they use a theorem I proved. But I charge somebody for the time I spend telling them which theorem to apply. -- D.E. Knuth
Nice quote, BTW. Diego
Hi Diego * On the 93th day of the year MMV a.d., Diego Biurrun wrote:
On Sun, Apr 03, 2005 at 02:40:30PM +0200, Daniel Hottinger wrote:
The good news is that I've just figured out that the hack in the external libfaad:
| if (hDecoder->fr_channels == 6) | break; (libfaad/syntax.c)
from a previous mail actually solved the problem completely! With external libfaad and -channels 6 I get 3 different stereo streams (front, rear, center/lfe). I must have been too tired that evening to play with -channels and swap the surround slot...
Could you make a patch out of this? If it fixes AMD64 while not breaking i386 and PPC I will most likely apply it.
I've attached it. The patch is against the CVS snapshot of libfaad and fixes the broken sound for /incoming/zx.eva.renewal.01.divx511_first_5mb_amd64.mkv on i386 and amd64 when using external libfaad. It's a hack and certainly breaks real 7 or 8 channel files (but I do not have such files here).
-- I was trained in the culture of mathematics, so I'm not used to charging people a penny every time they use a theorem I proved. But I charge somebody for the time I spend telling them which theorem to apply. -- D.E. Knuth
Nice quote, BTW.
Thanks ;-) Hotti
On Sun, Apr 03, 2005 at 02:40:30PM +0200, Daniel Hottinger wrote:
* On the 91th day of the year MMV a.d., Diego Biurrun wrote:
Could you please retry with latest CVS? Rich did some fixes to downmixing.
I tried the latest CVS (2005-04-03, ~12:00) but unfortunately the problem is still there. The internal libfaad is silent for the 2 and 6 channel files. The external libfaad plays at least the 2 channel file correct, but for the 6 channel file libfaad decodes 8 channels.
Could you please try out the updated CVS snapshot I built? Get it from here: http://mplayerhq.hu/~diego/libfaad2_updated.tar.bz2 Just drop this into your CVS checkout of MPlayer replacing the original libfaad2 directory, do a make distclean and recompile. Let's see if this works any better. Diego
Hi Diego * On the 95th day of the year MMV a.d., Diego Biurrun wrote:
On Sun, Apr 03, 2005 at 02:40:30PM +0200, Daniel Hottinger wrote:
I tried the latest CVS (2005-04-03, ~12:00) but unfortunately the problem is still there. The internal libfaad is silent for the 2 and 6 channel files. The external libfaad plays at least the 2 channel file correct, but for the 6 channel file libfaad decodes 8 channels.
Could you please try out the updated CVS snapshot I built? Get it from here:
Diego, you're great! I do not know what you have changed but this version works perfectly! I have tested the 6 channel file as well as a 2 channel file with AAC sound - everything works fine. Thank you! Hotti -- Algorithms are inherently mathematical things that should be as unpatentable as the value of pi. -- D.E. Knuth
participants (3)
-
D Richard Felker III -
Daniel Hottinger -
Diego Biurrun