Bug#381843: bad kernel resampling quality

Monty Montgomery xiphmont at gmail.com
Thu Jan 28 11:38:34 UTC 2010


This bug is beginning to conflate many issues.

However, the basic core problem comes down to where resampling is
happening.  Powerbooks only posses a few hardware playback rates,
several offer only 48000.  Something has to resample all other
playback rates to one that's actually supported.  Ao controls none of
this.  It simply sits between system sound API and the application and
passes calls in a portable fashion.

Audacity has its own resampling algorithms that are fairly high
quality.  If you look in the preferences dialogs, you will see there's
a choice of several, including 'let the sound card do it' (usually the
kernel driver actually).

Pulse is capable of figuring out what rate the card likes to run at
and does its own resampling. It has to in order to multiplex playback
of files that are different rates.  So pulse output should be good
(unless it's accidentally forced or tricked into running at a bad rate
and letting the kernel driver handle it).  48000 is a safe bet on all
Apple hardware.

Esd tries to switch rates on demand, so you can't really tell what the
Hell it's doing alot of the time.  It assumes that any rate the kernel
accepts is a good rate.

Any apps (ogg123, mpg123, mplayer) that simply hand the data directly
to the kernel driver are at ALSA/OSS's mercy.  ALSA/OSS resampling is
really really bad.  nasty tearing noises.  etc.   Why?  Because it's
really fast if you do it badly.

libao is but a small a relatively innocent piece in the middle of all
this suck.  It does not attempt to influence or solve the resampling
problem.  Good resampling is pretty hard, that's why it's a good idea
for sound cards to do it in hardware.

in ALSA, you can avoid getting 'bad' sampling rates by never using the
default device, and never using plug devices.  Always use hw: or
non-plug aliases like surround51 as these will reject rates not
directly supported by the hardware.

In OSS.... yeah, don't use OSS.

The best modern solution is to use Pulse, which will do all this
properly and automatically.

anyway, not libao's bug.

Monty





More information about the pkg-xiph-maint mailing list