My MG-300 guitar processor works fine when connected directly to the USB host port of a Teensy 3.6. But stops responding after a couple of messages when it is connected through a hub.
This hub works fine when I connect the MG-300 to a mac or PC. Also this hub works fine with the USB host port when I connect other devices.
Here is my test sketch:
So this code sends MIDI CC messages to which the MG-300 changes patch.
When the MG-300 is connected through a hub, the program will hang and the serial monitor will stop showing data:
This is what the debugging in the USBHost_library shows by uncommenting #define USBHOST_PRINT_DEBUG:
Who can help me?
This hub works fine when I connect the MG-300 to a mac or PC. Also this hub works fine with the USB host port when I connect other devices.
Here is my test sketch:
Code:
#include <USBHost_t36.h>
#define NUMBER_OF_USB_HOST_MIDI_PORTS 8
USBHost myusb;
USBHub hub1(myusb);
USBHub hub2(myusb);
USBHub hub3(myusb);
USBHub hub4(myusb);
MIDIDevice_BigBuffer usbhMIDI01(myusb); // With bigbuffer, newer Roland devices are working properly!
MIDIDevice_BigBuffer usbhMIDI02(myusb);
MIDIDevice_BigBuffer usbhMIDI03(myusb);
MIDIDevice_BigBuffer usbhMIDI04(myusb);
MIDIDevice_BigBuffer usbhMIDI05(myusb);
MIDIDevice_BigBuffer usbhMIDI06(myusb);
MIDIDevice_BigBuffer usbhMIDI07(myusb);
MIDIDevice_BigBuffer usbhMIDI08(myusb);
MIDIDevice_BigBuffer * usbhMIDI[NUMBER_OF_USB_HOST_MIDI_PORTS] = {
&usbhMIDI01, &usbhMIDI02, &usbhMIDI03, &usbhMIDI04, &usbhMIDI05, &usbhMIDI06, &usbhMIDI07, &usbhMIDI08
};
const uint32_t TIME = 500; // time between identity request messages
uint32_t timer = millis() + TIME;
uint8_t PC = 0;
void setup() {
Serial.begin(115200);
delay(1000);
myusb.begin();
}
void loop() {
myusb.Task();
if (millis() > timer) {
send_alternative_PC_message(PC);
if (PC++ > 9) PC = 0;
timer = millis() + TIME;
}
}
void send_alternative_PC_message(uint8_t program) {
for (uint8_t p = 0; p < NUMBER_OF_USB_HOST_MIDI_PORTS; p++) {
usbhMIDI[p]->sendControlChange(60, program, 0);
}
Serial.println("Sending CC#60 " + String(program));
}
So this code sends MIDI CC messages to which the MG-300 changes patch.
When the MG-300 is connected through a hub, the program will hang and the serial monitor will stop showing data:
Code:
Sending CC#60 0
Sending CC#60 1
Sending CC#60 2
Sending CC#60 3
Sending CC#60 4
This is what the debugging in the USBHost_library shows by uncommenting #define USBHOST_PRINT_DEBUG:
Code:
sizeof Device = 36
sizeof Pipe = 96
sizeof Transfer = 64
power up USBHS PHY
reset waited 5
USBHS_ASYNCLISTADDR = 0
USBHS_PERIODICLISTBASE = 1FFFC000
periodictable = 1FFFC000
Sending CC#60 0
port 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 01 40 E3 05 08 06 98 32 00 01 00 01
VendorID = 05E3, ProductID = 0608, Version = 3298
Class/Subclass/Protocol = 9(Hub) / 0 / 1(Single-TT)
Number of Configurations = 1
enumeration:
enumeration:
Product: USB2.0 Hub
enumeration:
Config data length = 25
enumeration:
Configuration Descriptor:
09 02 19 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 0C
Endpoint = 1 IN
Type = Interrupt
Max Size = 1
Polling Interval = 12
enumeration:
USBHub memory usage = 960
USBHub claim_device this=1FFF6860
found possible interface, altsetting=0
number of interfaces found = 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
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 = 4
getstatus, port = 2
USBHub control callback
01 01 01 00
New Port Status
status=10101 port=2
state=0
Device is present:
Has Power
USBHub control callback
Port Status Cleared, port=2
timer event (19999 us): Debounce Timer, this = 1FFF6860, timer = 1FFF6B78
ports in use bitmask = 4
getstatus, port = 2
USBHub control callback
01 01 00 00
New Port Status
status=101 port=2
state=2
Device is present:
Has Power
timer event (19999 us): Debounce Timer, this = 1FFF6860, timer = 1FFF6B78
ports in use bitmask = 4
getstatus, port = 2
USBHub control callback
01 01 00 00
New Port Status
status=101 port=2
state=3
Device is present:
Has Power
timer event (20000 us): Debounce Timer, this = 1FFF6860, timer = 1FFF6B78
ports in use bitmask = 4
getstatus, port = 2
USBHub control callback
01 01 00 00
New Port Status
status=101 port=2
state=4
Device is present:
Has Power
timer event (20000 us): Debounce Timer, this = 1FFF6860, timer = 1FFF6B78
ports in use bitmask = 4
getstatus, port = 2
USBHub control callback
01 01 00 00
New Port Status
status=101 port=2
state=5
Device is present:
Has Power
timer event (20000 us): Debounce Timer, this = 1FFF6860, timer = 1FFF6B78
ports in use bitmask = 4
getstatus, port = 2
USBHub control callback
01 01 00 00
New Port Status
status=101 port=2
state=6
Device is present:
Has Power
sending reset
send_setreset
USBHub control callback
unhandled setup, message = 40323
timer event (19999 us): Debounce Timer, this = 1FFF6860, timer = 1FFF6B78
ports in use bitmask = 0
HUB Callback (member)
status = 4
getstatus, port = 2
USBHub control callback
03 05 10 00
New Port Status
status=100503 port=2
state=7
Device is present:
Enabled, speed = 480 Mbit/sec
Has Power
USBHub control callback
unhandled setup, message = 140123
timer event (25000 us): Hello, I'm resettimer, this = 1FFF6860, timer = 1FFF6B94
port_doing_reset = 2
PORT_RECOVERY
new_Device: 480 Mbit/sec
new_Pipe
enumeration:
enumeration:
enumeration:
Device Descriptor:
12 01 00 02 EF 02 01 40 C9 1F 60 82 00 01 01 02 03 01
VendorID = 1FC9, ProductID = 8260, Version = 0100
Class/Subclass/Protocol = 239 / 2 / 1
Number of Configurations = 1
enumeration:
enumeration:
Manufacturer: NUX
enumeration:
Product: NUX MG-300 AUDIO
enumeration:
Serial Number: 2008101346
enumeration:
Config data length = 318
enumeration:
Configuration Descriptor:
09 02 3E 01 04 01 00 C0 01
NumInterfaces = 4
ConfigurationValue = 1
08 0B 00 03 01 00 20 00
Interface Association = 0 through 2
Class / Subclass / Protocol = 1 / 0 / 0
09 04 00 00 00 01 01 20 00
Interface = 0
Number of endpoints = 0
Class/Subclass/Protocol = 1 / 1 / 32
09 24 01 00 02 08 65 00 00
08 24 0A 29 03 07 00 00
08 24 0B 28 01 29 03 00
11 24 02 02 01 01 00 28 02 00 00 00 00 00 00 00 00
12 24 06 0A 02 0F 00 00 00 0F 00 00 00 0F 00 00 00 00
0C 24 03 14 01 03 00 0A 28 00 00 00
11 24 02 01 01 02 00 28 02 00 00 00 00 00 00 00 00
0C 24 03 16 01 01 00 02 28 00 00 00
09 04 01 00 00 01 02 20 00
Interface = 1
Number of endpoints = 0
Class/Subclass/Protocol = 1 / 2 / 32
09 04 01 01 02 01 02 20 00
Interface = 1
Number of endpoints = 2
Class/Subclass/Protocol = 1 / 2 / 32
10 24 01 02 00 01 01 00 00 00 02 00 00 00 00 00
06 24 02 01 04 18
07 05 01 05 58 02 04
Endpoint = 1 OUT
Type = Isochronous
Max Size = 600
Polling Interval = 4
08 25 01 00 00 00 00 00
07 05 81 11 04 00 04
Endpoint = 1 IN
Type = Isochronous
Max Size = 4
Polling Interval = 4
09 04 02 00 00 01 02 20 00
Interface = 2
Number of endpoints = 0
Class/Subclass/Protocol = 1 / 2 / 32
09 04 02 01 01 01 02 20 00
Interface = 2
Number of endpoints = 1
Class/Subclass/Protocol = 1 / 2 / 32
10 24 01 16 00 01 01 00 00 00 02 00 00 00 00 00
06 24 02 01 04 18
07 05 82 05 58 02 04
Endpoint = 2 IN
Type = Isochronous
Max Size = 600
Polling Interval = 4
08 25 01 00 00 00 00 00
09 04 03 00 02 01 03 00 04
Interface = 3
Number of endpoints = 2
Class/Subclass/Protocol = 1 / 3 / 0
07 24 01 00 01 41 00
06 24 02 01 01 00
06 24 02 02 02 00
09 24 03 01 03 01 02 01 00
09 24 03 02 04 01 01 01 00
09 05 04 02 00 01 00 00 00
Endpoint = 4 OUT
Type = Bulk
Max Size = 256
Polling Interval = 0
05 25 01 01 01
09 05 83 02 00 01 00 00 00
Endpoint = 3 IN
Type = Bulk
Max Size = 256
Polling Interval = 0
05 25 01 01 03
enumeration:
USBHub memory usage = 960
USBHub claim_device this=1FFF6C20
USBHub memory usage = 960
USBHub claim_device this=1FFF6FE0
USBHub memory usage = 960
USBHub claim_device this=1FFF5380
Descriptor 11 = IAD
Descriptor 4 = INTERFACE
MIDIDevice claim this=1FFF73C0
len = 301
Interface is unknown (might be Yahama)
type: 36, len: 9
MIDI Header (ignored)
type: 36, len: 8
Unknown MIDI CS_INTERFACE descriptor!
MIDIDevice claim this=1FFF84E0
len = 301
Interface is unknown (might be Yahama)
type: 36, len: 9
MIDI Header (ignored)
type: 36, len: 8
Unknown MIDI CS_INTERFACE descriptor!
MIDIDevice claim this=1FFF9600
len = 301
Interface is unknown (might be Yahama)
type: 36, len: 9
MIDI Header (ignored)
type: 36, len: 8
Unknown MIDI CS_INTERFACE descriptor!
MIDIDevice claim this=1FFFA720
len = 301
Interface is unknown (might be Yahama)
type: 36, len: 9
MIDI Header (ignored)
type: 36, len: 8
Unknown MIDI CS_INTERFACE descriptor!
MIDIDevice claim this=1FFF5740
len = 301
Interface is unknown (might be Yahama)
type: 36, len: 9
MIDI Header (ignored)
type: 36, len: 8
Unknown MIDI CS_INTERFACE descriptor!
MIDIDevice claim this=1FFF2020
len = 301
Interface is unknown (might be Yahama)
type: 36, len: 9
MIDI Header (ignored)
type: 36, len: 8
Unknown MIDI CS_INTERFACE descriptor!
MIDIDevice claim this=1FFF3140
len = 301
Interface is unknown (might be Yahama)
type: 36, len: 9
MIDI Header (ignored)
type: 36, len: 8
Unknown MIDI CS_INTERFACE descriptor!
MIDIDevice claim this=1FFF4260
len = 301
Interface is unknown (might be Yahama)
type: 36, len: 9
MIDI Header (ignored)
type: 36, len: 8
Unknown MIDI CS_INTERFACE descriptor!
Descriptor 36 = ???
Descriptor 36 = ???
Descriptor 36 = ???
Descriptor 36 = ???
Descriptor 36 = ???
Descriptor 36 = ???
Descriptor 36 = ???
Descriptor 36 = ???
Descriptor 4 = INTERFACE
MIDIDevice claim this=1FFF73C0
len = 191
Interface is unknown (might be Yahama)
type: 4, len: 9
This interface is not MIDI
MIDIDevice claim this=1FFF84E0
len = 191
Interface is unknown (might be Yahama)
type: 4, len: 9
This interface is not MIDI
MIDIDevice claim this=1FFF9600
len = 191
Interface is unknown (might be Yahama)
type: 4, len: 9
This interface is not MIDI
MIDIDevice claim this=1FFFA720
len = 191
Interface is unknown (might be Yahama)
type: 4, len: 9
This interface is not MIDI
MIDIDevice claim this=1FFF5740
len = 191
Interface is unknown (might be Yahama)
type: 4, len: 9
This interface is not MIDI
MIDIDevice claim this=1FFF2020
len = 191
Interface is unknown (might be Yahama)
type: 4, len: 9
This interface is not MIDI
MIDIDevice claim this=1FFF3140
len = 191
Interface is unknown (might be Yahama)
type: 4, len: 9
This interface is not MIDI
MIDIDevice claim this=1FFF4260
len = 191
Interface is unknown (might be Yahama)
type: 4, len: 9
This interface is not MIDI
Descriptor 4 = INTERFACE
MIDIDevice claim this=1FFF73C0
len = 182
Interface is unknown (might be Yahama)
type: 36, len: 16
MIDI Header (ignored)
type: 36, len: 6
MIDI IN Jack (ignored)
type: 5, len: 7
MIDIDevice claim this=1FFF84E0
len = 182
Interface is unknown (might be Yahama)
type: 36, len: 16
MIDI Header (ignored)
type: 36, len: 6
MIDI IN Jack (ignored)
type: 5, len: 7
MIDIDevice claim this=1FFF9600
len = 182
Interface is unknown (might be Yahama)
type: 36, len: 16
MIDI Header (ignored)
type: 36, len: 6
MIDI IN Jack (ignored)
type: 5, len: 7
MIDIDevice claim this=1FFFA720
len = 182
Interface is unknown (might be Yahama)
type: 36, len: 16
MIDI Header (ignored)
type: 36, len: 6
MIDI IN Jack (ignored)
type: 5, len: 7
MIDIDevice claim this=1FFF5740
len = 182
Interface is unknown (might be Yahama)
type: 36, len: 16
MIDI Header (ignored)
type: 36, len: 6
MIDI IN Jack (ignored)
type: 5, len: 7
MIDIDevice claim this=1FFF2020
len = 182
Interface is unknown (might be Yahama)
type: 36, len: 16
MIDI Header (ignored)
type: 36, len: 6
MIDI IN Jack (ignored)
type: 5, len: 7
MIDIDevice claim this=1FFF3140
len = 182
Interface is unknown (might be Yahama)
type: 36, len: 16
MIDI Header (ignored)
type: 36, len: 6
MIDI IN Jack (ignored)
type: 5, len: 7
MIDIDevice claim this=1FFF4260
len = 182
Interface is unknown (might be Yahama)
type: 36, len: 16
MIDI Header (ignored)
type: 36, len: 6
MIDI IN Jack (ignored)
type: 5, len: 7
Descriptor 36 = ???
Descriptor 36 = ???
Descriptor 5 = ENDPOINT
Descriptor 37 = ???
Descriptor 5 = ENDPOINT
Descriptor 4 = INTERFACE
MIDIDevice claim this=1FFF73C0
len = 129
Interface is unknown (might be Yahama)
type: 4, len: 9
This interface is not MIDI
MIDIDevice claim this=1FFF84E0
len = 129
Interface is unknown (might be Yahama)
type: 4, len: 9
This interface is not MIDI
MIDIDevice claim this=1FFF9600
len = 129
Interface is unknown (might be Yahama)
type: 4, len: 9
This interface is not MIDI
MIDIDevice claim this=1FFFA720
len = 129
Interface is unknown (might be Yahama)
type: 4, len: 9
This interface is not MIDI
MIDIDevice claim this=1FFF5740
len = 129
Interface is unknown (might be Yahama)
type: 4, len: 9
This interface is not MIDI
MIDIDevice claim this=1FFF2020
len = 129
Interface is unknown (might be Yahama)
type: 4, len: 9
This interface is not MIDI
MIDIDevice claim this=1FFF3140
len = 129
Interface is unknown (might be Yahama)
type: 4, len: 9
This interface is not MIDI
MIDIDevice claim this=1FFF4260
len = 129
Interface is unknown (might be Yahama)
type: 4, len: 9
This interface is not MIDI
Descriptor 4 = INTERFACE
MIDIDevice claim this=1FFF73C0
len = 120
Interface is unknown (might be Yahama)
type: 36, len: 16
MIDI Header (ignored)
type: 36, len: 6
MIDI IN Jack (ignored)
type: 5, len: 7
MIDIDevice claim this=1FFF84E0
len = 120
Interface is unknown (might be Yahama)
type: 36, len: 16
MIDI Header (ignored)
type: 36, len: 6
MIDI IN Jack (ignored)
type: 5, len: 7
MIDIDevice claim this=1FFF9600
len = 120
Interface is unknown (might be Yahama)
type: 36, len: 16
MIDI Header (ignored)
type: 36, len: 6
MIDI IN Jack (ignored)
type: 5, len: 7
MIDIDevice claim this=1FFFA720
len = 120
Interface is unknown (might be Yahama)
type: 36, len: 16
MIDI Header (ignored)
type: 36, len: 6
MIDI IN Jack (ignored)
type: 5, len: 7
MIDIDevice claim this=1FFF5740
len = 120
Interface is unknown (might be Yahama)
type: 36, len: 16
MIDI Header (ignored)
type: 36, len: 6
MIDI IN Jack (ignored)
type: 5, len: 7
MIDIDevice claim this=1FFF2020
len = 120
Interface is unknown (might be Yahama)
type: 36, len: 16
MIDI Header (ignored)
type: 36, len: 6
MIDI IN Jack (ignored)
type: 5, len: 7
MIDIDevice claim this=1FFF3140
len = 120
Interface is unknown (might be Yahama)
type: 36, len: 16
MIDI Header (ignored)
type: 36, len: 6
MIDI IN Jack (ignored)
type: 5, len: 7
MIDIDevice claim this=1FFF4260
len = 120
Interface is unknown (might be Yahama)
type: 36, len: 16
MIDI Header (ignored)
type: 36, len: 6
MIDI IN Jack (ignored)
type: 5, len: 7
Descriptor 36 = ???
Descriptor 36 = ???
Descriptor 5 = ENDPOINT
Descriptor 37 = ???
Descriptor 4 = INTERFACE
MIDIDevice claim this=1FFF73C0
len = 74
Interface is MIDI
type: 36, len: 7
MIDI Header (ignored)
type: 36, len: 6
MIDI IN Jack (ignored)
type: 36, len: 6
MIDI IN Jack (ignored)
type: 36, len: 9
MIDI OUT Jack (ignored)
type: 36, len: 9
MIDI OUT Jack (ignored)
type: 5, len: 9
MIDI Endpoint: 4
tx_size = 256
type: 37, len: 5
MIDI Endpoint Jack Association (ignored)
type: 5, len: 9
MIDI Endpoint: 83
rx_size = 256
type: 37, len: 5
MIDI Endpoint Jack Association (ignored)
new_Pipe
new_Pipe
Descriptor 36 = ???
Descriptor 36 = ???
Descriptor 36 = ???
Descriptor 36 = ???
Descriptor 36 = ???
Descriptor 5 = ENDPOINT
Descriptor 37 = ???
Descriptor 5 = ENDPOINT
Descriptor 37 = ???
Sending CC#60 1
MIDIDevice transmit complete
MIDI Data: 0B BF 3C 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
MIDIDevice Receive
MIDI Data: 0B B0 49 00
avail = 398
queue another receive packet
Sending CC#60 2
MIDIDevice transmit complete
MIDI Data: 0B BF 3C 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Sending CC#60 3
Sending CC#60 4
Who can help me?