You are not logged in.

#1 2019-04-12 19:15:11

zazzy
Member
Registered: 2018-07-22
Posts: 3

USB MIDI from Android Phone, alsaseq doesn't create ports

Hello!

I'm having an issue with my Pixel 2 sending MIDI to my laptop, running Arch (kernel 5.0.7-arch1-1-ARCH) with Gnome. The phone should create a MIDI port when it enters USB MIDI mode, but nothing is listed in aconnect -l aside from the default System and MIDI through port

lsusb -t

shows that it's using the snd-usb-audio driver, which should include a MIDI driver if I understand correctly

/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/6p, 5000M
    |__ Port 2: Dev 4, If 0, Class=Audio, Driver=snd-usb-audio, 5000M
    |__ Port 2: Dev 4, If 1, Class=Audio, Driver=snd-usb-audio, 5000M
    |__ Port 2: Dev 4, If 2, Class=Vendor Specific Class, Driver=, 5000M

I've also tested this on an Ubuntu 18.10 live USB with identical results, and on a Macbook Pro 11,4 which recognizes the MIDI interface and works fine.

Here's what popped out to me from the output of

sudo lsusb -d 0944:010f -v

for a working USB MIDI device (Korg NanoKontrol) compared to my Pixel 2:

The only meaningful difference I can see is that the NanoKontrol interface has 1 interface described below

Interface Descriptor:
        bLength                 9
        bDescriptorType         4
        bInterfaceNumber        0
        bAlternateSetting       0
        bNumEndpoints           2
        bInterfaceClass         1 Audio
        bInterfaceSubClass      3 MIDI Streaming
        bInterfaceProtocol      0 
        iInterface              0 
        MIDIStreaming Interface Descriptor:
          bLength                 7
          bDescriptorType        36
....

While the Pixel 2 has two interfaces

Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         1 Audio
      bInterfaceSubClass      1 Control Device
      bInterfaceProtocol      0 
      iInterface              5 MIDI function
      AudioControl Interface Descriptor:
        bLength                 9
        bDescriptorType        36
        bDescriptorSubtype      1 (HEADER)
        bcdADC               1.00
        wTotalLength       0x0009
        bInCollection           1
        baInterfaceNr(0)        1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         1 Audio
      bInterfaceSubClass      3 MIDI Streaming
      bInterfaceProtocol      0 
      iInterface              0 
      MIDIStreaming Interface Descriptor:
        bLength                 7
        bDescriptorType        36
.....

I'm thinking that I'd need to rewrite the device descriptor somehow, or maybe this is a kernel module level issue. Any pointers in the right direction are much appreciated.

Full outputs of each device follows:

NanoKontrol

Device Descriptor:
    bLength                18
    bDescriptorType         1
    bcdUSB               1.10
    bDeviceClass            0 
    bDeviceSubClass         0 
    bDeviceProtocol         0 
    bMaxPacketSize0        16
    idVendor           0x0944 KORG, Inc.
    idProduct          0x010f nanoKONTROL studio controller
    bcdDevice            1.00
    iManufacturer           1 KORG INC.
    iProduct                2 nanoKONTROL
    iSerial                 0 
    bNumConfigurations      1
    Configuration Descriptor:
      bLength                 9
      bDescriptorType         2
      wTotalLength       0x0053
      bNumInterfaces          1
      bConfigurationValue     1
      iConfiguration          0 
      bmAttributes         0x80
        (Bus Powered)
      MaxPower              100mA
      Interface Descriptor:
        bLength                 9
        bDescriptorType         4
        bInterfaceNumber        0
        bAlternateSetting       0
        bNumEndpoints           2
        bInterfaceClass         1 Audio
        bInterfaceSubClass      3 MIDI Streaming
        bInterfaceProtocol      0 
        iInterface              0 
        MIDIStreaming Interface Descriptor:
          bLength                 7
          bDescriptorType        36
          bDescriptorSubtype      1 (HEADER)
          bcdADC               1.00
          wTotalLength       0x0041
        MIDIStreaming Interface Descriptor:
          bLength                 6
          bDescriptorType        36
          bDescriptorSubtype      2 (MIDI_IN_JACK)
          bJackType               1 Embedded
          bJackID                 1
          iJack                   3 nanoKONTROL _ CTRL
        MIDIStreaming Interface Descriptor:
          bLength                 6
          bDescriptorType        36
          bDescriptorSubtype      2 (MIDI_IN_JACK)
          bJackType               2 External
          bJackID                 2
          iJack                   0 
        MIDIStreaming Interface Descriptor:
          bLength                 9
          bDescriptorType        36
          bDescriptorSubtype      3 (MIDI_OUT_JACK)
          bJackType               1 Embedded
          bJackID                 3
          bNrInputPins            1
          baSourceID( 0)          2
          BaSourcePin( 0)         1
          iJack                   4 nanoKONTROL _ SLIDER/KNOB
        MIDIStreaming Interface Descriptor:
          bLength                 9
          bDescriptorType        36
          bDescriptorSubtype      3 (MIDI_OUT_JACK)
          bJackType               2 External
          bJackID                 4
          bNrInputPins            1
          baSourceID( 0)          1
          BaSourcePin( 0)         1
          iJack                   0 
        Endpoint Descriptor:
          bLength                 9
          bDescriptorType         5
          bEndpointAddress     0x82  EP 2 IN
          bmAttributes            2
            Transfer Type            Bulk
            Synch Type               None
            Usage Type               Data
          wMaxPacketSize     0x0040  1x 64 bytes
          bInterval               1
          bRefresh                0
          bSynchAddress           0
          MIDIStreaming Endpoint Descriptor:
            bLength                 5
            bDescriptorType        37
            bDescriptorSubtype      1 (GENERAL)
            bNumEmbMIDIJack         1
            baAssocJackID( 0)       3
        Endpoint Descriptor:
          bLength                 9
          bDescriptorType         5
          bEndpointAddress     0x02  EP 2 OUT
          bmAttributes            2
            Transfer Type            Bulk
            Synch Type               None
            Usage Type               Data
          wMaxPacketSize     0x0040  1x 64 bytes
          bInterval               0
          bRefresh                0
          bSynchAddress           0
          MIDIStreaming Endpoint Descriptor:
            bLength                 5
            bDescriptorType        37
            bDescriptorSubtype      1 (GENERAL)
            bNumEmbMIDIJack         1
            baAssocJackID( 0)       1
  can't get debug descriptor: Resource temporarily unavailable
  Device Status:     0x0001
    Self Powered

Android phone (Pixel 2)

Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               3.10
  bDeviceClass            0 
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         9
  idVendor           0x18d1 Google Inc.
  idProduct          0x4ee9 
  bcdDevice            4.40
  iManufacturer           1 Google
  iProduct                2 Pixel 2
  iSerial                 3 [CENSORED]
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0094
    bNumInterfaces          3
    bConfigurationValue     1
    iConfiguration          4 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              896mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         1 Audio
      bInterfaceSubClass      1 Control Device
      bInterfaceProtocol      0 
      iInterface              5 MIDI function
      AudioControl Interface Descriptor:
        bLength                 9
        bDescriptorType        36
        bDescriptorSubtype      1 (HEADER)
        bcdADC               1.00
        wTotalLength       0x0009
        bInCollection           1
        baInterfaceNr(0)        1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         1 Audio
      bInterfaceSubClass      3 MIDI Streaming
      bInterfaceProtocol      0 
      iInterface              0 
      MIDIStreaming Interface Descriptor:
        bLength                 7
        bDescriptorType        36
        bDescriptorSubtype      1 (HEADER)
        bcdADC               1.00
        wTotalLength       0x0025
      MIDIStreaming Interface Descriptor:
        bLength                 6
        bDescriptorType        36
        bDescriptorSubtype      2 (MIDI_IN_JACK)
        bJackType               2 External
        bJackID                 1
        iJack                   0 
      MIDIStreaming Interface Descriptor:
        bLength                 9
        bDescriptorType        36
        bDescriptorSubtype      3 (MIDI_OUT_JACK)
        bJackType               1 Embedded
        bJackID                 2
        bNrInputPins            1
        baSourceID( 0)          1
        BaSourcePin( 0)         1
        iJack                   0 
      MIDIStreaming Interface Descriptor:
        bLength                 6
        bDescriptorType        36
        bDescriptorSubtype      2 (MIDI_IN_JACK)
        bJackType               1 Embedded
        bJackID                 3
        iJack                   0 
      MIDIStreaming Interface Descriptor:
        bLength                 9
        bDescriptorType        36
        bDescriptorSubtype      3 (MIDI_OUT_JACK)
        bJackType               2 External
        bJackID                 4
        bNrInputPins            1
        baSourceID( 0)          3
        BaSourcePin( 0)         1
        iJack                   0 
      Endpoint Descriptor:
        bLength                 9
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               0
        bRefresh                0
        bSynchAddress           0
        bMaxBurst               0
        MIDIStreaming Endpoint Descriptor:
          bLength                 5
          bDescriptorType        37
          bDescriptorSubtype      1 (GENERAL)
          bNumEmbMIDIJack         1
          baAssocJackID( 0)       3
      Endpoint Descriptor:
        bLength                 9
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               0
        bRefresh                0
        bSynchAddress           0
        bMaxBurst               0
        MIDIStreaming Endpoint Descriptor:
          bLength                 5
          bDescriptorType        37
          bDescriptorSubtype      1 (GENERAL)
          bNumEmbMIDIJack         1
          baAssocJackID( 0)       2
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        2
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass     66 
      bInterfaceProtocol      1 
      iInterface              7 ADB Interface
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               0
        bMaxBurst               4
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               0
        bMaxBurst               4
Binary Object Store Descriptor:
  bLength                 5
  bDescriptorType        15
  wTotalLength       0x0016
  bNumDeviceCaps          2
  USB 2.0 Extension Device Capability:
    bLength                 7
    bDescriptorType        16
    bDevCapabilityType      2
    bmAttributes   0x00000006
      BESL Link Power Management (LPM) Supported
  SuperSpeed USB Device Capability:
    bLength                10
    bDescriptorType        16
    bDevCapabilityType      3
    bmAttributes         0x00
    wSpeedsSupported   0x000f
      Device can operate at Low Speed (1Mbps)
      Device can operate at Full Speed (12Mbps)
      Device can operate at High Speed (480Mbps)
      Device can operate at SuperSpeed (5Gbps)
    bFunctionalitySupport   1
      Lowest fully-functional device speed is Full Speed (12Mbps)
    bU1DevExitLat           1 micro seconds
    bU2DevExitLat         500 micro seconds
can't get debug descriptor: Resource temporarily unavailable
Device Status:     0x000c
  (Bus Powered)
  U1 Enabled
  U2 Enabled

Thanks!
- Z

Offline

Board footer

Powered by FluxBB