-
-
Notifications
You must be signed in to change notification settings - Fork 173
Audio Devices Quickly Being Exhausted #380
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
Comments
Ah I see why, audioplayers |
Thanks so much for looking at this! I was going to do more debugging tonight after work, but it appears you already found the root cause. :) |
Okay, seems like iOS doesn't implement it either (bluefireteam/audioplayers#56), still would be good to have in flutter-pi. But maybe you can work around for now using AudioPool: https://pub.dev/documentation/audioplayers/latest/audioplayers/AudioPool-class.html |
AudioPool was the next thing I was going to try. I suspect it will be successful, and is probably the right call for my use case regardless. :) I unfortunately will be away for some family business for a week starting tomorrow, so I may or may not have time to test this theory. :/ Thanks for the suggestion! |
AudioPool does allow the clips to be played. That being said, any audio trigger generates the following warning:
The audio still plays correctly, but the warning doesn't appear on my Ubuntu devbox. |
Interesting, in your test app, do you have a way to check the current playback position reported by the audio player? Can you verify if it matches the actual playback position of the audio? |
Unfortunately not. They're just sound effects being kicked off by my "game". (It uses flame and flame_audio, but calling this thing a game is too generous 😂) In researching the error, it appears to happen when audio_players are used outside of a context. So is it possible that flutter-pi isn't properly providing context to audio_players? |
This is often the case for short sound effecs because you effectively cannot get correction position when your overall duration is within second or two (by the time you get position, playback ended)
I'm not sure how To release resources, But this is to clean up whole player The reason you get exhaust error is probably of incorrect usage of I remember encountering this issue by constantly creating new player and playing sound one time. So the only proper solution is to make sure you either re-use player or call I suspect this is problematic place so it is matter of where they use it and whether you have access to
Unfortunately it is the same as linux implementation 😄 |
This is a follow-up to my previous issue #379. After the merging of PR #345 the audio does indeed work. However I'm getting a new issue.
I'm using Flame, and triggering a bunch of audio sfx in short succession. The first few work fine, then it goes silent and I get the following error:
AL lib: (EE) ALCplaybackAlsa_open: Could not open playback device 'default': Device or resource busy
Initially I thought Flame just wasn't releasing the device after playing the sfx, but it works fine on a variety of other devices. This includes my Ubuntu development box.
This makes me think that flutter-pi isn't properly releasing the audio resources when asked. I can provide a code sample if necessary.
The text was updated successfully, but these errors were encountered: