After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 784068 - Night light not working on both monitor after unlocking
Night light not working on both monitor after unlocking
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: color
3.24.x
Other Linux
: Normal minor
: ---
Assigned To: Richard Hughes
gnome-settings-daemon-maint
Depends on:
Blocks:
 
 
Reported: 2017-06-21 22:07 UTC by lars.magnus
Modified: 2018-06-05 12:29 UTC
See Also:
GNOME target: ---
GNOME version: 3.23/3.24


Attachments
Log (5.60 KB, text/plain)
2017-06-21 22:07 UTC, lars.magnus
Details

Description lars.magnus 2017-06-21 22:07:29 UTC
Created attachment 354205 [details]
Log

Having two monitors connected with HDMI and Night Light enabled. The Night Light works on both monitors when I'm logged in.

If I lock the screen (CTRL + ALT + L) and then re-login, then the Night Light only works on the secondary monitor.

I have to disable Night Light and then re-enable it to have it working again on both monitors.

Tried to disable all extensions, and doing the same. Same issue.

Running the following:

Ubuntu 17.04
Gnome 3.24.2
Dell UltraSharp U2515H 25" 16:9 2560 x 1440
ASUS Z170 PRO GAMING
Intel Core i7-6700K
Corsair Vengeance LPX DDR4 2133MHz 16GB


Attached is the log the last 40 mins or so (journalctl /usr/bin/gnome-shell)
Comment 1 rockorequin 2017-06-28 04:12:46 UTC
I have very likely the same issue on Ubuntu 17.10 with gnome 3.24.2-0ubuntu2, except that night light breaks on the secondary monitor after both monitors go to sleep and re-awaken. The primary monitor is a laptop screen and the secondary is attached via HDMI.
Comment 2 Benjamin Berg 2018-03-17 13:11:41 UTC
https://gitlab.gnome.org/GNOME/gnome-settings-daemon/issues/6 is the same issue.

Could you maybe provide information about the used graphics card, driver, etc. there? This could well be a driver issue after all.
Comment 3 rockorequin 2018-03-18 06:28:28 UTC
My setup is a laptop with intel/nvidia graphics and an external Dell HDMI monitor. The nvidia card is turned off via bbswitch so only the intel i915 is being used.

All the libegl-mesa, libgl1-mesa, libglapi-mesa, libgles2-mesa packages are at v18.0.0~rc4-1ubuntu3. libgl1-mesa is at 9.0.0-2.1build1.

Often it works as expected but after a resume for instance, the external monitor turns off night light mode. Sometimes turning the night light off and back on again the settings resolves it.
Comment 4 Benjamin Berg 2018-03-18 12:14:31 UTC
Please see
 https://gitlab.gnome.org/GNOME/gnome-settings-daemon/issues/6#note_82347

I attached a script to query the gamma curve from mutter (just displaying the mid point value). I believe that you will find that the gamma is set correctly according to the script.

Could you run the test please?
Comment 5 rockorequin 2018-03-19 11:41:57 UTC
I just ran the script with night-light working correctly on the external monitor but *not* the laptop monitor. The output says gamma is zero everywhere, though:

$ python getgamma.py 
Found CRTCS:
 * 0 (size: 1920x1080px, position: 0, 1080)
   Gamma: 0.000000, 0.000000, 0.000000
 * 1 (size: 1920x1080px, position: 0, 0)
   Gamma: 0.000000, 0.000000, 0.000000
 * 2 (size: 0x0px, position: 0, 0)
   Gamma: 0.000000, 0.000000, 0.000000
()
Outputs:
 * Dell Inc. 24"
   Valid CRTCs for display: 0, 1, 2
   Current CRTC: 1
 * Built-in display
   Valid CRTCs for display: 0, 1, 2
   Current CRTC: 0
Comment 6 Benjamin Berg 2018-03-19 12:15:44 UTC
Funky! Now that is something that shouldn't happen!

I think that proofs it is not a gnome-settings-daemon issue, but it doesn't tell us where the issue actually is yet :-/

The "gamma" value that the script prints is just the middle point of the gamma table. This will be ~0.5 without night light and changes with night light.

