Re: [PATCH] ALSA: ctxfi: Keep line/mic notification controls per mixer
From: Takashi Iwai
Date: Mon May 18 2026 - 09:50:19 EST
On Mon, 18 May 2026 04:33:49 +0200,
Cássio Gabriel wrote:
>
> ctxfi stores the Line Capture Switch and Mic Capture Switch controls in
> a file-scope kctls[] array so do_line_mic_switch() can notify the
> opposite control when the shared line/mic input selection changes.
>
> That storage is shared by all ctxfi cards. If more than one X-Fi card is
> present, a later card can overwrite the pointers saved by an earlier one.
> A control update on one card can then use another card's kcontrol object
> for snd_ctl_notify(). If that other card is removed, the saved pointer can
> also become stale.
>
> Store those notification targets in struct ct_mixer instead. The mixer is
> per-card state and matches the lifetime of the controls created for that
> card.
>
> Signed-off-by: Cássio Gabriel <cassiogabrielcontato@xxxxxxxxx>
Applied now. Thanks.
Takashi