USBHost midi questions

Status
Not open for further replies.

NotoYota

Member
Hi,
thanks again on so much effort that went into these products. Much appreciated.

I am experimenting with MIDI.
I would like to see if i can make my Teensy the central HUB of my MIDI setup. Doing some midi-routing, and filtering/translating messages. Maybe even add some Arpeggio or step-sequencer capabilities.
I have an Arturia Keystep connected via USB which works great.
I have an Behringer BCR-2000 connected via USB working great.

I have a hardware midi output on Hardware Serial 1 to a Dave Smith Mopho working great.

Two devices that i can't get to work are both M-Audio. An really oldskool M-Audio Oxygen 8 and an M-Audio MIDIMAN 2x2 interface (http://m-audio.com/products/view/midisport-2x2-anniversary-edition).
I have everything connected through some dumb USB-Hub. So even the devices that ARE working connect through same hub. So i don't think the hub is the issue.

I am using the Midi 16x16 example to do the tests.
Is there some way to enumerate the connected usb midi devices and to which midi "port" they are connected? So in the example code there is an number of "ports" called midi01 through midi10.
They are combined in this array midilist.
So can i detect and send text to the serial monitor what device is connected to what "port"

Also, both these m-audio devices present themselves as a multi-port interface to a computer. Is this supported in the usbhost midi implementation of Teensy?

Last question: In the USBHost library i see the option of printing debug messages. How can i turn this on?
i added #define USBHOST_PRINT_DEBUG 1 to the beginning of my sketch, but it doesn't seem to do anything.

Thanks a lot!

Patrick
 
Here are attached some visual clues.
Any help would be much appreciated.

It seems those M-Audio products just aren't detected as midi devices. But they are very important for my setup to be what i want it to be.
Also according to the website of M-Audio, at least the Midisport 2x2 interface should be class complient.
 

Attachments

  • Screen Shot 2018-08-22 at 21.49.06.jpg
    Screen Shot 2018-08-22 at 21.49.06.jpg
    103.5 KB · Views: 114
  • Teensy-Midi-setup.jpg
    Teensy-Midi-setup.jpg
    103.3 KB · Views: 90
Try editing USBHost_t36.h. Look for this line to uncomment.

Code:
//#define USBHOST_PRINT_DEBUG

This will cause lots of info to print to the serial monitor. Copy & paste is all here. Buried in there will be this device's descriptors and (hopefully) some info that will help us figure out why the host midi driver didn't claim the interface.
 
thanks for your reply. So defining this in the sketch is not working ok, clear.

Here is the output with only the M-Audio midisport 2x2 connected to the hub:

Code:
port change: 10001805
  port enabled
  end recovery
new_Device: 12 Mbit/sec
new_Pipe
enumeration:
enumeration:
enumeration:
Device Descriptor:
  12 01 10 01 09 00 00 08 EB 03 02 09 00 01 00 00 00 01 
    VendorID = 03EB, ProductID = 0902, Version = 0100
    Class/Subclass/Protocol = 9(Hub) / 0 / 0
    Number of Configurations = 1
enumeration:
Config data length = 34
enumeration:
Configuration Descriptor:
  09 02 22 00 01 01 00 E0 32 
    NumInterfaces = 1
    ConfigurationValue = 1
  09 04 00 00 01 09 00 00 00 
    Interface = 0
    Number of endpoints = 1
    Class/Subclass/Protocol = 9(Hub) / 0 / 0
  07 05 81 03 01 00 FF 
    Endpoint = 1 IN
    Type = Interrupt
    Max Size = 1
    Polling Interval = 255
  09 29 04 09 00 32 64 00 1E 
enumeration:
USBHub memory usage = 960
USBHub claim_device this=1FFF2300
found possible interface, altsetting=0
number of interfaces found = 1
USBHub control callback
09 29 04 09 00 32 64 00 1E 00 00 00 00 00 00 00 
Hub ports = 4
USBHub control callback
USBHub control callback
USBHub control callback
USBHub control callback
power turned on to all ports
device addr = 1
new_Pipe
allocate_interrupt_pipe_bandwidth
 best_bandwidth = 3, at offset = 0, shift= 0
pipe cap1 = F0010101
HUB Callback (member)
status = 11
getstatus, port = 0
deferred getstatus, port = 4
USBHub control callback
00 00 01 00 
New Hub Status
getstatus, port = 4
USBHub control callback
01 01 01 00 
New Port Status
  status=10101  port=4
  state=0
  Device is present: 
  Has Power
USBHub control callback
Port Status Cleared, port=4
timer event (20000 us): Debounce Timer, this = 1FFF2300, timer = 1FFF2618
ports in use bitmask = 10
getstatus, port = 4
USBHub control callback
01 01 00 00 
New Port Status
  status=101  port=4
  state=2
  Device is present: 
  Has Power
HUB Callback (member)
status = 1
getstatus, port = 0
USBHub control callback
00 00 01 00 
New Hub Status
timer event (20000 us): Debounce Timer, this = 1FFF2300, timer = 1FFF2618
ports in use bitmask = 10
getstatus, port = 4
USBHub control callback
01 01 00 00 
New Port Status
  status=101  port=4
  state=3
  Device is present: 
  Has Power
timer event (19999 us): Debounce Timer, this = 1FFF2300, timer = 1FFF2618
ports in use bitmask = 10
getstatus, port = 4
USBHub control callback
01 01 00 00 
New Port Status
  status=101  port=4
  state=4
  Device is present: 
  Has Power
HUB Callback (member)
status = 1
getstatus, port = 0
USBHub control callback
00 00 01 00 
New Hub Status
timer event (20000 us): Debounce Timer, this = 1FFF2300, timer = 1FFF2618
ports in use bitmask = 10
getstatus, port = 4
USBHub control callback
01 01 00 00 
New Port Status
  status=101  port=4
  state=5
  Device is present: 
  Has Power
HUB Callback (member)
status = 1
getstatus, port = 0
USBHub control callback
00 00 01 00 
New Hub Status
timer event (20000 us): Debounce Timer, this = 1FFF2300, timer = 1FFF2618
ports in use bitmask = 10
getstatus, port = 4
USBHub control callback
01 01 00 00 
New Port Status
  status=101  port=4
  state=6
  Device is present: 
  Has Power
sending reset
send_setreset
USBHub control callback
unhandled setup, message = 40323
timer event (20000 us): Debounce Timer, this = 1FFF2300, timer = 1FFF2618
ports in use bitmask = 0
HUB Callback (member)
status = 11
getstatus, port = 0
deferred getstatus, port = 4
USBHub control callback
00 00 01 00 
New Hub Status
getstatus, port = 4
USBHub control callback
03 01 10 00 
New Port Status
  status=100103  port=4
  state=7
  Device is present: 
  Enabled, speed = 12 Mbit/sec
  Has Power
USBHub control callback
unhandled setup, message = 140123
timer event (25000 us): Hello, I'm resettimer, this = 1FFF2300, timer = 1FFF2634
port_doing_reset = 4
PORT_RECOVERY
new_Device: 12 Mbit/sec
new_Pipe
HUB Callback (member)
status = 1
getstatus, port = 0
USBHub control callback

the last part goes on ad infinitum.
 
Looks like it's getting hung up in the hub driver, never actually getting to the M-Audio device.

Which hub is that? (what exactly should I buy if I try to test it here)

Any chance you can test with a different hub?
 
The hub itself was a cheap brandless thing I got around lying around. According to the vendorid and productid it's an Atmel 4 port hub chip.

But the weird thing is the Arturia Keystep and Behringer BCR2000 works great on the same hub. Also tried several port combinations to rule out a faulty port.

I can see if I can test with a different hub. But it will be difficult-ish. Since I did not have a usb host connector and soldered wires of this hub directly to the teensy.
 
So, new clues :)

I have made a new host-cable so i can plug in and out different USB stuff.
The M-Audio midisport 2x2 on it's own was working.
But with the HUB it was not. With another HUB bus-powered it was also not working, but with that hub powered externally it DOES work.
So it seems to be some power-drainage issue which i assume influences the communication. Normally when i connect something to my mac that is using too much power it complains. But in this case it did not complain. Also the lights of the devices (including the M-Audio midisport 2x2) were lit.

The M-Audio Oxygen 8 is still not working. Not on it's own, Not on the new hub powered or not powered.

Here is the debug output with only the Oxygen 8 connected to the powered hub:

Code:
sizeof Device = 36
sizeof Pipe = 96
sizeof Transfer = 64
power up USBHS PHY
End of setup functionport change: 10001803
    connect

  begin reset
port change: 18001205
  port enabled
  end recovery
new_Device: 480 Mbit/sec
new_Pipe
enumeration:
enumeration:
enumeration:
Device Descriptor:
  12 01 00 02 09 00 02 40 E3 05 10 06 24 92 01 02 00 01 
    VendorID = 05E3, ProductID = 0610, Version = 9224
    Class/Subclass/Protocol = 9(Hub) / 0 / 2(Multi-TT)
    Number of Configurations = 1
enumeration:
enumeration:
Manufacturer: GenesysLogic
enumeration:
Product: USB2.0 Hub
enumeration:
Config data length = 41
enumeration:
Configuration Descriptor:
  09 02 29 00 01 01 00 E0 32 
    NumInterfaces = 1
    ConfigurationValue = 1
  09 04 00 00 01 09 00 01 00 
    Interface = 0
    Number of endpoints = 1
    Class/Subclass/Protocol = 9(Hub) / 0 / 1(Single-TT)
  07 05 81 03 01 00 0C 
    Endpoint = 1 IN
    Type = Interrupt
    Max Size = 1
    Polling Interval = 12
  09 04 00 01 01 09 00 02 00 
    Interface = 0
    Number of endpoints = 1
    Class/Subclass/Protocol = 9(Hub) / 0 / 2(Multi-TT)
  07 05 81 03 01 00 0C 
    Endpoint = 1 IN
    Type = Interrupt
    Max Size = 1
    Polling Interval = 12
enumeration:
USBHub memory usage = 960
USBHub claim_device this=1FFF26E0
found possible interface, altsetting=0
found possible interface, altsetting=1
number of interfaces found = 2
best interface is 0 using altsetting 1
USBHub control callback
09 29 04 E0 00 32 64 00 FF 00 00 00 00 00 00 00 
Hub ports = 4
USBHub control callback
unhandled setup, message = 10B01
USBHub control callback
USBHub control callback
USBHub control callback
USBHub control callback
power turned on to all ports
device addr = 1
new_Pipe
allocate_interrupt_pipe_bandwidth
  ep interval = 12
  interval = 256
 best_bandwidth = 2, at offset = 0
pipe cap1 = F0012101
HUB Callback (member)
status = 8
getstatus, port = 3
USBHub control callback
01 01 01 00 
New Port Status
  status=10101  port=3
  state=0
  Device is present: 
  Has Power
USBHub control callback
Port Status Cleared, port=3
timer event (19999 us): Debounce Timer, this = 1FFF26E0, timer = 1FFF29F8
ports in use bitmask = 8
getstatus, port = 3
USBHub control callback
01 01 00 00 
New Port Status
  status=101  port=3
  state=2
  Device is present: 
  Has Power
timer event (19999 us): Debounce Timer, this = 1FFF26E0, timer = 1FFF29F8
ports in use bitmask = 8
getstatus, port = 3
USBHub control callback
01 01 00 00 
New Port Status
  status=101  port=3
  state=3
  Device is present: 
  Has Power
timer event (19999 us): Debounce Timer, this = 1FFF26E0, timer = 1FFF29F8
ports in use bitmask = 8
getstatus, port = 3
USBHub control callback
01 01 00 00 
New Port Status
  status=101  port=3
  state=4
  Device is present: 
  Has Power
timer event (20000 us): Debounce Timer, this = 1FFF26E0, timer = 1FFF29F8
ports in use bitmask = 8
getstatus, port = 3
USBHub control callback
01 01 00 00 
New Port Status
  status=101  port=3
  state=5
  Device is present: 
  Has Power
timer event (20000 us): Debounce Timer, this = 1FFF26E0, timer = 1FFF29F8
ports in use bitmask = 8
getstatus, port = 3
USBHub control callback
01 01 00 00 
New Port Status
  status=101  port=3
  state=6
  Device is present: 
  Has Power
sending reset
send_setreset
USBHub control callback
unhandled setup, message = 40323
timer event (20000 us): Debounce Timer, this = 1FFF26E0, timer = 1FFF29F8
ports in use bitmask = 0
HUB Callback (member)
status = 8
getstatus, port = 3
USBHub control callback
03 01 10 00 
New Port Status
  status=100103  port=3
  state=7
  Device is present: 
  Enabled, speed = 12 Mbit/sec
  Has Power
USBHub control callback
unhandled setup, message = 140123
timer event (24999 us): Hello, I'm resettimer, this = 1FFF26E0, timer = 1FFF2A14
port_doing_reset = 3
PORT_RECOVERY
new_Device: 12 Mbit/sec
new_Pipe
enumeration:
enumeration:
enumeration:
Device Descriptor:
  12 01 00 01 FF FF FF 40 63 07 14 10 01 00 00 00 00 01 
    VendorID = 0763, ProductID = 1014, Version = 0001
    Class/Subclass/Protocol = 255 / 255 / 255
    Number of Configurations = 1
enumeration:
Config data length = 218
enumeration:
Configuration Descriptor:
  09 02 DA 00 01 01 00 80 32 
    NumInterfaces = 1
    ConfigurationValue = 1
  09 04 00 00 00 FF FF FF 00 
    Interface = 0
    Number of endpoints = 0
    Class/Subclass/Protocol = 255 / 255 / 255
  09 04 00 01 0D FF FF FF 00 
    Interface = 0
    Number of endpoints = 13
    Class/Subclass/Protocol = 255 / 255 / 255
  07 05 81 03 10 00 0A 
    Endpoint = 1 IN
    Type = Interrupt
    Max Size = 16
    Polling Interval = 10
  07 05 82 02 40 00 00 
    Endpoint = 2 IN
    Type = Bulk
    Max Size = 64
    Polling Interval = 0
  07 05 02 02 40 00 00 
    Endpoint = 2 OUT
    Type = Bulk
    Max Size = 64
    Polling Interval = 0
  07 05 84 02 40 00 00 
    Endpoint = 4 IN
    Type = Bulk
    Max Size = 64
    Polling Interval = 0
  07 05 04 02 40 00 00 
    Endpoint = 4 OUT
    Type = Bulk
    Max Size = 64
    Polling Interval = 0
  07 05 86 02 40 00 00 
    Endpoint = 6 IN
    Type = Bulk
    Max Size = 64
    Polling Interval = 0
  07 05 06 02 40 00 00 
    Endpoint = 6 OUT
    Type = Bulk
    Max Size = 64
    Polling Interval = 0
  07 05 88 01 10 00 01 
    Endpoint = 8 IN
    Type = Isochronous
    Max Size = 16
    Polling Interval = 1
  07 05 08 01 10 00 01 
    Endpoint = 8 OUT
    Type = Isochronous
    Max Size = 16
    Polling Interval = 1
  07 05 89 01 10 00 01 
    Endpoint = 9 IN
    Type = Isochronous
    Max Size = 16
    Polling Interval = 1
  07 05 09 01 10 00 01 
    Endpoint = 9 OUT
    Type = Isochronous
    Max Size = 16
    Polling Interval = 1
  07 05 8A 01 10 00 01 
    Endpoint = 10 IN
    Type = Isochronous
    Max Size = 16
    Polling Interval = 1
  07 05 0A 01 10 00 01 
    Endpoint = 10 OUT
    Type = Isochronous
    Max Size = 16
    Polling Interval = 1
  09 04 00 02 0D FF FF FF 00 
    Interface = 0
    Number of endpoints = 13
    Class/Subclass/Protocol = 255 / 255 / 255
  07 05 81 03 40 00 0A 
    Endpoint = 1 IN
    Type = Interrupt
    Max Size = 64
    Polling Interval = 10
  07 05 82 02 40 00 00 
    Endpoint = 2 IN
    Type = Bulk
    Max Size = 64
    Polling Interval = 0
  07 05 02 02 40 00 00 
    Endpoint = 2 OUT
    Type = Bulk
    Max Size = 64
    Polling Interval = 0
  07 05 84 02 40 00 00 
    Endpoint = 4 IN
    Type = Bulk
    Max Size = 64
    Polling Interval = 0
  07 05 04 02 40 00 00 
    Endpoint = 4 OUT
    Type = Bulk
    Max Size = 64
    Polling Interval = 0
  07 05 86 02 40 00 00 
    Endpoint = 6 IN
    Type = Bulk
    Max Size = 64
    Polling Interval = 0
  07 05 06 02 40 00 00 
    Endpoint = 6 OUT
    Type = Bulk
    Max Size = 64
    Polling Interval = 0
  07 05 88 01 00 01 01 
    Endpoint = 8 IN
    Type = Isochronous
    Max Size = 256
    Polling Interval = 1
  07 05 08 01 00 01 01 
    Endpoint = 8 OUT
    Type = Isochronous
    Max Size = 256
    Polling Interval = 1
  07 05 89 01 10 00 01 
    Endpoint = 9 IN
    Type = Isochronous
    Max Size = 16
    Polling Interval = 1
  07 05 09 01 10 00 01 
    Endpoint = 9 OUT
    Type = Isochronous
    Max Size = 16
    Polling Interval = 1
  07 05 8A 01 10 00 01 
    Endpoint = 10 IN
    Type = Isochronous
    Max Size = 16
    Polling Interval = 1
  07 05 0A 01 10 00 01 
    Endpoint = 10 OUT
    Type = Isochronous
    Max Size = 16
    Polling Interval = 1
enumeration:
USBHub memory usage = 960
USBHub claim_device this=1FFF2AA0
USBHub memory usage = 960
USBHub claim_device this=1FFF2E60
USBHub memory usage = 960
USBHub claim_device this=1FFF3220
Descriptor 4 = INTERFACE
MIDIDevice claim this=1FFF5D60
len = 209
MIDIDevice claim this=1FFF6420
len = 209
MIDIDevice claim this=1FFF3600
len = 209
MIDIDevice claim this=1FFF6AE0
len = 209
MIDIDevice claim this=1FFF71A0
len = 209
MIDIDevice claim this=1FFF2020
len = 209
MIDIDevice claim this=1FFF4EE0
len = 209
MIDIDevice claim this=1FFF4820
len = 209
MIDIDevice claim this=1FFF55A0
len = 209
MIDIDevice claim this=1FFF4160
len = 209
Descriptor 4 = INTERFACE
MIDIDevice claim this=1FFF5D60
len = 200
MIDIDevice claim this=1FFF6420
len = 200
MIDIDevice claim this=1FFF3600
len = 200
MIDIDevice claim this=1FFF6AE0
len = 200
MIDIDevice claim this=1FFF71A0
len = 200
MIDIDevice claim this=1FFF2020
len = 200
MIDIDevice claim this=1FFF4EE0
len = 200
MIDIDevice claim this=1FFF4820
len = 200
MIDIDevice claim this=1FFF55A0
len = 200
MIDIDevice claim this=1FFF4160
len = 200
Descriptor 5 = ENDPOINT
Descriptor 5 = ENDPOINT
Descriptor 5 = ENDPOINT
Descriptor 5 = ENDPOINT
Descriptor 5 = ENDPOINT
Descriptor 5 = ENDPOINT
Descriptor 5 = ENDPOINT
Descriptor 5 = ENDPOINT
Descriptor 5 = ENDPOINT
Descriptor 5 = ENDPOINT
Descriptor 5 = ENDPOINT
Descriptor 5 = ENDPOINT
Descriptor 5 = ENDPOINT
Descriptor 4 = INTERFACE
MIDIDevice claim this=1FFF5D60
len = 100
MIDIDevice claim this=1FFF6420
len = 100
MIDIDevice claim this=1FFF3600
len = 100
MIDIDevice claim this=1FFF6AE0
len = 100
MIDIDevice claim this=1FFF71A0
len = 100
MIDIDevice claim this=1FFF2020
len = 100
MIDIDevice claim this=1FFF4EE0
len = 100
MIDIDevice claim this=1FFF4820
len = 100
MIDIDevice claim this=1FFF55A0
len = 100
MIDIDevice claim this=1FFF4160
len = 100
Descriptor 5 = ENDPOINT
Descriptor 5 = ENDPOINT
Descriptor 5 = ENDPOINT
Descriptor 5 = ENDPOINT
Descriptor 5 = ENDPOINT
Descriptor 5 = ENDPOINT
Descriptor 5 = ENDPOINT
Descriptor 5 = ENDPOINT
Descriptor 5 = ENDPOINT
Descriptor 5 = ENDPOINT
Descriptor 5 = ENDPOINT
Descriptor 5 = ENDPOINT
Descriptor 5 = ENDPOINT
 
Status
Not open for further replies.
Back
Top