MPD, FAAD plugin sounds awful when playing aac web radio stream

Newest update of FAAD MPD plugin incorrectly probing "audio_format" to 22050 from original rate of 44100

result: awful sound

cat /etc/mpd.conf
playlist_directory	"/root/.mpd/playlists"
db_file			"/root/.mpd/database"

input {
        plugin "curl"
}

audio_output {
	type 		"alsa"
	name 		"My AUDIO Device"
	mixer_control	"Headphone"
}
playlist: play 8:"https://stream.radiojar.com/7csmg90fuqruv"
curl: icy-metaint=1024
decoder_thread: probing plugin faad
icy_metadata: unknown icy-tag: 'StreamUrl'
**decoder: audio_format=22050:16:1**, seekable=false
client: [0] command returned 0
alsa_output: opened default type=PLUG
alsa_output: buffer: size=1024..8192 time=42666..341334
alsa_output: period: size=511..513 time=21333..21334
alsa_output: default period_time = buffer_time/4 = 341333/4 = 85333
alsa_output: format=S16_LE (Signed 16 bit Little Endian)
alsa_output: buffer_size=8192 period_size=512
output: opened "My AUDIO Device" (alsa) audio_format=24000:16:1

@neheb likely related to https://github.com/openwrt/packages/tree/openwrt-19.07/libs/faad2/patches

Thanks in advance for looking

doubt it.

Can you report this upstream?

edit: which radio stream is this? does it use HE-AAC?

edit2: funny. I recognized the first song...

Playing it locally on Windows (MPC-HC) shows Audio: AAC 22050Hz 2.0 chn 57 kbit/s

There's a lot of crackling.

This is probably using HE-AAC. Unfortunately, an HE-AAC decoder cannot be distributed with OpenWrt as it's totally patented.

edit2: a lot of crackling under firefox too...

Thanks for your prompt reply.

Yes, likely it was a lemon source.

Moreover, using other source https://14103.live.streamtheworld.com/T_RAD_00S_S01AAC.aac, amd64 using VLC report sample rate is 44100 Hz, whilst mpd faad probed as 22050 Hz. The audio playback is not as bad as the 1st source anyway.

MPC-HC on Windows reports Audio: AAC 22050Hz 2.0 chn 60 kbit/s

Sounds fine though.

After I downgraded the faad library by this:

opkg install --force-downgrade https://downloads.openwrt.org/releases/packages-18.06/mipsel_24kc/packages/libfaad2_2.8.6-1_mipsel_24kc.ipk

mpd with faad is able to properly decode AAC+ (SBR) and HE-AAC+ (SBR+PS) again.

I am marking this thread as closed if it is [libfaad2_2.9.1-1] expected behavior.

Yeah it is.

ping @yousong

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.