Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Screen brightness slider resets to a low level upon reboot #155

Open
vjr opened this issue Nov 18, 2022 · 4 comments
Open

Screen brightness slider resets to a low level upon reboot #155

vjr opened this issue Nov 18, 2022 · 4 comments

Comments

@vjr
Copy link
Member

vjr commented Nov 18, 2022

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
Copy link
Member Author

vjr commented Nov 19, 2022

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
Copy link
Member Author

vjr commented Nov 19, 2022

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
Copy link
Member Author

vjr commented Nov 19, 2022

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

@vjr
Copy link
Member Author

vjr commented Dec 10, 2022

@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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant