Re: [PATCH] ALSA: pcm: Fix source frame count calculation

From: Takashi Iwai

Date: Mon Nov 02 2026 - 10:37:46 EST


On Mon, 02 Nov 2026 15:16:47 +0100,
Sreeraj S Kurup wrote:
>
> Pass the updated frame count to the "src_frames()" callback.
>
> When the next plugin handles fewer frames than requested, use the
> actual frame count instead of the original requested count.
>
> This ensures the correct number of source frames is calculated.
>
> Signed-off-by: Sreeraj S Kurup <sreekuttan2156239@xxxxxxxxx>
> ---
> sound/core/oss/pcm_plugin.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/sound/core/oss/pcm_plugin.c b/sound/core/oss/pcm_plugin.c
> index acf5ca663ba8..3de713779993 100644
> --- a/sound/core/oss/pcm_plugin.c
> +++ b/sound/core/oss/pcm_plugin.c
> @@ -604,7 +604,7 @@ snd_pcm_sframes_t snd_pcm_plug_write_transfer(struct snd_pcm_substream *plug, st
> if (err != frames1) {
> frames = err;
> if (plugin->src_frames) {
> - frames = plugin->src_frames(plugin, frames1);
> + frames = plugin->src_frames(plugin, err);

Hm, do you really see actually hitting this code path?
As far as I see, the all client_channels() callbacks return the frame
back as given, so the condition (err != frames1) would be always
false.


Takashi