Open Bug 1746156 Opened 3 years ago Updated 3 years ago

A muted auto-play video keeps playing in a background tab

Categories

(Core :: Audio/Video, enhancement, P3)

enhancement

Tracking

()

People

(Reporter: florian, Unassigned)

References

(Blocks 1 open bug, )

Details

(Keywords: power)

The page at https://www.ikea.com/fr/fr/p/malm-cadre-lit-coffre-blanc-20404806/ has a video that keeps playing despite the tab being in the background and being silent (the video has sound, but it is muted because the video is auto-played)

Here's a profile of it: https://share.firefox.dev/3yubrWL

This continuously uses 3-5% of a core for the content process that has the page, and also causes some activity in the rdd process.

Alastor, could you please help clarify it? Thanks a lot.

Flags: needinfo?(alwu)

For video, when it's invisible to users, we would shutdown the video decoder and generate fake video frames in order to save CPU resource. The default time enters that mode is 10s, so the video isn't the problem for this bug.

In the profiled result in comment0, all decoding happened in RDD were audio decoding. Currently we don't have a similar mechanism for audio, so audio would keep decoding and sending to audio backend even if it's muted. Bug 1743834 is going to address the latter problem, to shutdown the audio backend when audio is muted.

But for the first issue, muted audio would still be decoded, I'm not sure if we can apply same solution on audio. When we stop video decoding for invisible video, we would need to rely on audio clocks to update media time. The approach in bug 1743834 would also rely on decoded audio to know when audio reaches to the end.

Paul, could you help to leave some of your thought? Do you think we can use a system clock to completely replace the audio clock when audio is muted?

Thank you.

Severity: -- → S3
Type: defect → enhancement
Flags: needinfo?(alwu) → needinfo?(padenot)
Priority: -- → P3
See Also: → 1743834

Yes I'm working on this. There are two steps, that will land one after the other:

  • Close any system-level audio stream (cubeb) when the media is muted
  • Stop decoding the audio when the media is muted

The first part seems to work quite well, I'm going to finish it and land it. The second part I'll do later, after power and performance measurements of the first part.

Flags: needinfo?(padenot)
You need to log in before you can comment on or make changes to this bug.