-
-
Notifications
You must be signed in to change notification settings - Fork 40.4k
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
Stop sounds when suspended #11553
Stop sounds when suspended #11553
Conversation
This doesn't work on STM32F303. Specifically with the moonlander, which uses the same chip as the Proton C. |
Does it just not fix the problem, or does it break other things? Good news is I have a Proton C on order, expect to have it shortly... |
It stops the startup sound from playing. |
Hmmm... |
Did some verification:
|
81cf218
to
f31eef5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, this works! And fixes the audio init issues on arm, for me.
* fix stopping audio on suspend vs. startup sound * trim firmware size * fix stuck audio on startup (ARM)
* fix stopping audio on suspend vs. startup sound * trim firmware size * fix stuck audio on startup (ARM)
Description
The code to stop sounds when suspending was commented out long ago, because it interfered with the startup sound working correctly. The problem was that at the time of
audio_init()
the USB device status might still be in flux, passing through the Suspended state, which would callstop_all_notes()
.The solution is to move the playing of the startup song into a routine that is run 300ms after startup, giving enough time for the USB state to settle.
Note: This has been tested thoroughly on AVR. I have provided code for ARM, but it is not as well tested. I understand that the state of audio on ARM is limited to Proton-C; I'd appreciate if someone with that architecture could test this before it is merged.
Types of Changes
Fixes issues
Fixes #8167
Checklist