Open Bug 2034162 Opened 7 months ago Updated 7 months ago

PowerRequestSystemRequired not taken in conjection with PowerRequestDisplayRequired for windows wakelock

Categories

(Core :: Audio/Video, defect)

defect

Tracking

()

People

(Reporter: hballent, Unassigned)

References

(Blocks 1 open bug)

Details

Summary
On Windows 10 and earlier, the display wake lock may not function correctly if PowerRequestSystemRequired is not called alongside PowerRequestDisplayRequired. Firefox does not currently implement this combined call.

Background
The Windows documentation for PowerSetRequest notes that a PowerRequestSystemRequired must be taken in addition to a PowerRequestDisplayRequired to ensure the display stays on and the system does not enter sleep for the duration of the request. See: https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-powersetrequest#parameters

Chromium encountered this issue and addressed it in their power save blocker implementation. Their fix acquires both system and display wake locks during onscreen media playback on Windows 10 and below, to ensure sleep timeout puts the system to sleep only after the display has turned off. They note this is not necessary on Windows 11 and later, where a display request alone behaves correctly on both S3-based and Modern Standby systems. See: https://source.chromium.org/chromium/chromium/src/+/main:services/device/wake_lock/power_save_blocker/power_save_blocker_win.cc;l=76-82,93,94;drc=ab3903cafa49d204b050a363fc6a835e366b75b5
The original Chromium bug report is here: https://issues.chromium.org/issues/40170933

Current Firefox Behavior
Firefox does not have a specific implementation that calls PowerRequestSystemRequired alongside PowerRequestDisplayRequired on Windows 10 and earlier.

Severity and Reproduction
This appears to be rare. Chromium was unable to reproduce the issue reliably; it surfaced only on certain hardware configurations. This report is filed as a known potential issue to assist in debugging should it arise in the future.

Suggested Fix
On Windows 10 and earlier, acquire PowerRequestSystemRequired in addition to PowerRequestDisplayRequired when taking a display wake lock, consistent with the approach taken in Chromium.

Looks like the logic for this is in widget.

Component: Audio/Video → Widget: Win32

(In reply to Karl Tomlinson (:karlt) from comment #1)

Looks like the logic for this is in widget.

Yes exactly in that widget is where the potential bug is located. We aren't calling PowerRequestSystemRequired in conjunction with PowerRequestDisplayRequired which is what the docs suggest for Windows 10 and earlier.

The code is in widget but this is media-authored code (bug 1657043) so we don't track it. We don't have any issue with the setting as-is. Changes shouldn't affect us, so it's entirely your call. If you want to keep it the way it is, feel free to just close the bug.

Component: Widget: Win32 → Audio/Video
Blocks: wakelock
Severity: -- → S3
See Also: → 2034009
You need to log in before you can comment on or make changes to this bug.