Re: [PATCH v2] ALSA: linear: Check frame count for all channels
From: Takashi Iwai
Date: Fri Nov 06 2026 - 07:54:37 EST
On Fri, 06 Nov 2026 13:37:50 +0100,
Sreeraj S Kurup wrote:
>
> Hi Takashi,
>
> Thanks for reviewing.
>
> I added this check because I thought the available frame count could potentially
> differ between channels, similar to how the alignment is checked separately for
> each channel under CONFIG_SND_DEBUG.
Those alignment checks are with snd_BUG_ON(), so it'll give kernel
warning with stack trace, i.e. the code shouldn't be triggered.
I believe the checks are superfluous, but it's a sanity check for
debugging, after all.
> I understand that the ALSA plugin framework normally keeps the processed frame count
> identical across all channels.
>
> Is there any condition or exceptional case where the available frame count could differ
> between channels? Or is it guaranteed to be identical by the plugin framework?
The frame count must be identical. So, if any, such a check should be
conditionally enabled and trigger a kernel WARNING. It means, if it
happens, something must be completely wrong.
thanks,
Takashi
> If it is guaranteed, I agree that this additional check is unnecessary.
>
> Thanks for your guidance.
>
> Best regards,
> Sreeraj