libmad mp3 distortions

Alexander Leidinger Alexander at Leidinger.net
Thu Sep 17 14:33:13 UTC 2009


Quoting Andriy Gapon <avg at icyb.net.ua> (from Tue, 15 Sep 2009 14:09:56 +0300):

>
> I can reproduce the following on two very different machines: one is  
> older Intel
> CPU/chipset, i386 stable/7; the other is newer AMD CPU/chipset, amd64 head.
> When I play certain MP3 files with any player that uses libmad for  
> MP3 decoding,
> there are some very loud distortions from time to time. Something like what
> happens when too strong signal gets clipped.
> Examples of the programs: audacious2, mpg321.
> On the other hand, mpg123 plays the same files without any quality problems.
>
> I wonder if anybody else sees this too and if, perhaps, this is a  
> known problem.

Have you tried to play it with "madplay -v -a -6"? This will lower the  
volume by 6dB. IIRC this is still with the sound before the  
conversation to PCM. If this prevents the clipping, then it is normal.  
The reason is that because of rounding (and other operations) the  
value of a sample can be higher (or lower) than originally. If it was  
at the max level before, it can now exceed the max -> clipping.  
madplay is following the rules very strictly (and IIRC working with  
higher precision and bitsize), while other players have bigger  
mathematical errors. This would explain then, why you see this with  
madplay but not with other players. The problem I describe is not in  
the decoding step, the problem is at the encoding level.

Bye,
Alexander.

-- 
There is no statute of limitations on stupidity.

http://www.Leidinger.net    Alexander @ Leidinger.net: PGP ID = B0063FE7
http://www.FreeBSD.org       netchild @ FreeBSD.org  : PGP ID = 72077137


More information about the freebsd-multimedia mailing list