I assume that switching night light off/on and re-running the script fixes the issue and the script prints proper values again?
Comment 7 rockorequin 2018-03-20 06:03:13 UTC
Actually I always get the same numbers from the script no matter how many times I toggle night light and whether it's on or off. Is there an issue with the functions called over dbus maybe?
Comment 8 Benjamin Berg 2018-03-20 08:41:22 UTC
It works entirely as expected for me:

Found CRTCS:
 * 0 (size: 1920x1080px, position: 0, 0)
   Gamma: 0.501953, 0.501587, 0.501114
 * 1 (size: 0x0px, position: 2560, 648)
   Gamma: 0.501953, 0.501801, 0.501587
 * 2 (size: 0x0px, position: 0, 0)
   Gamma: 0.500000, 0.500000, 0.500000

Outputs:
 * Built-in display
   Valid CRTCs for display: 0, 1, 2
   Current CRTC: 0

And with night light:

[benjamin@ben-x1 xorgxrdp]$ ~/Downloads/getgamma.py
Found CRTCS:
 * 0 (size: 1920x1080px, position: 0, 0)
   Gamma: 0.501953, 0.338074, 0.188293
 * 1 (size: 0x0px, position: 2560, 648)
   Gamma: 0.501953, 0.501801, 0.501587
 * 2 (size: 0x0px, position: 0, 0)
   Gamma: 0.500000, 0.500000, 0.500000

Outputs:
 * Built-in display
   Valid CRTCs for display: 0, 1, 2
   Current CRTC: 0

Note how the green and blue components are a lot lower than 0.5. So, it seems more likely that something is wrong with querying the gamma table from mutter or the underlying stack.

It'll be hard to pin point this without the ability to reproduce it :-/
Comment 9 rockorequin 2018-03-20 11:12:41 UTC
Are there any debug messages produced by the night light software?

When I just unplugged the external monitor, when gnome-shell switched to the laptop monitor only night light was enabled on it, and after I plugged the external monitor back in again night light is now enabled on both monitors. (Originally it was only on the external monitor.)
Comment 10 rockorequin 2018-03-20 23:33:46 UTC
And this morning, when night light was supposed to automatically turn off, it only turned off on the external monitor, not the laptop monitor. I had to unplug and re-plug the external monitor to fix it.

Benjamin, it looks like you only have one monitor in your configuration in comment #8. Do you have an external monitor to test with?
Comment 11 Benjamin Berg 2018-03-21 09:24:07 UTC
Yeah, I have a number of external monitors to test with (generally only connected through DP). Funnily enough, I have never seen any issues with night light myself. I have seen the issue a few times with a colleague of mine, but we didn't spend time trying to figure out the issue then.

I am still suspecting a driver issue or possibly an issue in mutter …

Ah, are you on a Wayland or X11 session (I should probably extend that script to output the information)?
Comment 12 rockorequin 2018-03-21 13:31:52 UTC
I'm running an X11 session (Ubuntu defaults to that now).
Comment 13 rockorequin 2018-04-01 11:04:09 UTC
Disabling colour profiles (as reported in https://gitlab.gnome.org/GNOME/gnome-settings-daemon/issues/6) seems to fix this for me.
Comment 14 Koen Bulcke 2018-05-26 13:33:15 UTC
Hi,

I've posted in Ubuntu's Launchpad a maybe similar problem: 

https://bugs.launchpad.net/ubuntu/+source/mutter/+bug/1772212

Can I help/try/debug/log something (I'm new here)?

thanks,
br, Koen.
Comment 15 Benjamin Berg 2018-06-05 12:29:21 UTC
Koen, what you are saying is a different issue:

  https://gitlab.gnome.org/GNOME/gnome-settings-daemon/issues/39

We had a number of issues that were fixed recently. I am not completely convinced that the bugfix (from the first bug) fixes this issue, but there is a likelyhood.

 * Cancelling of smooth color temperature transitions after an abrupt
   change happens. This has been reported to fix issues
   where one monitor has the wrong state after resuming.
   https://bugzilla.gnome.org/show_bug.cgi?id=786569
 * There was an issue in certain mutter versions which caused
   night light to only work on one monitor
   https://gitlab.gnome.org/GNOME/mutter/merge_requests/71

I am closing this bug for now. If you are still able to reproduce the issue, then please re-open it on gitlab. Please note that some of these fixes are not yet part of a stable release. They will become available in gnome-settings-daemon 3.28.2.