mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ALSA: pcm: Fix source frame count calculation
@ 2026-11-02 14:16 Sreeraj S Kurup
  2026-11-02 14:31 ` Takashi Iwai
  0 siblings, 1 reply; 6+ messages in thread
From: Sreeraj S Kurup @ 2026-11-02 14:16 UTC (permalink / raw)
  To: perex, tiwai
  Cc: rosen, cezary.rojewski, tim.bird, linux-sound, linux-kernel,
	Sreeraj S Kurup

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@gmail.com>
---
 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);
 					if (frames <= 0)
 						return frames;
 				}
-- 
2.55.0


^ permalink raw reply	[flat|nested] 6+ messages in thread
* [PATCH] ALSA: pcm: Fix source frame count calculation
@ 2026-11-02 14:34 Sreeraj S Kurup
  0 siblings, 0 replies; 6+ messages in thread
From: Sreeraj S Kurup @ 2026-11-02 14:34 UTC (permalink / raw)
  To: perex, tiwai
  Cc: rosenp, cezary.rojewski, tim.bird, linux-sound, linux-kernel,
	Sreeraj S Kurup

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@gmail.com>
---
 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);
 					if (frames <= 0)
 						return frames;
 				}
-- 
2.55.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-11-02 15:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-02 14:16 [PATCH] ALSA: pcm: Fix source frame count calculation Sreeraj S Kurup
2026-11-02 14:31 ` Takashi Iwai
2026-11-02 14:47   ` Sreeraj S Kurup
2026-11-02 15:04     ` Takashi Iwai
2026-11-02 15:40       ` Sreeraj S Kurup
2026-11-02 14:34 Sreeraj S Kurup

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®