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

Fix battery drain from Web Audio #29203

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

mbachry
Copy link

@mbachry mbachry commented Feb 5, 2025

Element audio notifications cause a small, but noticeable battery drain on my Linux laptop, both with Firefox and Chromium. The drain is constant and disappears only after closing Element tab or the browser. In Firefox merely launching Element starts the battery issues, in Chromium it happens after the first notification arrives.

Here's a screenshot from pw-top long after a notification happened:

pipewire

pw-cli info confirms the bogus stream is an Element tab.

Web Audio doc says: "The suspend() method of the AudioContext Interface suspends the progression of time in the audio context, temporarily halting audio hardware access and reducing CPU/battery usage in the process — this is useful if you want an application to power down the audio hardware when it will not be using an audio context for a while."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-Enhancement Z-Community-PR Issue is solved by a community member's PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants