Firefox stopped inhibiting screensaver on video playback

Bug #2047262 reported by Eugene San
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mozilla Firefox
Confirmed
Unknown
firefox (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Update (02/2024):
With Firefox 122 on Ubuntu-Mate 23.10, screensaver/powermanager inhibition is completely broken even with Mozilla's .deb package.

After a fresh start of firefox, screen saver is blocked properly when playing video but after opening/un-suspending a few tabs with video, inhibition stops working.

I was unable to come up with reproducible scenario but after a few hours of browsing it usually stops working. Restarting firefox fixes the problem.

The bug first appeared around August and affects both .deb and snap packages.

Tested on Ubuntu-Mate 22.04.3, Xorg, both Pulseaudio and Pipewire (if that's relevant).
I don't see any relevant msgs in xsession-errors or system logs.

Revision history for this message
In , Thedcoder (thedcoder) wrote :
Download full text (3.8 KiB)

Firefox fails to properly call the `org.freedesktop.PowerManagement` D-Bus interface. The issue was originally posted on [Xfce's bug-tracker](https://gitlab.xfce.org/xfce/xfce4-power-manager/-/issues/210):

> I've been doing some debugging and found that Firefox isn't calling the D-Bus interface method at `org.freedesktop.PowerManagement.Inhibit -> Inhibit`.
>
> I used this command to monitor the calls and didn't see anything while I was playing media in Firefox: `busctl --user monitor org.freedesktop.PowerManagement`
>
> The interesting thing is that it does call `org.freedesktop.PowerManagement.Inhibit -> UnInhibit` with the wrong cookie value every-time I pause the video, but it won't call `Inhibit` after I resume playback:
>
> ```
> $ busctl --user monitor org.freedesktop.PowerManagement
> Monitoring bus message stream.
> ‣ Type=method_call Endian=l Flags=0 Version=1 Cookie=2768 Timestamp="Tue 2023-10-31 06:41:08.423673 UTC"
> Sender=:1.43 Destination=:1.35 Path=/org/freedesktop/PowerManagement/Inhibit Interface=org.freedesktop.PowerManagement.Inhibit Member=UnInhibit
> UniqueName=:1.43
> MESSAGE "u" {
> UINT32 21;
> };
>
> ‣ Type=error Endian=l Flags=1 Version=1 Cookie=273 ReplyCookie=2768 Timestamp="Tue 2023-10-31 06:41:08.423829 UTC"
> Sender=:1.35 Destination=:1.43
> ErrorName=org.xfce.PowerManager.Error.CookieNotFound ErrorMessage="Invalid cookie"
> UniqueName=:1.35
> MESSAGE "s" {
> STRING "Invalid cookie";
> };
>
> ‣ Type=method_call Endian=l Flags=0 Version=1 Cookie=2777 Timestamp="Tue 2023-10-31 06:41:15.928327 UTC"
> Sender=:1.43 Destination=:1.35 Path=/org/freedesktop/PowerManagement/Inhibit Interface=org.freedesktop.PowerManagement.Inhibit Member=UnInhibit
> UniqueName=:1.43
> MESSAGE "u" {
> UINT32 21;
> };
>
> ‣ Type=error Endian=l Flags=1 Version=1 Cookie=274 ReplyCookie=2777 Timestamp="Tue 2023-10-31 06:41:15.928471 UTC"
> Sender=:1.35 Destination=:1.43
> ErrorName=org.xfce.PowerManager.Error.CookieNotFound ErrorMessage="Invalid cookie"
> UniqueName=:1.35
> MESSAGE "s" {
> STRING "Invalid cookie";
> };
>
> ‣ Type=method_call Endian=l Flags=0 Version=1 Cookie=2786 Timestamp="Tue 2023-10-31 06:41:25.629256 UTC"
> Sender=:1.43 Destination=:1.35 Path=/org/freedesktop/PowerManagement/Inhibit Interface=org.freedesktop.PowerManagement.Inhibit Member=UnInhibit
> UniqueName=:1.43
> MESSAGE "u" {
> UINT32 21;
> };
>
> ‣ Type=error Endian=l Flags=1 Version=1 Cookie=275 ReplyCookie=2786 Timestamp="Tue 2023-10-31 06:41:25.629365 UTC"
> Sender=:1.35 Destination=:1.43
> ErrorName=org.xfce.PowerManager.Error.CookieNotFound ErrorMessage="Invalid cookie"
> UniqueName=:1.35
> MESSAGE "s" {
> STRING "Invalid cookie";
> };
> ```
>
> I also found that this issue is not easily reproducible. I restarted Firefox to test it again and it worked perfectly and called both functions normally with the correct values!
>
> I normally keep Firefox open 24/7, so at some point it glitches out and stops calling `Inhibit` and keeps calling `UnInhibit` with a cached cookie value every time the p...

Read more...

Revision history for this message
In , Stransky (stransky) wrote :

Can you run with MOZ_LOG="LinuxWakeLock:5" env variable? You'll get wake lock log from Firefox perspective and it's see what's called.

Revision history for this message
In , Thedcoder (thedcoder) wrote :

Created attachment 9361606
output.log

Turns out it was actually very easy to reproduce:

1. Open Firefox
2. Open private window and load a video (I just opened YouTube)
4. Close the private window
5. Open a new private window and load another video
6. Confirm that power inhibition is broken

Here's the terminal output:

Revision history for this message
In , Thedcoder (thedcoder) wrote :
Download full text (7.3 KiB)

Turns out it was actually very easy to reproduce:

1. Open Firefox
2. Open private window and load a video (I just opened YouTube)
4. Close the private window
5. Open a new private window and load another video
6. Confirm that power inhibition is broken

Here's the terminal output:
```
$ MOZ_LOG="LinuxWakeLock:5" firefox
[GFX1-]: vaapitest: ManageChildProcess failed

[Parent 330129: Main Thread]: D/LinuxWakeLock WakeLockListener video-playing state locked-foreground
[Parent 330129: Main Thread]: D/LinuxWakeLock WakeLockTopic::SwitchToNextWakeLockType() WakeLockType Initial
[Parent 330129: Main Thread]: D/LinuxWakeLock switched to WakeLockType FreeDesktopScreensaver
[Parent 330129: Main Thread]: D/LinuxWakeLock shouldLock 1
[Parent 330129: Main Thread]: D/LinuxWakeLock WakeLockTopic::InhibitScreensaver() state 0
[Parent 330129: Main Thread]: D/LinuxWakeLock WakeLockTopic::SendInhibit() WakeLockType FreeDesktopScreensaver
[Parent 330129: Main Thread]: D/LinuxWakeLock InhibitFreeDesktopScreensaver()
[Parent 330129: Main Thread]: D/LinuxWakeLock WakeLockTopic::DBusInhibitScreensaver() waiting 0
[Parent 330129: Main Thread]: D/LinuxWakeLock WakeLockTopic::DBusInhibitScreensaver() proxy created
[Parent 330129: Main Thread]: D/LinuxWakeLock WakeLockTopic::DBusInhibitFailed() Inhibit call failed : GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.ScreenSaver was not provided by any .service files
[Parent 330129: Main Thread]: D/LinuxWakeLock WakeLockTopic::DBusInhibitFailed(1)
[Parent 330129: Main Thread]: D/LinuxWakeLock WakeLockTopic::SwitchToNextWakeLockType() WakeLockType FreeDesktopScreensaver
[Parent 330129: Main Thread]: D/LinuxWakeLock switched to WakeLockType FreeDesktopPower
[Parent 330129: Main Thread]: D/LinuxWakeLock WakeLockTopic::SendInhibit() WakeLockType FreeDesktopPower
[Parent 330129: Main Thread]: D/LinuxWakeLock InhibitFreeDesktopPower()
[Parent 330129: Main Thread]: D/LinuxWakeLock WakeLockTopic::DBusInhibitScreensaver() waiting 0
[Parent 330129: Main Thread]: D/LinuxWakeLock WakeLockTopic::DBusInhibitScreensaver() proxy created
[Parent 330129: Main Thread]: D/LinuxWakeLock WakeLockTopic::DBusInhibitSucceeded(), mInhibitRequestID 3
[Parent 330129: Main Thread]: D/LinuxWakeLock WakeLockListener video-playing state locked-background
[Parent 330129: Main Thread]: D/LinuxWakeLock WakeLockTopic::~WakeLockTopic() state 0
[Parent 330129: Main Thread]: D/LinuxWakeLock shouldLock 0
[Parent 330129: Main Thread]: D/LinuxWakeLock WakeLockTopic::UninhibitScreensaver() state 1
[Parent 330129: Main Thread]: D/LinuxWakeLock WakeLockTopic::SendUninhibit() WakeLockType FreeDesktopPower
[Parent 330129: Main Thread]: D/LinuxWakeLock UninhibitFreeDesktopPower()
[Parent 330129: Main Thread]: D/LinuxWakeLock WakeLockTopic::DBusUninhibitScreensaver() waiting 0 request id 3
[Parent 330129: Main Thread]: D/LinuxWakeLock WakeLockListener video-playing state unlocked
[Parent 330129: Main Thread]: D/LinuxWakeLock WakeLockTopic::~WakeLockTopic() state 0
[Parent 330129: Main Thread]: D/LinuxWakeLock shouldLock 0
[Parent 330129: Main Thread]: D/LinuxWakeLock WakeLockTopic::UninhibitScreensaver() state 1
[Parent 330129: Main Th...

Read more...

Revision history for this message
In , Stransky (stransky) wrote :

This testcase works for me, Thanks!

Revision history for this message
In , Stransky (stransky) wrote :

Created attachment 9361707
Bug 1862159 [Linux] Add IsCancelledGError() to detect DBus operation cancellation r?emilio

Revision history for this message
In , Stransky (stransky) wrote :

Created attachment 9361708
Bug 1862159 [Linux] Rework wake lock to better handle wake lock states and allow to cancel pending DBus operations r?emilio

- Update WAKE_LOCK_LOG to print 'this' which allows to sort operations by lock type
- GetOrInsertNew() call always creates a new WakeLockTopic object so in this patch call it only if we create a new object.
- Split mWaitingForDBusReply to mWaitingForDBusInhibit/mWaitingForDBusUninhibit. It allows to ignore repeated requests and also cancel
  opposite requests.
- Use g_cancellable to cancel pending DBus operation if we want different wake lock action.

Depends on D192621

Revision history for this message
In , Pulsebot-d (pulsebot-d) wrote :

Pushed by <email address hidden>:
https://hg.mozilla.org/integration/autoland/rev/a3014ce3c54a
[Linux] Add IsCancelledGError() to detect DBus operation cancellation r=emilio

Revision history for this message
In , Smolnar (smolnar) wrote :
Revision history for this message
In , Thedcoder (thedcoder) wrote :

(In reply to Sandor Molnar[:smolnar] from comment #8)
> https://hg.mozilla.org/mozilla-central/rev/a3014ce3c54a

Are you sure that this is fixed? Revision D192622 also seems to be required and it's still open for merge.

Also would these fixes be deployed in v121? Why not v120?

Revision history for this message
In , Stransky (stransky) wrote :

Sorry, my fault. Forget to mark as leave open.

Revision history for this message
In , Mbarriolinares (mbarriolinares) wrote :

I'm testing firefox-nightly installed from here https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=firefox-nightly-bin

This isn't fixed.

```
# busctl --user monitor org.freedesktop.PowerManagement

‣ Type=method_call Endian=l Flags=0 Version=1 Cookie=172 Timestamp="Tue 2023-11-07 19:04:09.075478 UTC"
  Sender=:1.110 Destination=:1.26 Path=/org/freedesktop/PowerManagement/Inhibit Interface=org.freedesktop.PowerManagement.Inhibit Member=UnInhibit
  UniqueName=:1.110
  MESSAGE "u" {
          UINT32 2;
  };

‣ Type=error Endian=l Flags=1 Version=1 Cookie=383 ReplyCookie=172 Timestamp="Tue 2023-11-07 19:04:09.075756 UTC"
  Sender=:1.26 Destination=:1.110
  ErrorName=org.xfce.PowerManager.Error.CookieNotFound ErrorMessage="Invalid cookie"
  UniqueName=:1.26
  MESSAGE "s" {
          STRING "Invalid cookie";
  };
```

Revision history for this message
In , Stransky (stransky) wrote :

We're waiting to D192622.

Revision history for this message
In , Pulsebot-d (pulsebot-d) wrote :

Pushed by <email address hidden>:
https://hg.mozilla.org/integration/autoland/rev/7c1e05f847ba
[Linux] Rework wake lock to better handle wake lock states and allow to cancel pending DBus operations r=emilio

Revision history for this message
In , Sstanca (sstanca) wrote :

Backed out for causing WakeLock related failures.
* [Backout link]()

* [Push with failures wpt failures](https://treeherder.mozilla.org/jobs?repo=autoland&group_state=expanded&resultStatus=success%2Cpending%2Crunning%2Ctestfailed%2Cbusted%2Cexception&fromchange=008d97a8a9a984bfdc4a96e3ce3340b1b4e998ce&searchStr=linux%2C18.04%2Cx64%2Cwebrender%2Copt%2Cweb%2Cplatform%2Ctests%2Cwithout%2Cfission%2Cenabled%2Ctest-linux1804-64-qr%2Fopt-web-platform-tests-nofis%2Cwpt1&selectedTaskRun=ej2i_7W_Tua6-rf0yhKy0Q.0&tochange=100fece899f062e60491f83988a5a76eb5bdba81)
* [Failure Log](https://treeherder.mozilla.org/logviewer?job_id=435435291&repo=autoland)
* Failure line: PROCESS-CRASH | MOZ_DIAGNOSTIC_ASSERT(g_cancellable_is_cancelled(mCancellable)) [@ WakeLockTopic::SwitchToNextWakeLockType] | /screen-capture/getdisplaymedia-framerate.https.html

-----------------------------------------------------------------------------------------------------------------------------------------------------------------

* [Push with failures - reftests failures](https://treeherder.mozilla.org/jobs?repo=autoland&group_state=expanded&selectedTaskRun=UJMXfz5xQbeS_7lvfhMq4w.0&resultStatus=success%2Ctestfailed%2Cbusted%2Cexception&fromchange=27fd9f6f57eac66fd6d1f83504d83853f480c48a&searchStr=linux%2C18.04%2Cx64%2Cwebrender%2Cdebug%2Creftests%2Ctest-linux1804-64-qr%2Fdebug-crashtest%2Cc&tochange=100fece899f062e60491f83988a5a76eb5bdba81)
* [Failure Log](https://treeherder.mozilla.org/logviewer?job_id=435435004&repo=autoland)
* Failure line: Assertion failure: g_cancellable_is_cancelled(mCancellable), at /builds/worker/checkouts/gecko/widget/gtk/WakeLockListener.cpp:700

-----------------------------------------------------------------------------------------------------------------------------------------------------------------

* [Push with failures - mochitests failures](https://treeherder.mozilla.org/jobs?repo=autoland&group_state=expanded&resultStatus=testfailed%2Cbusted%2Cexception&fromchange=b055ae43d5fc71bc68dc83d4aca73ea4411b48df&tochange=100fece899f062e60491f83988a5a76eb5bdba81&selectedTaskRun=Oj-Wk0-KTg6awxS24Dvz0Q.0)
* [Failure Log](https://treeherder.mozilla.org/logviewer?job_id=435433821&repo=autoland)
* Failure line: Assertion failure: g_cancellable_is_cancelled(mCancellable), at /builds/worker/checkouts/gecko/widget/gtk/WakeLockListener.cpp:700

Revision history for this message
In , Stransky (stransky) wrote :

Updated, Thanks.

Revision history for this message
In , Pulsebot-d (pulsebot-d) wrote :

Pushed by <email address hidden>:
https://hg.mozilla.org/integration/autoland/rev/63c54b25b36f
[Linux] Rework wake lock to better handle wake lock states and allow to cancel pending DBus operations r=emilio

Revision history for this message
In , Sstanca (sstanca) wrote :
Revision history for this message
In , Stransky (stransky) wrote :

Updated, Thanks.

Revision history for this message
In , Pulsebot-d (pulsebot-d) wrote :

Pushed by <email address hidden>:
https://hg.mozilla.org/integration/autoland/rev/61e218fa6f1c
[Linux] Rework wake lock to better handle wake lock states and allow to cancel pending DBus operations r=emilio

Revision history for this message
In , Stransky (stransky) wrote :

Created attachment 9362793
Bug 1862159 [Linux] Fix WakeLockListener to build with disabled DBus r?emilio

Revision history for this message
In , Pulsebot-d (pulsebot-d) wrote :

Pushed by <email address hidden>:
https://hg.mozilla.org/integration/autoland/rev/7d108376e269
[Linux] Fix WakeLockListener to build with disabled DBus r=emilio

Revision history for this message
In , Nerli (nerli) wrote :
Revision history for this message
In , Thedcoder (thedcoder) wrote :

Is this supposed to be fixed? I can still reproduce it in Nightly `121.0a1 (2023-11-10) (64-bit)`

Revision history for this message
In , Stransky (stransky) wrote :

(In reply to Damon from comment #23)
> Is this supposed to be fixed? I can still reproduce it in Nightly `121.0a1 (2023-11-10) (64-bit)`

Yes, it should be fixed. Please attach another log of MOZ_LOG="LinuxWakeLock:5".
Thanks.

Revision history for this message
In , Thedcoder (thedcoder) wrote :
Download full text (7.6 KiB)

The steps to reproduce have changed a bit:

1. Open Firefox
2. Open a private window and load a video
3. Close the window abruptly (without pausing/stopping the video, while it's still playing)
4. Repeat step 2
5. Confirm that power inhibition is broken

Output:
```
$ MOZ_LOG="LinuxWakeLock:5" firefox-nightly
[GFX1-]: vaapitest: ManageChildProcess failed

[Parent 70035, Main Thread] WARNING: Failed to call GetIdletime(): GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.Mutter.IdleMonitor was not provided by any .service files
: 'glib warning', file /build/firefox-nightly/src/mozilla-central/toolkit/xre/nsSigHandlers.cpp:187

** (firefoxnightly:70035): WARNING **: 00:39:29.405: Failed to call GetIdletime(): GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.Mutter.IdleMonitor was not provided by any .service files

[Parent 70035: Main Thread]: D/LinuxWakeLock [7f308ea77580] WakeLockTopic::WakeLockTopic() created video-playing
[Parent 70035: Main Thread]: D/LinuxWakeLock [7f308ea77580] WakeLockTopic::SwitchToNextWakeLockType() WakeLockType Initial
[Parent 70035: Main Thread]: D/LinuxWakeLock [7f308ea77580] switched to WakeLockType FreeDesktopScreensaver
[Parent 70035: Main Thread]: D/LinuxWakeLock [7f30c22fd8e0] WakeLockListener topic video-playing state locked-foreground request lock 1
[Parent 70035: Main Thread]: D/LinuxWakeLock [7f308ea77580] WakeLockTopic::InhibitScreensaver() Inhibited 0
[Parent 70035: Main Thread]: D/LinuxWakeLock [7f308ea77580] WakeLockTopic::SendInhibit() WakeLockType FreeDesktopScreensaver
[Parent 70035: Main Thread]: D/LinuxWakeLock [7f308ea77580] InhibitFreeDesktopScreensaver()
[Parent 70035: Main Thread]: D/LinuxWakeLock [7f308ea77580] WakeLockTopic::DBusInhibitScreensaver() mWaitingForDBusInhibit 0 mWaitingForDBusUninhibit 0
[Parent 70035: Main Thread]: D/LinuxWakeLock [7f308ea77580] WakeLockTopic::DBusInhibitScreensaver() proxy created
[Parent 70035: Main Thread]: D/LinuxWakeLock [7f308ea77580] WakeLockTopic::DBusInhibitFailed() Inhibit call failed : GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.ScreenSaver was not provided by any .service files
[Parent 70035: Main Thread]: D/LinuxWakeLock [7f308ea77580] WakeLockTopic::DBusInhibitFailed(1)
[Parent 70035: Main Thread]: D/LinuxWakeLock [7f308ea77580] WakeLockTopic::SwitchToNextWakeLockType() WakeLockType FreeDesktopScreensaver
[Parent 70035: Main Thread]: D/LinuxWakeLock [7f308ea77580] switched to WakeLockType FreeDesktopPower
[Parent 70035: Main Thread]: D/LinuxWakeLock [7f308ea77580] WakeLockTopic::SendInhibit() WakeLockType FreeDesktopPower
[Parent 70035: Main Thread]: D/LinuxWakeLock [7f308ea77580] InhibitFreeDesktopPower()
[Parent 70035: Main Thread]: D/LinuxWakeLock [7f308ea77580] WakeLockTopic::DBusInhibitScreensaver() mWaitingForDBusInhibit 0 mWaitingForDBusUninhibit 0
[Parent 70035: Main Thread]: D/LinuxWakeLock [7f308ea77580] WakeLockTopic::DBusInhibitScreensaver() proxy created
[Parent 70035: Main Thread]: D/LinuxWakeLock [7f308ea77580] WakeLockTopic::DBusInhibitSucceeded(), mInhibitRequestID 11 mShouldInhibit 1
[Parent 70035: Main Thread]: D/LinuxWakeLock [7f30c22fd8e0]...

Read more...

Eugene San (eugenesan)
summary: - Firefox stops inhibiting screensaver after opening two or more tabs with
- video playback
+ Firefox stops inhibiting screensaver after opening/un-suspending two or
+ more tabs with video playback
description: updated
Eugene San (eugenesan)
summary: - Firefox stops inhibiting screensaver after opening/un-suspending two or
- more tabs with video playback
+ Firefox stopped inhibiting screensaver on video playback
description: updated
Revision history for this message
In , Intrlocutr (intrlocutr) wrote :

Created attachment 9380085
firefox_no_inhibit

This bug is still present on Firefox 122.0.1, Arch Linux. Relevant package versions:
linux 6.7.4.arch1-1
dbus 1.14.10-2
firefox 122.0.1-1

Revision history for this message
In , Intrlocutr (intrlocutr) wrote :

Comment on attachment 9380085
firefox_no_inhibit

I am using i3wm 4.23, no desktop environment.

Revision history for this message
In , Mbarriolinares (mbarriolinares) wrote :

Can confirm, this bug is still happening.

Archlinux up-to-date. XFCE.

Revision history for this message
In , Eugene San (eugenesan) wrote :
Download full text (5.6 KiB)

Around 6 months ago, I was experiencing similar issues when Firefox would randomly stop inhibiting screensaver after some time, closing/opening tabs or just starting/stopping playback in more than two tabs (concurrently or sequentially).

Recently, with versions ~120 screensaver/lock inhibition stopped working completely.

I tested on Ubuntu-Mate 22.04, 23.10, 24.04 and vanilla Ubuntu 24.04 and the problem persists.
Firefox packages from Mozilla, Canonical PPA and Snap are all broken.

Here is the log of setting the lock to 1 minute, starting playback, waiting till screensaver actiavtes, cancel the the screensaver and stop playback:
```
MOZ_LOG="LinuxWakeLock:5" firefox
libva info: VA-API version 1.19.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_18
libva info: va_openDriver() returns 0
[Parent 7830: Main Thread]: D/LinuxWakeLock [7c3313712b00] WakeLockTopic::WakeLockTopic() created video-playing
[Parent 7830: Main Thread]: D/LinuxWakeLock [7c3313712b00] WakeLockTopic::SwitchToNextWakeLockType() WakeLockType Initial
[Parent 7830: Main Thread]: D/LinuxWakeLock [7c3313712b00] switched to WakeLockType FreeDesktopScreensaver
[Parent 7830: Main Thread]: D/LinuxWakeLock [7c333831aa30] WakeLockListener topic video-playing state locked-foreground request lock 1
[Parent 7830: Main Thread]: D/LinuxWakeLock [7c3313712b00] WakeLockTopic::InhibitScreensaver() Inhibited 0
[Parent 7830: Main Thread]: D/LinuxWakeLock [7c3313712b00] WakeLockTopic::SendInhibit() WakeLockType FreeDesktopScreensaver
[Parent 7830: Main Thread]: D/LinuxWakeLock [7c3313712b00] InhibitFreeDesktopScreensaver()
[Parent 7830: Main Thread]: D/LinuxWakeLock [7c3313712b00] WakeLockTopic::DBusInhibitScreensaver() mWaitingForDBusInhibit 0 mWaitingForDBusUninhibit 0
[Parent 7830: Main Thread]: D/LinuxWakeLock [7c3313712b00] WakeLockTopic::DBusInhibitScreensaver() proxy created
[Parent 7830: Main Thread]: D/LinuxWakeLock [7c3313712b00] WakeLockTopic::DBusInhibitFailed() Inhibit call failed : GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.ScreenSaver was not provided by any .service files
[Parent 7830: Main Thread]: D/LinuxWakeLock [7c3313712b00] WakeLockTopic::DBusInhibitFailed(1)
[Parent 7830: Main Thread]: D/LinuxWakeLock [7c3313712b00] WakeLockTopic::SwitchToNextWakeLockType() WakeLockType FreeDesktopScreensaver
[Parent 7830: Main Thread]: D/LinuxWakeLock [7c3313712b00] switched to WakeLockType FreeDesktopPower
[Parent 7830: Main Thread]: D/LinuxWakeLock [7c3313712b00] WakeLockTopic::SendInhibit() WakeLockType FreeDesktopPower
[Parent 7830: Main Thread]: D/LinuxWakeLock [7c3313712b00] InhibitFreeDesktopPower()
[Parent 7830: Main Thread]: D/LinuxWakeLock [7c3313712b00] WakeLockTopic::DBusInhibitScreensaver() mWaitingForDBusInhibit 0 mWaitingForDBusUninhibit 0
[Parent 7830: Main Thread]: D/LinuxWakeLock [7c3313712b00] WakeLockTopic::DBusInhibitScreensaver() proxy created
[Parent 7830: Main Thread]: D/LinuxWakeLock [7c3313712b00] WakeLockTopic::DBusInhibitFailed() Inhibit call failed : GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.PowerManagemen...

Read more...

Revision history for this message
In , Eugene San (eugenesan) wrote :
Download full text (5.8 KiB)

(In reply to Eugene San from comment #29)
> Around 6 months ago, I was experiencing similar issues when Firefox would randomly stop inhibiting screensaver after some time, closing/opening tabs or just starting/stopping playback in more than two tabs (concurrently or sequentially).
>
> Recently, with versions ~120 screensaver/lock inhibition stopped working completely.
>
> I tested on Ubuntu-Mate 22.04, 23.10, 24.04 and vanilla Ubuntu 24.04 and the problem persists.
> Firefox packages from Mozilla, Canonical PPA and Snap are all broken.
>
> Here is the log of setting the lock to 1 minute, starting playback, waiting till screensaver actiavtes, cancel the the screensaver and stop playback:
> ```
> MOZ_LOG="LinuxWakeLock:5" firefox
> libva info: VA-API version 1.19.0
> libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
> libva info: Found init function __vaDriverInit_1_18
> libva info: va_openDriver() returns 0
> [Parent 7830: Main Thread]: D/LinuxWakeLock [7c3313712b00] WakeLockTopic::WakeLockTopic() created video-playing
> [Parent 7830: Main Thread]: D/LinuxWakeLock [7c3313712b00] WakeLockTopic::SwitchToNextWakeLockType() WakeLockType Initial
> [Parent 7830: Main Thread]: D/LinuxWakeLock [7c3313712b00] switched to WakeLockType FreeDesktopScreensaver
> [Parent 7830: Main Thread]: D/LinuxWakeLock [7c333831aa30] WakeLockListener topic video-playing state locked-foreground request lock 1
> [Parent 7830: Main Thread]: D/LinuxWakeLock [7c3313712b00] WakeLockTopic::InhibitScreensaver() Inhibited 0
> [Parent 7830: Main Thread]: D/LinuxWakeLock [7c3313712b00] WakeLockTopic::SendInhibit() WakeLockType FreeDesktopScreensaver
> [Parent 7830: Main Thread]: D/LinuxWakeLock [7c3313712b00] InhibitFreeDesktopScreensaver()
> [Parent 7830: Main Thread]: D/LinuxWakeLock [7c3313712b00] WakeLockTopic::DBusInhibitScreensaver() mWaitingForDBusInhibit 0 mWaitingForDBusUninhibit 0
> [Parent 7830: Main Thread]: D/LinuxWakeLock [7c3313712b00] WakeLockTopic::DBusInhibitScreensaver() proxy created
> [Parent 7830: Main Thread]: D/LinuxWakeLock [7c3313712b00] WakeLockTopic::DBusInhibitFailed() Inhibit call failed : GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.ScreenSaver was not provided by any .service files
> [Parent 7830: Main Thread]: D/LinuxWakeLock [7c3313712b00] WakeLockTopic::DBusInhibitFailed(1)
> [Parent 7830: Main Thread]: D/LinuxWakeLock [7c3313712b00] WakeLockTopic::SwitchToNextWakeLockType() WakeLockType FreeDesktopScreensaver
> [Parent 7830: Main Thread]: D/LinuxWakeLock [7c3313712b00] switched to WakeLockType FreeDesktopPower
> [Parent 7830: Main Thread]: D/LinuxWakeLock [7c3313712b00] WakeLockTopic::SendInhibit() WakeLockType FreeDesktopPower
> [Parent 7830: Main Thread]: D/LinuxWakeLock [7c3313712b00] InhibitFreeDesktopPower()
> [Parent 7830: Main Thread]: D/LinuxWakeLock [7c3313712b00] WakeLockTopic::DBusInhibitScreensaver() mWaitingForDBusInhibit 0 mWaitingForDBusUninhibit 0
> [Parent 7830: Main Thread]: D/LinuxWakeLock [7c3313712b00] WakeLockTopic::DBusInhibitScreensaver() proxy created
> [Parent 7830: Main Thread]: D/LinuxWakeLock [7c3313712b00] WakeLockTopic::DBusInhibitFailed() Inhibit ca...

Read more...

Revision history for this message
In , Plurtu (plurtu) wrote :

(In reply to Eugene San from comment #29)
> Recently, with versions ~120 screensaver/lock inhibition stopped working completely.

It works for me on vanilla Ubuntu 23.10.

The `video-playing` inhibitor is only set when the video is visible (ie window is not minimized or fully covered by another window). Wayland is able to detect covered windows unlike X11 and was recently enabled in version 121. You can disable Wayland to see the difference:

     MOZ_ENABLE_WAYLAND=0 MOZ_LOG="LinuxWakeLock:5" firefox

Revision history for this message
In , O-me-d (o-me-d) wrote :

I have the same issue on latest Gentoo, with Firefox 123.0

Revision history for this message
In , Eugene San (eugenesan) wrote :

(In reply to Kestrel from comment #31)
> (In reply to Eugene San from comment #29)
> > Recently, with versions ~120 screensaver/lock inhibition stopped working completely.
>
> It works for me on vanilla Ubuntu 23.10.
>
> The `video-playing` inhibitor is only set when the video is visible (ie window is not minimized or fully covered by another window). Wayland is able to detect covered windows unlike X11 and was recently enabled in version 121. You can disable Wayland to see the difference:
>
> MOZ_ENABLE_WAYLAND=0 MOZ_LOG="LinuxWakeLock:5" firefox

I have not tried Vanilla 23.10 and since other browsers do not have this issue I see no reason to blame/exclude any specific distro. Numerous reports support.
Now when I think about it, I tested both X and Wayland variants of Ubuntu so we can't blame X or Wayland either.
Maybe your routine/setup/hardware somehow avoids the issue and we should figure out how your setup is different from let's say generic install of "Vanilla" system in Virtualbox.

Also, why would you assume anyone taking their time to report the issue here, would test with the video in background or partially covered? It's a possibility, but common we are mostly gown-ups here.

Revision history for this message
In , Eugene San (eugenesan) wrote :

Update.
Seems like the issue is not affecting KDE Plasma sessions.
I installed Plasma session on the same machine (Ubuntu Mate 23.10) and it works with the same Firefox instance without an issue.
Maybe "Media Playback" detection (indicated by the relevant Tray Icon) helps or maybe Plasma handling DBUS msgs differently.

I also tried freshly installed Kubuntu 24.04 and OpenSuSe Thumbleweed with plasma and they both work.

Here is the log:
```
MOZ_ENABLE_WAYLAND=0 MOZ_LOG="LinuxWakeLock:5" firefox
libva info: VA-API version 1.19.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_18
libva info: va_openDriver() returns 0
[Parent 17406: Main Thread]: D/LinuxWakeLock [78ca7343e650] WakeLockTopic::WakeLockTopic() created video-playing
[Parent 17406: Main Thread]: D/LinuxWakeLock [78ca7343e650] WakeLockTopic::SwitchToNextWakeLockType() WakeLockType Initial
[Parent 17406: Main Thread]: D/LinuxWakeLock [78ca7343e650] switched to WakeLockType FreeDesktopScreensaver
[Parent 17406: Main Thread]: D/LinuxWakeLock [78ca8721f670] WakeLockListener topic video-playing state locked-foreground request lock 1
[Parent 17406: Main Thread]: D/LinuxWakeLock [78ca7343e650] WakeLockTopic::InhibitScreensaver() Inhibited 0
[Parent 17406: Main Thread]: D/LinuxWakeLock [78ca7343e650] WakeLockTopic::SendInhibit() WakeLockType FreeDesktopScreensaver
[Parent 17406: Main Thread]: D/LinuxWakeLock [78ca7343e650] InhibitFreeDesktopScreensaver()
[Parent 17406: Main Thread]: D/LinuxWakeLock [78ca7343e650] WakeLockTopic::DBusInhibitScreensaver() mWaitingForDBusInhibit 0 mWaitingForDBusUninhibit 0
[Parent 17406: Main Thread]: D/LinuxWakeLock [78ca7343e650] WakeLockTopic::DBusInhibitScreensaver() proxy created
[Parent 17406: Main Thread]: D/LinuxWakeLock [78ca7343e650] WakeLockTopic::DBusInhibitSucceeded(), mInhibitRequestID 6943 mShouldInhibit 1
[Parent 17406: Main Thread]: D/LinuxWakeLock [78ca8721f670] WakeLockListener topic video-playing state unlocked request lock 0
[Parent 17406: Main Thread]: D/LinuxWakeLock [78ca7343e650] WakeLockTopic::UninhibitScreensaver() Inhibited 1
[Parent 17406: Main Thread]: D/LinuxWakeLock [78ca7343e650] WakeLockTopic::SendUninhibit() WakeLockType FreeDesktopScreensaver
[Parent 17406: Main Thread]: D/LinuxWakeLock [78ca7343e650] UninhibitFreeDesktopScreensaver()
[Parent 17406: Main Thread]: D/LinuxWakeLock [78ca7343e650] WakeLockTopic::DBusUninhibitScreensaver() mWaitingForDBusInhibit 0 mWaitingForDBusUninhibit 0 request id 6943
[Parent 17406: Main Thread]: D/LinuxWakeLock [78ca7343e650] WakeLockTopic::DBusUninhibitScreensaver() proxy created
[Parent 17406: Main Thread]: D/LinuxWakeLock [78ca7343e650] WakeLockTopic::DBusUninhibitSucceeded() mShouldInhibit 0
```

Revision history for this message
In , Mbarriolinares (mbarriolinares) wrote :

This is still happening

Firefox 125.0.3 (64-bit)
XFCE xfwm4 4.18.0

```
dbus-send --dest=org.freedesktop.PowerManagement --print-reply=literal /org/freedesktop/PowerManagement/Inhibit org.freedesktop.PowerManagement.Inhibit.GetInhibitors
```
```
   array [
   ]
```

This returns nothing when firefox is opened for a while. If I restart firefox, then the inhibit is ok.

Revision history for this message
In , Gunerius (gunerius) wrote :

Sorry if this is irrelevant, but I have the same problem on Firefox 126.0 for Windows 10. Not expecting any replies, just wanted to mention it in case it's useful to anyone.

Revision history for this message
In , Stransky (stransky) wrote :

(In reply to Øystein Guneriussen from comment #36)
> Sorry if this is irrelevant, but I have the same problem on Firefox 126.0 for Windows 10. Not expecting any replies, just wanted to mention it in case it's useful to anyone.

Please file another bug against Windows - it's different issue there.

Revision history for this message
Amin Bandali (bandali) wrote :

Hello,

Are you able to reproduce this on Ubuntu Noble (24.04), and with the latest version of Firefox? If so, would you please also open a bug report upstream on Mozilla's tracker at https://bugzilla.mozilla.org ?

Also, would you please double-check the system logs and also dmesg for any potentially relevant errors, such as AppArmor DENIED lines?

Changed in firefox (Ubuntu):
status: New → Incomplete
Revision history for this message
Eugene San (eugenesan) wrote (last edit ):

To fix the issue, I was forced to switch to KDE Plasma (on the same system).
KDE Plasma had no issues with Firefox on both 23.10 and 24.04.

I opened a bug with Mate and there is already a bug report on bugzilla.
Unfortunately, no solution was provided so for now Mate + Firefox is not a practical combination.

Regarding error msgs and relevant log entries, there are none.
The problem seems to be related to DBUS communication between Mate and Firefox.

Revision history for this message
In , Mbarriolinares (mbarriolinares) wrote :

This bug is never gonna get fixed right?

Revision history for this message
In , Stransky (stransky) wrote :

(In reply to Manu Barrio Linares [:Manu] from comment #38)
> This bug is never gonna get fixed right?

Who knows. There's too many bugs and few developers who works on them. Feel free to join and try to solve it. There's a mini-howto:
https://mastransky.wordpress.com/2023/07/04/no-one-fights-alone-a-guide-to-your-first-firefox-patch-on-linux/

Revision history for this message
Amin Bandali (bandali) wrote :

I see, thanks for the update. Would you please provide the bug number on Bugzilla so we could potentially link it to this one Launchpad for future reference?

Revision history for this message
Eugene San (eugenesan) wrote :

@bandali
I believe this bug report on bugzilla is related: https://bugzilla.mozilla.org/show_bug.cgi?id=1862159

Revision history for this message
Amin Bandali (bandali) wrote :

Thanks, I'll amend this bug's metadata accordingly.

Changed in firefox (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
In , Stransky (stransky) wrote :

Manu, please run Firefox on terminal and attach a log with MOZ_LOG="LinuxWakeLock:5" env variable so we can check why Wake lock is not applied.
Run as:
```
MOZ_LOG="LinuxWakeLock:5" firefox > log.txt 2>&1
```
and attach the log here.
Thanks.

Changed in firefox:
status: Unknown → Confirmed
Revision history for this message
In , Mbarriolinares (mbarriolinares) wrote :

Created attachment 9418891
LinuxWakeLock.log

(In reply to Martin Stránský [:stransky] (ni? me) from comment #40)
> Manu, please run Firefox on terminal and attach a log with MOZ_LOG="LinuxWakeLock:5" env variable so we can check why Wake lock is not applied.
> Run as:
> ```
> MOZ_LOG="LinuxWakeLock:5" firefox > log.txt 2>&1
> ```
> and attach the log here.
> Thanks.

Revision history for this message
In , Mbarriolinares (mbarriolinares) wrote :

Before closing firefox in the log I attached above, video was playing and there was NO inhibitor in dbus:

```
# dbus-send --dest=org.freedesktop.PowerManagement --print-reply=literal /org/freedesktop/PowerManagement/Inhibit org.freedesktop.PowerManagement.Inhibit.GetInhibitors
   array [
   ]
```

Revision history for this message
In , Stransky (stransky) wrote :

It may be a dupe of Bug 1896235. Will try to look at it when Bug 1896235 lands.

Revision history for this message
In , SharkCZ (dan-danny) wrote :

I suspect I am affected by this as well, after updating from FF 115 ESR to FF 128 ESR in F-40 with XFCE.

Revision history for this message
In , Stransky (stransky) wrote :
Revision history for this message
In , Mbarriolinares (mbarriolinares) wrote :

(In reply to Martin Stránský [:stransky] (ni? me) from comment #45)
> Can you test latest nightly please?
> https://fedoraproject.org/wiki/How_to_debug_Firefox_problems#Testing_Mozilla_Nightly_binaries
> Thanks.

Been testing Nightly for the last 2 days, and the problem seems to be gone.
I'll continue to test for a few more days.

Revision history for this message
In , Mbarriolinares (mbarriolinares) wrote :

1 day later, happened again. Three big is still present in nightly.

Revision history for this message
In , Plurtu (plurtu) wrote :

When it happens in latest Nightly, try opening the video in a new window and see if playing creates a new inhibitor (as per Comment 42).

Revision history for this message
In , Stransky (stransky) wrote :

Please attach fresh MOZ_LOG="LinuxWakeLock:5" log from latest nightly.
Thanks.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.