Need to restart browser to re-read ALSA config




3 years ago
2 years ago


(Reporter: singpolyma, Unassigned, NeedInfo)


44 Branch

Firefox Tracking Flags

(Not tracked)


(Whiteboard: [needinfo 2016-08-14 to reporter])


(1 attachment)



3 years ago
User Agent: Mozilla/5.0 (X11; Linux i686; rv:44.0) Gecko/20100101 Firefox/44.0
Build ID: 20160211225047

Steps to reproduce:

When I plug in my HDMI cable, it creates /etc/asound.conf to set HDMI to the default output device.

Actual results:

Firefox continued to play though my laptop speakers. Even when loading new pages or new tabs.

Closing Firefox completely and opening it again caused it to play through HDMI.

Expected results:

Should have begun to play through HDMI next time an audio stream was opened (after pause/play or a new video is navigated to or a new tab is used to open a video).

Comment 1

3 years ago
Does it happen on latest release ( and on latest Nightly build (
Component: Untriaged → Audio/Video: cubeb
OS: Unspecified → Linux
Product: Firefox → Core
Hardware: Unspecified → x86
Paul, Matthew -- Can either of you confirm this bug?  If so, how much effort is it to resolve?
Flags: needinfo?(padenot)
Flags: needinfo?(kinetik)
Whiteboard: [needinfo 2016-06-12 to kinetik, padenot]
Does this work in other apps? If so, which ones -- I'm curious what they're doing, as ALSA doesn't really support device switching as far I understand it.

Except for working around a PA-ALSA plugin integration bug, our ALSA backend doesn't cache any ALSA config state across stream creations, so we're not doing anything that should actively prevent config changes at runtime if ALSA supports that.

Note that this should work seamlessly with the PulseAudio backend.  We're in the process of deprecating the ALSA backend in favour of PA (there's a bug somewhere, but I can't find it right now), so unless the changes required to make this work are trivial it's unlikely they'll happen unless someone volunteers.
Flags: needinfo?(kinetik)
Flags: needinfo?(padenot)
Do other app have the behaviour you expect? We don't do anything special on Alsa, so it's a bit surprising.
Flags: needinfo?(singpolyma)
Whiteboard: [needinfo 2016-06-12 to kinetik, padenot] → [needinfo 2016-06-24 to reporter]

Comment 5

3 years ago
Well, on VLC I can just select my audio output manually, so it doesn't really come up.

I expect this has something to do with how ALSA is normally initialised generally, as you say, but if restarting the app fixes it then certainly something could be done without restarting the app?

For now I have worked around by configuring my ALSA to always emit to both HDMI and internal speakers, and then mute internal speakers when I connect HDMI.
Did the VLC info help? (trying to keep conversation going. This needinfo whiteboard system is imperfect)
Flags: needinfo?(singpolyma) → needinfo?(kinetik)
Whiteboard: [needinfo 2016-06-24 to reporter] → [needinfo 2016-08-12 to kinetik]
Posted patch test fixSplinter Review
It looks like ALSA tries to re-read the config every time a stream is opened, but libcubeb's hack to work around bugs in the alsa-pulse plugin might be defeating the config reloading.  This patch deletes the alsa-pulse workaround entirely, which will hopefully cause config changes to take effect the next time a stream is opened.

If this works, we'll probably need a better fix to commit that retains the alsa-pulse workaround but makes the detection of the plugin more focused -- I suspect the existing code triggers if alsa-pulse is present at all, but we really only need to apply the workaround if it's the device we're going to use.  I doubt I'll have time to do this work, with bug 1247056 we're trying to deprecate ALSA support and direct our development energy towards the PA backend.
Assignee: nobody → kinetik
Ever confirmed: true
Test builds will appear at in a couple of hours.  Please try them and let me know how you get on.
Assignee: kinetik → nobody
Ever confirmed: false
Flags: needinfo?(kinetik) → needinfo?(singpolyma)
Whiteboard: [needinfo 2016-08-12 to kinetik] → [needinfo 2016-08-14 to reporter]
Last Resolved: 2 years ago
Depends on: 1247056
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.