Open Bug 1808039 Opened 1 year ago Updated 20 days ago

Firefox won't let me sleep in Windows 11

Categories

(Core :: Audio/Video, defect)

Firefox 108
defect

Tracking

()

UNCONFIRMED

People

(Reporter: nobeks, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36 Edg/108.0.1462.54

Steps to reproduce:

I just left the firefox window open.

Actual results:

The system does not fall asleep in about 80% of cases.
When you type powercfg -requests it says:
SYSTEM:

[DRIVER] USB Audio Device (USB\VID_0951&PID_16A4&MI_00\6&3321d09b&0&0000)

The audio stream is already in use.

[DRIVER] Deprecated kernel caller

After a long search, I disabled this driver through the command:
powercfg -requestsoverride DRIVER "USB Audio Device (USB\VID_0951&PID_16A4&MI_00\6&3321d09b&0&0000)" SYSTEM

After several tests, the error occurred again, and then it gave this:
EXECUTION:

[PROCESS] \Device\HarddiskVolume2\Program Files\Mozilla Firefox\firefox.exe
non-display request

I tested many times, including turning off the first exception. As a result, I came to the conclusion that if the Firefox window is open, then the system does not fall asleep.

Expected results:

PC should have gone to sleep

The Bugbug bot thinks this bug should belong to the 'Core::Widget: Win32' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Widget: Win32
Product: Firefox → Core
Component: Widget: Win32 → Audio/Video

When the issue happens, could you try to help to identify which tab you've opened causes the problem? I can try that by closing tab one by one to see which tab requests a wakelock. Because non-display request means that there is a tab playing audible audio. But if you didn't hear anything playing, then it must something wrong happening for Firefox.

Thank you.

Blocks: wakelock
Flags: needinfo?(nobeks)

Another hint is that, when issue happens, you can see if there is any tab which has a little speaker icon on the tab bar, or showing "Playing". If so, that means that tab is playing something audible. If that tab actually doesn't produce any sound to you, could you please provide that url to me? Thanks.

I'm a skilled enough user to see the speaker sign. But ok, I'll test the bug again. Although I have already started using edge, which is sad. But it's sadder not to fall asleep on the PC when any random tab in FF is open. It doesn't happen 100% of the time though.

Flags: needinfo?(nobeks)

I updated to 108.0.2, everything is still the same.
I followed the behavior, it seems that if you play the sound in Firefox (YouTube, etc.), then that's it, she does not fall asleep

@(In reply to Alastor Wu [:alwu] from comment #3)

Another hint is that, when issue happens, you can see if there is any tab which has a little speaker icon on the tab bar, or showing "Playing". If so, that means that tab is playing something audible. If that tab actually doesn't produce any sound to you, could you please provide that url to me? Thanks.

Sorry, can I disable this process using the command line for the time being? What would fall asleep if the audio is not used. For example, as it says here https://www.reddit.com/r/firefox/comments/j33f9j/firefox_81_active_playing_video_preventing_sleep/
I wanted to use this, but I don't know how to disable this command later.
"powercfg -requestsoverride process firefox.exe display execution"

it seems that if you play the sound in Firefox (YouTube, etc.), then that's it, she does not fall asleep

Do you mean you don't want Firefox prevent your computer from sleeping while you're actively playing audio or video? Because that behavior is intended in order not to let computer to sleep while playing audio. If users are playing video, then Firefox would also prevent screen to turn off.

In bug 1804770, we exposed that to a pref, which you can turn off the video wakelock by the pref media.video-wakelock. If you want to turn off the audio wakelock as well, I can expose another pref to turn the audio wakelock off.

Flags: needinfo?(nobeks)

(In reply to Alastor Wu [:alwu] from comment #7)

Do you mean you don't want Firefox prevent your computer from sleeping while you're actively playing audio or video? Because that behavior is intended in order not to let computer to sleep while playing audio. If users are playing video, then Firefox would also prevent screen to turn off.

No no. I thought this solved my "hidden audio" problem. Of course, I don't want the screen to go blank when I'm watching a video or listening to audio while using my computer. Or sitting in front of her. I hope you understand.
In short, as I understand it, this does not solve my problem.

Flags: needinfo?(nobeks)

(In reply to Alastor Wu [:alwu] from comment #7)

Do you mean you don't want Firefox prevent your computer from sleeping while you're actively playing audio or video? Because that behavior is intended in order not to let computer to sleep while playing audio. If users are playing video, then Firefox would also prevent screen to turn off.
Same problem here: https://www.reddit.com/r/firefox/comments/107tvhw/firefox_preventing_computer_from_going_to_sleep/

The severity field is not set for this bug.
:jimm, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(jmathies)

So what about this problem? I installed the latest Waterfox G5.1.3 for an experiment, it's the same there. I have a feeling that this behavior (bug) of FF is superimposed on a system problem, for example, on a sound driver ... Although this does not happen in the same edge and chrome.
I tested the problem a lot and I can say with 90% certainty that the problem is not due to "invisible audio playback" in some tabs. This happens in any random tabs where there can be no sound playback at all. The path is 90% like this. You put the browser, after a couple of openings, this starts, and for example, when you first fall asleep after turning on the PC, everything can be fine, but it doesn’t fall asleep the second time. Perhaps the condition of the bug may be playing and stopping the sound in the browser at least 1 time, but I’m not sure.
I also want to say that for example I always turn off "notifications from sites"

Component: Audio/Video → Widget: Win32
Flags: needinfo?(jmathies)

The Win32 WakeLockListener code seems pretty straightforward. I don't see any indication that this is likely to be Win32-specific, rather than being in the cross-platform code that calls the WakeLockListener or in the logic of Callback() itself — either of which Audio/Video would be better positioned to diagnose, I think.

:jimm, if you send this back over to us again, please clarify.

(And nobeks: this is a shot in the dark, but do you happen to have any add-ons that might sometimes play sound? Or, more directly, does this still happen in Troubleshooting Mode?)

Component: Widget: Win32 → Audio/Video
Flags: needinfo?(jmathies)

(And nobeks: this is a shot in the dark, but do you happen to have any add-ons that might sometimes play sound? Or, more directly, does this still happen in Troubleshooting Mode?)

Just double checked in safe mode, no problem. Although I wouldn't trust it 100%, especially since I restarted the browser every time. And I said that sleeplessness goes away every time.
However, here is my list of included extensions:

https://addons.mozilla.org/en/firefox/addon/radio_player_/reviews/?utm_source=firefox-browser&utm_medium=firefox-browser&utm_content=addons-manager-reviews-link

https://addons.mozilla.org/en/firefox/addon/view-image/reviews/?utm_source=firefox-browser&utm_medium=firefox-browser&utm_content=addons-manager-reviews-link

https://addons.mozilla.org/ru/firefox/addon/yandex-search-image/reviews/?utm_source=firefox-browser&utm_medium=firefox-browser&utm_content=addons-manager-reviews-link

Windscribe - Free Proxy and Ad Blocker
Open in VLC™ media player
(And this works on https://webextension.org/listing/open-in-vlc.html)

TWP - Translate Web Pages
sponsor block
uBlock Origin

Suspicions may be, but I checked by disabling half of all these extensions

@Ray Kraesig [:rkraesig]
I also use the css setting, looks like this:

#_windscribeff-menuitem-_uBlock0-blockElement {
display: none !important;
}

#navigator-toolbox{
background-color: accentColor !important;
}

/* JOIN TABS and SET TAB SHAPE */
.tab-background {
border-radius: 8px 8px 0px 0px !important;
margin-top: 0px !important;
margin-bottom: 0px !important;}

/* SET SPACE BETWEEN TABS */
.tabbrowser-tab {
padding-left: 0px !important;
padding-right: 1px !important;}

/* SET TABS BOTTOM BORDER COLOR */
#TabsToolbar {
border-bottom: solid 0px #FF0000; !important;}

#tabbrowser-tabs:not([overflow="true"]) ~ #alltabs-button{ display: none }

There are also these extensions, but I either have them for a long time, or quite recently.
Notes by Firefox
LocalCDN
Urban VPN Proxy

Now disabled the first extension in the list from the top and even lower
Open in VLC™ media player
View Image
Windscribe
The problem did not arise, I will still test

Update!!!

This morning it repeats again, including in safe mode! 2 times checked.

(In reply to nobeks from comment #11)

I tested the problem a lot and I can say with 90% certainty that the problem is not due to "invisible audio playback" in some tabs. This happens in any random tabs where there can be no sound playback at all.

Could you try to type powercfg -requests in your Command Prompt or Windows PowerShells (but they need to be run as admin) to see what prevent your computer from sleeping? That command would list all active wakelock on your computer.

Thanks.

Flags: needinfo?(jmathies) → needinfo?(nobeks)

Could you try to type powercfg -requests in your Command Prompt or Windows PowerShells (but they need to be run as admin) to see what prevent your computer from sleeping? That command would list all active wakelock on your computer.

Thanks.

I checked every time and now I checked. Naturally, it doesn't show anything. But it appears right after firefox does not allow you to go to sleep. Now I uninstalled firefox and everything is fine. Until recently, everything remained as on the screen. Nothing new.

Flags: needinfo?(nobeks)

The severity field is not set for this bug.
:jimm, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(jmathies)
Flags: needinfo?(jmathies)

(In reply to Alastor Wu [:alwu] from comment #18)

(In reply to nobeks from comment #11)

I tested the problem a lot and I can say with 90% certainty that the problem is not due to "invisible audio playback" in some tabs. This happens in any random tabs where there can be no sound playback at all.

Could you try to type powercfg -requests in your Command Prompt or Windows PowerShells (but they need to be run as admin) to see what prevent your computer from sleeping? That command would list all active wakelock on your computer.

Thanks.

I am having the same issue, here is my powercfg -requests output:

C:\WINDOWS\system32>powercfg -requests
DISPLAY:
[PROCESS] \Device\HarddiskVolume4\Program Files\Mozilla Firefox\firefox.exe
display request

SYSTEM:
None.

AWAYMODE:
None.

EXECUTION:
None.

PERFBOOST:
None.

ACTIVELOCKSCREEN:
None.

I'm also running into the issue, and I was also running into it in older versions although it may had stopped for a few versions. Similar ticket which has been closed is Bug 1165677

DISPLAY:
None.

SYSTEM:
[DRIVER] AMD High Definition Audio Device (HDAUDIO\FUNC_01&VEN_1002&DEV_AA01&SUBSYS_00AA0100&REV_1008\7&10da2036&0&0001)
Μια ροή ήχου χρησιμοποιείται αυτή τη στιγμή.

AWAYMODE:
None.

EXECUTION:
None.

PERFBOOST:
None.

ACTIVELOCKSCREEN:
None.```
Closing Firefox change "System" to none and PC can go to sleep without issues.
Also as I've wrote in Bug 1165677, issue for me seems to appear each time an e-mail is received from hotmail (outlook.live.com) which I have as a pinned tab. Closing that tab also seems to stop the audio stream.

Bugzilla does not allow editing? ...
Repeating the last part of my previous comment since it accidentally appeared in a code quote:

Closing Firefox change "System" to none and PC can go to sleep without issues.
Also as I've wrote in Bug 1165677, issue for me seems to appear each time an e-mail is received from hotmail (outlook.live.com) which I have as a pinned tab. Closing that tab also seems to stop the audio stream.

Currently running 120.0.1

(In reply to nobeks from comment #19)

Could you try to type powercfg -requests in your Command Prompt or Windows PowerShells (but they need to be run as admin) to see what prevent your computer from sleeping? That command would list all active wakelock on your computer.

Thanks.

I checked every time and now I checked. Naturally, it doesn't show anything. But it appears right after firefox does not allow you to go to sleep. Now I uninstalled firefox and everything is fine. Until recently, everything remained as on the screen. Nothing new.

Try to set the perf "dom.webaudio.enabled" to false and restart firefox, it might help.
Please note that any web apps or addons which using Web Audio API will not work anymore.

(In reply to psxlover from comment #26)

Closing Firefox change "System" to none and PC can go to sleep without issues.
I didn't understand where to change this value?

(In reply to Willy Young (Mozilla Taiwan Community) from comment #27)

Try to set the perf "dom.webaudio.enabled" to false and restart firefox, it might help.
Please note that any web apps or addons which using Web Audio API will not work anymore.

I'm trying it now and will watch.
I am sure that this is due to a conflict with the Hyperx Cloud driver (headphones on my system). Some kind of bug occurs with firefox, it appears when I open any tab with a sound, watch a video, listen to audio. And then even if you stop/close the tab, the system does not fall asleep with this error

I didn't understand where to change this value?

Closing Firefox changes "System" to none and PC can go to sleep without issues.
Sorry an "s" was missing. It's not something you should change it's what happens. If you close Firefox it stops keeping the audio stream active and thus powercfg shows nothing and PC can go to sleep. Same happens if you find which tab has played a sound and is still keeping the audio stream active, which in my case is almost always is the outlook.office.com tab that I have pinned.

(In reply to psxlover from comment #29)
Okay, I kind of get it... Do you want me to figure out the tab where the audio stream doesn't stop? But unfortunately this is not the problem. This happens to me with any tab, even if it is closed. For example, I watched a video on Youtube, paused it and went to lunch, the system did not fall asleep, simply because I started the sound. It's the same if I close this tab, but don't close the browser. This happened chaotically and with varying results, but in 80% of cases.

(In reply to Willy Young (Mozilla Taiwan Community) from comment #27)

Please note that any web apps or addons which using Web Audio API will not work anymore.

I did it, it seems to have fixed it.
But I would like to ask what the shutdown might affect. In simple words

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: