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

RESOLVED FIXED

Status

()

Core
Audio/Video
--
major
RESOLVED FIXED
4 years ago
3 years ago

People

(Reporter: owenw4rd, Unassigned)

Tracking

({html5})

27 Branch
x86_64
Windows 8.1
html5
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

4 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 youtube.com 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.
(Reporter)

Updated

4 years ago
Severity: normal → major
Keywords: html5
(Reporter)

Comment 1

4 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.
(Reporter)

Comment 2

4 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.
(Reporter)

Comment 3

4 years ago
Update: 

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.

Updated

4 years ago
Component: Untriaged → Video/Audio
Product: Firefox → Core
(Reporter)

Comment 4

4 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: http://msdn.microsoft.com/en-us/library/windows/desktop/dd370810%28v=vs.85%29.aspx

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
Status: UNCONFIRMED → NEW
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

Updated

3 years ago
See Also: → bug 698079
I'm (slowly) working on this in a new branch: https://github.com/kinetiknz/cubeb/tree/wasapi_routing
This should be fixed by bug 698079.
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.