Skip to content
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

ZXTune goes into "doze" mode if not in focus after exactly 10 minutes of play #2250

Open
Crysalim opened this issue Mar 6, 2025 · 9 comments

Comments

@Crysalim
Copy link

Crysalim commented Mar 6, 2025

I'm using stock Android 14 on a Pixel 8 Pro. If I have a playlist playing in the background while I read Reddit or waste too much time on a gacha Dragonball game, the tunes playing will cease after exactly 10 minutes no matter what I'm doing. Screen timeout also seems to trigger this - I leave a playlist on over Bluetooth while I shower, and my usual timeout is 2 minutes, which I have to increase to 30 so it doesn't turn off (as long as the player is in focus and the screen is on, this 10 minute stoppage doesn't occur).

When I tried to find a system wide solution, there were many threads of background Youtube/Spotify/other media ceasing after 10 minutes as well, and one person mentioned something called a "doze" mode, which sounds different from the automatic background app closing that Android does to save memory.

Is it possible to add a toggle to ZXTune to override the system setting, so that play will continue indefinitely? I hope I was descriptive enough, because this doesn't seem to be an issue across all of Android phones.

@vitamin-caig
Copy link
Owner

Do you see a triangle with exclamation mark inside icon at the top of the main panel?

@Crysalim
Copy link
Author

Crysalim commented Mar 6, 2025

I do, yes. On tap it shows a dialog box about optimizing battery use. Tapping "set up optimization" bring me to the app battery usage section, and going to ZXTune there has a single toggle for "allow background usage", which is set to on. I explored these options with the dev option section too.

Should I do anything else? I can provide screenshots too if necessary.

@vitamin-caig
Copy link
Owner

Is there any suitable solution here? https://dontkillmyapp.com/google

@Crysalim
Copy link
Author

Crysalim commented Mar 6, 2025

The options presented there were in old Android revisions it seems - turning doze off entirely (!) being an option, which I checked, but it's not available on Android 14. This is a common theme; most of the workarounds attempted I've seen on threads are on older versions of Android. I did notice Pixel phones came up more often with these issues.

You can ask the user to make your app not battery optimized. See https://developer.android.com/training/monitoring-device-state/doze-standby

That might be the closest, haha. I don't know enough about Android dev, but I am totally willing to let it drain my battery in my use cases.

@vitamin-caig
Copy link
Owner

Tbh, battery optimization issues are real pain in the ass. Different devices implement it in their own way. Even etalon google device (like your Pixel) has that issue.

@Crysalim
Copy link
Author

Crysalim commented Mar 7, 2025

So do you have any other suggestions for my use case to keep the player on in the background? Is it possible / worth adding some kind of "always focused" toggle, or something as a workaround to ZXTune? There's a freeform windows mode in developer options that may be worth trying, but it changes the whole phone app system so I'm waiting to do that. If it would help i'm willing to test things, as well. And thanks for the attention thus far.

@vitamin-caig
Copy link
Owner

Please show me app's battery control page

@Crysalim
Copy link
Author

Crysalim commented Mar 7, 2025

The way you asked that made me think the normal battery page for the app wasn't comprehensive, so I searched for what is possible there, and I found this: https://android.stackexchange.com/questions/258711/how-to-access-the-app-battery-optimization-settings-on-android-12-and-above

Specifically in the answer it notes that you can tap the text for "Allow background usage" for another page of options (thanks for the obfuscation Google)

That's what I think you asked for so I screenshotted how it looks on my phone, and it's attached here, necessary red arrow included. Then on the dialog there it was set to optimized, and I changed it to unrestricted (another screenshot included).

After that I let my phone run a playlist in the background with my screen on 30 min timeout - the 10 min issue didn't occur! Then I put it back to the 2 minute timeout, and the playlist didn't stop after 10 min there either - it's been running around an hour now with the phone screen off, woot!

So prob solved now, I think? I imagine this could drain the battery fully after a couple days or so, but that won't happen.. probably.

Image
Image

@vitamin-caig
Copy link
Owner

Specifically in the answer it notes that you can tap the text for "Allow background usage" for another page of options (thanks for the obfuscation Google)

OMG! Such an incredible (no) UX!

When I was googling about a doze issues in fresh pixels, only last page was shown everywhere - it's obvious what to do there, but your story really shocked me...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants