Explicit audio output device is configured by Firefox instead of using Windows default
Categories
(Core :: Audio/Video: Playback, defect, P5)
Tracking
()
People
(Reporter: sander, Unassigned)
Details
(Whiteboard: [media-audio])
Attachments
(8 files, 1 obsolete file)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:71.0) Gecko/20100101 Firefox/71.0
Steps to reproduce:
The exact trigger for this is unknown - it only happens occasionally and I have not found a way to reproduce it reliably. When I do accidentally run into it, it goes like this:
- I change Windows default audio device (e.g. from speakers to headset).
- I play some audio (e.g. open up a YouTube video).
Actual results:
Audio is not played through default device but rather through a different device that was previously the default device.
Expected results:
Audio plays through the new default device.
Reporter | ||
Comment 1•5 years ago
|
||
When I open the "App volume and device preferences" control panel I see that Firefox is listed as explicitly using the wrong output device (e.g. Speakers) instead of having its setting as "Default". I never changed this myself - I can only assume that Firefox itself changed this setting.
To fix, I reset this setting back to say "Default" and the problem goes away.
I have been unable to determine a specific action that causes this setting to change so far.
Comment 2•5 years ago
|
||
I believe this is a duplicate of Bug 1563475. Will mark it as a duplicate for now.
Comment 3•5 years ago
|
||
The descriptions are similar indeed but Bug 1563475 is an OSX specific one. On the other hand, this one is specific for windows. The descriptions are similar indeed but they must be different bugs.
Reporter | ||
Comment 4•5 years ago
|
||
The referenced bug is about a failure to select audio devices. In my reported case, I can select everything just fine, it's just that at some point in the night Firefox switches its output device off the "Default" setting. As such, the only similarity I see is that both bugs concern audio devices and that's it.
Perhaps I miss a similarily that is only obvious when the underlying principles of the Firefox audio framework are considered? If not, these sound quite different cases. What is the rationale for considering it duplicate?
Comment 5•5 years ago
|
||
I believe this is a different bug. I am going to reopen this.
Comment 6•5 years ago
|
||
Hi Sanders,
At first glance it looked similar to the bug I duplicated it to, thanks for Alex and C.M.Chang for re-opening this as I was wrong about the similarities. Do you still encounter this issue on the latest Firefox Release?
Reporter | ||
Comment 7•5 years ago
|
||
Yes, I confirm that I still encounter this issue on Firefox 72. I continue to try nail down some more useful repro steps but whenever I pay close attention, the issue does not occur... is there any logging I should enable/check to find clues and provide more information?
Comment 8•5 years ago
|
||
Could you please run "dxdiag" from Start->Run, click "Save All Information" and attach the result to the bug?
Comment 9•5 years ago
|
||
Also, it would be good if you can upload here your about:support
page. Thank you.
Reporter | ||
Comment 10•5 years ago
|
||
Reporter | ||
Comment 11•5 years ago
|
||
Reporter | ||
Comment 12•5 years ago
|
||
Files uploaded.
One pattern I have noticed is that the issue seems to occur when I am away from the PC - for example, overnight or when I am not at the PC for many hours. When I log back in afterwards, I see that in the "App volume and device preferences" one or more (not always all) instances of Firefox are set to an explicit audio device.
99% of the time my audio device is Speakers, which is also the only explicitly set device I have seen there. However, perhaps this is just due to me typically not leaving the Windows audio device set to something else (TV/headset) when I go away from my PC.
I have never noticed this issue in the middle of a computer usage session. Most often (though not always) I notice it in the morning, as I switch the Windows device to my headset to not wake my family and notice Firefox is not playing audio through it. My PC does not sleep overnight - standby is disabled - so it should not be anything power management related.
Comment 13•5 years ago
|
||
Bugbug thinks this bug should belong to this component, but please revert this change in case of error.
When you next encounter the bug, could you check if it's impacted by Window's default communication device settings?
In the start menu if you search for 'Sounds Settings' and open the resulting option, then in that settings window open up 'Sound Control Panel' from the options on the top right. You should then get a window with a playback tab where output devices can be configured. From here Windows will let you configure a 'Default Device' and a 'Default Communication Device'. It would be useful to know if these are both set to the same device when you encounter the issue. If they're different, could you make a note of which one Firefox is playing through, then try switching it to see if it resolves the issue.
I will upload a screenshot showing the dialog I'm referencing shortly.
Screenshot showing sound dialog with the ability to pick different default device and default communication device.
Reporter | ||
Comment 16•5 years ago
|
||
Right now, immediately after noticing the issue again, both defaults are set to the Headset device, whereas Firefox is playing through the Speakers device.
I have also seen Firefox be locked to a different device (TV), so it does not appear to be getting locked to any particular device.
Reporter | ||
Comment 17•5 years ago
|
||
Reporter | ||
Comment 18•5 years ago
|
||
There was only 1 instance of Firefox in this list when I first opened it after the issue occurred. In the period when I opened Bugzilla and navigated the sound control panels, more appeared (all with Speakers output).
Comment 19•5 years ago
|
||
The priority flag is not set for this bug.
:bryce, could you have a look please?
For more information, please visit auto_nag documentation.
(In reply to Sander Saares from comment #18)
Created attachment 9133385 [details]
"App volume and device preferences" shortly after issue occurredThere was only 1 instance of Firefox in this list when I first opened it after the issue occurred. In the period when I opened Bugzilla and navigated the sound control panels, more appeared (all with Speakers output).
If you set the output device to for Firefox to default in that dialog, does it remain on default, or change to other devices over time?
Reporter | ||
Comment 21•5 years ago
|
||
Yes, exactly - it eventually changes over to an explicit choice instead of Default. I suspect it "gets stuck" on the device that is set as default at the moment when whatever causes this triggers.
I'm not certain if Firefox controls those settings, or rather, if it's those settings that control Firefox. I.e. something that isn't Firefox could be changing the preferred output device for Firefox which then outputs to that device.
kinetik, any idea what's going on here?
Comment 23•5 years ago
|
||
Firefox does not control those settings. The behavior you are experiencing is completely different from the expected behavior. The expected behavior would be to hear audio from your default device and not change over the time unless you unplug the default device (if it is an external one) or you change the default settings to a different device.
Since we don't have any clue what is causing it, would it be possible to capture logs while you are reproducing the issue? In order to do that close Firefox, navigate to your Firefox install directory and open a command prompt there then run the following in the command prompt:
Run set MOZ_DISABLE_GMP_SANDBOX=1
Run set MOZ_DISABLE_CONTENT_SANDBOX=1
Run set MOZ_LOG=sync,timestamp,cubeb:4,AudioStream:4
Run set MOZ_LOG_FILE=%TEMP%/firefox_log.txt
Run firefox and reproduce the issue.
Once that's done enter %TEMP% into the address bar in windows explorer and that should put you in a directory that contains a file containing a firefox_log.txt file as well as several firefox_log.txt.child-n files, where n is a number -- for example I see 7 when doing this. Could you then attach all those files to this bug -- you can zip them up first to make it easier?
Also can you please repost your about:support page but using the "Copy raw data to clipboard" button this time. The one you have used truncates information which would be interesting to have for this problem.
Finally, is it a new problem? Has it started after an update or something or it was always like that?
Reporter | ||
Comment 24•5 years ago
|
||
OK, will run Firefox with logging as described above. It may take some time (weeks) to post an update as the issue occurs at very irregular intervals.
The issue stared approximately Q3/Q4 2019 but I do not remember exactly when. At first, I just ignored it and did not report, so the start is hazy in my memory.
Reporter | ||
Comment 25•5 years ago
|
||
Raw data for about:support
Comment 26•5 years ago
|
||
I bet the problem appears between the Speakers (Realtek High Definition Audio) and the Headset (Logitech G930 Gaming Headset) devices. The speaker is the default device for voice. The headset is the default device for multimedia and notifications (or just multimedia if there is no notification default in windows).
According to your description, the problem must be happening because the default device changes, under your nose, so Firefox understands that and switches to the new default device. The problem that we need to track down is why the default device changes without you changing it.
Can you please observe the behavior a little? For example, when the problem happens can you compare the info in the windows menu from comment 15 and the about:support
page (mostly the preferred values for the affected devices)? Do they align? What are the preferred
values for the expected and the actual device? Right now the preferred values are:
Speakers (Realtek High Definition Audio) : preferred: 5 (multimedia & notifications)
Headset (Logitech G930 Gaming Headset) : preferred: 2 (voice)
Reporter | ||
Comment 27•5 years ago
|
||
why the default device changes without you changing it.
To try clarify, the device selected as the Windows default device is always correct (what I have selected). This is not what is changing without me changing it. This is only changed by me.
What happens automatically is that at some point the Firefox audio device changes from Default to some explicit device (most often Speakers but it has also been "FTV ..." at least once - likely most often Speakers because 95% of my time Default is set to Speakers, so it just encounters that the most).
I will inspect the properties you listed when I next encounter the issue and take notes.
Reporter | ||
Comment 28•5 years ago
|
||
Issue just occurred again today. In Windows audio settings, I see "Speakers ..." listed as the output device. In about:support, I see preferred=2 on "Headset ...", preferred=5 on "Speakers ..." and preferred=7 on "Microphone". No change here, seemingly. Will attach the file with today's about:support state.
As I was monitoring closely today, I noticed the value before changing my default audio device (ordinarily, I notice it by "hey why is there no audio" after a change of the system default device). System default is also set to Speakers right now, and I believe was so also at the moment the Firefox default device changed in Windows settings.
Using Process Monitor I was able to detect the moment the change was stored in the Windows registry. It was 10:18:25.025 local time (UTC+2), by svchost.exe. Inspecting this instance reveals that it is hosting only the Windows Audio service. This seems less informative than I was hoping for, since presumably Windows Audio can be triggered by any number of things to do such a change. I attach the stack trace of the call to RegSetValueEx that stored this change into the registry - but it looks fairly uninformative to my untrained eye.
I will also attach the Firefox log files as zip. firefox_log.txt.child-87.moz_log and firefox_log.txt.child-8.moz_log seem to have entries close to the timestamp of the registry write that I captured.
Reporter | ||
Comment 29•5 years ago
|
||
Reporter | ||
Comment 30•5 years ago
|
||
Reporter | ||
Comment 31•5 years ago
|
||
Comment 32•5 years ago
•
|
||
Sander, I think you are on to something by looking for external processes making these changes - I can't think of a way for those settings to be changed by Firefox code (that I know of).
It might be possible to track down the process that sends the change request you captured AUDIOSRVPOLICYMANAGER.dll (a Windows built-in) processing using Event Tracing for Windows (ETW) and watching for the appropriate audio-related events - there's an explanation here from a audio engineer at Microsoft for a different use case. I'm not sure if the tracing config linked in the blog post captures the appropriate events to solve this issue, but it's probably a good point to continue the investigation from.
I'm marking this p5 since there doesn't seem to be a path for Fx to change the device. However, if we can identify the source we may wish to mitigate this, depending on why it is happening.
Reporter | ||
Comment 34•5 years ago
|
||
This no longer reproduces for me since around mid-June.
Possibly correlated events are: update to Windows 10 version 2004, updating NVidia drivers (for audio output channel to smart TV), updating smart TV firmware.
Reporter | ||
Comment 35•5 years ago
|
||
Resolving as WFM since no longer reproduces for me and nobody else has reported encountering it.
Description
•