Teensy usb midi device not recognised by Teensy USB host

MrCanvas

Well-known member
Hi,

I have two Teensy-based systems that I am attempting to connect via USB for "midi-purposes"

System 1 is a 4.1-based hw running USBHost_t36.h. To this I have connected a 4-port usb hub, a midi controller (Launchpad) and a midi keyboard (LPK25). This setup is working well, and running a simple scanner based on the "joystick example" yields:
Code:
START
*** Device Hub1 5e3:610 - connected ***
  manufacturer: GenesysLogic
  product: USB2.0 Hub
*** Device midi1 9e8:76 - connected ***
  manufacturer: AKAI professional LLC
  product: LPK25
*** Device midi2 1235:113 - connected ***
  manufacturer: Focusrite - Novation
  product: Launchpad Mini MK3
  Serial: AY7PFFP18

Then, to this setup I want to connect System 2 which is a 4.0-based hw configured as usb midi device, with the intention of controlling it from the 4.1. This system is working well when connected to a PC but on the 4.1 it is not located at all (the scanner output is same as above). It is powered on ok on usb power and I tried using a powered hub as well to eliminate power related issues but no success there.

System 1 (host) is set to USB type Serial + Midi + Audio and has a host configuration like this:

Code:
USBHost myusb;
USBHub hub1(myusb);
MIDIDevice midi1(myusb); // Launchpad
MIDIDevice midi2(myusb); // Midi keyboard
MIDIDevice midi3(myusb); // External synth?

USBDriver *drivers[] = {&hub1, &midi1, &midi2, &midi3};
#define CNT_DEVICES (sizeof(drivers)/sizeof(drivers[0])) 
bool driver_active[CNT_DEVICES] = {false, false, false, false};
const char * driver_names[CNT_DEVICES] = {"Hub1", "midi1", "midi2", "midi3"};

And system 2 is just set to usb type Serial + Midi + Audio

Any obvious screwups or misunderstandings? More details needed?

Cheers, Daniel
 
Having enabled debug info in the usb host library I can see the 4.0 being recognised in some form at least, see below. But is there any reason for it not to show up as a midi device so I can do stuff like midi3.sendNoteOn??

Code:
Device Descriptor:
  12 01 00 02 EF 02 01 40 C0 16 8A 04 79 02 01 02 03 01 
    VendorID = 16C0, ProductID = 048A, Version = 0279
    Class/Subclass/Protocol = 239 / 2 / 1
    Number of Configurations = 1
enumeration:
enumeration:
Manufacturer: Teensyduino
enumeration:
Product: Teensy MIDI/Audio
enumeration:
Serial Number: 9951820
 
Finally, in an attempt to provide all info, here is the code to the "scanner" mentioned above. Its just snippets stolen from the host library examples. I would expect the 4.0 to show up in the results here. But probably I have just misunderstood something.

Code:
#include <USBHost_t36.h>
#include <MIDI.h>

USBHost myusb;
USBHub hub1(myusb);
MIDIDevice midi1(myusb); //Launchpad?
MIDIDevice midi2(myusb); // Midi keyboard ?
MIDIDevice midi3(myusb); // Midi keyboard ?
MIDIDevice midi4(myusb); // Midi keyboard ?

USBDriver *drivers[] = {&hub1, &midi1, &midi2, &midi3, &midi4};
#define CNT_DEVICES (sizeof(drivers)/sizeof(drivers[0])) 
bool driver_active[CNT_DEVICES] = {false, false, false, false, false};
const char * driver_names[CNT_DEVICES] = {"Hub1", "midi1", "midi2", "midi3", "midi4"};

void setup() {
 Serial.begin(115200);
 Serial.println("START");
  delay(200); //Wait to turn on USB Host
  myusb.begin();
}

void loop() {
  // put your main code here, to run repeatedly:
  myusb.Task();
  PrintDeviceListChanges();
}

void PrintDeviceListChanges() {
  for (uint8_t i = 0; i < CNT_DEVICES; i++) {
    if (*drivers[i] != driver_active[i]) {
      if (driver_active[i]) {
        Serial.printf("*** Device %s - disconnected ***\n", driver_names[i]);
        driver_active[i] = false;
      } else {
        Serial.printf("*** Device %s %x:%x - connected ***\n", driver_names[i], drivers[i]->idVendor(), drivers[i]->idProduct());
        driver_active[i] = true;

        const uint8_t *psz = drivers[i]->manufacturer();
        if (psz && *psz) Serial.printf("  manufacturer: %s\n", psz);
        psz = drivers[i]->product();
        if (psz && *psz) Serial.printf("  product: %s\n", psz);
        psz = drivers[i]->serialNumber();
        if (psz && *psz) Serial.printf("  Serial: %s\n", psz);
      }
    }
  }
}
 
In the end it was easy after I got my forum searches right. MIDIDevice_BigBuffer solves the problem.
 
Back
Top