Opendigitalradio / dablin

DAB/DAB+ receiver for Linux (including ETI-NI and EDI AF playback)
GNU General Public License v3.0
123 stars 27 forks source link

Seg fault with 32 kHz sampling rates and ODR-fdk-aac #26

Closed andimik closed 7 years ago

andimik commented 7 years ago

Seems the combination ODR-fdk-aac and dablin_gtk does not like 32 kHz sampling rates:

ETIPlayer: format: HE-AAC, 32 kHz Mono @ 24 kBit/s AACDecoder: using decoder 'FDK-AAC' SDLOutput: audio closed SDLOutput: using audio buffer of 32000 bytes SDLOutput: audio opened; driver name: pulseaudio, freq: 32000, channels: 1, size: 2048, samples: 1024, silence: 0x00, output: 16bit integer Speicherzugriffsfehler (Speicherabzug geschrieben)

and

Error in `dablin_gtk': free(): invalid next size (normal): 0x00007fb82402df50 ======= Backtrace: ========= /lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7fb856b3d7e5] /lib/x86_64-linux-gnu/libc.so.6(+0x7fe0a)[0x7fb856b45e0a] /lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7fb856b4998c] dablin_gtk(_ZN16SuperframeFilterD0Ev+0x6d)[0x41541d] dablin_gtk(_ZN9ETIPlayer12ProcessFrameEPKh+0x5f)[0x4190bf] dablin_gtk(_ZN9ETISource4MainEv+0x642)[0x4181e2] /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xb8c80)[0x7fb857166c80] /lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7fb858ccd6ba] /lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7fb856bcc82d]

The FAAD2 decoder works indeed.

andimik commented 7 years ago

I have an (older and not 100% errorfree) eti at http://andimik.bplaced.net/temp/10d_lang2.eti.zip

Listen to Glasbeni radio

basicmaster commented 7 years ago

32 kHz does not seem to be the reason, as e.g. ENERGY Wien (HE-AAC, 32 kHz Stereo) works flawlessly. Mono together with HE-AAC seems to be the problem (e.g. B5 aktuell); I will investigate.

basicmaster commented 7 years ago

I fixed the issue. In this case, two things happened:

  1. The output frame len was specified in wrong terms, resulting in twice as much space. Hence when the lib tried to write to the complete space, other memory was overwritten and a segfault occured instead of a runtime error.
  2. When SBR with Mono is used, the lib assumes possibly present PS and uses Stereo instead of Mono output. To fix this, the output channel count is now restricted to the actual input channel count.

I won't release a new version here, as it doesn't affect the default FAAD2 decoder and in addition only specific audio formats.

Thanks for the report!