Re: [PATCH 0/2] ALSA: aloop: Update the PCM Slave controls for a matching playback

From: Takashi Iwai

Date: Wed Oct 21 2026 - 09:01:50 EST


On Wed, 21 Oct 2026 09:46:44 +0200,
Henrik Enquist via B4 Relay wrote:
>
> Hi,
>
> One more aloop fix, after the notify mode one (ded1060369 "ALSA:
> aloop: Don't constrain playback params in notify mode"). I ran into
> this while working on a new CamillaDSP feature that uses notify mode.
> The "PCM Slave" controls are meant to report the playback's
> parameters, but often they don't. loopback_check_format() returns
> early when a capture is open and the parameters match, before it
> updates the controls. They then keep the module defaults, or the
> values of an earlier stream.
>
> This isn't specific to notify mode. Without notify, a playback that
> joins a running capture always has matching parameters, so the controls
> are never updated in that case. The early return has been there since
> the driver was added, hence the Fixes tag on the 2010 commit.
>
> Patch 1 skips only the capture stop when the parameters match, and
> always updates the controls. A value event is still sent only for a
> control whose value changes, so nothing new shows up except where a
> stale value gets corrected.
>
> Patch 2 adds a test for it to the aloop selftest. It doesn't need to go
> to stable, so it can wait for the next merge window if that's easier.
>
> Testing: for-linus at 443ed4edc2, arm64 VM, kernel with KASAN,
> lockdep, DEBUG_ATOMIC_SLEEP and DEBUG_LIST, comparing the patched
> driver with the unpatched one built from the same tree.
> - The selftest passes 5 of 5 patched. Unpatched, only the new test
> fails: the controls keep the earlier stream's values (96000 Hz,
> S32_LE, 4 channels, non-interleaved) and no value events arrive.
> - The reproducer in patch 1 reports 48000 unpatched and 44100 patched.
> - No KASAN, lockdep or other warnings in dmesg.
> Not tested: real hardware, other architectures.
>
> AI disclosure: as with the notify series, I used Claude Code (Claude
> Opus 5.5). It traced the bug through the driver and its history, wrote
> both patches and their changelogs, built the test kernels and ran the
> tests. I reviewed all of it.
>
> Henrik
>
> ---
> Henrik Enquist (2):
> ALSA: aloop: Update the PCM Slave controls for a matching playback
> selftests/alsa: Check the aloop PCM Slave controls for a matching playback

Applied both patches now. Thanks.


Takashi