[alsa-devel] pcm_rate API question

Clemens Ladisch clemens at ladisch.de
Mon Sep 30 16:16:58 CEST 2013


Rob Sykes wrote:
>>> Typically there is some buffering/delay within a resampler -- how
>>> does the pcm_rate API allow for this?
>>
>> The API itself does not allow for this.  Your code must generate
>> dst_frames samples.
>>
>> At startup, prefix the output with zero samples.
>
> this situation can apparently occur at any time: "after that first
> call all subsequent calls will probably get you about 2000 samples out
> for every 1000 samples you put in" — only "probably", not "always";
> occurring after the start, this will likely cause audible distortion.

You must know your resampling algorithm.  If it introduces delays, you
need to buffer more samples.


Regards,
Clemens


More information about the Alsa-devel mailing list