Open jpalus opened 4 years ago
i have same issue but its way more noticeable like the sound is almost muted, just occasionally few fraction of seconds
Hello, @jpalus @Kazzaky.
Unfortunately old link is not working. Please consider re-sharing (I believe you can attach file to message by simply drag-n-dropping).
I would be glad to investigate the problem. Also, please mention an alternative decoder you use, so I will have a baseline for comparison.
Link still works fine for me but here it is compressed with zip (due to file type restrictions in GH). out-aac.zip
Regarding decoders:
Those that work well: ffmpeg
, fdk-aac
, ie using gstreamer
:
# ffmpeg
$ gst-launch-1.0 filesrc location=out.aac ! aacparse ! avdec_aac ! audioresample ! audioconvert ! audio/x-raw,format=S16LE,rate=41000 ! wavenc ! filesink location=out-av.wav
# fdk-aac
$ gst-launch-1.0 filesrc location=out.aac ! aacparse ! fdkaacdec ! audioresample ! audioconvert ! audio/x-raw,format=S16LE,rate=41000 ! wavenc ! filesink location=out-fdk-aac.wav
And for faad
:
$ gst-launch-1.0 filesrc location=out.aac ! aacparse ! faad ! audioresample ! audioconvert ! audio/x-raw,format=S16LE,rate=41000 ! wavenc ! filesink location=out-faad.wav
Thanks. This will help a lot.
Even with faad executable distortion is reproducible. Trying to compare with other aac decoding library. Unfortunately, there is no open libraries that just build and work...
Likely found one problem: faad2 drops the first frame output. (that is because object type is LC, not LD?)
But distortion is still there...
It seems that sound is not distorted at the beginning... It is just goes very quiet after first few frames.
Top: current faad2 Middle: modified faad2 that does not swallow first frame Bottom: Fraunhofer decoder
One more clue - decoding in "fixed_point" mode produces loud noise... Still do not have enough time to pinpoint the problem...
This is still marked as one of the release blockers in #115. How are the chances to fix this? @eustas
At last debugging session I've got some insights and understood that I need to dive deeper. Going to remove it from blocker list, as have no resources to fix it timely.
Noticed this for some iTunes M4A files as well. Using minimp4 as demuxer, though. Problem vanishes with libfdk-aac.
Unfortunately, there is no open libraries that just build and work...
Found simple example with fdk-aac here. I prepared sample project based on it for debugging decoding with fdk-aac with supplied file. See https://github.com/bahusoid/aac-example
Debugging dec_test.cpp
I noticed that second frame is decoded differently with libfaad and fdk-aac. In fdk-aac second frame is decoded to all zeroes (same as first frame) but it has some values in libfaad.
Looks suspicious.
In fdk-aac second frame has some values initially and data are zeroed in sbr processing (inside sbrDecoder_DecodeElement
):
First some values are zeroed by qmfSynPrototypeFirSlot
Stackrace:
qmfSynPrototypeFirSlot qmf.cpp:184
qmfSynthesisFilteringSlot qmf.cpp:881
qmfSynthesisFiltering qmf.cpp:951
sbr_dec sbr_dec.cpp:571
sbrDecoder_DecodeElement sbrdecoder.cpp:1473
sbrDecoder_Apply sbrdecoder.cpp:1624
aacDecoder_DecodeFrame aacdecoder_lib.cpp:951
AacDecoder::aacdec_decode_frame fdkaac_dec.cpp:79
main dec_test.cpp:100
And then left non-zero values are zeroed here
So seems libfaad makes something differently in sbr processing (if I properly found similar place something wrong might be here)
48kbps AAC stream is decoded fine with ffmpeg while faad2 decodes it distorted. However I think for a small fraction of second at the very beginning it plays fine (volume level is significantly different between "good" and "bad"). Sample can be downloaded here:
http://jpalus.fastmail.com/out.aac