elementary/triage

Screen brightness slider resets to a low level upon reboot

vjr opened this issue · 4 comments

vjr commented

What Happened?

Installed elementary 7 daily ISO image (2022-11-18) on a Dell OptiPlex 777 all-in-one PC today and the screen brightness slider reverts to a low level in the greeter, indicator and switchboard power plug even if I raise it in any of these places.

IIRC the brightness was OK in the live session during installation but upon reboot this issue started.

Please let me know what additional information I can provide.

Steps to Reproduce

TBD

Expected Behavior

Screen brightness level should be remembered after adjusting it.

OS Version

7.x (Early Access)

Software Version

Latest release (I have run all updates)

Log Output

console:

(io.elementary.switchboard:1718): dconf-DEBUG: 11:39:20.217: watch_fast: "/org/gnome/settings-daemon/plugins/power/" (establishing: 0, active: 0)
(io.elementary.switchboard:1718): dconf-DEBUG: 11:39:20.217: watch_established: "/org/gnome/desktop/peripherals/touchpad/" (establishing: 1)
(io.elementary.switchboard:1718): dconf-DEBUG: 11:39:20.217: watch_established: "/org/gnome/desktop/peripherals/mouse/" (establishing: 1)
(io.elementary.switchboard:1718): dconf-DEBUG: 11:39:20.217: watch_established: "/org/gnome/settings-daemon/plugins/power/" (establishing: 1)
** (io.elementary.switchboard:1718): DEBUG: 11:39:20.220: MainView.vala:314: Detected backlight interface

** (io.elementary.switchboard:1718): WARNING **: 11:39:20.221: MainView.vala:343: Error opening directory '/proc/acpi/button/lid': No such file or directory
(io.elementary.switchboard:1718): dconf-DEBUG: 11:39:20.221: watch_fast: "/org/gnome/desktop/session/" (establishing: 0, active: 0)
(io.elementary.switchboard:1718): dconf-DEBUG: 11:39:20.221: watch_established: "/org/gnome/desktop/session/" (establishing: 1)
(io.elementary.switchboard:1718): dconf-DEBUG: 11:39:29.778: unwatch_fast: "/org/gnome/desktop/session/" (active: 1, establishing: 0)
(io.elementary.switchboard:1718): dconf-DEBUG: 11:39:29.783: unwatch_fast: "/io/elementary/switchboard/preferences/" (active: 1, establishing: 0)
(io.elementary.switchboard:1718): dconf-DEBUG: 11:39:29.784: sync

syslog:

Nov 19 11:46:48 mumbird systemd[1]: Starting Load/Save Screen Backlight Brightness of backlight:dell_uart_backlight...
Nov 19 11:46:48 mumbird systemd-backlight[543]: dell_uart_backlight: Saved brightness 0 is too low; increasing to 5.

Hardware Info

TBD

vjr commented

I get the following output (snippet) when running G_MESSAGES_DEBUG=all io.elementary.switchboard and opening the power plug and adjusting the brightness slider. The setting is preserved upon logout/login and also restarting lightdm service but lost (reverts to low level) upon reboot:

(io.elementary.switchboard:1718): dconf-DEBUG: 11:39:20.217: watch_fast: "/org/gnome/settings-daemon/plugins/power/" (establishing: 0, active: 0)
(io.elementary.switchboard:1718): dconf-DEBUG: 11:39:20.217: watch_established: "/org/gnome/desktop/peripherals/touchpad/" (establishing: 1)
(io.elementary.switchboard:1718): dconf-DEBUG: 11:39:20.217: watch_established: "/org/gnome/desktop/peripherals/mouse/" (establishing: 1)
(io.elementary.switchboard:1718): dconf-DEBUG: 11:39:20.217: watch_established: "/org/gnome/settings-daemon/plugins/power/" (establishing: 1)
** (io.elementary.switchboard:1718): DEBUG: 11:39:20.220: MainView.vala:314: Detected backlight interface

** (io.elementary.switchboard:1718): WARNING **: 11:39:20.221: MainView.vala:343: Error opening directory '/proc/acpi/button/lid': No such file or directory
(io.elementary.switchboard:1718): dconf-DEBUG: 11:39:20.221: watch_fast: "/org/gnome/desktop/session/" (establishing: 0, active: 0)
(io.elementary.switchboard:1718): dconf-DEBUG: 11:39:20.221: watch_established: "/org/gnome/desktop/session/" (establishing: 1)
(io.elementary.switchboard:1718): dconf-DEBUG: 11:39:29.778: unwatch_fast: "/org/gnome/desktop/session/" (active: 1, establishing: 0)
(io.elementary.switchboard:1718): dconf-DEBUG: 11:39:29.783: unwatch_fast: "/io/elementary/switchboard/preferences/" (active: 1, establishing: 0)
(io.elementary.switchboard:1718): dconf-DEBUG: 11:39:29.784: sync
vjr commented

Seems to be a systemd-backlight service issue:

Nov 19 11:46:48 mumbird systemd[1]: Starting Load/Save Screen Backlight Brightness of backlight:dell_uart_backlight...
Nov 19 11:46:48 mumbird systemd-backlight[543]: dell_uart_backlight: Saved brightness 0 is too low; increasing to 5.
vjr commented

I think I might propose a PR to save/restore the backlight level in a settings object if that is a cleaner alternative?

vjr commented

@elementary/desktop-developers

Looked into this issue and here are my observations:

  • If I restart from within my user desktop session either via the EndSessionDialog restart, or if I type "reboot" in terminal window, the brightness level is not saved/restored.
  • If I switch to console TTY and just press CTRL+ALT+DEL or login and type reboot, then the brightness level is saved/restored.

So I modified wingpanel-indicator-session to always call systemd login dbus interface reboot() method here: https://github.com/elementary/wingpanel-indicator-session/blob/master/src/Indicator.vala#L346

This avoids propagating to Gala's dbus proxy signal call here: https://github.com/elementary/gala/blob/master/src/SessionManager.vala#L67

This seems to get the brightness save/restore working but regresses an old issue where during shutdown there is a systemd 90 second wait "A stop job is running for Session c2 of user vishal..." which maybe why the Gala call to gnome SessionManager was made?

Incidentally, while I was looking at this PR here: elementary/switchboard-plug-about#253 and noticed the calls to systemd.login1.reboot() does not result in the shutdown 90 second wait, not sure how: https://github.com/elementary/switchboard-plug-about/blob/master/src/Interfaces/LoginManager.vala#L64 except in indicator-session the interactive flag is false while here it is set to true.

In any case, I guess either porting gala to Gtk4 or more likely fixing this "investigate systemd session management" issue should resolve this issue?