From: Julian Scheel <julian@jusst.de>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org, Daniel Mack <daniel@zonque.org>
Subject: Re: [PATCH] ALSA: usb-audio: Recurse before saving terminal properties
Date: Fri, 14 Aug 2015 15:25:12 +0200 [thread overview]
Message-ID: <55CDEC38.7000006@jusst.de> (raw)
In-Reply-To: <s5hr3n6t3wt.wl-tiwai@suse.de>
Am 14.08.2015 um 15:06 schrieb Takashi Iwai:
> On Wed, 12 Aug 2015 22:14:59 +0200,
> Julian Scheel wrote:
>>
>> When the descriptor parser recurses into the clock source descriptor, the
>> terminals properties, like name and type, are set to the values of the clock
>> selector as check_input_term overwrites term->name and others in the recursive
>> call. As we want to only fill missing values using the descriptors higher in
>> the recursion tree the properties taken from the actual descriptor must be
>> applied after recursing.
>>
>> Signed-off-by: Julian Scheel <julian@jusst.de>
>
> Thanks for the patch. I vaguely remember of a similar patch, maybe
> you who already sent.
Hm, I couldn't remember to have sent a similar patch before :)
> One thing I find uncertain is whether this
> breaks the current logic completely, namely:
>
>> @@ -715,15 +715,16 @@ static int check_input_term(struct mixer_build *state, int id,
>> term->name = d->iTerminal;
>> } else { /* UAC_VERSION_2 */
>> struct uac2_input_terminal_descriptor *d = p1;
>> - term->type = le16_to_cpu(d->wTerminalType);
>> - term->channels = d->bNrChannels;
>> - term->chconfig = le32_to_cpu(d->bmChannelConfig);
>> - term->name = d->iTerminal;
>>
>> /* call recursively to get the clock selectors */
>> err = check_input_term(state, d->bCSourceID, term);
>> if (err < 0)
>> return err;
>> +
>> + term->type = le16_to_cpu(d->wTerminalType);
>> + term->channels = d->bNrChannels;
>> + term->chconfig = le32_to_cpu(d->bmChannelConfig);
>> + term->name = d->iTerminal;
>
> ... by this override, essentially all fields except for id are
> restored. Then what's the point to call check_input_term() for the
> clock source?
This is a good point indeed, but due do my understanding the recursion
is not about filling missing information, but about verifying a valid
descriptor. So in case there are broken references in the descriptor it
gets abandoned. I'm happy to be corrected if this understanding is wrong.
When overriding the value in the recursion as it is without this patch
it leads to virtually any control getting the name of the Clock
Selector... I wondered about this on several UAC2 devices (like the XMOS
stuff), before I looked into it.
-Julian
next prev parent reply other threads:[~2015-08-14 13:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-12 20:14 [PATCH] ALSA: usb-audio: Recurse before saving terminal properties Julian Scheel
2015-08-14 13:06 ` Takashi Iwai
2015-08-14 13:25 ` Julian Scheel [this message]
2015-08-16 11:45 ` Daniel Mack
2015-08-17 5:56 ` Julian Scheel
2015-08-17 8:35 ` Julian Scheel
2015-08-18 8:09 ` Daniel Mack
2015-09-06 15:34 ` Johan Aires Rastén
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=55CDEC38.7000006@jusst.de \
--to=julian@jusst.de \
--cc=alsa-devel@alsa-project.org \
--cc=daniel@zonque.org \
--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