element-hq / element-web

A glossy Matrix collaboration client for the web.
https://element.io
Apache License 2.0
10.99k stars 1.95k forks source link

Element in Firefox is keeping an audio device busy, preventing system from going to sleep #27784

Open elfez opened 1 month ago

elfez commented 1 month ago

Steps to reproduce

Recently (as in sometime in the last few weeks) my Windows 11 PC, which is set to suspend after 20 minutes inactivity, stopped going to sleep. Running powercfg -requests in an admin terminal provided the output

SYSTEM: [DRIVER] NVIDIA High Definition Audio (HDAUDIO\FUNC_01&VEN_10DE&DEV_0091&SUBSYS_1043866A&REV_1001\5&b22e16e&0&0001) An audio stream is currently in use.

A post I found suggested Firefox might be the culprit and with some trial and error I discovered that if I closed the tab containing Element the powercfg output no longer lists any power requests. Reopen the tab and the output again shows an audio power request.

No audio is being, as far as I know, recorded or played by Element. Firefox does not display a speaker icon on the tab which would indicate there is audio being played.

I can manually suspend the system, so it's just the timed suspend that fails.

Outcome

What did you expect?

The audio device should not be kept busy when no audio is in use thus allowing the system to suspend.

What happened instead?

The audio device is being kept open preventing the system from suspending

Operating system

Windows 11

Browser information

Firefox 128.0

URL for webapp

app.element.io

Application version

Element version: 1.11.71 Crypto version: Rust SDK 0.7.1 (80a151e), Vodozemac 0.6.0

Homeserver

matrix.org

Will you send logs?

Yes

elfez commented 1 month ago

Just tested the issue in Edge Version 126.0.2592.102. This does not display the same behaviour and works as expected.

Edit: As far as I can tell settings are identical between the Firefox instance and the Edge instance.

zc-devs commented 1 month ago

No audio is being, as far as I know, recorded or played by Element. Firefox does not display a speaker icon on the tab which would indicate there is audio being played.

Seems, last part of https://github.com/element-hq/element-web/issues/27793#issuecomment-2241323898 describes this behavior.