From: Takashi Iwai <tiwai@suse.de>
To: Stefan Sauer <ensonic@hora-obscura.de>
Cc: alsa-devel@alsa-project.org
Subject: Re: focusrite scarlett 18i20 : Mixer controls with corrupted names for
Date: Tue, 25 Jun 2019 09:54:08 +0200 [thread overview]
Message-ID: <s5hwohat80v.wl-tiwai@suse.de> (raw)
In-Reply-To: <65ad9ddb-bb67-2dc0-d5f5-e0c518641db2@hora-obscura.de>
On Sat, 22 Jun 2019 22:55:25 +0200,
Stefan Sauer wrote:
>
> So the first 8 controls are added somewhere else. Looks like this is from
> mixer.c and after
> echo -n 'file sound/usb/mixer.c +p' >/sys/kernel/debug/dynamic_debug/control
> I get
> [ 4405.855432] usb 1-2: [51] PU [KKKKKKKKKKKKKÃÃÃÃÃÃÃÃÃÃÃ Switch] ch = 1, val = 0/1
> [ 4405.856423] usb 1-2: [52] PU [ Switch] ch = 1, val = 0/1
This indicates that these weird names come from the two extension
units id 51 and 52.
Could you put some debug print in build_audio_procunit() like below?
thanks,
Takashi
--- a/sound/usb/mixer.c
+++ b/sound/usb/mixer.c
@@ -2358,8 +2358,10 @@ static int build_audio_procunit(struct mixer_build *state, int unitid,
for (info = list; info && info->type; info++)
if (info->type == type)
break;
- if (!info || !info->type)
+ if (!info || !info->type) {
+ pr_info("XXX unit %d to default_info\n", unitid);
info = &default_info;
+ }
for (valinfo = info->values; valinfo->control; valinfo++) {
__u8 *controls = uac_processing_unit_bmControls(desc, state->mixer->protocol);
@@ -2375,8 +2377,11 @@ static int build_audio_procunit(struct mixer_build *state, int unitid,
}
map = find_map(state->map, unitid, valinfo->control);
+ if (map)
+ pr_info("XXX map found for unit %d\n", unitid);
if (check_ignored_ctl(map))
continue;
+
cval = kzalloc(sizeof(*cval), GFP_KERNEL);
if (!cval)
return -ENOMEM;
@@ -2444,19 +2449,26 @@ static int build_audio_procunit(struct mixer_build *state, int unitid,
kctl->private_free = snd_usb_mixer_elem_free;
if (check_mapped_name(map, kctl->id.name, sizeof(kctl->id.name))) {
+ pr_info("XXX name copied from map: '%s' for unit %d\n", kctl->id.name, unitid);
/* nothing */ ;
} else if (info->name) {
strlcpy(kctl->id.name, info->name, sizeof(kctl->id.name));
+ pr_info("XXX name copied from info: '%s' for unit %d\n", kctl->id.name, unitid);
} else {
nameid = uac_processing_unit_iProcessing(desc, state->mixer->protocol);
+ pr_info("XXX nameid=%d, unit %d\n", nameid, unitid);
len = 0;
- if (nameid)
+ if (nameid) {
len = snd_usb_copy_string_desc(state->chip,
nameid,
kctl->id.name,
sizeof(kctl->id.name));
- if (!len)
+ pr_info("XXX copy string desc '%s'\n", kctl->id.name);
+ }
+ if (!len) {
strlcpy(kctl->id.name, name, sizeof(kctl->id.name));
+ pr_info("XXX copy default name '%s'\n", kctl->id.name);
+ }
}
append_ctl_name(kctl, " ");
append_ctl_name(kctl, valinfo->suffix);
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
next prev parent reply other threads:[~2019-06-25 7:54 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-22 20:55 focusrite scarlett 18i20 : Mixer controls with corrupted names for Stefan Sauer
2019-06-22 21:17 ` Stefan Sauer
2019-06-23 11:28 ` Stefan Sauer
2019-06-25 7:54 ` Takashi Iwai [this message]
2019-06-26 20:06 ` Stefan Sauer
2019-06-26 20:13 ` Stefan Sauer
2019-06-26 21:42 ` Takashi Iwai
2019-06-29 12:32 ` Stefan Sauer
2019-06-29 15:31 ` Takashi Iwai
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=s5hwohat80v.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=ensonic@hora-obscura.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