mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] ALSA: aloop: Update the PCM Slave controls for a matching playback
@ 2026-10-21  7:46 Henrik Enquist via B4 Relay
  2026-10-21  7:46 ` [PATCH 1/2] " Henrik Enquist via B4 Relay
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Henrik Enquist via B4 Relay @ 2026-10-21  7:46 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai, Mark Brown, Shuah Khan
  Cc: linux-sound, linux-kernel, linux-kselftest, stable, Henrik Enquist

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

 sound/drivers/aloop.c                     | 11 +++++----
 tools/testing/selftests/alsa/aloop-test.c | 40 +++++++++++++++++++++++++++++++
 2 files changed, 47 insertions(+), 4 deletions(-)
---
base-commit: 443ed4edc2678cc51c5a01e7dffc4c890be40051
change-id: 20261021-aloop-slave-controls-9bcc118ddf2a

Best regards,
--  
Henrik Enquist <henrik.enquist@gmail.com>



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

end of thread, other threads:[~2026-10-21 12:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-21  7:46 [PATCH 0/2] ALSA: aloop: Update the PCM Slave controls for a matching playback Henrik Enquist via B4 Relay
2026-10-21  7:46 ` [PATCH 1/2] " Henrik Enquist via B4 Relay
2026-10-21  7:46 ` [PATCH 2/2] selftests/alsa: Check the aloop " Henrik Enquist via B4 Relay
2026-10-21 12:56 ` [PATCH 0/2] ALSA: aloop: Update the " Takashi Iwai

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®