vampirefrog / motu

MOTU midi express 128 linux driver
GNU General Public License v3.0
13 stars 4 forks source link

micro lite confirmed working Ubuntu 20.04 #2

Closed bufu9k closed 9 months ago

bufu9k commented 2 years ago

Bitwig 4.1.6. ALSA via Jack.

Latency is actually considerably faster than windows.

Haven't tested other programs, but I assume they will work. Sending MIDI information over the nonexistent 6th, 7th and 8th ports on the device results in outputs of 3-4 random ports.

Not that it really matters since it's just MIDI but I can also confirm it works with a Roland JX-8P, Roland MC-303, KORG MS2000B, Meeblip Geode, and a Polyend Tracker. Also works through a powered USB 3.0 hub into a 3.1 port.

I have not encountered the kernel panic, but it's only been a day.

Thank you so much for this. This was the final device I struggled to get working on my Linux machine. Truly a gift, you're a blessing <3

vampirefrog commented 2 years ago

That's good to hear, man!

vampirefrog commented 2 years ago

Not sure when I'll have time to do another debug session to fix the kernel panic, but I remember reproducing it when I had a Roland keyboard plugged into an USB port and Reaper running inside the test VM and it would reproduce quite consistently.

If latency is better it's due to ALSA being kernel level, probably, nothing to do with my driver, but that's good to hear.

Could you please paste the output of

lsusb -v -d 07fd:0001

and maybe I can figure out how to limit it to 5 ports for the micro lite.

bufu9k commented 2 years ago

Let me preface this by saying aside from tinkering in SuperCollider, I am not a developer at ALL, so sorry if I'm a bit oblivious to something.

I was able to replicate the kernel panic in the latest version of Reaper by sending MIDI simultaneously on all five outputs, then did the same process in Bitwig and it also resulted in a kernel panic.

Tried sending MIDI to only one output at a time, all outputs work.

I then tried 3 and 4 at once. Worked.

3, 4 and 5 caused a panic.

then tried 1, 2 and 3. No panic. Then 1, 2, 3 and 4. No panic.

Then obviously, just for good measure, tried all outputs again, and got a panic.

I'm guessing it has something to do with how outputs 3 and 5 interact.

I have not tried the midi inputs at all. I also don't have any Roland USB devices, so I can't test that part, but I'm guessing it doesn't have anything to do with it. This is also on real hardware, not a VM. Don't know if that matters. i5-7200u, 12gb 2133, 1tb hdd.

$ lsusb -v -d 07fd:0001

Bus 001 Device 010: ID 07fd:0001 Mark of the Unicorn MIDI Interface
Couldn't open device, some information will be missing
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.00
  bDeviceClass          255 Vendor Specific Class
  bDeviceSubClass         3 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x07fd Mark of the Unicorn
  idProduct          0x0001 MIDI Interface
  bcdDevice            0.51
  iManufacturer           1 
  iProduct                2 
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x006b
    bNumInterfaces          2
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      3 
      bInterfaceProtocol    255 
      iInterface              0 
      ** UNRECOGNIZED:  0b 24 01 01 05 00 02 05 00 01 00
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      3 
      bInterfaceProtocol    255 
      iInterface              0 
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       1
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      3 
      bInterfaceProtocol    255 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0020  1x 32 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0020  1x 32 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       2
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      3 
      bInterfaceProtocol    255 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0020  1x 32 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0020  1x 32 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       3
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      3 
      bInterfaceProtocol    255 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0020  1x 32 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0020  1x 32 bytes
        bInterval               1
bufu9k commented 2 years ago

Actually, ignore all of that. I am able to get panics on any pair (or more) of ports if I just bang on the keyboard super fast and send a ton of information (note on/off, velocity, aftertouch + transport) through both ports at the same time.

I can’t get it to happen when it’s just any one output.

Sorry if that’s not much help :(

vampirefrog commented 2 years ago

No, this is great, thanks. It narrows it down a lot, you did a better job than me lol.

vampirefrog commented 2 years ago

Looks like I've already found a way to get the number of ports, on the left is the micro lite and on the right is the midi express 128:

image

lost-bit0 commented 2 years ago

I my version of the driver i read out the clear-name of the device and decide how many ports really exist ;-)

After a lot of tests on micro-lite, i ran in a panic. I created heavy load on each output-channel, and sometimes (very rare) it happens. I will debug this in the next days. I think it is also a matter of cpu-power. Next try is on a much smaller machine.

lost-bit0 commented 2 years ago

After further investigations i was missing some kind of locking. Five input streams in one output :-O I added a spinlock and now i do not have any panic after a whole day of excessive testing parallel output streams. This version is not committed yet. When testing this i found another problem using the "express"-device. Using multiple output-channels in parallel i have some command-loss. The "lite" works fine. This will be fixed next.

vampirefrog commented 2 years ago

Thanks, I really appreciate it, do you also have a midi express 128? Is that what you're referring to?

lost-bit0 commented 2 years ago

No, i own only the small interfaces (micro lite and micro express) and have no access to the "big" ones. It would be nice, if somebody make some tests with the 19" versions. I hope to have some time to work on it again in the next days.

lost-bit0 commented 2 years ago

Hi,

now i found some time to get things working. Input does not produce kernel-oops anymore. (in my test-sceanrio ;-) The output of the micro-express is now correct under heavy load on each channel.

The 128 and XT are still untested.

vampirefrog commented 9 months ago

Thanks for the hard work, marking this issue as closed!