Summary:ASTERISK-14292: native asterisk format moh playback sounds garbled
Reporter:David Brillert (aragon)Labels:
Date Opened:2009-06-09 11:17:32Date Closed:2011-06-07 14:07:57
Versions:Frequency of
Description:I have several .mp3 files in /var/lib/asterisk/moh/
I have removed the stock .wav files
During moh playback these files always sound garbled.
I get warnings in CLI during each playback

[Jun  9 12:05:35] WARNING[28610]: mp3/interface.c:215 decodeMP3: Junk at the beginning of frame 49443302

This has been happening on various Asterisk 1.4 versions for a long time.  I thought it was time I opened a bug report...

Playback using madplay sounds perfect, but I would prefer to use Asterisk and sound converter to avoid CPU usage and transcoding.
I get the same garble if I convert the mp3 files to other formats using Asterisk and put those files in same directory.

Comments:By: Tilghman Lesher (tilghman) 2009-06-09 11:32:56

This idea that you save CPU by using app_mp3 is completely bogus.  All it does is to invoke mpg123 to playback the file.  If you have a problem with the audio output of mpg123, you need to report this to that project.

By: Tilghman Lesher (tilghman) 2009-06-09 11:34:08

Additionally, for format_mp3, the generator in question is external, mpglib.

By: David Brillert (aragon) 2009-06-09 11:45:03


Please clarify the following for me:
If I convert mp3 file to format ulaw and use native asterisk format for moh playback I don't save any CPU cycles?

Like I mentioned madplay works perfectly so I am happy using that instead of mpg123

By: David Brillert (aragon) 2009-06-09 12:58:29

The only files that playback nicely are mp3.
Does not matter if I use native playback or madplay
Any mp3 converted by Asterisk to another codec just sounds garbled during playback using Asterisk or Madplay.

I honestly don't know if this is the expected behavior when trying to playback ulaw, slin, wav, gsm using Asterisk.
Madplay cannot play back all of these codecs.

By: Tilghman Lesher (tilghman) 2009-06-09 13:28:58

So don't use Asterisk to convert mp3 to a native sound format.  Problem solved.

By: David Brillert (aragon) 2009-06-09 14:03:59

I'll leave the bug report open in case someone wants to take a stab at it.

tilghman, you are probably right and I should not use Asterisk to convert (based on poor results) would you like to make a recommendation on which other method to use?

By: Leif Madsen (lmadsen) 2009-06-11 07:26:03

I'm confused, are you saying you are only getting this garbled sound when using the mp3-to-native conversions when using mpg123?

Why can't you convert the mp3 to ulaw (etc...) with sox or something, then just let Asterisk play the ulaw file directly instead of having to convert each time? Does that still sound garbled?

I'm actually going to close out this issue for now as I'm not sure there is really anything we can do here since Asterisk is just using external applications to do the mp3 conversion.