Drumfix / motu-avb-usb

Linux USB driver for the MOTU AVB series interfaces
GNU General Public License v2.0
66 stars 9 forks source link

Setting vendor=1 doesn't load the snd-motu-avb #1

Open magoostus opened 3 years ago

magoostus commented 3 years ago

it seems that setting "vendor=1" module parameter doesn't load up snd-motu-avb like it should

I've also tried setting the CURL command which the stage-b16 accepts, but it doesn't seem to make a difference

dmesg dump: [Tue May 11 12:47:14 2021] usb 1-1.1: new high-speed USB device number 9 using xhci_hcd [Tue May 11 12:47:14 2021] usb 1-1.1: device descriptor read/64, error -71 [Tue May 11 12:47:14 2021] usb 1-1.1: config 1 interface 6 altsetting 1 has a duplicate endpoint with address 0x9, skipping [Tue May 11 12:47:14 2021] usb 1-1.1: config 1 interface 7 altsetting 1 has a duplicate endpoint with address 0x87, skipping [Tue May 11 12:47:14 2021] usb 1-1.1: New USB device found, idVendor=07fd, idProduct=0005, bcdDevice= 2.00 [Tue May 11 12:47:14 2021] usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [Tue May 11 12:47:14 2021] usb 1-1.1: Product: Stage-B16 [Tue May 11 12:47:14 2021] usb 1-1.1: Manufacturer: MOTU [Tue May 11 12:47:14 2021] usb 1-1.1: SerialNumber: 0001f2fffe003acb [Tue May 11 12:47:14 2021] usb 1-1.1: samplerate = 48000, queue_length = 21, midi = 1, vendor = 1 [Tue May 11 12:47:14 2021] usb 1-1.1: probing interface 1 [Tue May 11 12:47:14 2021] usb 1-1.1: probing interface 2 [Tue May 11 12:47:14 2021] usb 1-1.1: probing interface 5 [Tue May 11 12:47:14 2021] usb 1-1.1: probing interface 4 [Tue May 11 12:47:14 2021] usb 1-1.1: probing interface 6 [Tue May 11 12:47:14 2021] usb 1-1.1: probing interface 7 [Tue May 11 12:47:14 2021] usb 1-1.1: probing interface 3 [Tue May 11 12:47:14 2021] usb 1-1.1: probing interfaces sucessful [Tue May 11 12:47:14 2021] usb 1-1.1: invalid capture endpoint [Tue May 11 12:47:19 2021] usb 1-1.1: clock source 1 is not valid, cannot use (end)

Where as "vendor=0" loads up like this correctly

[Tue May 11 12:51:28 2021] usb 1-1.1: new high-speed USB device number 5 using xhci_hcd [Tue May 11 12:51:28 2021] usb 1-1.1: config 1 interface 6 altsetting 1 has a duplicate endpoint with address 0x9, skipping [Tue May 11 12:51:28 2021] usb 1-1.1: config 1 interface 7 altsetting 1 has a duplicate endpoint with address 0x87, skipping [Tue May 11 12:51:28 2021] usb 1-1.1: New USB device found, idVendor=07fd, idProduct=0005, bcdDevice= 2.00 [Tue May 11 12:51:28 2021] usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [Tue May 11 12:51:28 2021] usb 1-1.1: Product: Stage-B16 [Tue May 11 12:51:28 2021] usb 1-1.1: Manufacturer: MOTU [Tue May 11 12:51:28 2021] usb 1-1.1: SerialNumber: 0001f2fffe003acb [Tue May 11 12:51:28 2021] motu: loading out-of-tree module taints kernel. [Tue May 11 12:51:28 2021] usb 1-1.1: samplerate = 48000, queue_length = 21, midi = 1, vendor = 0 [Tue May 11 12:51:28 2021] usb 1-1.1: probing interface 1 [Tue May 11 12:51:28 2021] usb 1-1.1: probing interface 2 [Tue May 11 12:51:28 2021] usb 1-1.1: probing interface 5 [Tue May 11 12:51:28 2021] usb 1-1.1: probing interface 4 [Tue May 11 12:51:28 2021] usb 1-1.1: probing interface 6 [Tue May 11 12:51:28 2021] usb 1-1.1: probing interface 7 [Tue May 11 12:51:28 2021] usb 1-1.1: probing interface 3 [Tue May 11 12:51:28 2021] usb 1-1.1: probing interfaces sucessful [Tue May 11 12:51:28 2021] usb 1-1.1: max packets capture endpoint 1872 [Tue May 11 12:51:28 2021] usb 1-1.1: max packets playback endpoint 1872 [Tue May 11 12:51:28 2021] usbcore: registered new interface driver snd-motu-avb [Tue May 11 12:51:28 2021] usbcore: registered new interface driver snd-usb-audio [Tue May 11 12:51:28 2021] usb 1-1.1: capture_open [Tue May 11 12:51:29 2021] usb 1-1.1: Motu driver 0.1 [Tue May 11 12:51:30 2021] usb 1-1.1: capture_open [Tue May 11 12:51:30 2021] usb 1-1.1: capture_open [Tue May 11 12:51:30 2021] usb 1-1.1: capture_open [Tue May 11 12:51:30 2021] usb 1-1.1: capture_open [Tue May 11 12:51:30 2021] usb 1-1.1: capture_open [Tue May 11 12:51:30 2021] usb 1-1.1: capture_open [Tue May 11 12:51:30 2021] usb 1-1.1: capture_open [Tue May 11 12:51:30 2021] usb 1-1.1: capture_open [Tue May 11 12:51:30 2021] usb 1-1.1: playback_open [Tue May 11 12:51:30 2021] usb 1-1.1: playback_open [Tue May 11 12:51:30 2021] usb 1-1.1: playback_open [Tue May 11 12:51:30 2021] usb 1-1.1: playback_open [Tue May 11 12:51:30 2021] usb 1-1.1: playback_open [Tue May 11 12:51:30 2021] usb 1-1.1: playback_open [Tue May 11 12:51:30 2021] usb 1-1.1: playback_open [Tue May 11 12:51:30 2021] usb 1-1.1: playback_open [Tue May 11 12:51:30 2021] usb 1-1.1: playback_open [Tue May 11 12:51:30 2021] usb 1-1.1: playback_open [Tue May 11 12:51:30 2021] usb 1-1.1: capture_open [Tue May 11 12:51:30 2021] usb 1-1.1: playback_open [Tue May 11 12:51:30 2021] usb 1-1.1: capture_open (end)

I'm trying this on a raspi4b with kernel 5.11.0-1007-raspi on ubuntu 21.04

Drumfix commented 3 years ago

vendor mode requires a kernel patch that disables the duplicate endpoint nonsense.

Modify in drivers/usb/core/config.c the function config_endpoint_is_duplicate so that it always returns false (just remove everything in that function except the "return false" statement at the end).

You may also want to blacklist the motu in the snd-usb-audio driver.

In sound/usb/card.c modify the function usb_audio_probe:

below:

id = USB_ID(le16_to_cpu(dev->descriptor.idVendor),
            le16_to_cpu(dev->descriptor.idProduct));

add:

    /* blacklist motu */

    if (id == USB_ID(0x07fd, 0x0005))
    return -ENODEV;