[alsa-devel] pcm_rate API question

Rob Sykes aquegg at yahoo.co.uk
Fri Sep 27 13:59:33 CEST 2013


Hello alsa devs,

There's an ongoing attempt to see if libsoxr-lsr can be used as a plug-in replacement for libsamplerate in pulseaudio and in alsa (libsoxr-lsr is designed with this usage in mind).

With pulseaudio, it seems to 'just work', but with alsa, it looks like there is a buffering problem.  Progress reports for this are here:

http://blog.ivitera.com/pavel/linux-audio/pulseaudio-with-ld_preloading-libsoxr-lsr

http://blog.ivitera.com/pavel/linux-audio/simple-use-of-libsoxr-lsr-in-alsa-using-ld_preload


AFAICT, the problem with alsa relates to the use of this function in pcm_rate.h:

typedef struct snd_pcm_rate_ops {
...
        void (*convert_s16)(void *obj, int16_t *dst, unsigned int dst_frames,
                            const int16_t *src, unsigned int src_frames);

Is there documentation available regarding the use of this function? For example, is the plugin obliged always to consume src_frames and generate dst_frames samples?  If so, how is the plugin expected to comply (say, if it's not been given enough input to generate that amount of output)?

TIA,
Rob


More information about the Alsa-devel mailing list