[alsa-devel] alsa-lib rate plugins - float samples

Pavel Hofman pavel.hofman at ivitera.com
Mon Jun 20 09:35:12 CEST 2011


Hi,

This is probably a question for Jaroslav Kysela. The better-quality rate
plugins offer float resolution, but currently we are deliberately
loosing information by down-converting to s16 in plugin_rate API
(convert_s16). In rate_samplerate.c, the samples are up-converted to
float before calling the libsamplerate API. Speex offers float API too,
while we are using the int16 one.

There are two ways to handle this:

A. Implementing the generic "convert" API function for these plugins,
handling the sample - float conversion in each plugin individually.

B. Extending the pcm_rate API (pcm_rate.h) with a new optional function
convert_float.

Since the conversion from general sample format to float is not trivial
(using the plugin_ops.h operations), I would be inclined to suggest the
extension (well I have it hacked already :-) ). On the other hand, the
conversion routine can be located in some common code shared by all the
plugins involved and we could keep the existing API, using the generic
convert function.


Thanks a lot for suggestions.

Best regards,

Pavel.



More information about the Alsa-devel mailing list