-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
Fix android audio issue when screen is off and broadcast audio session id #1247
Fix android audio issue when screen is off and broadcast audio session id #1247
Conversation
…s off. Not familiar with libmpv, but seems to favor audiotrack audio output over opensles. KRTirtho#571
…o other apps. Fixes KRTirtho#1221
Wow, that's a really awesome fix for this issue. I was trying to fix it for a quite a while. Thanks for the help ❤️
It is good enough for anyone who started writing dart recently. No worries. I'll clean it up a little bit after merging although most of it is correct and works 😄 |
|
No problem when cloning a fresh copy of my branch with flutter 3.16.9 and dart 3.2.6 I'll try with your dev branch |
No problem building from your dev with my changes. I ran into issues because I was mixing flutter versions (fvm vs global installed outside fvm), but fvm has proxy for flutter and dart commands so I tried everything a 2nd time cleanly from the start in order to write the following steps and it worked. Here's what I did (on Windows) for reference:
...
┌─────────┬─────────┬─────────────────┬──────────────┬──────────────┬────────┐
|
I checked it now. And as you suspected, I was using a pre version of flutter through fvm. Silly mistake by me. Sorry for the trouble 😅 |
I can't test it in any device right now, and I can't reproduce it. So I'm merging it sort of blindly😅, though the app builds, and no side effects are found |
I tested these changes on a couple of Android devices and everything was working. I'm pretty confident that favoring audiotrack output over opensles is safe. Adding the extra comma at the end ("audiotrack,opensles,"), makes libmpv select another audio output not provided in the list, but available on the device.
My flutter skills being low, I might not have properly named the variables, formatted the code or defined constants in the proper place, so constructive comments are welcomed 🙃
For reference, here's the list of devices I tested: