-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support with MIDI devices that also doubles as Audio Interface #8
Comments
There is probably no workaround right yet. Please attach a dump of the USB descriptors of the devices that are giving you trouble. |
I've attached the USB descriptors dump for the Valeton GP-100 using dumper from Thesycon. |
Thanks. I will try crafting a solution based on this data, but it may take a day or two, and it may require some iteration to get it |
@VocasoGK By working with me, I meant that I will put out some code, you will test it and give feedback here. |
@VocasoGK This may not be a bug in this library. The default max TinyUSB Host descriptor storage is 256 bytes. I added up the lengths of all the USB Descriptors of the GP-100 and got 431 bytes. You didn't say whether you were using the library in Arduino or in C/C++. In C/C++, find your project's file
Change 256 to 512 and see if it works. If you are using the Arduino Adafruit TinyUSB Host library, your project won't have a Please let me know whether you are using C/C++ or Arduino, what is your target hardware, and whether the change I suggested you make works for you. |
For what it is worth, I submitted this issue to the Adafruit_TinyUSB_Arduino project. |
Thanks for the quick response! I'll keep you updated as soon as I can. |
Update: I don't have the GP-100 in my hand right now, but my MG-400 shouldn't be too different. (I've attached MG-400 Descriptor Dump just in case). And one thing I just found out to keep in mind, I don't find any way to edit the enumeration buffer size for the EZ_USB_MIDI_HOST. It still shows just the "Device removed, address = 1" just like when the enum buffer is 256. I really hope my explanation is clear because those kind of stuffs isn't really my forte, but I'll try as much as I can. usb_midi_host_pio dump: (MG-400 compared to G1XFOUR, MIDI Device Address is missing for the MG-400) NUX MG-400 Descriptor Dump: |
@VocasoGK I can explain some. I need a bit more information from you to help you further and determine whether this is a bug in my software, the environment, We will get to the bottom of this, I hope. |
@VocasoGK I looked at your console output again. I was confused by the text before it. It looks like your ZoomG1XFour enumerated OK and presumably has the correct endpoints. The MG-400 device descriptor decoded OK, but the audio descriptors failed to parse. Am I correct? In the future, please only post console output for one device enumeration attempt at a time. |
My apologies. I've realized my mistakes.
Yes, I believe that's what happened here.
I'm using I'm using PIO to attach the USB device. I use pin 2 because pin 16 on RP2040 Zero is hardwired to the internal LED, and pin 17 is basically inaccessible.
Yes sure.
then I connected the MG-400 to the RP2040:
Then when I disconnect the MG-400:
And this is when G1XFour is connected:
and when disconnected:
I've just realized what's wrong, this is probably the outcome of the previous issue, where the MG-400's MIDI Device can't be mounted. My serial monitor didn't show anything because the sketch isn't really spitting out the device descriptor that are connected, it just show whenever a MIDI device is connected. TLDR: I actually fully understand what's going on with Thanks as always for the help! |
@VocasoGK Thank you for the clarifications. I built a USB device from a spare Raspberry Pi Pico board that emulates the USB
and change the 0 to a 1, 2 or 3 for different levels of debug log verbosity. Your terminal program can capture the debug log to a file. If you attach that debug log to this bug, I might be able to figure out what is going wrong. If you don't have the UART to USB converter, you can make one if you have a spare RP2040-Zero or Raspberry Pi Pico; just burn the Picoprobe image. If you don't want to mess with that, I am trying to come up with a software workaround so you can get the debug log to the BTW, you don't have to screenshot the Arduino IDE serial monitor window. Use your mouse to highlight/select the text. Then press CTRL-C to copy it. Paste the text to a new text file in Windows notepad or some other text editor, and attach it to the bug. Thank you for working with me on this to help me make this driver code better. |
Yeah I do in fact have a spare RP2040-Zero. I've tried it using Picoprobe for the past hour following the PDF manual, but I can't get anything showing up on the PuTTY. All wired properly and the ports are correct, but no data is showing up. I unfortunately don't have any USB-UART interface lying around though. And also, when I changed
Yea, I don't know why I didn't think earlier of that. |
@VocasoGK Before I start hacking code, I want to verify you went through all the steps to get the picoprobe serial port converter working with Putty. The reason is there is less opportunity for introducing other problems this way. If you have already been through all of this, then I will send you some hacked files to try.
Once you have that working try again to get the debug prints working for this driver. |
Oh wow, I guess technology is a weird thing. Here's the dump with
and |
@VocasoGK Outstanding work! I was able to copy the configuration descriptor from the output of |
@VocasoGK I believe I have a fix for the issue. Please download a new copy of usb_midi_host.c raw file and overwrite the one in the |
Wow! It's actually working now! Doing fine on both my G1XFour and MG-400! I'll try on the GP100 probably in a couple of days (which I'm pretty sure will work fine as well), but in the meantime we can probably close this issue. Thanks for the help for the past few days! Couldn't be more happier. One of the most helpful library I've ever used. |
@VocasoGK You are most welcome. If you like this library, your star can encourage others to use it too. I pushed version 1.0.2 tags to GitHub, which includes the fixes you tested and updates the README file about the enumeration buffer size. By tomorrow the changes you tested to should be available to everyone. |
I've tested both device_info.ino example from the Pico PIO USB Library and usb_midi_host_pio_example and both are working fine on my Zoom G1XFour. The G1XFour only has MIDI capabilities and no Audio Interface built-in. Meanwhile my NU-X MG-400 and Valeton GP-100 both has audio interface and both went undetected on those program sketches. Serial monitor only shows device removed when the device is disconnected, but nothing is happening when I connect the device.
![image](https://private-user-images.githubusercontent.com/62440597/302117350-062788a9-e854-4a2f-9d20-84aad479a9c5.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA0MjA0OTEsIm5iZiI6MTcyMDQyMDE5MSwicGF0aCI6Ii82MjQ0MDU5Ny8zMDIxMTczNTAtMDYyNzg4YTktZTg1NC00YTJmLTlkMjAtODRhYWQ0NzlhOWM1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzA4VDA2Mjk1MVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTQ4YzdlODFkMTFmYzAxNWE1ZDQyMWE4Y2UwNWYxZDk3OWRhY2JkMWFjODE4MGU3ZDA5MWRkNmFiNTMyOTNiZDAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.agfcbDi8y3qJbRGwwLbRC4H_j2TODPrxTK_7AUMP434)
Is there any workaround to this? Thanks!
The text was updated successfully, but these errors were encountered: