Open Bug 1863193 Opened 2 years ago Updated 4 months ago

Audio power request prevents sleep on Windows 11 on Aliexpress pages

Categories

(Core :: Web Audio, defect)

Firefox 119
Unspecified
Windows
defect

Tracking

()

People

(Reporter: brahman.calf, Unassigned)

References

(Blocks 1 open bug)

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/119.0

Steps to reproduce:

  1. Go to https://www.aliexpress.us/item/3256805048523628.html (or any other product page on Aliexpress)
  2. Click anywhere on page after it has fully loaded
  3. Run "powercfg /requests"

Actual results:

Powercfg reports a persistent request for the audio device even though the site has no audio playing (i.e. no "PLAYING" displayed on tab) . This prevents sleep entry from idle timer expiration. Closing the tab causes the audio request to get removed and sleep happens normally.

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

Expected results:

As no audio is playing from the site the system should enter sleep normally from the idle timer.

The Bugbug bot thinks this bug should belong to the 'Core::Widget: Win32' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Widget: Win32
Product: Firefox → Core

Pinging :handyman for initial investigation, since it's a Windows audio issue.

Severity: -- → S3
Flags: needinfo?(davidp99)
Priority: -- → P3

I don't know how they are getting around reporting as playing sound but I believe the request for the audio device is coming from here

Component: Widget: Win32 → Audio/Video: cubeb
Flags: needinfo?(davidp99)
OS: Unspecified → Windows

The component has been changed since the backlog priority was decided, so we're resetting it.
For more information, please visit BugBot documentation.

Priority: P3 → --
Blocks: power-usage
See Also: → 1771179

If it helps, here is another website that causes similar issues:

https://www.classicalwcrb.org/, click the play button at the top. Then pause the audio. "powercfg /requests" shows a persistent "An audio stream is currently in use." even though no music is playing.

From what I can tell this website does not intend to use any tricks -- this is a website for a radio station intended to play audio.

I can create a separate ticket if necessary. (I was about to do that until I found this ticket)

MOZ_LOG=WebAudioAPI:4 shows Web Audio API usage on Aliexpress that looks pointless, unless used for fingerprinting purposes.

0.000000: frequency for 1 SetValue value=440 time=0.000000 constant=0
0.000000: detune for 1 SetValue value=0 time=0.000000 constant=0
0.000000: gain for 3 SetValue value=1 time=0.000000 constant=0
0.000000: OscillatorNode 1 Connect() to AnalyserNode 2
0.000000: gain for 3 SetValue value=0 time=0.000000 constant=0
0.000000: AnalyserNode 2 Connect() to ScriptProcessorNode 4
0.000000: ScriptProcessorNode 4 Connect() to GainNode 3
0.000000: GainNode 3 Connect() to AudioDestinationNode 0
0.000000: frequency for 6 SetValue value=440 time=0.000000 constant=0
0.000000: detune for 6 SetValue value=0 time=0.000000 constant=0
0.000000: gain for 8 SetValue value=1 time=0.000000 constant=0
0.000000: gain for 8 SetValue value=0 time=0.000000 constant=0
0.000000: OscillatorNode 6 Connect() to AnalyserNode 7
0.000000: AnalyserNode 7 Connect() to ScriptProcessorNode 9
0.000000: ScriptProcessorNode 9 Connect() to GainNode 8
0.000000: GainNode 8 Connect() to AudioDestinationNode 5
0.080000: AnalyserNode 2 Disconnect()
0.080000: ScriptProcessorNode 4 Disconnect()
0.080000: GainNode 3 Disconnect()
0.098667: AnalyserNode 7 Disconnect()
0.098667: ScriptProcessorNode 9 Disconnect()
0.098667: GainNode 8 Disconnect()

Chrome shows the similar audio device usage indefinitely (but I'm not able to check powercfg on this system).

Aliexpress could stop the audio device usage on both sites with AudioContext.suspend().

https://www.classicalwcrb.org/ could also resolve with AudioContext.suspend().
API usage is more conventional:

0.000000: gain for 1 SetValue value=1 time=0.000000 constant=0
0.000000: gain for 1 SetValueAtTime value=1 time=0.000000 constant=0
0.000000: GainNode 1 Connect() to AudioDestinationNode 0
0.000000: gain for 3 SetValue value=1 time=0.000000 constant=0
0.000000: gain for 3 SetValueAtTime value=1 time=0.000000 constant=0
0.000000: GainNode 3 Connect() to AudioDestinationNode 2
0.000000: detune for 4 SetValue value=0 time=0.000000 constant=0
0.000000: playbackRate for 4 SetValue value=1 time=0.000000 constant=0
0.000000: AudioBufferSourceNode 4 Connect() to AudioDestinationNode 2
0.000000: AudioBufferSourceNode 4 Start(0.000000, 0, 2.22507e-308)
0.024000: AudioBufferSourceNode 4 Disconnect()

In Chrome the audio device usage stops after several seconds.
I don't know exactly what makes Chrome behave differently from on aliexpress.

Status: UNCONFIRMED → NEW
Component: Audio/Video: cubeb → Web Audio
Ever confirmed: true

Bug 1682508 intends to release the audio device in both cases. I'll leave this open for now, until we know exactly what will be done for bug 1682508.

You need to log in before you can comment on or make changes to this bug.