MIDI device class not working.

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by smoorby on Thu Apr 19 14:55:31 MST 2012
Hi all,

I've tried using the MIDI device class but have problems in both the IN and OUT directions. 

In the OUT direction I get some MIDI events but a lot of garbage too.  The data returned by MIDI_Device_ReceiveEventPacket sometimes but not always contains valid MIDI events.  Also the rate and number of events doesn't match what I know is being sent from the host. Looking at the code the problem is with the Endpoint_Read_Stream_LE() function which does not correctly consume the bytes received.  I've already commented on this in the context of the virtual serial device topic. I've done a fix which seems to work for MIDI out.  I hope a similar fix for CDCClassDevice.c will work too (haven't tried it yet).

Don't know what the problem is with MIDI IN, I don't see any bulk in traffic at the host.  The code appears to be sending the MIDI events but I'm not seeing them using usbmon.  I do get bulk in traffic with the CDC example code so I'm going to use that to help me debug.


P.S. The code base I'm working with is v0.94

Original Attachment has been moved to: MIDIClassDevice.c.zip

Original Attachment has been moved to: EndpointStream_LPC.c.zip