All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ALSA: usb-audio: Add quirk for Focusrite Scarlett 18i6
@ 2012-11-09  9:20 Martin Schwenke
  2012-11-13  6:33 ` Takashi Iwai
  0 siblings, 1 reply; 6+ messages in thread
From: Martin Schwenke @ 2012-11-09  9:20 UTC (permalink / raw)
  To: alsa-devel

Probing this device currently fails in snd_usb_audio_probe() because
the call to snd_usb_create_mixer() fails.  This is due to unknown or
non-standard interface descriptor subtypes in parse_audio_unit():

  usbaudio: unit 51: unexpected type 0x09
  snd-usb-audio: probe of 1-8:1.0 failed with error -5

Some people are working around this by recompiling usb-audio with the
call to snd_usb_create_mixer() commented out.  It would be nice to
avoid that.

While the best idea would be to look into the mixer creation failure,
a reasonable short-term solution is to use quirks to only probe the
trouble-free interfaces.  This allows audio and MIDI interfaces to be
used without any obvious issues.

Interface 0 is the main one to ignore.  It contains lots of
control-fu, including the unexpected interface descriptor subtypes.
Interface 5 is for firmware updates and I'm not sure how to get
support for this.  Interface 3 is some sort of control interface that
I don't understand:

    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        3
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         1 Audio
      bInterfaceSubClass      1 Control Device
      bInterfaceProtocol      0
      iInterface              0
      AudioControl Interface Descriptor:
        bLength                 9
        bDescriptorType        36
        bDescriptorSubtype      1 (HEADER)
        bcdADC               1.00
        wTotalLength            9
        bInCollection           1
        baInterfaceNr( 0)       1

Signed-off-by: Martin Schwenke <martin@meltin.net>
---
 sound/usb/quirks-table.h |   52
++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52
insertions(+)

diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h
index 88d8ceb..c9dde5f 100644
--- a/sound/usb/quirks-table.h
+++ b/sound/usb/quirks-table.h
@@ -2882,6 +2882,58 @@ YAMAHA_DEVICE(0x7010, "UB99"),
 
 {
 	/*
+	 * Focusrite Scarlett 18i6
+	 *
+	 * Avoid mixer creation, which otherwise fails because some of
+	 * the interface descriptor subtypes for interface 0 are
+	 * unknown.  That should be fixed or worked-around but this at
+	 * least allows the device to be used successfully with a DAW
+	 * and an external mixer.  See comments below about other
+	 * ignored interfaces.
+	 */
+	USB_DEVICE(0x1235, 0x8004),
+	.driver_info = (unsigned long) & (const struct
snd_usb_audio_quirk) {
+		.vendor_name = "Focusrite",
+		.product_name = "Scarlett 18i6",
+		.ifnum = QUIRK_ANY_INTERFACE,
+		.type = QUIRK_COMPOSITE,
+		.data = & (const struct snd_usb_audio_quirk[]) {
+			{
+				/* InterfaceSubClass 1 (Control
Device) */
+				.ifnum = 0,
+				.type = QUIRK_IGNORE_INTERFACE
+			},
+			{
+				.ifnum = 1,
+				.type = QUIRK_AUDIO_STANDARD_INTERFACE
+			},
+			{
+				.ifnum = 2,
+				.type = QUIRK_AUDIO_STANDARD_INTERFACE
+			},
+			{
+				/* InterfaceSubClass 1 (Control
Device) */
+				.ifnum = 3,
+				.type = QUIRK_IGNORE_INTERFACE
+			},
+			{
+				.ifnum = 4,
+				.type = QUIRK_MIDI_STANDARD_INTERFACE
+			},
+			{
+				/* InterfaceSubClass 1 (Device
Firmware Update) */
+				.ifnum = 5,
+				.type = QUIRK_IGNORE_INTERFACE
+			},
+			{
+				.ifnum = -1
+			}
+		}
+	}
+},
+
+{
+	/*
 	 * Some USB MIDI devices don't have an audio control interface,
 	 * so we have to grab MIDI streaming interfaces here.
 	 */
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] ALSA: usb-audio: Add quirk for Focusrite Scarlett 18i6
  2012-11-09  9:20 [PATCH] ALSA: usb-audio: Add quirk for Focusrite Scarlett 18i6 Martin Schwenke
@ 2012-11-13  6:33 ` Takashi Iwai
  2012-11-13  8:38   ` Martin Schwenke
  0 siblings, 1 reply; 6+ messages in thread
From: Takashi Iwai @ 2012-11-13  6:33 UTC (permalink / raw)
  To: Martin Schwenke; +Cc: alsa-devel

At Fri, 9 Nov 2012 20:20:23 +1100,
Martin Schwenke wrote:
> 
> Probing this device currently fails in snd_usb_audio_probe() because
> the call to snd_usb_create_mixer() fails.  This is due to unknown or
> non-standard interface descriptor subtypes in parse_audio_unit():
> 
>   usbaudio: unit 51: unexpected type 0x09
>   snd-usb-audio: probe of 1-8:1.0 failed with error -5
> 
> Some people are working around this by recompiling usb-audio with the
> call to snd_usb_create_mixer() commented out.  It would be nice to
> avoid that.
> 
> While the best idea would be to look into the mixer creation failure,
> a reasonable short-term solution is to use quirks to only probe the
> trouble-free interfaces.  This allows audio and MIDI interfaces to be
> used without any obvious issues.
> 
> Interface 0 is the main one to ignore.  It contains lots of
> control-fu, including the unexpected interface descriptor subtypes.
> Interface 5 is for firmware updates and I'm not sure how to get
> support for this.  Interface 3 is some sort of control interface that
> I don't understand:
> 
>     Interface Descriptor:
>       bLength                 9
>       bDescriptorType         4
>       bInterfaceNumber        3
>       bAlternateSetting       0
>       bNumEndpoints           0
>       bInterfaceClass         1 Audio
>       bInterfaceSubClass      1 Control Device
>       bInterfaceProtocol      0
>       iInterface              0
>       AudioControl Interface Descriptor:
>         bLength                 9
>         bDescriptorType        36
>         bDescriptorSubtype      1 (HEADER)
>         bcdADC               1.00
>         wTotalLength            9
>         bInCollection           1
>         baInterfaceNr( 0)       1
> 
> Signed-off-by: Martin Schwenke <martin@meltin.net>

Unfortunately your MUA broke lines so the patch cannot be applied
cleanly.  Please fix your MUA setup and resend, or use an attachment
if it doesn't work.


thanks,

Takashi

> ---
>  sound/usb/quirks-table.h |   52
> ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52
> insertions(+)
> 
> diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h
> index 88d8ceb..c9dde5f 100644
> --- a/sound/usb/quirks-table.h
> +++ b/sound/usb/quirks-table.h
> @@ -2882,6 +2882,58 @@ YAMAHA_DEVICE(0x7010, "UB99"),
>  
>  {
>  	/*
> +	 * Focusrite Scarlett 18i6
> +	 *
> +	 * Avoid mixer creation, which otherwise fails because some of
> +	 * the interface descriptor subtypes for interface 0 are
> +	 * unknown.  That should be fixed or worked-around but this at
> +	 * least allows the device to be used successfully with a DAW
> +	 * and an external mixer.  See comments below about other
> +	 * ignored interfaces.
> +	 */
> +	USB_DEVICE(0x1235, 0x8004),
> +	.driver_info = (unsigned long) & (const struct
> snd_usb_audio_quirk) {
> +		.vendor_name = "Focusrite",
> +		.product_name = "Scarlett 18i6",
> +		.ifnum = QUIRK_ANY_INTERFACE,
> +		.type = QUIRK_COMPOSITE,
> +		.data = & (const struct snd_usb_audio_quirk[]) {
> +			{
> +				/* InterfaceSubClass 1 (Control
> Device) */
> +				.ifnum = 0,
> +				.type = QUIRK_IGNORE_INTERFACE
> +			},
> +			{
> +				.ifnum = 1,
> +				.type = QUIRK_AUDIO_STANDARD_INTERFACE
> +			},
> +			{
> +				.ifnum = 2,
> +				.type = QUIRK_AUDIO_STANDARD_INTERFACE
> +			},
> +			{
> +				/* InterfaceSubClass 1 (Control
> Device) */
> +				.ifnum = 3,
> +				.type = QUIRK_IGNORE_INTERFACE
> +			},
> +			{
> +				.ifnum = 4,
> +				.type = QUIRK_MIDI_STANDARD_INTERFACE
> +			},
> +			{
> +				/* InterfaceSubClass 1 (Device
> Firmware Update) */
> +				.ifnum = 5,
> +				.type = QUIRK_IGNORE_INTERFACE
> +			},
> +			{
> +				.ifnum = -1
> +			}
> +		}
> +	}
> +},
> +
> +{
> +	/*
>  	 * Some USB MIDI devices don't have an audio control interface,
>  	 * so we have to grab MIDI streaming interfaces here.
>  	 */
> -- 
> 1.7.10.4
> 
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ALSA: usb-audio: Add quirk for Focusrite Scarlett 18i6
  2012-11-13  6:33 ` Takashi Iwai
