-
Notifications
You must be signed in to change notification settings - Fork 617
Bug/Feature: Fix audio silence when display is turned off #2340
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
base: main
Are you sure you want to change the base?
Conversation
…r switched to PCM offload mode
| } | ||
|
|
||
| if (!wakeLock.isHeld) { | ||
| wakeLock.acquire(10*60*1000L /*10 minutes*/) |
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.
If wake lock is held when doing audio playback, the device won't be able to go into deep suspend, which indicates the offload work may not really save much power.
|
|
||
| val powerManager = getSystemService(POWER_SERVICE) as PowerManager | ||
| wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "PowerPlay::AudioWakeLock") | ||
| } catch (e: Throwable) { |
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.
Could it be more specific which exception may be thrown from which function call?
Summary
This PR addresses an issue where audio streams could become silent or stall when the device display is turned off.
Changes
Checklist