mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ALSA: dummy: Report a change when one capture switch channel moves
@ 2026-09-01 15:39 HyeongJun An
  2026-09-01 16:26 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: HyeongJun An @ 2026-09-01 15:39 UTC (permalink / raw)
  To: perex, tiwai; +Cc: linux-sound, linux-kernel, HyeongJun An

The snd_dummy_capsrc_put() builds its change flag with &&, so it reports
a change only when both channels move at once.  Writing a single channel
stores the new value and returns 0, the control core then sends no
SNDRV_CTL_EVENT_MASK_VALUE, and a second reader keeps showing the old
setting until it polls again.

The volume put a few lines above compares the same pair of channels with
||.

The mixer selftest already reports this.  With snd-dummy loaded it fails
event_missing on all five capture switches:

  # CD Capture Switch.1 orig 0 read 1, is_volatile 0
  not ok 13 event_missing.Dummy.9

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Assisted-by: Claude:claude-opus-5
Signed-off-by: HyeongJun An <sammiee5311@gmail.com>
---
Verified side by side on 6.17.0-35-generic.  The v6.17 dummy.c with only
this change built as a second module registers as Dummy_1 alongside the
stock Dummy, and mixer-test then reports:

  ok     6 event_missing.Dummy_1.10   ... all 11 pass
  not ok 90 event_missing.Dummy.9
  not ok 104 event_missing.Dummy.7
  not ok 118 event_missing.Dummy.5
  not ok 132 event_missing.Dummy.3
  not ok 146 event_missing.Dummy.1

The five that fail are the capture switches.  The volume controls in
between already use ||.

 sound/drivers/dummy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/drivers/dummy.c b/sound/drivers/dummy.c
index b908d2564aee..3f6bfee29986 100644
--- a/sound/drivers/dummy.c
+++ b/sound/drivers/dummy.c
@@ -808,7 +808,7 @@ static int snd_dummy_capsrc_put(struct snd_kcontrol *kcontrol, struct snd_ctl_el
 	left = ucontrol->value.integer.value[0] & 1;
 	right = ucontrol->value.integer.value[1] & 1;
 	guard(spinlock_irq)(&dummy->mixer_lock);
-	change = dummy->capture_source[addr][0] != left &&
+	change = dummy->capture_source[addr][0] != left ||
 	         dummy->capture_source[addr][1] != right;
 	dummy->capture_source[addr][0] = left;
 	dummy->capture_source[addr][1] = right;
-- 
2.43.0


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

* Re: [PATCH] ALSA: dummy: Report a change when one capture switch channel moves
  2026-09-01 15:39 [PATCH] ALSA: dummy: Report a change when one capture switch channel moves HyeongJun An
@ 2026-09-01 16:26 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2026-09-01 16:26 UTC (permalink / raw)
  To: HyeongJun An; +Cc: perex, tiwai, linux-sound, linux-kernel

On Tue, 01 Sep 2026 17:39:21 +0200,
HyeongJun An wrote:
> 
> The snd_dummy_capsrc_put() builds its change flag with &&, so it reports
> a change only when both channels move at once.  Writing a single channel
> stores the new value and returns 0, the control core then sends no
> SNDRV_CTL_EVENT_MASK_VALUE, and a second reader keeps showing the old
> setting until it polls again.
> 
> The volume put a few lines above compares the same pair of channels with
> ||.
> 
> The mixer selftest already reports this.  With snd-dummy loaded it fails
> event_missing on all five capture switches:
> 
>   # CD Capture Switch.1 orig 0 read 1, is_volatile 0
>   not ok 13 event_missing.Dummy.9
> 
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Assisted-by: Claude:claude-opus-5
> Signed-off-by: HyeongJun An <sammiee5311@gmail.com>

Applied now.  Thanks.


Takashi

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

end of thread, other threads:[~2026-09-01 16:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-01 15:39 [PATCH] ALSA: dummy: Report a change when one capture switch channel moves HyeongJun An
2026-09-01 16:26 ` 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®