Closed Bug 1682362 Opened 3 years ago Closed 3 years ago

pulseaudio high CPU

Categories

(Core :: Audio/Video: Playback, defect)

Firefox 83
defect

Tracking

()

RESOLVED INVALID

People

(Reporter: y22spm, Unassigned)

Details

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:83.0) Gecko/20100101 Firefox/83.0

Steps to reproduce:

  1. Open Firefox
  2. Go to a page that contains an embedded video that is not playing automatically, e.g. https://www.rottentomatoes.com/m/sound_of_metal
  3. Do not play the video

Environment

Firefox version: 83.0 (64-bit)
pulseaudio version: 13.99.2
OS: Ubuntu 20.10 64-bit
Gnome version: 3.38.1
Windowing system: Wayland
CPU: Intel® Core™ i7-8565U CPU @ 1.80GHz × 8
RAM: 15,5 GiB
GPU: Mesa Intel® UHD Graphics 620 (WHL GT2)

Actual results:

pulseaudio process is spawned and rapidly becomes the most CPU consuming process on my machine (especially after a few seconds, when the Web Content ones start to cool down). Even though no sound is actually played! When switching to another tab with no embedded video, pulseaudio keeps overloading the CPU. This only stops after closing Firefox.

Expected results:

I'm not sure this is what should be expected, but I'll give it a shot:

  • pulseaudio process should only be spawned when actually playing a media that requires audio
  • pulseaudio should not be the #1 CPU consuming process
  • pulseaudio process should at the very least not massively use CPU when no sound is playing

How did you make sure that this is due to problematic code in upstream Firefox code? Please link to previous discussions in the support forum or issue tracker of your distribution which led you to believe that this is something to fix in Firefox upstream code. Thanks.

Flags: needinfo?(y22spm)

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: Untriaged → Audio/Video: Playback
Product: Firefox → Core

(In reply to Andre Klapper from comment #1)

How did you make sure that this is due to problematic code in upstream Firefox code? Please link to previous discussions in the support forum or issue tracker of your distribution which led you to believe that this is something to fix in Firefox upstream code. Thanks.

Thanks Andre for the quick reply. That's a good point, I should've first asked on the support forum and then reported the issue to the Ubuntu support team. I guess you can close the bug for now, I will do these 2 steps and re-open the bug once they have confirmed this is an issue with the upstream Firefox code! Sorry for the noise :)

Flags: needinfo?(y22spm)

Close the bug for now, by comment 3

Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Resolution: --- → INVALID

I'm seeing what seems to be the same issue, triggered by opeing Discord, not using audio or video chat. It's Firefox 88.0.1 on Ubuntu 21.04
Pulseaudio continues to read from the sound card even though nothing is playing audio. When I quit Firefox, strace of pulseaudio daemon becomes nice and quiet. It ends up being a significant battery drain.

I also notice that when Firefox has discord open my webcam activity LED flashes constantly - maybe Discord is querying available devices which keeps waking audio/video drivers?

If there's any debugging information to help please let me know.

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