[alsa-devel] motu microbook iic
Alexander Tsoy
alexander at tsoy.me
Wed Feb 26 03:27:55 CET 2020
В Ср, 07/08/2019 в 19:30 +0200, thomas rost пишет:
> Hello,
>
> can anybody help me get the 'class compliant' motu microbook iic to
> run?
>
> this is my alsa-info.sh output:
>
> http://alsa-project.org/db/?f=0fd9a8df7bae3400d83b6af8b75c45aa0760d84d
>
> thanks in advance.
>
> thomas
Hello, Thomas!
Could you test the patch below? It should apply cleanly on 5.4.22 and
newer.
There are still issues with usb descriptors and clock validity checks,
so the card is quite noisy in the kernel logs.
diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c
index bd258f1ec2dd..04ccc7d80671 100644
--- a/sound/usb/pcm.c
+++ b/sound/usb/pcm.c
@@ -358,9 +358,13 @@ static int set_sync_ep_implicit_fb_quirk(struct snd_usb_substream *subs,
ifnum = 1;
goto add_sync_ep_from_ifnum;
case USB_ID(0x07fd, 0x0004): /* MOTU MicroBook II */
- ep = 0x84;
- ifnum = 0;
- goto add_sync_ep_from_ifnum;
+ if (altsd->bInterfaceClass == USB_CLASS_VENDOR_SPEC) {
+ ep = 0x84;
+ ifnum = 0;
+ goto add_sync_ep_from_ifnum;
+ }
+ /* else MicroBook IIc */
+ return 0;
case USB_ID(0x07fd, 0x0008): /* MOTU M Series */
ep = 0x81;
ifnum = 2;
diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h
index d187aa6d50db..1c8719292eee 100644
--- a/sound/usb/quirks-table.h
+++ b/sound/usb/quirks-table.h
@@ -3472,7 +3472,7 @@ AU0828_DEVICE(0x2040, 0x7270, "Hauppauge", "HVR-950Q"),
},
/* MOTU Microbook II */
{
- USB_DEVICE(0x07fd, 0x0004),
+ USB_DEVICE_VENDOR_SPEC(0x07fd, 0x0004),
.driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) {
.vendor_name = "MOTU",
.product_name = "MicroBookII",
diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c
index 7f558f4b4520..369e5163e9c9 100644
--- a/sound/usb/quirks.c
+++ b/sound/usb/quirks.c
@@ -1113,6 +1113,12 @@ static int snd_usb_motu_microbookii_boot_quirk(struct usb_device *dev)
return err;
}
+static int snd_usb_motu_microbookiic_boot_quirk(struct usb_device *dev)
+{
+ msleep(3000);
+ return 0;
+}
+
static int snd_usb_motu_m_series_boot_quirk(struct usb_device *dev)
{
int ret;
@@ -1316,7 +1322,11 @@ int snd_usb_apply_boot_quirk(struct usb_device *dev,
case USB_ID(0x2466, 0x8010): /* Fractal Audio Axe-Fx 3 */
return snd_usb_axefx3_boot_quirk(dev);
case USB_ID(0x07fd, 0x0004): /* MOTU MicroBook II */
- return snd_usb_motu_microbookii_boot_quirk(dev);
+ if (get_iface_desc(intf->altsetting)->bInterfaceClass ==
+ USB_CLASS_VENDOR_SPEC &&
+ get_iface_desc(intf->altsetting)->bInterfaceNumber < 3)
+ return snd_usb_motu_microbookii_boot_quirk(dev);
+ break;
}
return 0;
@@ -1328,6 +1338,11 @@ int snd_usb_apply_boot_quirk_once(struct usb_device *dev,
unsigned int id)
{
switch (id) {
+ case USB_ID(0x07fd, 0x0004): /* MOTU MicroBook IIc */
+ if (get_iface_desc(intf->altsetting)->bInterfaceClass ==
+ USB_CLASS_AUDIO)
+ return snd_usb_motu_microbookiic_boot_quirk(dev);
+ break;
case USB_ID(0x07fd, 0x0008): /* MOTU M Series */
return snd_usb_motu_m_series_boot_quirk(dev);
}
@@ -1754,5 +1769,12 @@ void snd_usb_audioformat_attributes_quirk(struct snd_usb_audio *chip,
else
fp->ep_attr |= USB_ENDPOINT_SYNC_SYNC;
break;
+ case USB_ID(0x07fd, 0x0004): /* MOTU MicroBook IIc */
+ /*
+ * Due to an error in descriptors this card produces only
+ * noise on sample rates other than 96KHz
+ */
+ fp->attributes &= ~UAC_EP_CS_ATTR_FILL_MAX;
+ break;
}
}
More information about the Alsa-devel
mailing list