USB MIDI

Go To Last Post
8 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,

I'm using a SAME54 Xplained pro board and I'm trying to develop connectivity via USB to pass MIDI data.

The SAM board is the device and the PC the Host. My goal was to enumerate my device and use the windows default MIDI driver to communicate with the PC.

 

I haven't found any example on Start for ASF4 for this purpose, so I decided to start from Vendor class middleware and from there I have in fact managed to correctly enumerate my Device and properly load on Windows the correct driver which appear correctly configured after the enumeration.

 

I have also checked the enumeration activities through a protocol analyzer where I correctly see:

1) attachment of the device to the bus

2) set address request

3) get device descriptor, get configuration descriptor, get interface descriptor

4) set interface descriptor

 

In this last request I clearly see my device correctly setting the proper interface number (mididstreaming with jack in and jack out and bulk endpoints).

 

But here I stuck.

 

I can send from the pc a midi message that I see correctly set inside the protocol analyzer but:

1) no answer from the device

2) the midi driver seems frozen, if I try to send a second message from the pc or if I try to detouch the windows midi driver from the application I use to send the message inside the pc everything is simply blocked

3) I can't get any callback inside the device from the bulk out endpoint

 

I'm frustrated cause I feel I'm very close to the job done but after having tried many experiments I really feel I'm running out of ideas

An additional info is that in the USB register EPINTFLAG of the bulk EP, I see flagged the bit TRFAIL1 that should indicate that something goes wrong...

 

Should anyone have any idea that would really be appreciated.

 

Thanks a lot in advance,

 

Filo

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I was able to get Midi up and running, however I used the USB Composite Device example and created the Midistreaming class based on the CDC Serial implementation to replace the HID Generic class. I replicated all of the functions and initialized and registered all of the callbacks just the way it is done in the ASF4 examples.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello sukuwc,

thanks so much for sharing your experience.

I will give it a try with CDC composite and post my progresses, should this be useful to someone else.

 

Cheers,

 

Filippo

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi all,

 

I am very interested in any example code to get MIDI USB working.  I am just starting in on this, I will post any progress I make also.

 

-Troy

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Troy,

find below the link to my repository where I have uploaded my projet.

This project, based upon the Vendor USB middleware found in Atmel Start for SAMD54 Xplained Board, is currently correctly enumerating as MIDI device, is making my Window 10 correctly loading the AUDI MIDI generic driver and is activating the bulk endpoint. However here I stuck. When i try to send a MIDI message from the PC (the Host) to the device, this message do not seem arriving inside the board and no callback event is triggered. If i try to send a second message everything gets blocked.

 

https://github.com/fcampanini/US...

 

Let me know if you manage to advance.

 

Cheers,

 

Filo

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks much Filo, I will try it out.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks so much for sharing this code, Filo.  Looks like I am able to get to the same state as you.  I see the MIDI device pop up in Ableton Live, but I am not seeing loopback.

 

Can you send MIDI messages like Note On out of your code to the host?   If so, what is the syntax for that?

 

-Troy

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ciao Troy,

as I said I can link the midi driver in my Midi monitoring application (MIDI-OX) both in and out.

That's unfortunately all!

 

No way to have a callback reception inside the SAME54 for messages sent from MIDI-OX and no way to find the functions to send messages from the SAME54.

 

To be honest I think that we are substantially there, it's just something unclear in the usage of these Atmel drivers which are very structured and convoluted and moreover very poorly documented.

 

Cheers,

 

Filo