@ 2012-11-13  8:38   ` Martin Schwenke
  2012-11-13  8:59     ` Takashi Iwai
  0 siblings, 1 reply; 6+ messages in thread
From: Martin Schwenke @ 2012-11-13  8:38 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel

On Tue, 13 Nov 2012 07:33:33 +0100, Takashi Iwai <tiwai@suse.de> wrote:

> Unfortunately your MUA broke lines so the patch cannot be applied
> cleanly.  Please fix your MUA setup and resend, or use an attachment
> if it doesn't work.

Sorry, that's irritating!  Is this better?

peace & happiness,
martin

p.s. I can't see another way of adding a comment like this above the
patch, other than the scissors thing that is processed by "git am -c".
Sorry, I don't know how standard this is...

--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--
Probing this device currently fails in snd_usb_audio_probe() because
the call to snd_usb_create_mixer() fails.  This is due to unknown or
non-standard interface descriptor subtypes in parse_audio_unit():

  usbaudio: unit 51: unexpected type 0x09
  snd-usb-audio: probe of 1-8:1.0 failed with error -5

Some people are working around this by recompiling usb-audio with the
call to snd_usb_create_mixer() commented out.  It would be nice to
avoid that.

While the best idea would be to look into the mixer creation failure,
a reasonable short-term solution is to use quirks to only probe the
trouble-free interfaces.  This allows audio and MIDI interfaces to be
used without any obvious issues.

Interface 0 is the main one to ignore.  It contains lots of
control-fu, including the unexpected interface descriptor subtypes.
Interface 5 is for firmware updates and I'm not sure how to get
support for this.  Interface 3 is some sort of control interface that
I don't understand:

    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        3
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         1 Audio
      bInterfaceSubClass      1 Control Device
      bInterfaceProtocol      0
      iInterface              0
      AudioControl Interface Descriptor:
        bLength                 9
        bDescriptorType        36
        bDescriptorSubtype      1 (HEADER)
        bcdADC               1.00
        wTotalLength            9
        bInCollection           1
        baInterfaceNr( 0)       1

Signed-off-by: Martin Schwenke <martin@meltin.net>
---
 sound/usb/quirks-table.h |   52 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)

diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h
index 88d8ceb..c9dde5f 100644
--- a/sound/usb/quirks-table.h
+++ b/sound/usb/quirks-table.h
@@ -2882,6 +2882,58 @@ YAMAHA_DEVICE(0x7010, "UB99"),
 
 {
 	/*
+	 * Focusrite Scarlett 18i6
+	 *
+	 * Avoid mixer creation, which otherwise fails because some of
+	 * the interface descriptor subtypes for interface 0 are
+	 * unknown.  That should be fixed or worked-around but this at
+	 * least allows the device to be used successfully with a DAW
+	 * and an external mixer.  See comments below about other
+	 * ignored interfaces.
+	 */
+	USB_DEVICE(0x1235, 0x8004),
+	.driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
+		.vendor_name = "Focusrite",
+		.product_name = "Scarlett 18i6",
+		.ifnum = QUIRK_ANY_INTERFACE,
+		.type = QUIRK_COMPOSITE,
+		.data = & (const struct snd_usb_audio_quirk[]) {
+			{
+				/* InterfaceSubClass 1 (Control Device) */
+				.ifnum = 0,
+				.type = QUIRK_IGNORE_INTERFACE
+			},
+			{
+				.ifnum = 1,
+				.type = QUIRK_AUDIO_STANDARD_INTERFACE
+			},
+			{
+				.ifnum = 2,
+				.type = QUIRK_AUDIO_STANDARD_INTERFACE
+			},
+			{
+				/* InterfaceSubClass 1 (Control Device) */
+				.ifnum = 3,
+				.type = QUIRK_IGNORE_INTERFACE
+			},
+			{
+				.ifnum = 4,
+				.type = QUIRK_MIDI_STANDARD_INTERFACE
+			},
+			{
+				/* InterfaceSubClass 1 (Device Firmware Update) */
+				.ifnum = 5,
+				.type = QUIRK_IGNORE_INTERFACE
+			},
+			{
+				.ifnum = -1
+			}
+		}
+	}
+},
+
+{
+	/*
 	 * Some USB MIDI devices don't have an audio control interface,
 	 * so we have to grab MIDI streaming interfaces here.
 	 */
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] ALSA: usb-audio: Add quirk for Focusrite Scarlett 18i6
  2012-11-13  8:38   ` Martin Schwenke
@ 2012-11-13  8:59     ` Takashi Iwai
  2012-12-29  9:10       ` Grant Diffey
  0 siblings, 1 reply; 6+ messages in thread
From: Takashi Iwai @ 2012-11-13  8:59 UTC (permalink / raw)
  To: Martin Schwenke; +Cc: alsa-devel

At Tue, 13 Nov 2012 19:38:03 +1100,
Martin Schwenke wrote:
> 
> On Tue, 13 Nov 2012 07:33:33 +0100, Takashi Iwai <tiwai@suse.de> wrote:
> 
> > Unfortunately your MUA broke lines so the patch cannot be applied
> > cleanly.  Please fix your MUA setup and resend, or use an attachment
> > if it doesn't work.
> 
> Sorry, that's irritating!  Is this better?
> 
> peace & happiness,
> martin
> 
> p.s. I can't see another way of adding a comment like this above the
> patch, other than the scissors thing that is processed by "git am -c".
> Sorry, I don't know how standard this is...

No problem, I applied the patch now.

Thanks.


Takashi

> 
> --8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--
> Probing this device currently fails in snd_usb_audio_probe() because
> the call to snd_usb_create_mixer() fails.  This is due to unknown or
> non-standard interface descriptor subtypes in parse_audio_unit():
> 
>   usbaudio: unit 51: unexpected type 0x09
>   snd-usb-audio: probe of 1-8:1.0 failed with error -5
> 
> Some people are working around this by recompiling usb-audio with the
> call to snd_usb_create_mixer() commented out.  It would be nice to
> avoid that.
> 
> While the best idea would be to look into the mixer creation failure,
> a reasonable short-term solution is to use quirks to only probe the
> trouble-free interfaces.  This allows audio and MIDI interfaces to be
> used without any obvious issues.
> 
> Interface 0 is the main one to ignore.  It contains lots of
> control-fu, including the unexpected interface descriptor subtypes.
> Interface 5 is for firmware updates and I'm not sure how to get
> support for this.  Interface 3 is some sort of control interface that
> I don't understand:
> 
>     Interface Descriptor:
>       bLength                 9
>       bDescriptorType         4
>       bInterfaceNumber        3
>       bAlternateSetting       0
>       bNumEndpoints           0
>       bInterfaceClass         1 Audio
>       bInterfaceSubClass      1 Control Device
>       bInterfaceProtocol      0
>       iInterface              0
>       AudioControl Interface Descriptor:
>         bLength                 9
>         bDescriptorType        36
>         bDescriptorSubtype      1 (HEADER)
>         bcdADC               1.00
>         wTotalLength            9
>         bInCollection           1
>         baInterfaceNr( 0)       1
> 
> Signed-off-by: Martin Schwenke <martin@meltin.net>
> ---
>  sound/usb/quirks-table.h |   52 ++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 52 insertions(+)
> 
> diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h
> index 88d8ceb..c9dde5f 100644
> --- a/sound/usb/quirks-table.h
> +++ b/sound/usb/quirks-table.h
> @@ -2882,6 +2882,58 @@ YAMAHA_DEVICE(0x7010, "UB99"),
>  
>  {
>  	/*
> +	 * Focusrite Scarlett 18i6
> +	 *
> +	 * Avoid mixer creation, which otherwise fails because some of
> +	 * the interface descriptor subtypes for interface 0 are
> +	 * unknown.  That should be fixed or worked-around but this at
> +	 * least allows the device to be used successfully with a DAW
> +	 * and an external mixer.  See comments below about other
> +	 * ignored interfaces.
> +	 */
> +	USB_DEVICE(0x1235, 0x8004),
> +	.driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
> +		.vendor_name = "Focusrite",
> +		.product_name = "Scarlett 18i6",
> +		.ifnum = QUIRK_ANY_INTERFACE,
> +		.type = QUIRK_COMPOSITE,
> +		.data = & (const struct snd_usb_audio_quirk[]) {
> +			{
> +				/* InterfaceSubClass 1 (Control Device) */
> +				.ifnum = 0,
> +				.type = QUIRK_IGNORE_INTERFACE
> +			},
> +			{
> +				.ifnum = 1,
> +				.type = QUIRK_AUDIO_STANDARD_INTERFACE
> +			},
> +			{
> +				.ifnum = 2,
> +				.type = QUIRK_AUDIO_STANDARD_INTERFACE
> +			},
> +			{
> +				/* InterfaceSubClass 1 (Control Device) */
> +				.ifnum = 3,
> +				.type = QUIRK_IGNORE_INTERFACE
> +			},
> +			{
> +				.ifnum = 4,
> +				.type = QUIRK_MIDI_STANDARD_INTERFACE
> +			},
> +			{
> +				/* InterfaceSubClass 1 (Device Firmware Update) */
> +				.ifnum = 5,
> +				.type = QUIRK_IGNORE_INTERFACE
> +			},
> +			{
> +				.ifnum = -1
> +			}
> +		}
> +	}
> +},
> +
> +{
> +	/*
>  	 * Some USB MIDI devices don't have an audio control interface,
>  	 * so we have to grab MIDI streaming interfaces here.
>  	 */
> -- 
> 1.7.10.4
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ALSA: usb-audio: Add quirk for Focusrite Scarlett 18i6
  2012-11-13  8:59     ` Takashi Iwai
@ 2012-12-29  9:10       ` Grant Diffey
  2012-12-29 12:38         ` Clemens Ladisch
  0 siblings, 1 reply; 6+ messages in thread
From: Grant Diffey @ 2012-12-29  9:10 UTC (permalink / raw)
  To: Takashi Iwai
  Cc: ALSA development, Clemens Ladisch, Martin Schwenke, Daniel Mack

Hi everyone,

Last week on #alsa  I found yet another person who's having problems with
snd-usb-audio not supporting UAC2 Feature units.  Worse still the relevant
part of the descriptor is incomplete according to lsusb so while the device
is in the main compliant the feature unit has a descriptor that lsusb
thinks is too short and I suspect isn't compliant (so even if we were
trying to parse feature units it'd blow up here)

      AudioControl Interface Descriptor:        bLength
16        bDescriptorType        36        bDescriptorSubtype      9
(EXTENSION_UNIT)      Warning: Descriptor too short        bUnitID
           51        wExtensionCode          0        bNrPins
       1        baSourceID( 0)          2        bNrChannels
  4        wChannelConfig          0        iChannelNames           3
       bmControls        0x00        iExtension             26


(a full lsusb -v is here: http://pastebin.ubuntu.com/1451668/)
So while we could submit another quirk for this to ignore the mixer for
now. and this would probably make the device "work"  without access to the
feature unit is it sensible? (we verified that modifying martin's quirk
above (just changing vid:pid) was enough to make the device "work")

Note also this is the problem for the eleven rack as discussed in April
http://mailman.alsa-project.org/pipermail/alsa-devel/2012-April/050899.html

How difficult would it be to have the mixer/control code just "skip"
feature units rather than the current failure mode? or default to ignore
the interface if the control parser fails but continue to remaining
interfaces?  I've tried understanding this code. but my C foo is lacking.

Grant.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ALSA: usb-audio: Add quirk for Focusrite Scarlett 18i6
  2012-12-29  9:10       ` Grant Diffey
@ 2012-12-29 12:38         ` Clemens Ladisch
  0 siblings, 0 replies; 6+ messages in thread
From: Clemens Ladisch @ 2012-12-29 12:38 UTC (permalink / raw)
  To: Grant Diffey, Takashi Iwai; +Cc: ALSA development, Martin Schwenke, Daniel Mack

Grant Diffey wrote:
>Last week on #alsa  I found yet another person who's having
>problems with snd-usb-audio not supporting UAC2 Feature units.

This is an extension unit. The driver not handling it is yet another bug.

>Worse still the relevant part of the descriptor is incomplete according to
>lsusb

lsusb might be as error-free as snd-usb-audio, and in any case an
incomplete descriptor for some random mixer control should be no
reason to refuse working with the device altogether.

>So while we could submit another quirk for this to ignore the mixer for
>now. and this would probably make the device "work"  without access to
>the feature unit is it sensible?

The sensible thing to do is to review the entire new descriptor parsing
code to remove all invalid and overzealous error cases.


Regards,
Clemens

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-12-29 12:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-09  9:20 [PATCH] ALSA: usb-audio: Add quirk for Focusrite Scarlett 18i6 Martin Schwenke
2012-11-13  6:33 ` Takashi Iwai
2012-11-13  8:38   ` Martin Schwenke
2012-11-13  8:59     ` Takashi Iwai
2012-12-29  9:10       ` Grant Diffey
2012-12-29 12:38         ` Clemens Ladisch

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.