Open Bug 1617412 Opened 5 years ago Updated 2 years ago

Creates too many Pulseaudio sink-inputs

Categories

(Core :: Audio/Video: cubeb, defect, P2)

73 Branch
Desktop
Linux
defect

Tracking

()

Tracking Status
firefox73 --- affected
firefox74 --- affected
firefox75 --- affected

People

(Reporter: tom.wrobel90, Unassigned)

References

Details

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

Steps to reproduce:

Linux 5.4.20 #1 SMP
Firefox 73.0.1 (64 bit)
Pulseaudio 13.0

  1. Open website with many multimedia content with sound. Best infinite scrolling website.
  2. Each sound media content which is loaded on website, creates Pulseaudio input even if it's not used/played/unmuted.
  3. Keep scrolling until Pulseaudio limit of sink-inputs is reached. Depends of configuration/version. Mine is 255 inputs per source.

Actual results:

Whole session of Firefox hangs. Browser needs to be killed.

Syslog:
[pulseaudio] sink-input.c: Failed to create sink input: too many inputs per sink.

Expected results:

Ability to browse such websites continuously.

Firefox shouldn't create unused sink-inputs. Or it should clear old unused ones to keep their number below limit

Hello could you please provide a more specific website from where you encountered this issue so I can look into it more thoroughly and assign this issue to a proper component.

Flags: needinfo?(tom.wrobel90)

Hi, yes of course
Infinite scrolling website example: https://9gag.com/video
I just need to keep browsing until limit is reached.

Sink inputs can be count like this:
pactl list sink-inputs | grep -e "application.name" | uniq -c

Flags: needinfo?(tom.wrobel90)

I managed to reproduce the issue on Fx 75.0a1(2020-02-20), 74.0b8 and on 73.0.1 indeed the whole session hangs. I will assign this issue to a component so one of our developers can have a further look into it, if it's not the correct component please feel free to change it to the proper one.

Status: UNCONFIRMED → NEW
Component: Untriaged → Audio/Video: cubeb
Ever confirmed: true
OS: Unspecified → Linux
Product: Firefox → Core
Hardware: Unspecified → Desktop
See Also: → 1602345
Priority: -- → P2

I've discovered a related issue to this. It doesn't directly cause the same failure but it makes handling the Pulseaudio sink-input(s) extremely challenging.

In my specific case, I wanted to create a dedicated Pulseaudio sink to route its input to a specific PA output device (the host has multiple output devices). The use-case is routing the audio to a different room from the one where the Pulseaudio default output is.

From a single Firefox tab at Amazon Music, using the web player, when playing an album, each individual track on the page (which are played automatically in sequence) creates a new sink-input. The result is the audio resets to the PA default output (in the wrong room!) at the start of each track.

https://music.amazon.co.uk/albums/

I've been trying to work around it with a shell script that continuously monitors the list of PA sink-inputs and tries to detect the new track. This is a terrible kludge and not reliable if there are other tabs/windows/pages with audio playing at the same time.

I had hoped Firefox would add recognisable per-tab unique metadata to the PA sink-input so it could be used externally to identify the correct sink-input but the information that is human-understandable is generic and the same across multiple Firefox audio sink-inputs. What I needed was to see the name of the tab the sink-input is originating from, or some other ID that is also easily visible in the FF GUI or possibly logged to stdout/stderr or some file so that could be monitored by the external script and used to identify the correct sink-input index.

I did wonder if some form of user script or extension might be able to do this inside Firefox but I don't have the time to get back up to speed with Firefox internals to determine that - last time I worked on the internals was about 15 years ago. I couldn't find any existing extensions that have a suitable capability.

Kernel v5.19.6 on Debian 11 Buster amd64, with Firefox v104.0.1 currently.

Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.