Opened 9 years ago

Closed 9 years ago

#1749 closed defect (fixed)

FAAD AAC decoder is broken for some files

Reported by: t.artem@… Owned by: reimar
Priority: normal Component: ad
Version: HEAD Severity: major
Keywords: Cc: reimar, r_togni@…
Blocked By: Blocking:
Reproduced by developer: Analyzed by developer:

Description

ffplay plays the sample file just fine.
faad decodes the same file just fine.

mplayer has audio distorted.

Attachments (1)

out.aac (938.0 KB) - added by t.artem@… 9 years ago.
sample audio clip

Download all attachments as: .zip

Change History (16)

Changed 9 years ago by t.artem@…

sample audio clip

comment:1 Changed 9 years ago by t.artem@…

mplayer -v out.aac
MPlayer SVN-r31889-4.4.4 (C) 2000-2010 MPlayer Team
CPU vendor name: GenuineIntel? max cpuid level: 11
CPU: Intel(R) Core(TM) i5 CPU 650 @ 3.20GHz (Family: 6, Model: 37, Stepping: 2)
extended cpuid-level: 8
extended cache-info: 16801856
Detected cache-line size is 64 bytes
Testing OS support for SSE... yes.
Tests of OS support for SSE passed.
CPUflags: MMX: 1 MMX2: 1 3DNow: 0 3DNowExt: 0 SSE: 1 SSE2: 1 SSSE3: 1
Compiled for x86 CPU with extensions: MMX MMX2 SSE SSE2 SSSE3 CMOV
get_path('codecs.conf') -> '/home/birdie/.mplayer/codecs.conf'
Reading /home/birdie/.mplayer/codecs.conf: Can't open '/home/birdie/.mplayer/codecs.conf': No such file or directory
Reading /usr/local/etc/mplayer/codecs.conf: 159 audio & 341 video codecs
Configuration: --disable-vidix --enable-gui --enable-dynamic-plugins --enable-menu --enable-radio --enable-radio-capture --disable-inet6 --disable-arts --disable-esd --disable-smb --disable-openal --disable-lirc
CommandLine?: '-v' 'out.aac'
init_freetype
Using MMX (with tiny bit MMX2) Optimized OnScreenDisplay?
get_path('fonts') -> '/home/birdie/.mplayer/fonts'
Using nanosleep() timing
get_path('input.conf') -> '/home/birdie/.mplayer/input.conf'
Parsing input config file /home/birdie/.mplayer/input.conf
Input config file /home/birdie/.mplayer/input.conf parsed: 3 binds
get_path('out.aac.conf') -> '/home/birdie/.mplayer/out.aac.conf'

Playing out.aac.
get_path('sub/') -> '/home/birdie/.mplayer/sub/'
[file] File size is 960563 bytes
STREAM: [file] out.aac
STREAM: Description: File
STREAM: Author: Albeu
STREAM: Comment: based on the code from ??? (probably Arpi)
LAVF_check: raw ADTS AAC
Checking for YUV4MPEG2
ASF_check: not ASF guid!
Checking for REAL
Checking for SMJPEG
Searching demuxer type for filename out.aac ext: .aac
Checking for Nullsoft Streaming Video
Checking for MOV
Checking for VIVO
AVS: avs_check_file - attempting to open file out.aac
AVS: File is too big, aborting...
Checking for PVA
Checking for MPEG-TS...
TRIED UP TO POSITION 67516, FOUND 47, packet_size= 0, SEEMS A TS? 0
Checking for LMLM4 Stream Format
Invalid packet in LMLM4 stream: ch=65529 size=562035926
LMLM4 Stream Format not found
sync_mpeg_ps: seems to be MP3 stream...
MPEG Stream reached EOF
ds_fill_buffer: EOF reached (stream: video)
MPEG packet stats: p100: 1 p101: 0 p1B6: 0 p12x: 2 sli: 0 a: 0 b: 0 c: 0 idr: 0 sps: 0 pps: 0 PES: 5 MP3: 143, synced: 0
Not MPEG System Stream format... (maybe Transport Stream?)

{ERROR5,c=249}

sync_mpeg_ps: seems to be MP3 stream...
MPEG Stream reached EOF
ds_fill_buffer: EOF reached (stream: video)
MPEG packet stats: p100: 1 p101: 0 p1B6: 0 p12x: 2 sli: 0 a: 0 b: 0 c: 0 idr: 0 sps: 0 pps: 0 PES: 4 MP3: 143, synced: 0
Not MPEG System Stream format... (maybe Transport Stream?)
Seek failed
==> Found video stream: 0
ds_fill_buffer: EOF reached (stream: video)
LAVF_check: raw ADTS AAC
libavformat file format detected.
[aac @ 0x9445b00] max_analyze_duration reached
[aac @ 0x9445b00] Estimating duration from bitrate, this may be inaccurate
==> Found audio stream: 0
======= WAVE Format =======
Format Tag: 20557 (0x504D)
Channels: 1
Samplerate: 44100
avg byte/sec: 16063
Block align: 1
bits/sample: 0
cbSize: 0
==========================================================================
[lavf] stream 0: audio (aac), -aid 0
LAVF: 1 audio and 0 video streams found
LAVF: build 3427840
get_path('sub/') -> '/home/birdie/.mplayer/sub/'
==========================================================================
Opening audio decoder: [faad] AAC (MPEG2/4 Advanced Audio Coding)
dec_audio: Allocating 6144 bytes for input buffer.
dec_audio: Allocating 65536 + 65536 = 131072 bytes for output buffer.

AAC_PROBE: 6144 bytes

AAC_PROBE: ret 0
FAAD: Decoder init done (6144Bytes)!
FAAD: Negotiated samplerate: 44100Hz channels: 2
FAAD: got 128kbit/s bitrate from MP4 header!
AUDIO: 44100 Hz, 2 ch, s16le, 128.5 kbit/9.11% (ratio: 16063->176400)
Selected audio codec: [faad] afm: faad (FAAD AAC (MPEG-2/MPEG-4 Audio))
==========================================================================
Building audio filter chain for 44100Hz/2ch/s16le -> 0Hz/0ch/??...
[libaf] Adding filter dummy
[dummy] Was reinitialized: 44100Hz/2ch/s16le
[dummy] Was reinitialized: 44100Hz/2ch/s16le
Trying preferred audio driver 'alsa', options '[none]'
alsa-init: requested format: 44100 Hz, 2 channels, 9
alsa-init: using ALSA 1.0.23
alsa-init: setup for 1/2 channel(s)
alsa-init: using device default
alsa-init: pcm opened in blocking mode
alsa-init: got buffersize=65536
alsa-init: got period size 1024
alsa: 44100 Hz/2 channels/4 bpf/65536 bytes buffer/Signed 16 bit Little Endian
AO: [alsa] 44100Hz 2ch s16le (2 bytes per sample)
AO: Description: ALSA-0.9.x-1.x audio output
AO: Author: Alex Beregszaszi, Zsolt Barat <joy@…>
AO: Comment: under developement
Building audio filter chain for 44100Hz/2ch/s16le -> 44100Hz/2ch/s16le...
[dummy] Was reinitialized: 44100Hz/2ch/s16le
[dummy] Was reinitialized: 44100Hz/2ch/s16le
Video: no video
Freeing 0 unused video chunks.
Starting playback...
Increasing filtered audio buffer size from 0 to 65536

comment:2 Changed 9 years ago by t.artem@…

  • Cc patriotact@… added

comment:3 Changed 9 years ago by t.artem@…

  • Cc r_togni@… added

comment:4 Changed 9 years ago by t.artem@…

  • Component changed from core to ad
  • Owner changed from reimar to r_togni@…

comment:5 Changed 9 years ago by reimar

  • Cc Reimar.Doeffinger@… added

I think (but am not sure) it works fine with -ac ffaac.
If so, this would be a FAAD bug. In which case it would be interesting to know if this happens also with external libfaad.

comment:6 Changed 9 years ago by t.artem@…

  • Summary changed from AAC decoder is broken for some files to FAAD AAC decoder is broken for some files

(In reply to comment #2)

I think (but am not sure) it works fine with -ac ffaac.
If so, this would be a FAAD bug. In which case it would be interesting to know

yep, it works nicely with -ac ffaac

if this happens also with external libfaad.

How can I check it out? like I said faad can decode this file without any problems.

ldd which faad

linux-gate.so.1 => (0xb77b1000)
libfaad.so.0 => /usr/lib/libfaad.so.0 (0xb7746000)
libm.so.6 => /lib/libm.so.6 (0xb771c000)
libc.so.6 => /lib/libc.so.6 (0xb7590000)
/lib/ld-linux.so.2 (0xb77b2000)

comment:7 Changed 9 years ago by t.artem@…

I've hit a GCC bug.

GCC 4.4.4 produces a broken faad library with any compilation flags (even with -O2 -march=i686).

GCC 4.2.4 produces a working faad library even with -O3 -march=native.

Probably I have to file a bug on GCC's bugzilla.

Please, advise.

comment:8 Changed 9 years ago by t.artem@…

  • Resolution set to remind
  • Status changed from new to closed

A relevant GCC bug is here http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45160

It's very strange no one has hit this bug before.

comment:9 Changed 9 years ago by reimar

  • Owner changed from r_togni@… to reimar

You should probably try with -fnostrict-aliasing compile option, that is the most likely one to cause issues.

comment:10 Changed 9 years ago by compn

  • Cc patriotact@… removed

.

comment:11 Changed 9 years ago by t.artem@…

Let's see what GCC developers will say.

comment:12 Changed 9 years ago by t.artem@…

(In reply to comment #6)

You should probably try with -fnostrict-aliasing compile option, that is the
most likely one to cause issues.

This flag has solved the issue for me.

comment:13 Changed 9 years ago by reimar

Then it is most likely a programming error, and possibly one of the "violates strict-aliasing rules" warnings points to the problem.

comment:14 Changed 9 years ago by t.artem@…

  • Resolution remind deleted
  • Status changed from closed to reopened

Can anyone then add -fno-strict-aliasing GCC flag to the internal mplayer faad library?

That will fix the bug until libfaad2 developers release a new library version (and that may never happen).

comment:15 Changed 9 years ago by t.artem@…

  • Resolution set to fixed
  • Status changed from reopened to closed

I cannot reproduce this bug any longer.

Probably someone has fixed the internal AAC decoder.

Note: See TracTickets for help on using tickets.