Migrate to TinyUSB native support#14
Migrate to TinyUSB native support#14DisasterAreaDesigns wants to merge 2 commits intorppicomidi:mainfrom
Conversation
Migrate to built-in TinyUSB functions
rppicomidi
left a comment
There was a problem hiding this comment.
First, thank you for the pull request. I have not tried this yet, but I did have a chance to look at the code a bit. I have a design question for you.
I get that tuh_midih_define_limits() is not in the TinyUSB USB version of the MIDI host class driver. How do you propose to support the user who needs to adjust the buffer sizes in an Arduino environment? I am afraid not supporting the additional settings may break someone's application. You cannot just define the buffer sizes and number of cables in the sketch using compiler macros. The only things I could think of is to require the user to edit the tusb_config_[your processor here].h for the Adafruit_TinyUSB_Arduino library or to modify the platform.txt file. I suppose you will have to do that anyway to support USB MIDI Host for now. But eventually, hopefully, the Adafruit_TinyUSB_Arduino library will support MIDI host out of the box.
rppicomidi
left a comment
There was a problem hiding this comment.
The README.md file's Library Configuration and Implementation Details section needs to be revised to match how you configure the code to work prior to release of the native TinyUSB MIDI Host driver in the Adafruit_TinyUSB_Arduino library. Also, it needs to reference how to configure buffer sizes to work around problems given you can't do it in the settings class.
You're totally correct about the removal of tuh_midih_define_limits() - there isn't a clean way to do this using TinyUSB. What other options would we have, without usb_midi_host.h as the man in the middle? I would be fine with using it but TinyUSB works much better with USB hub support. How about adding a tusb_config.h in the sketch folder and including that? I'm using Arduino so I'm not sure how that affects the C++ side, but I think this might be a workaround. The TinyUSB library does need to be modified to allow for USB host support anyway, so changing that might not be a deal-breaker. As for updating the readme.md, I'm working on that now as indicated by the WIP statement at the top. |
|
@DisasterAreaDesigns I am sorry for the delay. Am very busy this week. I will try to catch up next week. In the meantime, if you have updates to the README, please feel free to submit them, too. |
|
@DisasterAreaDesigns I plan to fully test and likely merge this pull request if my pull request to Adafruit_TinyUSB_Arduino gets merged. |
Initial commit to add TinyUSB native support.
Important note: tested on RP2040 hardware. Adafruit_TinyUSB 3.7.3 does not have USB Host MIDI support enabled, so you must add the following lines to /src/arduino/ports/rp2040/tusb_config_rp2040.h:
// enable MIDI Host
#define CFG_TUH_MIDI (CFG_TUH_DEVICE_MAX)