Forum Rule: Always post complete source code & details to reproduce any issue!
Page 2 of 3 FirstFirst 1 2 3 LastLast
Results 26 to 50 of 51

Thread: MIDI SendSysEx on USB host

  1. #26
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,344
    Ok, I'm looking at the UHS 2.0 code. I see this at line 313:

    Code:
                                    if( isMidi )
                                            index = ((epDesc->bEndpointAddress & 0x80) == 0x80) ? epDataInIndex : epDataOutIndex;
                                    else
                                            index = ((epDesc->bEndpointAddress & 0x80) == 0x80) ? epDataInIndexVSP : epDataOutIndexVSP;
    Then I see this at line 222:

    Code:
            if( !isMidiFound ){ //MIDI Device not found. Try last Bulk transfer device
                    USBTRACE("MIDI not found. Attempts bulk device\r\n");
                    epInfo[epDataInIndex].epAddr      = epInfo[epDataInIndexVSP].epAddr;
                    epInfo[epDataInIndex].maxPktSize  = epInfo[epDataInIndexVSP].maxPktSize;
                    epInfo[epDataOutIndex].epAddr     = epInfo[epDataOutIndexVSP].epAddr;
                    epInfo[epDataOutIndex].maxPktSize = epInfo[epDataOutIndexVSP].maxPktSize;
            }
    I guess I don't really understand why they bother to with epDataInIndexVSP and epDataOutIndexVSP, and 2 more sets of info in their list of endpoints, when they'll just unconditionally use the "VSP" entries when isMidiFound is false. What's the point?

    But what I *really* don't understand is how this code deals with the *many* USB devices that have interfaces with 2 bulk endpoints. What happens if you try to use a hub, a MIDI drumpad, and also a FTDI serial board? What keeps the USBH_MIDI from trying to talk MIDI to the FTDI device? Likewise for USB storage and many other interfaces that use 2 bulk endpoints?

  2. #27
    Member
    Join Date
    Feb 2019
    Location
    Switzerland
    Posts
    23
    We're getting close. With your suggested change in midi.cpp, I can receive data from the THR10. A bInterfaceClass of 0xff probably makes sense, because the THR10 also has an USB audio interface that is not class compliant. Yamaha offers a proprietary Steinberg driver for this device.

    I can also send out SysEx messages and the THR10 does understand them (i.e. it does what I want it to

    I think I found another problem, though: My memory gets overwritten when the Teensy receives a certain amount of SysEx data. I suspect a buffer overrun within the library. With the original buffer sizes of MAX_PACKET_SIZE = 64 / RX_QUEUE_SIZE = 80, this happens almost immediately when I turn some knobs on the THR10. With the increased buffer sizes of 512 / 2048, I can't reproduce this behaviour. But Maybe that's something you want to check.

    Is there anything I have to do in order to clear the receive queue regularly or can I safely ignore all incoming messages from the THR10?

    BTW I left ehci.cpp in it's original state (no speed reduction to 12Mbit/s).

  3. #28
    Member
    Join Date
    Jul 2018
    Posts
    38
    I see you found the UHS code. I do not see how it can reject non-MIDI devices. As long as the device has at least 1 bulk in and 1 bulk out the driver will claim the device. Perhaps a better solution is to add a way force claim a non-compliant MIDI device based on VID/PID (and at least 1 bulk in and 1 bulk out). The default is to claim only class compliant MIDI devices.

  4. #29
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,344
    Quote Originally Posted by Hirnilein0815 View Post
    I think I found another problem, though: My memory gets overwritten when the Teensy receives a certain amount of SysEx data. I suspect a buffer overrun within the library. With the original buffer sizes of MAX_PACKET_SIZE = 64 / RX_QUEUE_SIZE = 80, this happens almost immediately when I turn some knobs on the THR10. With the increased buffer sizes of 512 / 2048, I can't reproduce this behaviour. But Maybe that's something you want to check.
    I'd like to investigate this. Without a real THR10 here for testing, or some other way to reproduce the problem, not sure how I could even begin.

    I don't even have a clear picture what you're really observing when you say "My memory gets overwritten". Even if I had a THR10 here, the only instruction I have so far to reproduce the problem is "turn some knobs on the THR10", but no idea of what you're expecting to see and what you actually seeing. There may indeed be a bug where memory is overwritten. Or any number of other issues could be happening. If I had a THR10, I would also need a clear description of the actual steps and observed behavior.

    EDIT: or with a very clear description of the behavior you're actually observing, and a good idea of what the THR10 is actually sending, I might be able to program another Teensy as a stand-in for the THR10. Or maybe you could try that, if you've got a spare Teensy available?
    Last edited by PaulStoffregen; 02-26-2019 at 10:19 PM.

  5. #30
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,344
    Quote Originally Posted by gdsports View Post
    I do not see how it can reject non-MIDI devices. As long as the device has at least 1 bulk in and 1 bulk out the driver will claim the device. Perhaps a better solution is to add a way force claim a non-compliant MIDI device based on VID/PID (and at least 1 bulk in and 1 bulk out). The default is to claim only class compliant MIDI devices.
    I looked briefly at the Linux source code.

    My understanding of their code is vendor ID 0x0499 (Yamaja) causes create_yamaha_midi_quirk() to be called. That functions seems to look for an interface which has the MIDI jack descriptors and 2 bulk endpoints. As nearly as I can tell, it seems to completely ignore bInterfaceClass and also bInterfaceSubClass in the interface descriptor. That kinda make me wonder if there are other Yahama devices out there were they didn't even bother to set bInterfaceSubClass to 3?

    Here's the patch that seems to have added this to the Linux kernel, proposed almost 6 years ago.

    https://git.congatec.com/arm/imx6_ke...2ddf671ea9108c

  6. #31
    Member
    Join Date
    Jul 2018
    Posts
    38
    I just tried a USB composite device with CDC ACM and MSC with the UHS2 USB host MIDI driver. The driver claimed the clearly non-MIDI device. I do not see how it can co-exist with any other USB device with bulk endpoints. Perhaps Uno/UHS users do not use multiple USB devices given the limited RAM and Flash.

    Maintaining code for quirky devices seems like a high maintenance solution.

  7. #32
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,344
    I've committed an attempt to detect these Yamaha devices, without falsely claiming non-MIDI interfaces.

    https://github.com/PaulStoffregen/US...171deb108574fa

    Here's the new midi.cpp file. I don't have any Yamaha devices to test.
    Attached Files Attached Files

  8. #33
    Member ETMoody3's Avatar
    Join Date
    Mar 2014
    Location
    New Ulm, Mn
    Posts
    55
    Hey there.

    I have a Yamaha MX49 keyboard that has both usb audio I/O and 5 midi ports ( cables) in one physical USB cable.

    I saw a post on social media looking for this amp to test and Paul asked me to post the debug info from the MX49.

    Hopefully this helps.

    In any case, I know I want to develop a Teensy - based patch editor as this keyboard uses a third party editor to edit sounds. Sound editing is not done from the device panel, and Yamaha is enabling third party coding. The implementation of this editing "midi port" is available online and may *also* offer clues to how Yamaha may choose to use midi to control the parameters in the amp. Certainly this keyboard contains a multifx engine and full control of it is available via midi cc#s.

    I'd like to know myself how to have the midi host library select/differentiate between these ports.

    From the documentation:
    port 1 = the instrument as you'd normally expect
    port 2 = exclusive to DAW remote control functions on keyboard panel
    port 3 = midi thru ( meaning the 5 pin jacks on the keyboard)
    port 4 = "Not Used"
    port 5 = data communication for "remote editor" ( the third party software, see yamaha documentation online at https://usa.yamaha.com/files/downloa...h_en_pm_a0.pdf )

    All that plus audio I/O just like the amplifier. The keyboard becomes the soundcard in both directions.

    As per Paul's request, this is the debug results from the Midi-InputsFunctions example and the appropriate library modified. I edited out a huge number of clock receive events...

    Code:
    port change: 10001803
        connect
      begin reset
    port change: 10001005
      port enabled
      end recovery
    new_Device: 12 Mbit/sec
    new_Pipe
    enumeration:
    enumeration:
    enumeration:
    Device Descriptor:
      12 01 00 02 EF 02 01 08 99 04 11 17 20 01 01 02 00 02 
        VendorID = 0499, ProductID = 1711, Version = 0120
        Class/Subclass/Protocol = 239 / 2 / 1
        Number of Configurations = 2
    enumeration:
    enumeration:
    Manufacturer: Yamaha Corporation
    enumeration:
    Product: Yamaha MX Series
    enumeration:
    Config data length = 421
    enumeration:
    Configuration Descriptor:
      09 02 A5 01 04 01 00 C0 01 
        NumInterfaces = 4
        ConfigurationValue = 1
      08 0B 00 04 01 00 20 00 
        Interface Association = 0 through 3
        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 09 4B 00 00 
      08 24 0A 20 01 01 00 00 
      08 24 0B 21 01 20 01 00 
      11 24 02 01 01 01 00 21 02 03 00 00 00 00 00 00 00 
      0C 24 03 02 13 07 00 01 21 00 00 00 
      11 24 02 03 13 07 00 21 02 03 00 00 00 00 00 00 00 
      0C 24 03 04 01 01 00 03 21 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 01 01 02 20 00 
        Interface = 1
        Number of endpoints = 1
        Class/Subclass/Protocol = 1 / 2 / 32
      10 24 01 01 00 01 01 00 00 00 02 03 00 00 00 00 
      06 24 02 01 03 18 
      07 05 01 05 20 01 01 
        Endpoint = 1 OUT
        Type = Isochronous
        Max Size = 288
        Polling Interval = 1
      08 25 01 00 00 00 00 00 
      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 04 00 01 01 00 00 00 02 03 00 00 00 00 
      06 24 02 01 03 18 
      07 05 82 25 20 01 01 
        Endpoint = 2 IN
        Type = Isochronous
        Max Size = 288
        Polling Interval = 1
      08 25 01 00 00 00 00 00 
      09 04 03 00 02 01 03 00 00 
        Interface = 3
        Number of endpoints = 2
        Class/Subclass/Protocol = 1 / 3 / 0
      07 24 01 00 01 BD 00 
      06 24 02 01 01 00 
      06 24 02 02 02 00 
      06 24 02 01 03 00 
      06 24 02 02 04 00 
      06 24 02 01 05 00 
      06 24 02 02 06 00 
      06 24 02 01 07 00 
      06 24 02 02 08 00 
      06 24 02 01 09 00 
      06 24 02 02 0A 00 
      09 24 03 01 0B 01 02 01 00 
      09 24 03 02 0C 01 01 01 00 
      09 24 03 01 0D 01 04 01 00 
      09 24 03 02 0E 01 03 01 00 
      09 24 03 01 0F 01 06 01 00 
      09 24 03 02 10 01 05 01 00 
      09 24 03 01 11 01 08 01 00 
      09 24 03 02 12 01 07 01 00 
      09 24 03 01 13 01 0A 01 00 
      09 24 03 02 14 01 09 01 00 
      09 05 03 02 20 00 01 00 00 
        Endpoint = 3 OUT
        Type = Bulk
        Max Size = 32
        Polling Interval = 1
      09 25 01 05 01 03 05 07 09 
      09 05 84 02 20 00 01 00 00 
        Endpoint = 4 IN
        Type = Bulk
        Max Size = 32
        Polling Interval = 1
      09 25 01 05 0B 0D 0F 11 13 
    enumeration:
    USBHub memory usage = 960
    USBHub claim_device this=1FFF26E0
    USBHub memory usage = 960
    USBHub claim_device this=1FFF2AA0
    Descriptor 11 = IAD
    Descriptor 4 = INTERFACE
    MIDIDevice claim this=1FFF2020
    len = 404
    Descriptor 36 =  ???
    Descriptor 36 =  ???
    Descriptor 36 =  ???
    Descriptor 36 =  ???
    Descriptor 36 =  ???
    Descriptor 36 =  ???
    Descriptor 36 =  ???
    Descriptor 4 = INTERFACE
    MIDIDevice claim this=1FFF2020
    len = 312
    Descriptor 4 = INTERFACE
    MIDIDevice claim this=1FFF2020
    len = 303
    Descriptor 36 =  ???
    Descriptor 36 =  ???
    Descriptor 5 = ENDPOINT
    Descriptor 37 =  ???
    Descriptor 4 = INTERFACE
    MIDIDevice claim this=1FFF2020
    len = 257
    Descriptor 4 = INTERFACE
    MIDIDevice claim this=1FFF2020
    len = 248
    Descriptor 36 =  ???
    Descriptor 36 =  ???
    Descriptor 5 = ENDPOINT
    Descriptor 37 =  ???
    Descriptor 4 = INTERFACE
    MIDIDevice claim this=1FFF2020
    len = 202
      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: 6
        MIDI IN Jack (ignored)
    type: 36, len: 6
        MIDI IN Jack (ignored)
    type: 36, len: 6
        MIDI IN Jack (ignored)
    type: 36, len: 6
        MIDI IN Jack (ignored)
    type: 36, len: 6
        MIDI IN Jack (ignored)
    type: 36, len: 6
        MIDI IN Jack (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: 36, len: 9
        MIDI OUT Jack (ignored)
    type: 36, len: 9
        MIDI OUT Jack (ignored)
    type: 36, len: 9
        MIDI OUT Jack (ignored)
    type: 36, len: 9
        MIDI OUT Jack (ignored)
    type: 36, len: 9
        MIDI OUT Jack (ignored)
    type: 36, len: 9
        MIDI OUT Jack (ignored)
    type: 36, len: 9
        MIDI OUT Jack (ignored)
    type: 36, len: 9
        MIDI OUT Jack (ignored)
    type: 5, len: 9
        MIDI Endpoint: 3
          tx_size = 32
    type: 37, len: 9
        MIDI Endpoint Jack Association (ignored)
    type: 5, len: 9
        MIDI Endpoint: 84
          rx_size = 32
    type: 37, len: 9
        MIDI Endpoint Jack Association (ignored)
    new_Pipe
    new_Pipe
    Descriptor 36 =  ???
    Descriptor 36 =  ???
    Descriptor 36 =  ???
    Descriptor 36 =  ???
    Descriptor 36 =  ???
    Descriptor 36 =  ???
    Descriptor 36 =  ???
    Descriptor 36 =  ???
    Descriptor 36 =  ???
    Descriptor 36 =  ???
    Descriptor 36 =  ???
    Descriptor 36 =  ???
    Descriptor 36 =  ???
    Descriptor 36 =  ???
    Descriptor 36 =  ???
    Descriptor 36 =  ???
    Descriptor 36 =  ???
    Descriptor 36 =  ???
    Descriptor 36 =  ???
    Descriptor 36 =  ???
    Descriptor 36 =  ???
    Descriptor 5 = ENDPOINT
    Descriptor 37 =  ???
    Descriptor 5 = ENDPOINT
    Descriptor 37 =  ???
    MIDIDevice Receive
      MIDI Data: 0F F8 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    avail = 78
    queue another receive packet
    read: F80F
    Clock
    MIDIDevice Receive
      MIDI Data: 0F F8 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    avail = 78
    queue another receive packet
    read: F80F
    Clock
    port change: 1C00100A
        disconnect
    disconnect_Device:
    USBDriver (available_drivers) list: 1FFF26E0 -> 1FFF2AA0
    USBDriver (dev->drivers) list: 1FFF2020
    disconnect driver 1FFF2020
    USBDriver (available_drivers) list: 1FFF2020 -> 1FFF26E0 -> 1FFF2AA0
    delete_Pipe 1FFF2420
      remove QH from async schedule
      Free transfers
        * 536818944 * remove * free
      Free transfers attached to QH
        * 536818816
    * Delete Pipe completed
    delete_Pipe 1FFF2480
      remove QH from async schedule
      Free transfers
      Free transfers attached to QH
        * 536818880
    * Delete Pipe completed
    delete_Pipe 1FFF3400
      shut down async schedule
      Free transfers
      Free transfers attached to QH
        * 536819008
    * Delete Pipe completed
    removed Device_t from devlist
      disable

  9. #34
    Member
    Join Date
    Feb 2019
    Location
    Switzerland
    Posts
    23
    Quote Originally Posted by PaulStoffregen View Post
    I don't even have a clear picture what you're really observing when you say "My memory gets overwritten". Even if I had a THR10 here, the only instruction I have so far to reproduce the problem is "turn some knobs on the THR10", but no idea of what you're expecting to see and what you actually seeing. There may indeed be a bug where memory is overwritten. Or any number of other issues could be happening. If I had a THR10, I would also need a clear description of the actual steps and observed behavior.
    In my code I have a global char[] that holds a filename. The content of this array got corrupted shortly after I connected the THR10 (I found out because file.open() first worked, but later failed with an error message: "Can't open <garbage>"). <garbage> was getting longer with every sysex message the Teensy received, so it's quite obvious that the library is filling up memory that doesn't belong to it. After some more time the Teensy became unresponsive. Again, this only happend with small buffers.

    I don't do anything with the Incoming sysexs, like copying them somwhere or run any code. I simply ignore them.

    Quote Originally Posted by PaulStoffregen View Post
    EDIT: or with a very clear description of the behavior you're actually observing, and a good idea of what the THR10 is actually sending, I might be able to program another Teensy as a stand-in for the THR10. Or maybe you could try that, if you've got a spare Teensy available?
    Unfortunately, I don't have another Teensy. But I can post the output of my Windows-based MIDI-Monitor, if that helps. The THR10 sends a heartbeat every second or so, plus all the setting changes (i.e. turning knobs).

  10. #35
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,344
    Quote Originally Posted by Hirnilein0815 View Post
    In my code I have a global char[] that holds a filename. The content of this array got corrupted shortly after I connected the THR10
    First, please make a backup copy of this code. Memory corruption bugs can be very elusive. Even small changes can cause the placement of variables in memory to change.

    With that in mind, I'm hoping you can share a copy of this code, or maybe trim away any secret or proprietary details and share just a small program where the memory corruption happens. Even with a program that's known to reproduce the bug, I'm going to have to create a replacement for the THR10 from only the info about the sysex message... so odds of reproducing exactly the same problem are already not good. If I have to guess the code on the Teensy 3.6 side too, I will need to get very lucky to reproduce this problem. Really hoping you can share a program for the Teensy 3.6 which prints that "Can't open <garbage>" result?

  11. #36
    Member
    Join Date
    Feb 2019
    Location
    Switzerland
    Posts
    23
    Sure, I use SourceSafe as version control system, so I should be able to reproduce the code. The code also depends on other hardware (buttons, OLED, SD Card). I will try to reproduce the bug with a stripped down version that doesn't depend on extra hardware.

  12. #37
    Member
    Join Date
    Feb 2019
    Location
    Switzerland
    Posts
    23
    As I found out, my own code doesn't make any difference. Even with this simple example that doesn't do anything with the incoming data, the Teensy hangs a short time after I connect the THR10:

    Code:
    #include <USBHost_t36.h>
    
    USBHost myUsb;
    USBHub hub1(myUsb);
    USBHub hub2(myUsb);
    MIDIDevice myMidi(myUsb);
    
    char g_sString[] = "This is a string!";
    unsigned int g_nCounter = 0;
    
    void setup()
    {
    	Serial.begin(115200);
    
    	// Wait for serial port to connect
    	while (!Serial)
    	{
    		delay(10);
    	}
    
    	
    	delay(1000);
    	myUsb.begin();
    }
    
    void loop()
    {
      // put your main code here, to run repeatedly:
    	delay(1000);
    	Serial.print(g_sString);
    	Serial.print(" ");
    	Serial.println(g_nCounter++);
    }
    This happens only with the small buffers (i.e. USBHost_t36.h in its original state). This is what the THR10 sends about every second:

    0000173A 2 3 F0 Buffer: 9 Bytes System Exclusive
    SYSX: F0 43 7D 60 44 54 41 31 F7
    0000192E 2 3 F0 Buffer: 9 Bytes System Exclusive
    SYSX: F0 43 7D 60 44 54 41 31 F7
    00001B22 2 3 F0 Buffer: 9 Bytes System Exclusive
    SYSX: F0 43 7D 60 44 54 41 31 F7
    00001D16 2 3 F0 Buffer: 9 Bytes System Exclusive
    SYSX: F0 43 7D 60 44 54 41 31 F7
    00001F0B 2 3 F0 Buffer: 9 Bytes System Exclusive
    SYSX: F0 43 7D 60 44 54 41 31 F7
    000020FE 2 3 F0 Buffer: 9 Bytes System Exclusive
    SYSX: F0 43 7D 60 44 54 41 31 F7
    000022F3 2 3 F0 Buffer: 9 Bytes System Exclusive
    SYSX: F0 43 7D 60 44 54 41 31 F7
    000024E6 2 3 F0 Buffer: 9 Bytes System Exclusive
    SYSX: F0 43 7D 60 44 54 41 31 F7

  13. #38
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,344
    I'm trying to reproduce the problem here, but not having much luck.

    This is the code I have on a Teensy 3.2, trying to emulate the THR10.

    Code:
    uint8_t sysex[9] = {0xF0,0x43,0x7D,0x60,0x44,0x54,0x41,0x31,0xF7};
    
    void setup() {
      pinMode(13, OUTPUT);
    }
    int count=0;
    
    void loop() {
      digitalWrite(13, HIGH);
      for (int i=0; i < 8; i++) {
        sysex[1] = i;
        sysex[2] = count;
        usbMIDI.sendSysEx(9, sysex, true);
      }
      delay(10);
      digitalWrite(13, LOW);
      delay(990);
      if (++count > 128) count = 0;
    }
    I'm running your program, but it's not crashing or printing garbage for the string.

    Click image for larger version. 

Name:	sc.png 
Views:	6 
Size:	44.4 KB 
ID:	16027

  14. #39
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,344
    Could you run your test again, but with "#define USBHOST_PRINT_DEBUG" uncommented in USBHost_t36.h, and then post the debug output? That will give me a much better picture of the USB packets actually sent by the THR10. Maybe with that info, I can change my code to make the Teensy 3.2 more closely mimic the THR10 and reproduce this problem.

  15. #40
    Member
    Join Date
    Feb 2019
    Location
    Switzerland
    Posts
    23
    Hi Paul,

    Sure, I can do this when I'm back home.

    I just reviewed the changes you made to the library two days ago. You introduced a new class MIDIDevice_BigBuffer. May I suggest to solve this within the existing MIDIDevice class instead with an new constructor like this:

    Code:
    public MIDIDevice(USBHost &host, bool bUseBigBuffers)
    or even better, define an enum for different buffer sizes

    Code:
    enum eBufferSize = { eDefault, eLarge };
    
    public MIDIDevice(USBHost &host, eBufferSize bufferSize)
    This would make future changes much easier without breaking existing code.

  16. #41
    Member
    Join Date
    Feb 2019
    Location
    Switzerland
    Posts
    23
    Just a thought: I think to remember from another forum discussion that the THR10 automatically sends out all its settings when you connect it to a host. That would be 261 bytes for the patch, 18 bytes for the prefix and 2 bytes for the suffix that are sent out at once. Is it possible that the buffers get corrupted if a single SysEx message is larger than the receive buffer or the queue? Maybe you can try to send a much larger byte Array from your Teensy 3.2.

    I have been staring at
    Code:
    void MIDIDeviceBase::rx_data(const Transfer_t *transfer)
    for some time now and I believe that large transfers won't be handled correctly if the Transfer size is bigger than the queue. Not sure, though.
    Last edited by Hirnilein0815; 03-01-2019 at 09:10 AM.

  17. #42
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,344
    Quote Originally Posted by Hirnilein0815 View Post
    Just a thought: I think to remember from another forum discussion that the THR10 automatically sends out all its settings when you connect it to a host. That would be 261 bytes for the patch, 18 bytes for the prefix and 2 bytes for the suffix that are sent out at once. Is it possible that the buffers get corrupted if a single SysEx message is larger than the receive buffer or the queue? Maybe you can try to send a much larger byte Array from your Teensy 3.2.
    Possible, maybe. I've never tested with really long sysex data, so this very well may be it.

    Before I do more guessing to program a Teensy 3.2 to reproduce this problem, I'm waiting for you to post that debug info. I've already put the time into programming 1 unsuccessful attempt from a written description. I really want my 2nd attempt to be informed by the actual debug data. Hope you can understand my reluctance to blind guess again before seeing this info?


    Quote Originally Posted by Hirnilein0815 View Post
    May I suggest to solve this within the existing MIDIDevice class instead with an new constructor like this:

    Code:
    public MIDIDevice(USBHost &host, bool bUseBigBuffers)
    or even better, define an enum for different buffer sizes
    .....
    I will consider this if you can show more specifically how to implement it, within the way the library is designed.

    USBHost_t36 never uses heap memory, by malloc/free or C++ new/delete or any other way. The buffers should be allocated within the class instances, but I am willing to consider other approaches. The memory usage *must* be visible to Arduino users in the summary the Arduino IDE prints when you compile. A major goal of USBHost_t36 is to avoid large allocation on the stack and any use of the heap, so users get a clear idea of how much memory is used by the driver instances they've chosen.

    Also off the table is any C++ template syntax in the user level API. Template stuff within the private APIs is ok, as long as it isn't exposed to users for use in their Arduino sketches.

    If you can show me how to make this idea work, within those design constraints, then I will consider it.

  18. #43
    Member
    Join Date
    Feb 2019
    Location
    Switzerland
    Posts
    23
    Quote Originally Posted by PaulStoffregen View Post
    If you can show me how to make this idea work, within those design constraints, then I will consider it.
    I didn't know about these constraints. My idea was indeed to allocate the buffers dynamically.

  19. #44
    Member
    Join Date
    Feb 2019
    Location
    Switzerland
    Posts
    23
    sizeof Device = 36
    sizeof Pipe = 96
    sizeof Transfer = 64
    power up USBHS PHY
    reset waited 5
    USBHS_ASYNCLISTADDR = 0
    USBHS_PERIODICLISTBASE = 1FFF6000
    periodictable = 1FFF6000
    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 FF 00 FF 40 99 04 07 15 00 01 01 02 00 01
    VendorID = 0499, ProductID = 1507, Version = 0100
    Class/Subclass/Protocol = 255 / 0 / 255
    Number of Configurations = 1
    enumeration:
    enumeration:
    Manufacturer: Yamaha Corporation
    enumeration:
    Product: THR10
    enumeration:
    Config data length = 215
    enumeration:
    Configuration Descriptor:
    09 02 D7 00 04 01 00 C0 00
    NumInterfaces = 4
    ConfigurationValue = 1
    09 04 00 00 00 FF 01 00 00
    Interface = 0
    Number of endpoints = 0
    Class/Subclass/Protocol = 255 / 1 / 0
    0A 24 01 00 01 34 00 02 01 02
    0C 24 02 01 01 01 00 02 03 00 00 00
    09 24 03 02 01 03 00 01 00
    0C 24 02 03 03 06 00 02 03 00 00 00
    09 24 03 04 01 01 00 03 00
    09 04 01 00 00 FF 02 00 00
    Interface = 1
    Number of endpoints = 0
    Class/Subclass/Protocol = 255 / 2 / 0
    09 04 01 01 01 FF 02 00 00
    Interface = 1
    Number of endpoints = 1
    Class/Subclass/Protocol = 255 / 2 / 0
    07 24 01 01 01 01 00
    0B 24 02 01 02 03 18 01 44 AC 00
    07 05 07 05 24 00 01
    Endpoint = 7 OUT
    Type = Isochronous
    Max Size = 36
    Polling Interval = 1
    07 25 01 01 00 00 00
    09 04 02 00 00 FF 02 00 00
    Interface = 2
    Number of endpoints = 0
    Class/Subclass/Protocol = 255 / 2 / 0
    09 04 02 01 01 FF 02 00 00
    Interface = 2
    Number of endpoints = 1
    Class/Subclass/Protocol = 255 / 2 / 0
    07 24 01 04 01 01 00
    0B 24 02 01 04 03 18 01 44 AC 00
    07 05 86 05 48 00 01
    Endpoint = 6 IN
    Type = Isochronous
    Max Size = 72
    Polling Interval = 1
    07 25 01 01 00 00 00
    09 04 03 00 02 FF 03 FF 00
    Interface = 3
    Number of endpoints = 2
    Class/Subclass/Protocol = 255 / 3 / 255
    07 24 01 00 01 24 00
    06 24 02 02 01 00
    09 24 03 02 01 01 01 01 00
    07 05 01 02 00 02 00
    Endpoint = 1 OUT
    Type = Bulk
    Max Size = 512
    Polling Interval = 0
    07 05 82 02 00 02 00
    Endpoint = 2 IN
    Type = Bulk
    Max Size = 512
    Polling Interval = 0
    enumeration:
    USBHub memory usage = 960
    USBHub claim_device this=1FFF2020
    USBHub memory usage = 960
    USBHub claim_device this=1FFF23E0
    Descriptor 4 = INTERFACE
    MIDIDevice claim this=1FFF27A0
    len = 206
    Descriptor 36 = ???
    Descriptor 36 = ???
    Descriptor 36 = ???
    Descriptor 36 = ???
    Descriptor 36 = ???
    Descriptor 4 = INTERFACE
    MIDIDevice claim this=1FFF27A0
    len = 145
    Descriptor 4 = INTERFACE
    MIDIDevice claim this=1FFF27A0
    len = 136
    Descriptor 36 = ???
    Descriptor 36 = ???
    Descriptor 5 = ENDPOINT
    Descriptor 37 = ???
    Descriptor 4 = INTERFACE
    MIDIDevice claim this=1FFF27A0
    len = 95
    Descriptor 4 = INTERFACE
    MIDIDevice claim this=1FFF27A0
    len = 86
    Descriptor 36 = ???
    Descriptor 36 = ???
    Descriptor 5 = ENDPOINT
    Descriptor 37 = ???
    Descriptor 4 = INTERFACE
    MIDIDevice claim this=1FFF27A0
    len = 45
    Interface is MIDI
    type: 36, len: 7
    MIDI Header (ignored)
    type: 36, len: 6
    MIDI IN Jack (ignored)
    type: 36, len: 9
    MIDI OUT Jack (ignored)
    type: 5, len: 7
    MIDI Endpoint: 1
    tx_size = 512
    type: 5, len: 7
    MIDI Endpoint: 82
    rx_size = 512
    new_Pipe
    new_Pipe
    Descriptor 36 = ???
    Descriptor 36 = ???
    Descriptor 36 = ???
    Descriptor 5 = ENDPOINT
    Descriptor 5 = ENDPOINT
    MIDIDevice Receive
    MIDI Data: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    avail = 2047
    queue another receive packet
    MIDIDevice Receive
    MIDI Data: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    avail = 2047
    queue another receive packet
    MIDIDevice Receive
    MIDI Data: 04 F0 43 7D 04 60 44 54 07 41 31 F7 04 F0 43 7D 04 60 44 54 07 41 31 F7 04 F0 43 7D 04 60 44 54 07 41 31 F7 04 F0 43 7D 04 60 44 54 07 41 31 F7 04 F0 43 7D 04 60 44 54 07 41 31 F7 04 F0 43 7D 04 60 44 54 07 41 31 F7 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    avail = 2029
    queue another receive packet
    MIDIDevice Receive
    MIDI Data: 04 F0 43 7D 04 60 44 54 07 41 31 F7 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    avail = 2026
    queue another receive packet
    This is a string! 0
    MIDIDevice Receive
    MIDI Data: 04 F0 43 7D 04 60 44 54 07 41 31 F7 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    avail = 2023
    queue another receive packet
    MIDIDevice Receive
    MIDI Data: 04 F0 43 7D 04 60 44 54 07 41 31 F7 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    avail = 2020
    queue another receive packet
    This is a string! 1
    MIDIDevice Receive
    MIDI Data: 04 F0 43 7D 04 60 44 54 07 41 31 F7 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    avail = 2017
    queue another receive packet
    MIDIDevice Receive
    MIDI Data: 04 F0 43 7D 04 60 44 54 07 41 31 F7 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    avail = 2014
    queue another receive packet

    [ Shortened ...]

    MIDIDevice Receive
    MIDI Data: 04 F0 43 7D 04 10 41 30 04 01 01 00 06 05 F7 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    avail = 148
    queue another receive packet
    MIDIDevice Receive
    MIDI Data: 04 F0 43 7D 04 10 41 30 04 01 01 00 06 06 F7 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    avail = 144
    queue another receive packet
    MIDIDevice Receive
    MIDI Data: 04 F0 43 7D 04 10 41 30 04 01 01 00 06 09 F7 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    avail = 140
    queue another receive packet
    This is a string! 19
    MIDIDevice Receive
    MIDI Data: 04 F0 43 7D 04 10 41 30 04 01 01 00 06 0C F7 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    avail = 136
    queue another receive packet
    MIDIDevice Receive
    MIDI Data: 04 F0 43 7D 04 10 41 30 04 01 01 00 06 10 F7 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    avail = 132
    queue another receive packet
    MIDIDevice Receive
    MIDI Data: 04 F0 43 7D 04 10 41 30 04 01 01 00 06 15 F7 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    avail = 128
    queue another receive packet
    MIDIDevice Receive
    MIDI Data: 04 F0 43 7D 04 10 41 30 04 01 01 00 06 1B F7 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    avail = 124
    wait to receive more packets
    This is a string! 20
    This is a string! 21
    This is a string! 22
    This is a string! 23
    This is a string! 24
    This is a string! 25
    This is a string! 26
    This is a string! 27
    This is a string! 28
    This is a string! 29
    This is a string! 30
    This is a string! 31
    This is a string! 32
    This is a string! 33

  20. #45
    Member
    Join Date
    Feb 2019
    Location
    Switzerland
    Posts
    23
    Hi Paul

    The Output is huge. I made two tests:

    - With small buffers I didn't get any output for incoming SysEx messages
    - With large buffers I got the above output

    As you can see, after 20 Seconds I get no more debug messages. The avail value is getting smaller with each message.

    I then added the following code to my scetch:

    Code:
    	while (myMidi.read())
    	{
    		;
    	}
    This leads to the following output:

  21. #46
    Member
    Join Date
    Feb 2019
    Location
    Switzerland
    Posts
    23
    MIDIDevice Receive
    MIDI Data: 04 F0 43 7D 04 10 41 30 04 01 01 00 06 51 F7 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    avail = 136
    queue another receive packet
    MIDIDevice Receive
    MIDI Data: 04 F0 43 7D 04 60 44 54 07 41 31 F7 04 F0 43 7D 04 10 41 30 04 01 01 00 06 52 F7 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    avail = 129
    queue another receive packet
    This is a string! 9
    read: 54446004
    MIDIDevice Receive
    MIDI Data: 04 F0 43 7D 04 10 41 30 04 01 01 00 06 51 F7 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    avail = 126
    wait to receive more packets
    This is a string! 10
    read: F7314107
    read: 7D43F004
    MIDIDevice Receive
    MIDI Data: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    avail = 128
    queue another receive packet
    MIDIDevice Receive
    MIDI Data: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    avail = 128
    queue another receive packet
    MIDIDevice Receive
    MIDI Data: 04 F0 43 7D 04 10 41 30 04 01 01 00 06 44 F7 00 04 F0 43 7D 04 10 41 30 04 01 01 00 06 3E F7 00 04 F0 43 7D 04 10 41 30 04 01 01 00 06 38 F7 00 04 F0 43 7D 04 10 41 30 04 01 01 00 06 31 F7 00 04 F0 43 7D 04 10 41 30 04 01 01 00 06 2C F7 00 04 F0 43 7D 04 10 41 30 04 01 01 00 06 29 F7 00 04 F0 43 7D 04 10 41 30 04 01 01 00 06 26 F7 00 04 F0 43 7D 04 10 41 30 04 01 01 00 06 25 F7 00 04 F0 43 7D 04 10 41 30 04 01 01 00 06 24 F7 00 04 F0 43 7D 04 10 41 30 04 01 01 00 06 23 F7 00 04 F0 43 7D 04 10 41 30 04 01 01 00 06 22 F7 00 04 F0 43 7D 04 10 41 30 04 01 01 00 06 23 F7 00 04 F0 43 7D 04 10 41 30 04 01 01 00 06 24 F7 00 04 F0 43 7D 04 10 41 30 04 01 01 00 06 27 F7 00 04 F0 43 7D 04 10 41 30 04 01 01 00 06 29 F7 00 04 F0 43 7D 04 10 41 30 04 01 01 00 06 2A F7 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    avail = 64
    wait to receive more packets
    This is a string! 11
    read: 54446004
    This is a string! 12
    read: F7314107
    read: 7D43F004
    This is a string! 13
    read: 54446004
    This is a string! 14
    read: F7314107
    read: 7D43F004
    This is a string! 15
    read: 54446004
    This is a string! 16
    read: F7314107
    read: 7D43F004
    This is a string! 17
    read: 54446004
    This is a string! 18
    read: F7314107
    read: 7D43F004
    This is a string! 19
    read: 30411004
    This is a string! 20
    read: 10104
    This is a string! 21
    read: F72706
    read: 7D43F004
    This is a string! 22
    read: 30411004
    This is a string! 23
    read: 10104
    This is a string! 24
    read: F72806
    read: 7D43F004
    This is a string! 25
    read: 30411004
    This is a string! 26
    read: 10104
    This is a string! 27
    read: F72906
    read: 7D43F004
    This is a string! 28
    read: 30411004
    This is a string! 29
    read: 10104
    This is a string! 30
    read: F72B06
    read: 7D43F004
    This is a string! 31
    read: 30411004
    This is a string! 32
    read: 10104
    This is a string! 33
    read: F72D06
    read: 7D43F004
    This is a string! 34
    read: 30411004
    This is a string! 35
    read: 10104
    This is a string! 36
    read: F73006
    read: 7D43F004
    This is a string! 37
    read: 30411004
    This is a string! 38
    read: 10104
    This is a string! 39
    read: F73306
    read: 7D43F004
    This is a string! 40
    read: 30411004
    This is a string! 41
    read: 10104
    This is a string! 42
    read: F73706
    read: 7D43F004
    This is a string! 43
    read: 30411004
    This is a string! 44
    read: 10104
    This is a string! 45
    read: F73B06
    read: 7D43F004
    This is a string! 46
    read: 30411004
    This is a string! 47
    read: 10104
    This is a string! 48
    read: F73F06
    read: 7D43F004
    This is a string! 49
    read: 30411004
    This is a string! 50
    read: 10104
    This is a string! 51
    read: F74206
    read: 7D43F004
    This is a string! 52
    read: 30411004
    This is a string! 53
    read: 10104
    This is a string! 54
    read: F74506
    read: 7D43F004
    This is a string! 55
    read: 30411004
    This is a string! 56
    read: 10104
    This is a string! 57
    read: F74706
    read: 7D43F004
    MIDIDevice Receive
    MIDI Data: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    avail = 128
    queue another receive packet
    MIDIDevice Receive
    MIDI Data: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    avail = 128
    queue another receive packet
    MIDIDevice Receive
    MIDI Data: 04 F0 43 7D 04 60 44 54 07 41 31 F7 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    avail = 125
    wait to receive more packets
    This is a string! 58
    read: 30411004
    This is a string! 59
    read: 10104
    This is a string! 60
    read: F74A06
    read: 7D43F004
    MIDIDevice Receive
    MIDI Data: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    avail = 129
    queue another receive packet
    MIDIDevice Receive
    MIDI Data: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    avail = 129
    queue another receive packet
    MIDIDevice Receive
    MIDI Data: 04 F0 43 7D 04 60 44 54 07 41 31 F7 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    avail = 126
    wait to receive more packets
    MIDIDevice Receive
    MIDI Data: 04 F0 43 7D 04 60 44 54 07 41 31 F7 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    avail = 123
    wait to receive more packets
    This is a string! 61
    read: 30411004
    This is a string! 62
    read: 10104
    This is a string! 63
    read: F74D06
    read: 7D43F004
    This is a string! 64
    read: 30411004
    MIDIDevice Receive
    MIDI Data: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    avail = 128
    queue another receive packet
    MIDIDevice Receive
    MIDI Data: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    avail = 128
    queue another receive packet
    MIDIDevice Receive
    MIDI Data: 04 F0 43 7D 04 60 44 54 07 41 31 F7 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    avail = 125
    wait to receive more packets
    This is a string! 65
    read: 10104

  22. #47
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,344
    Quote Originally Posted by Hirnilein0815 View Post
    The Output is huge. I made two tests:

    - With small buffers I didn't get any output for incoming SysEx messages
    - With large buffers I got the above output

    As you can see, after 20 Seconds I get no more debug messages. The avail value is getting smaller with each message.

    I then added the following code to my scetch:

    Code:
    	while (myMidi.read())
    	{
    		;
    	}
    This leads to the following output:
    Everything appears to be working properly.

    The descriptor info says the endpoint max is 512 bytes, so this can never work with the small buffers. The small buffers class should not try to claim the interface.

    When you saw the memory corrupted string, is there any chance you were running a modified copy of the library? If you deleted the code which checks the max packet size, then the small buffer class would erroneously claim the interface. Large incoming packets would be written to the small buffers, badly corrupting other memory!

    But if you're running the library without edits, this line is supposed to avoid using the small buffers when a larger packet size is used.

    Code:
            // if an IN endpoint was found, create its pipe
            if (rx_ep && rx_size <= max_packet_size) {

  23. #48
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,344
    I should also point out, the descriptor info you showed in msg #21 is not the same as the descriptors in msg #44.

    From msg #21:

    Code:
    new_Device: 12 Mbit/sec
    Code:
    07 05 01 02 40 00 00
    Endpoint = 1 OUT
    Type = Bulk
    Max Size = 64
    Polling Interval = 0
    07 05 82 02 40 00 00
    Endpoint = 2 IN
    Type = Bulk
    Max Size = 64
    Polling Interval = 0
    From msg #44:

    Code:
    new_Device: 480 Mbit/sec
    Code:
    07 05 01 02 00 02 00
    Endpoint = 1 OUT
    Type = Bulk
    Max Size = 512
    Polling Interval = 0
    07 05 82 02 00 02 00
    Endpoint = 2 IN
    Type = Bulk
    Max Size = 512
    Polling Interval = 0
    Why these aren't the same, I can only guess. This is the same THR10 device, right?

    Maybe in msg #21, perhaps you were running a modified copy of USBHost_t36 with the 12 Mbit edit I suggested in msg #13?

    The USB protocol limits bulk endpoints to only 64 bytes when the speed is 12 Mbit. But at 480 Mbit, up to 512 bytes is allowed. Most 480 Mbit devices send 2 different sets of descriptors and of course use different packet sizes, depending on the speed.

    Remember, I don't have a THR10. Everything I know about the THR10's USB is from the info you've posted here. Until just now, I believed THR10 was a 12 Mbit only device, since the msg #21 was the only info so far. Now it seems THR10 really is a 480 Mbit device?


    If you're running code that is different than the last release (in 1.45 and 1.46-beta6) or the latest on github, and you don't mention that fact when posting the debug output.... can you see how that could add a lot of extra uncertainty??

  24. #49
    Member
    Join Date
    Feb 2019
    Location
    Switzerland
    Posts
    23
    The only changes I ever made where those you advised me to do:

    1. Reduce Speed to 12MBit/s according to Post#13. This change didn't make any difference, so I rolled it back later.
    2. Increase Buffer size in USBHost_t36.h according to Post#12. This change helped, so I kept it this way
    3. Comment out the bInterfaceClass == 1 condition in midi.cpp according to post#23. This change is essential for the THR10, so I kept it.

    Just to be on the safe sid I downloaded the library from GitHub again today, applied changes 2 and 3, and tested again. I cannot reproduce the crash with small buffers anymore. I still can reproduce the output in post#46. Basically, this is how I read it: I receive all messages until the avail value drops below 128. After that, messages get lost. The question is: How do I empty the queue?

  25. #50
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,344
    Ok, I'm going to consider the memory corruption issue to be fully resolved.

    Quote Originally Posted by Hirnilein0815 View Post
    I still can reproduce the output in post#46. Basically, this is how I read it: I receive all messages until the avail value drops below 128. After that, messages get lost. The question is: How do I empty the queue?
    To answer your question, the way to empty the queue: just keep calling midi1.read(). The code fragment in msg #45 should do it.

    If that's not working, if you believe you've found another bug, as usual I need to see the full code to reproduce it. I'd like to ask you to please test with the latest code from github, without any changes, and please mention this in any more messages with code and debug data so I know exactly which copy of the library you used.

    Just to be clear, I have taken this thread off my list of known problems. If there is another bug here to be investigated, I will only put this thread back on my issue list when I see full code to reproduce the issue. Otherwise, I'm considering every problem raised so far on this thread to be fully resolved.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •