Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Cezary Rojewski <cezary.rojewski@intel.com>
To: Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.de>
Cc: <tiwai@suse.com>, <broonie@kernel.org>, <amade@asmblr.net>,
	<linux-sound@vger.kernel.org>, <kuninori.morimoto.gx@renesas.com>
Subject: Re: [PATCH v3] ALSA: control: Verify put() result when in debug mode
Date: Mon, 9 Feb 2026 22:05:37 +0100	[thread overview]
Message-ID: <36ce60fe-4ca6-4f8d-b261-f2f0d49a64c6@intel.com> (raw)
In-Reply-To: <816aa887-087d-4ed2-a6d1-68f78e99e568@perex.cz>

On 2026-02-09 4:14 PM, Jaroslav Kysela wrote:
> On 2/9/26 15:43, Cezary Rojewski wrote:
>> On 2026-02-06 1:28 PM, Takashi Iwai wrote:
>>> On Fri, 06 Feb 2026 12:32:50 +0100,
>>> 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

...

>>> Also, this message doesn't show any relevant information about which
>>> card, device and which control caused the error, and that makes
>>> debugging harder.  Put some prefix to identify the problematic
>>> control.
>>
>> Quick peak to what I'm currently logging - output from 'cat trace':
>>
> 
> ...
> 
>           amixer-1185    [003] .....   144.007205: snd_ctl_put_fail:
>> expected=1, actual=0 for ctl "Loopback Mute" of numid=5 from
>> dev="bdw_rt286", card="broadwell-rt286"
>>
>>
>> The format for trace_snd_ctl_put event class:
>>
>>           TP_printk("expected=%d, actual=%d for ctl \"%s\" of numid=%d
>> from dev=\"%s\", card=\"%s\"\n",
>>                     __entry->expected, __entry->actual,
>>                     __get_str(kname), __entry->numid,
>>                     __get_str(dname), __get_str(cname))
>>
>>
>> kname = kctl->id.name
>> dname = dev_name(card->dev)
>> cname = shortname or longname, shortname prio
> 
> I would trace just card number (the driver/names can be obtained with 
> other tools), but add control index and control interface number. See 
> 'amixer controls' output for hints.

I like the idea of aligning closer to the output of ALSA's standard 
apps. For the rest of reviewers, pasting exemplary output from my test 
device:

	test@BDW-I2S-1:~$ amixer -c0 controls
	numid=12,iface=CARD,name='Headphone Jack'
	numid=11,iface=CARD,name='Mic Jack'
	numid=1,iface=MIXER,name='Master Playback Volume'
	(and the list goes on)

Not sure about "but add control index" part though. I'm already dumping 
kctl->id.numid and, kctl->id.index is nowhere to be found in 'amixer -c0 
controls'. At least not on my end.

Example after the change:

	snd_ctl_put_fail: expected=1, actual=0 for ctl numid=5, iface=MIXER, 
name="Loopback Mute", card id=0

Looks good?


      reply	other threads:[~2026-02-09 21:05 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-06 11:32 [PATCH v3] ALSA: control: Verify put() result when in debug mode Cezary Rojewski
2026-02-06 12:28 ` Takashi Iwai
2026-02-06 14:08   ` Mark Brown
2026-02-06 14:33     ` Takashi Iwai
2026-02-06 14:44       ` Mark Brown
2026-02-06 17:34         ` Cezary Rojewski
2026-02-06 17:45   ` Cezary Rojewski
2026-02-06 17:57     ` Mark Brown
2026-02-09 14:43   ` Cezary Rojewski
2026-02-09 15:14     ` Jaroslav Kysela
2026-02-09 21:05       ` 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=36ce60fe-4ca6-4f8d-b261-f2f0d49a64c6@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 \
    --cc=tiwai@suse.de \
    /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