All of lore.kernel.org
 help / color / mirror / Atom feed
From: Clemens Ladisch <clemens@ladisch.de>
To: Mark Hills <mark@pogo.org.uk>
Cc: alsa-devel@alsa-project.org, Daniel Mack <zonque@gmail.com>
Subject: Re: usb-audio: Correct way to do a mixer quirk?
Date: Mon, 20 Feb 2012 09:07:59 +0100	[thread overview]
Message-ID: <4F41FF5F.8040409@ladisch.de> (raw)
In-Reply-To: <alpine.LNX.2.01.1202192059040.7408@stax.localdomain>

Mark Hills wrote:
> The Electrix Ebox-44 is a new USB interface, but the MIXER_UNIT descriptor
> is broken and refers to a non-existing unit_id.
>
> I worked around it with the patch below to remove the additional entry,
> and the device seems to work as expected.
>
> But inserting code here is probably not desirable -- I imagine I need to
> turn this into a quirk of some sort. Am I correct?
>
> And what is the best way to do this?
>
> * It doesn't appear I can use quirks-table.h to adjust the content
>   of a mixer unit (the bNrInPins attribute)
>
> * It seems that to use mixer_quirks.c would require a function to
>   create the whole mixer
>
> It's possible I'm incorrect on the above, though. Can anyone advise on how
> to make this fix in the correct way?

I'd suggest to change the code to not abort if a unit doesn't exist.


Regards,
Clemens


> ---
>  AudioControl Interface Descriptor:
>     bLength                15
>     bDescriptorType        36
>     bDescriptorSubtype      4 (MIXER_UNIT)
>     bUnitID                 6
>     bNrInPins               3         <-- should be 2
>     baSourceID( 0)          5
>     baSourceID( 1)          4
>     baSourceID( 2)          2         <-- bogus entry
>
> ---
>  sound/usb/mixer.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
> index 8147ffc..ab3ccca 100644
> --- a/sound/usb/mixer.c
> +++ b/sound/usb/mixer.c
> @@ -1387,6 +1387,9 @@ static int parse_audio_mixer_unit(struct mixer_build *state, int unitid, void *r
>  		return 0;
>  	}
>
> +	if (state->chip->usb_id == USB_ID(0x200c, 0x1018) && unitid == 6)
> +		input_pins = 2;
> +
>  	num_ins = 0;
>  	ich = 0;
>  	for (pin = 0; pin < input_pins; pin++) {

  reply	other threads:[~2012-02-20  8:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-19 21:49 usb-audio: Correct way to do a mixer quirk? Mark Hills
2012-02-20  8:07 ` Clemens Ladisch [this message]
2012-02-20 19:55   ` Mark Hills
2012-02-20 21:40     ` Clemens Ladisch
2012-02-24 12:26       ` Mark Hills
2012-03-09 12:13   ` Mark Hills

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=4F41FF5F.8040409@ladisch.de \
    --to=clemens@ladisch.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=mark@pogo.org.uk \
    --cc=zonque@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.