Audio playback fails to switch between headphones and speakers on Windows Vista upwards




5 years ago
4 years ago


(Reporter: owenw4rd, Unassigned)



27 Branch
Windows 8.1

Firefox Tracking Flags

(Not tracked)




5 years ago
User Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0 (Beta/Release)
Build ID: 20140127194636

Steps to reproduce:

Set to play videos in HTML5 instead of flash. Start playing a video through Surface Pro headphones. Unplug headphones.

Actual results:

Sound cuts out in headphones but doesn't switch to speakers. Plugging in headphones again doesn't restore sound in headphones. Refreshing the youtube page restores sound in headphones if they are plugged, in but not in speakers if the headphones are not plugged in. Restarting the Firefox browser with the headphones unplugged is the only way to get the youtube HTML5 player to switch to speakers and visa versa for headphones. 

Expected results:

Sound should have switched from headphones to speakers and back.


5 years ago
Severity: normal → major
Keywords: html5

Comment 1

5 years ago
Reverse problem: If Firefox is started with the headphones unplugged, a youtube HTML5 video will play through the speakers. After plugging in the headphones, the sound continues to play through the speakers, even after a page refresh. Restarting the browser with the headphones plugged in is the only way to get the youtube HTML5 player to play through the headphones.

Comment 2

5 years ago
Another major problem: After playing a youtube HTML5 video through the headphones and then unplugging the headphones, the Firefox process hangs after closing the browser. This prevents Firefox from being restarted. The firefox process has to be manually killed with the Task Manager.

Comment 3

5 years ago

I just tested this same scenario using Internet Explorer 11. While playing a youtube video with HTML5, I could switch back and forth between headphones and speakers perfectly. 

So it is not a Windows 8 or Surface Pro bug. It is a Firefox bug. Please fix it. 

Firfefox had similar headphone/speaker issues with the flash player. I opened a previous bug for that.
Component: Untriaged → Video/Audio
Product: Firefox → Core

Comment 4

5 years ago
I installed the Pale Moon Mozilla-based browser (v 24.5.0) and tested the above scenario again. It works fine. The browser dynamically switches between headphones and speaker while playing an HTML5 youtube video. 

So I'm done with Firefox until (if) they fix this bug.
This would've broken when we switched to the WASAPI in Firefox 25, so this breakage will migrate into Pale Moon when they update their source.

The old API (WinMM) used to handle this for us, but now it looks like we need to do a bunch of work at the WASAPI level to detect that an endpoint has gone away (not too surprising as WASAPI is significantly lower level).

Looks like registering an IMMNotificationClient to receive OnDefaultDeviceChanged notifications is what we need to do.  MSDN docs here:

Paul/Randel, I can't find an existing OnDefaultDeviceChanged in the tree - does WebRTC use WASAPI for capture?  If so, we'll have the same sort of problem there.
Blocks: 866675
Ever confirmed: true
Summary: Youtube HTML5 video player fails to switch between headphones and speakers on Surface Pro → Audio playback fails to switch between headphones and speakers on Windows Vista upwards


5 years ago
See Also: → bug 698079
I'm (slowly) working on this in a new branch:
This should be fixed by bug 698079.
Last Resolved: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.