* [PATCH] ALSA: cs8427: read the PCM stream IEC958 status from its own buffer
@ 2026-11-04 8:33 raoxu
2026-11-04 14:40 ` Takashi Iwai
0 siblings, 1 reply; 2+ messages in thread
From: raoxu @ 2026-11-04 8:33 UTC (permalink / raw)
To: perex
Cc: tiwai, luiz.von.dentz, brgl, pengpeng, pmenzel, raoxu,
linux-sound, linux-kernel
From: Xu Rao <raoxu@uniontech.com>
The IEC958 Playback PCM Stream control writes pcm_status, but its
get callback always returns def_status. As a result, userspace
reads back the default status instead of the PCM stream status after
writing the stream control. Rate changes also update pcm_status
without being reflected in the value returned by the control.
Select the status buffer using the same private_value as the put
callback. The default control continues to return def_status,
while the PCM stream control now returns its own current status.
Signed-off-by: Xu Rao <raoxu@uniontech.com>
---
sound/i2c/cs8427.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/sound/i2c/cs8427.c b/sound/i2c/cs8427.c
index 1de985ba85d9..773383471f17 100644
--- a/sound/i2c/cs8427.c
+++ b/sound/i2c/cs8427.c
@@ -424,9 +424,11 @@ static int snd_cs8427_spdif_get(struct snd_kcontrol *kcontrol,
{
struct snd_i2c_device *device = snd_kcontrol_chip(kcontrol);
struct cs8427 *chip = device->private_data;
+ const char *status = kcontrol->private_value ?
+ chip->playback.pcm_status : chip->playback.def_status;
snd_i2c_lock(device->bus);
- memcpy(ucontrol->value.iec958.status, chip->playback.def_status, 24);
+ memcpy(ucontrol->value.iec958.status, status, 24);
snd_i2c_unlock(device->bus);
return 0;
}
--
2.50.1
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] ALSA: cs8427: read the PCM stream IEC958 status from its own buffer
2026-11-04 8:33 [PATCH] ALSA: cs8427: read the PCM stream IEC958 status from its own buffer raoxu
@ 2026-11-04 14:40 ` Takashi Iwai
0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2026-11-04 14:40 UTC (permalink / raw)
To: raoxu
Cc: perex, tiwai, luiz.von.dentz, brgl, pengpeng, pmenzel,
linux-sound, linux-kernel
On Wed, 04 Nov 2026 09:33:04 +0100,
raoxu wrote:
>
> From: Xu Rao <raoxu@uniontech.com>
>
> The IEC958 Playback PCM Stream control writes pcm_status, but its
> get callback always returns def_status. As a result, userspace
> reads back the default status instead of the PCM stream status after
> writing the stream control. Rate changes also update pcm_status
> without being reflected in the value returned by the control.
>
> Select the status buffer using the same private_value as the put
> callback. The default control continues to return def_status,
> while the PCM stream control now returns its own current status.
>
> Signed-off-by: Xu Rao <raoxu@uniontech.com>
Applied to for-next branch now, as this is no urgent fix.
thanks,
Takashi
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-04 14:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-04 8:33 [PATCH] ALSA: cs8427: read the PCM stream IEC958 status from its own buffer raoxu
2026-11-04 14:40 ` 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®