Skip to contentSkip to conversation

alsa-lib resamping error

DISCUSSION Paul Davis 2 participants 3 messages Jan 22, 2003 – Jan 27, 2003

lore
Share & tools
lore

Paul Davis

author
#0 lore raw

if you try to play a 22.05kHz stream on hardware that supports 32kHz and 44.1kHz but not 22.05kHz, alsa-lib's plughw layer chooses to use 32kHz and resamples. this seems like an error to me: it would be much better to choose 44.1kHz and do simple integer resampling. that is:
the search for the best rate should first try integer multiples and divisors of the desired rate, not the "closest" rate.

--p

-------------------------------------------------------
This SF.net email is sponsored by: Scholarships for Techies! Can't afford IT training? All 2003 ictp students receive scholarships. Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more. www.ictp.com/training/sourceforge.asp

#1 lore raw

At Wed, 22 Jan 2003 12:38:31 -0500,

Quoted 7 lines · Paul Davis

if you try to play a 22.05kHz stream on hardware that supports 32kHz and 44.1kHz but not 22.05kHz, alsa-lib's plughw layer chooses to use 32kHz and resamples. this seems like an error to me: it would be much better to choose 44.1kHz and do simple integer resampling. that is:
the search for the best rate should first try integer multiples and divisors of the desired rate, not the "closest" rate.

agreed, it would be better.

but... errm... changing this in alsa-lib is like going into a big labyrinth for me :)

Takashi

-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com

#2 lore raw

At Thu, 23 Jan 2003 17:20:02 +0100,

Quoted 11 lines · I wrote:

At Wed, 22 Jan 2003 12:38:31 -0500,

Quoted 7 lines · Paul Davis

if you try to play a 22.05kHz stream on hardware that supports 32kHz and 44.1kHz but not 22.05kHz, alsa-lib's plughw layer chooses to use 32kHz and resamples. this seems like an error to me: it would be much better to choose 44.1kHz and do simple integer resampling. that is:
the search for the best rate should first try integer multiples and divisors of the desired rate, not the "closest" rate.

Quoted 4 lines

agreed, it would be better.

but... errm... changing this in alsa-lib is like going into a big labyrinth for me :)

and after a long wandering in the labyrinth, the changes are on cvs now (both for alsa-driver and alsa-lib).
the new code will try the integer multiples at first.
i hope this works correctly...

Takashi

-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com