-
Notifications
You must be signed in to change notification settings - Fork 81
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
Freezing a few seconds after boot #39
Comments
Thanks @hizzlekizzle. Just to be sure: You do get sound using a USB MIDI controller, but then after a few seconds you get no more sound? Which output are you using for sound, the headphone jack? If you attach the RPI to a HDMI display, you should see some debug output. Can you see something there? |
Yes, PWM/headphone jack and I do get sound until it freezes, at which point it just buzzes with whatever was the last sample (that is, it's not the full multi-wave tone, just a single wave). Ah, I didn't think about HDMI output! Unfortunately, I don't see any obvious errors:
To be clear, it doesn't print any new messages to the screen before/during the freeze. I did see a pair of exception messages pop up once just as it froze, but it was only up for a few seconds before the screen blanked out to some diagonal lines. The diagonal line thing doesn't usually happen, though, so I think that was an unrelated fluke. It usually just stays on the frozen screen with the diagnostic messages forever. Interestingly: if I hold one of the keys right at boot, it doesn't freeze immediately (I can hold it for >1 min with no freeze) but if I hit a few different keys, it freezes on the 4th or 5th tone/trigger. It'll also freeze after a few seconds with no keys pressed, or, if I hold one key to prevent freezing, it'll freeze after releasing/pressing the same key a few more times or if I press 4-5 other keys while holding the first. Odd stuff. Let me know if you need to me to do/test anything else on my end. Otherwise, I'll just keep trying things as the project progresses. |
@hizzlekizzle Can you please replace the file kernel8.img on your SD card with the file extracted from the attached .zip file and run again. This should result in additional messages, which may help to solve the problem. If so, please post these messages. |
Oh thanks! Now we're getting somewhere :) I get a bunch of:
EDIT: ^^this is apparently printed when no keys are held. followed by a few slight variations on:
EDIT: ^^this is printed when keys are held. followed by:
and then in red:
EDIT: ^^and this is what happens when it actually freezes. |
Thanks for testing! Do you have the file cmdline.txt with the contents |
Ok, I did have a cmdline.txt with Is there anything else you would like me to test while I'm here, or shall I close this one out? |
Great! Thanks for testing! I think, this problem was device related. I don't know exactly, what happens, but I can only guess the your keyboard controller sends more data on an USB IN request, than the USB driver expected. This does normally not happen and triggers the failed assertion. I found some forum articles on the net, which state, that the M-Audio KeyRig 49 (which should have a similar firmware as yours) did not work even with Windows under some conditions. So this seems to be critical. Without the @probonopd I think we can learn two things from this:
|
@hizzlekizzle which model is your @rsta2 would it be possible to have a fallback that would attach (for the lack of a better word) a USB device with |
@probonopd The option |
@probonopd We could try one thing to solve this problem. Currently we use There is an other method to do the audio processing outside from an IRQ handler on a secondary CPU core and providing the samples by calling Actually this is, what mt32-pi is doing and I did not found such USB MIDI issues it the Issues or Discussions there. But a consequence would be, that the RPi 1 and Zero (W) cannot be supported then. My impression is, that most synth project, which are based on Circle, do not support the RPi 1 anyway. |
@probonopd it's this crummy little guy, the O2: https://www.soundonsound.com/reviews/m-audio-o2 |
Let's both test mt32-pi and see whether it works properly with our USB controllers out of the box... I tested the M-AUDIO Keystation Mini 32 Mk3 with mt32-pi on a Raspberry Pi 2 and it works properly. @hizzlekizzle does your O2 do, too? |
I just tried mt32-pi with my O2 and it worked out of the box, yes. |
So after the successful tests of mt32-pi with your USB keyboard controllers I think we should try the |
I just applied the patch and built for RPI3/32-bit and it seems to be running just fine without any freezing here. |
@hizzlekizzle Good to know. Thanks for testing! |
Should result in a smaller IRQ latency on CPU core 0 and in a better USB handling. It still works on the RPi 1 too, but the MIDI dump and profiling has to be disabled there, otherwise one will hear drops, when the screen scrolls. #39 (comment) Thanks @rsta2
Should no longer be needed with f784824 #39 (comment)
Ouch. Looks like the latest continuous build containing this patch does not work at all for me. I get USB "Function not supported" messages, the LCD does not show any messages. I get no MIDI or performance debug messages and no sound. Rebooting by pressing the rotary encoder knob still works, though. Will revert it for now. Keeping the build here: |
Oops. On which RPi model have you tested this? |
RPi 2. |
OK, I will check this. I tested only on the RPi 4B with multi-core and on RPi 1 without. It was working there. |
I can reproduce the problem on the RPi 2B. I have to find the reason. Will take some time. |
Thanks for looking into it; no hurries! If I remember correctly, I had tested mt32-pi on the same Raspberry Pi 2. |
Thanks for info. How is looks like, this is a problem in the multi-core initialization with 32-bit only. |
I have found the problem. It's in the 32-bit multi-core initialization in Circle. The data cache has to be cleaned, before the secondary CPU cores can be started. Because of some bad luck this did not show up until now. I will prepare a hotfix for Circle. |
@probonopd The multi-core initialization problem is solved, but unfortunately there is another issue: The function |
Looks like this project is stress-testing Circle? ;-) No hurry. Your help is tremendous! |
Thank you! :) Yes, but this is one reason, why I'm trying to help to improve MiniDexed. Because I learned, that you need the feedback from developing real applications, to be able to improve projects like circle-stdlib and circle. This helps a lot. Both reported problems have been catched, and there is a new hotfix release 44.4.1 already, which solves the multi-core problem. I don't know, when @smuehlst has the time, to create a new release of circle-stdlib based of the fixes. He wanted to do this at this weekend, but now we had this delay from my side. Then I will create a new PR with an improved multi-core support patch, so that you can test, if it solves the USB problems, which have been discovered with your USB keyboard controller. |
New command line option "--option" for specifying additional defines that will be used for the compilation of Circle and circle-newlib. It is important to have consistent defines in the compilation of Circle and circle-newlib, otherwise things like described in probonopd/MiniDexed#39 happen where inconsistent defines in the compilation of the libraries caused a hang.
The announced multi-core patch with the fixes in available in PR #47. |
There seem to be USB devices, which send more data than it is expected. This was leading to a failed assertion. This should prevent a system crash by faking a frame overrun error, which should be handled by the upper layers. See: probonopd/MiniDexed#39
@hizzlekizzle does the latest build work for you? If yes, then I think we can close this issue. Thanks! |
I'm afraid it still crashes for me unless I remove the usbspeed=full :( Perhaps there was something screwy with my self-compile that gave me a false-positive on the fix? |
@hizzlekizzle Yes, you have to remove the |
Oh, gotcha. In that case, yes, it's working as expected! Thanks for looking into this, guys :) |
Just for information if anybody is looking: I had this same issue with my Studiologic SL 73 Studio keyboard (removing the |
Thanks for letting us know @apvanzanten. Will add this to the documentation. |
I'm using an RPi 3 (FAT32) with a USB MIDI controller, but it seems to freeze after about 5-10 seconds whether the controller is plugged in or not. It sounds great right up until then, though :)
Is there any way to do diagnostics/logging?
As an aside, I'm really happy to see someone working on this. I've been checking around for exactly this (headless dexed on RPi) every few months and was going to put in a feature request with dopefish to see if he would consider adding it to mt32-pi when i saw there was already a ticket for it. Then, I saw your comment about this project in the ticket comments! Exciting stuff.
The text was updated successfully, but these errors were encountered: