-
Notifications
You must be signed in to change notification settings - Fork 39
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
Multiple MIDI Devices through Hub #29
Comments
You must handle all instances.
I have not tried the Poll() feature. |
Ok, so you MUST use isReady() and RecvData() on all UHS_MIDI objects in order for any of them to work? That's the behaviour I'm getting. Also, your above code works when a device is connected directly, but doesn't work on a hub for me, where as the code below does (a single midi device) :
|
@xxxajk Help me. I don't know how to use with HUB. |
1: Hubs take care of themselves. |
Oh btw, you can do this:
...and you can throw away the buf variable instead of this:
|
I think that it is not MIDI but HUB issue. @mattomatto @xxxajk |
Could be a bug, but all you should need to do is specify 2 hub instances, and it should work. I'll check on it later this morning. |
What platform are you using? ARM or AVR, and which ARM or AVR? |
I am using AVR. @mattomatto is ARM. |
Which AVR? Note that the ones with smaller amount of RAM might be the issue. |
Will this code run on Teensy 3.x? |
Yes :-) |
@YuuichiAkagawa - email me directly (paul at pjrc dot com) with your mailing address and I'll send you a couple Teensy 3.x boards to help with testing this. |
To be more clear on my quick answer: |
@YuuichiAkagawa email me directly: (xxxajk at gmail dot com) and I'll get to you a mega2560, a UHS mini, and a special edition of the USB Host Shield that I made, which is designed to be attached to the bottom of any MCU you want permanently, or used as a regular pluggable one. It is also UHS30 ready. I'll even do the rework on the mini so it can attach to the teensy 3.x. (heck, why not!) |
@PaulStoffregen Note he will need to have a host cable. I made mine with a relay on it so I can always leave everything plugged in, and I set a pin to flip it to use the host cable. Email me an let me know if you want a schematic. I believe it would be a good product for you to sell. It lowers the wear and tare on the teensy 3.x's USB port, since you don't need to swap cables all the time. You just push the program button and then upload. |
Maybe we can talk Kris (aka Onehorse) into making & selling these special cables on Tindie? |
actually, it could just be made into a board. |
If you are willing to sell it, I can actually produce these... |
PJRC probably won't make and sell this. We probably could make more money if I created dozens more products, but it's also a huge distraction from my main mission of improving the Teensy platform and Arduino software & libraries in general. My goal is to assist others to make & sell these sorts of add-on boards. Sometime "soon" (perhaps many months away) I'm going to redesign the website to showcase other products alongside Teensy.... things like this. |
No rush here. I'll throw together something for him in the meantime. It won't be a professionally etched board, but done here in my lab. |
Ok, I sent Kris a detailed message. Dunno if he'll be interested in making a board. I need to update my own page about how to use the UHS library, since it's all old info about Teensy2 and pre-dates UHS3. Would be really nice to update it with photos and info about how to actually make this special cable connection. If Kris (or anyone else) doesn't make & sell an add-on board, maybe you could send me a quick photo of your custom cable? |
I'll email you, watch your inbox. |
@YuuichiAkagawa Thanks for testing - I still can't get mine to work correctly. I've tried a 7 port D-link hub, a 4 port D-link hub, and a 4 port amazon hub. I'll try another brand. @xxxajk I will try avoiding printf and test by forwarding MIDI data between devices, thanks. |
Interesting. I'll have to hook up my beagle as well and see what I can find out here on Saturday too. |
I tested it with native host. Did not work via HUB. Direct connect is OK. @xxxajk
|
That sketch should work fine. If yes to only the second, then compiler is suspected. |
Unless you've selected LTO in Tools > Optimize, it's very unlikely to be the compiler. LTO optimization has exposed numerous bugs. So far, all appear to be in the libraries, not the compiler. But plenty of less than ideal practices exist in my libs, so LTO is not the default for ARM yet... |
This could also be related to another problem I have ran into. |
Link pointing out the problem: |
Without a reproducible test case, the best I can suggest is fiddling with the bus switch matrix priority settings. But I'd recommend against going down that path. Your time would be much better spent on isolating the issue and coming up with a test case that reproduces the problem. |
That's easy to do, run the file system program, and after the first time (there should be success) replug the thumb drive and you should end up seeing it. The possible correct way according to the DS and PRG is to resend it. What it doesn't say is if you have to change the toggle bits, and it doesn't say if there are any other caveats, such as success on the other end, you may be doing the same thing twice, which isn't good. |
Here is where the error is actually translated. See comment in code. UHS30/libraries/UHS_host/UHS_KINETIS_FS_HOST/UHS_KINETIS_FS_HOST_INLINE.h Lines 621 to 626 in 0923cee
As far as playing with the AXBS/MCM_CR it looks to me that the backdoor is never set and is in the default mode. I'll bet you dollars to doughnuts that if SRAM_[UL] is set to: |
I test with DUE + UHS mini. Did not work via HUB. Direct connect is OK.
DUE's compiler is
Teensy's compiler is
|
And this works on AVR, though, correct?
…On Thu, Apr 13, 2017 at 9:33 AM, Yuuichi Akagawa ***@***.***> wrote:
I test with DUE + UHS mini. Did not work via HUB. Direct connect is OK.
- Arduino IDE 1.8.2(Windows)
- 4 port USB HUB
- AKAI MPK mini, KORG nanoKEY, nanoKONTROL
DUE's compiler is
AppData\Local\Arduino15\packages\arduino\tools\arm-
none-eabi-gcc\4.8.3-2014q1/bin/arm-none-eabi-g++ --version
arm-none-eabi-g++ (GNU Tools for ARM Embedded Processors) 4.8.3 20140228
(release) [ARM/embedded-4_8-branch revision 208322]
Teensy's compiler is
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#29 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ADskzJSKoAtJQzxxlJQadK7IaqZ3EcZgks5rviQ0gaJpZM4My351>
.
--
Visit my github for awesome Arduino code @ https://github.com/xxxajk
|
Yes. AVR is works. But, if I connect the USB HUB and the MIDI device first and then turn on the power, it will take a very long time until it works. |
Because AVR is a bit slower, but ok, so it does work on AVR. That's a good
clue. Thanks!
…On Thu, Apr 13, 2017 at 11:08 AM, Yuuichi Akagawa ***@***.***> wrote:
Yes. AVR is works.
But, if I connect the USB HUB and the MIDI device first and then turn on
the power, it will take a very long time until it works.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#29 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ADskzLI6_dTEbM6wiRQCSBleanQGpfRzks5rvjp6gaJpZM4My351>
.
--
Visit my github for awesome Arduino code @ https://github.com/xxxajk
|
Hi guys, Just catching up on this issue - am I correct in thinking that there is a confirmed issue on ARM with multiple MIDI instances through a hub? |
Yeah, Still attempting to find out what the issue is. I was a bit busy this
weekend with all sorts of holiday junk.
…On Tue, Apr 18, 2017 at 12:14 PM, mattomatto ***@***.***> wrote:
Hi guys,
Just catching up on this issue - am I correct in thinking that there is a
confirmed issue on ARM with multiple MIDI instances through a hub?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#29 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ADskzP_n8Vs9qdG5NhurUxonldHipubmks5rxOFSgaJpZM4My351>
.
--
Visit my github for awesome Arduino code @ https://github.com/xxxajk
|
Great, thanks. |
Hi all, I've been checking in regularly on this and have not seen any movement. I've just tried the latest version of the library and this is still an issue for me. I can't get more than one Midi device working through a hub. Would it be possible for someone to look into this again? Many thanks, Matt |
Try latest that I pushed today. I have not had the chance to test it, but by looking at the code there was a very obvious bug in the polling timer. Not sure if it fixes ARM, but could! |
Please confirm this is now working. I will be doing a push fairly soon. If no comment after a few days, and if it does work for me, I will assume this has been fixed. |
Again, sorry if this is a known issue, but I cannot find another issue discussing it.
I have modified the USB_MIDI_Dump demo to use two hubs and two midi devices.
I find that a single device works well through a hub, but creating a second midi device stops it working. It compiles, but doesn't connect to or receive data from either MIDI device once more than one is declared.
Many thanks,
Here's the code:
The text was updated successfully, but these errors were encountered: