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
Sound: Play one-off sound, then stop audio thread again? #66
Comments
Hello! It actually sounds like a bug in a backend. Which OS do you use? I just checked how it works on Windows and single core load was around 2-5%. |
Hi! Thanks for the quick response, given that its holiday season :) I'm on Linux, so using the alsa backend. |
Should be fixed now. Changes are in 34591e9 . Could you please confirm if CPU usage is ok now? |
I checked on virtual machine and it was something around 0.6-1.0%, previously it was ~98%. |
Edit: Figured my problems out. (Note: When upgrading from 0.18.0, one has to create a SoundEngine and register the context there) YES, the issue is now fixed! There's no thread consuming 100% CPU anymore. CPU usage is back to very low levels (as expected). Thanks for the quick work! |
Note: I don't know if its a side effect or if it worked before already but (at least on my system) sounds also play flawlessly now in debug mode. |
Cool. Yeah, I changed design a bit to support multiple contexts. I'm closing the issue then, it is good that you spotted this issue, thanks! I'll try to publish 0.19.0 on crates.io as soon as possible. |
I would like to add some sound an application. However, I only need to play a short sound (a few seconds) every few minutes. When using
rg3d-sound
, theContext
spawns a mixer thread in the background which consumes 100% cpu (of one core). Unfortunately, I cannot find a way to stop this thread again (not even if I executestd::mem::drop(context)
after playing the sound).Is there some way to create a
Context
in such a way that it automatically stops itself again after playing the sound, so that my application doesnt need that high CPU resources all the time?The text was updated successfully, but these errors were encountered: