Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Cezary Rojewski <cezary.rojewski@intel.com>
To: Jaroslav Kysela <perex@perex.cz>, <tiwai@suse.com>
Cc: <broonie@kernel.org>, <amade@asmblr.net>,
	<kuninori.morimoto.gx@renesas.com>, <linux-sound@vger.kernel.org>
Subject: Re: [PATCH v6] ALSA: control: Verify put() result when in debug mode
Date: Tue, 24 Feb 2026 16:36:07 +0100	[thread overview]
Message-ID: <f52654e3-c116-4690-8e1f-de01207d9d51@intel.com> (raw)
In-Reply-To: <4f8a3505-8c6a-46bd-ad03-0ceeab4f89b5@perex.cz>

On 2026-02-24 2:21 PM, Jaroslav Kysela wrote:
> On 2/23/26 15:49, Cezary Rojewski wrote:
>> The put() operation is expected to return:
>> 1) 0 on success if no changes were made
>> 2) 1 on success if changes were made
>> 3) error code otherwise
>>
>> Currently 2) is usually ignored when writing control-operations. While
>> forcing compliance is not an option right now, make it easier for
>> developers to adhere to the expectations and notice problems by logging
>> them when CONFIG_SND_CTL_DEBUG is enabled.
>>
>> Due to large size of struct snd_ctl_elem_value, 'value_buf' is provided
>> as a reusable buffer for kctl->put() verification. This prevents
>> exhausting the stack when verifying the operation.
>>
>>> From user perspective, patch introduces a new trace/events category
>> 'snd_ctl' containing a single 'snd_ctl_put' event type. Log sample:
>>
>>    amixer-1107    [002] .....   9.553687: snd_ctl_put: success: 
>> expected=0, actual=0 for ctl numid=1, iface=MIXER, name='Master 
>> Playback Volume', card id=0
>>    amixer-1108    [003] .....   9.498897: snd_ctl_put: success: 
>> expected=1, actual=1 for ctl numid=1, iface=MIXER, name='Master 
>> Playback Volume', card id=0
>>    amixer-1111    [001] .....   9.882768: snd_ctl_put: success: 
>> expected=1, actual=1 for ctl numid=5, iface=MIXER, name='Loopback 
>> Mute', card id=0
>>    amixer-1114    [002] .....   9.212184: snd_ctl_put: fail: 
>> expected=1, actual=0 for ctl numid=5, iface=MIXER, name='Loopback 
>> Mute', card id=0
> 
> Index (and maybe device/subdevice) numbers are missing to get full 
> control identification to follow amixer. Also, "card id" is usually 
> referred to automatically or manually assigned ASCII card identifier/ 
> alias (like USB-audio or PCH). I would just use 'card=<number>' in 
> TP_printk.


If the message length isn't a problem, then I'm going to add all of them 
in v7.

      reply	other threads:[~2026-02-24 15:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-23 14:49 [PATCH v6] ALSA: control: Verify put() result when in debug mode Cezary Rojewski
2026-02-24 12:09 ` Takashi Iwai
2026-02-24 15:46   ` Cezary Rojewski
2026-02-24 15:59     ` Takashi Iwai
2026-02-24 13:21 ` Jaroslav Kysela
2026-02-24 15:36   ` Cezary Rojewski [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f52654e3-c116-4690-8e1f-de01207d9d51@intel.com \
    --to=cezary.rojewski@intel.com \
    --cc=amade@asmblr.net \
    --cc=broonie@kernel.org \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox