GNOME Bugzilla – Bug 784068
Night light not working on both monitor after unlocking
Last modified: 2018-06-05 12:29:21 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)
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.
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.
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.
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?
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
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?
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?
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 :-/
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.)
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?
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)?
I'm running an X11 session (Ubuntu defaults to that now).
Disabling colour profiles (as reported in https://gitlab.gnome.org/GNOME/gnome-settings-daemon/issues/6) seems to fix this for me.
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.
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.