You are not logged in.

#1 2020-07-31 06:53:21

digitalone
Member
Registered: 2011-08-19
Posts: 350

Cannot restore backlight on AMD VGA after systemd upgrade

Updated the following packages:

systemd-libs (245.6-8 -> 245.7-1)
systemd (245.6-8 -> 245.7-1)
systemd-sysvcompat (245.6-8 -> 245.7-1)

The kernel is not changed, which is 5.7.10. mesa and xf86-video-amdgpu are to the latest version.

VGA and backlight driver are:

$ lspci
00:01.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Mullins [Radeon R3 Graphics] (rev 40)
$ ls /sys/class/backlight/
amdgpu_bl0

At the reboot, the backlight is not restored. What's interesting is that systems service is not showing any error, but it keeps not restoring the backlight,

$ systemctl status systemd-backlight@backlight:amdgpu_bl0.service
● systemd-backlight@backlight:amdgpu_bl0.service - Load/Save Screen Backlight Brightness of backlight:amdgpu_bl0
     Loaded: loaded (/usr/lib/systemd/system/systemd-backlight@.service; static; vendor preset: disabled)
     Active: active (exited) since Fri 2020-07-31 08:26:17 CEST; 8min ago
       Docs: man:systemd-backlight@.service(8)
    Process: 277 ExecStart=/usr/lib/systemd/systemd-backlight load backlight:amdgpu_bl0 (code=exited, status=0/SUCCESS)
   Main PID: 277 (code=exited, status=0/SUCCESS)

Is it a systemd bug? I'm pretty sure if I disable the service and set up brillo, it will work as expected.

Offline

#2 2020-07-31 07:03:59

digitalone
Member
Registered: 2011-08-19
Posts: 350

Re: Cannot restore backlight on AMD VGA after systemd upgrade

As I thought, downgrading the 3 packages to the previous version is working.

Offline

#3 2020-08-03 00:11:03

glenb77
Member
Registered: 2014-10-02
Posts: 68

Re: Cannot restore backlight on AMD VGA after systemd upgrade

i have same issue also with those systemd upgrades with amd backlight. i also tried to force with kernel parameter but no luck. other than downgrade any known workaround for this ?

Offline

#4 2020-08-04 02:50:46

jpegxguy
Member
From: Earth
Registered: 2018-06-18
Posts: 38

Re: Cannot restore backlight on AMD VGA after systemd upgrade

Also happening on

03:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Picasso [1002:15d8] (rev c2)

It used to be like yours (not failing as a service, but failing in its function).

amdgpu_bl0: Saved brightness <SOME 4 FIGURE NUMBER HERE> too high; decreasing to 255.

I just rebooted on Linux 5.8 and I saw it fail for the first time. Maybe it was a race condition though...

● systemd-backlight@backlight:amdgpu_bl0.service - Load/Save Screen Backlight Brightness of backlight:amdgpu_bl0
     Loaded: loaded (/usr/lib/systemd/system/systemd-backlight@.service; static)
     Active: failed (Result: exit-code) since Tue 2020-08-04 05:41:00 EEST; 5min ago
       Docs: man:systemd-backlight@.service(8)
    Process: 331 ExecStart=/usr/lib/systemd/systemd-backlight load backlight:amdgpu_bl0 (code=exited, status=1/FAILURE)
   Main PID: 331 (code=exited, status=1/FAILURE)

Αυγ 04 05:41:00  systemd[1]: Starting Load/Save Screen Backlight Brightness of backlight:amdgpu_bl0...
Αυγ 04 05:41:00  systemd-backlight[331]: amdgpu_bl0: Saved brightness 25443 too high; decreasing to 255.
Αυγ 04 05:41:00  systemd-backlight[331]: amdgpu_bl0: Failed to write system 'brightness' attribute: No such device or address
Αυγ 04 05:41:00  systemd[1]: systemd-backlight@backlight:amdgpu_bl0.service: Main process exited, code=exited, status=1/FAILURE
Αυγ 04 05:41:00  systemd[1]: systemd-backlight@backlight:amdgpu_bl0.service: Failed with result 'exit-code'.
Αυγ 04 05:41:00  systemd[1]: Failed to start Load/Save Screen Backlight Brightness of backlight:amdgpu_bl0.

hi

Offline

#5 2020-08-04 02:52:21

jpegxguy
Member
From: Earth
Registered: 2018-06-18
Posts: 38

Re: Cannot restore backlight on AMD VGA after systemd upgrade


hi

Offline

#6 2020-08-15 14:35:36

navarroaxel
Member
Registered: 2018-11-04
Posts: 23

Re: Cannot restore backlight on AMD VGA after systemd upgrade

Thanks for the tip, this works https://wiki.archlinux.org/index.php/AS … #Backlight!

Last edited by navarroaxel (2020-08-15 21:13:58)

Offline

#7 2020-08-17 01:45:02

Mortimer Houghton
Member
Registered: 2014-09-28
Posts: 88

Re: Cannot restore backlight on AMD VGA after systemd upgrade

I got my system to restore backlight settings by appending the kernel parameter "acpi_backlight=video" (see Backlight:Kernel command-line options)

This worked, but it did have the unintended consequence of making my backlight FN keys work automatically (so that there was a conflicting behavior as I had assigned a keybind to these).  I commented out the keybind (in my Sway config), and now everything is working as intended.

Last edited by Mortimer Houghton (2020-08-17 01:49:08)

Offline

#8 2020-08-17 07:12:48

koroki
Member
Registered: 2013-08-03
Posts: 52

Re: Cannot restore backlight on AMD VGA after systemd upgrade

jpegxguy wrote:

Thanks!

I come for exactly that.

Offline

#9 2020-08-18 08:03:17

jpegxguy
Member
From: Earth
Registered: 2018-06-18
Posts: 38

Re: Cannot restore backlight on AMD VGA after systemd upgrade

Seems like the patch is on its way to get merged. Don't know if it will get backported (I hope...)
https://lore.kernel.org/lkml/CADnq5_OaT … gmail.com/


hi

Offline

#10 2020-10-19 09:29:24

jpegxguy
Member
From: Earth
Registered: 2018-06-18
Posts: 38

Re: Cannot restore backlight on AMD VGA after systemd upgrade

Did this patch actually land in Linux 5.9? (the "Applied, thanks!" suggests so)
Because now I get this:

Οκτ 19 11:01:45  systemd[1]: Starting Load/Save Screen Backlight Brightness of backlight:amdgpu_bl0...
Οκτ 19 11:01:45  systemd-backlight[331]: amdgpu_bl0: Failed to write system 'brightness' attribute: No such device or address
Οκτ 19 11:01:45  systemd[1]: systemd-backlight@backlight:amdgpu_bl0.service: Main process exited, code=exited, status=1/FAILURE
Οκτ 19 11:01:45  systemd[1]: systemd-backlight@backlight:amdgpu_bl0.service: Failed with result 'exit-code'.
Οκτ 19 11:01:45  systemd[1]: Failed to start Load/Save Screen Backlight Brightness of backlight:amdgpu_bl0.

Of course the service works normally if I restart it so it seems that the brightness or (probably) the amdgpu_bl0 node doesn't exist when the service runs. Why?

Last edited by jpegxguy (2020-10-19 09:29:50)


hi

Offline

#11 2020-10-31 18:47:39

drew_klx300
Member
Registered: 2020-10-31
Posts: 2

Re: Cannot restore backlight on AMD VGA after systemd upgrade

I am in the same situation of wondering if the change got included in 5.9 kernel.

Restarting  systemd-backlight@backlight\:amdgpu_bl0 restores my backlight setting when run manually, but not on startup as it should.

I also suspect it has not been created at the time the service has run. It should be possible to delay or make it wait on.

● systemd-backlight@backlight:amdgpu_bl0.service - Load/Save Screen Backlight Brightness of backlight:amdgpu_bl0
     Loaded: loaded (/usr/lib/systemd/system/systemd-backlight@.service; static)
     Active: failed (Result: exit-code) since Sat 2020-10-31 14:33:25 EDT; 23s ago
       Docs: man:systemd-backlight@.service(8)
    Process: 947 ExecStart=/usr/lib/systemd/systemd-backlight load backlight:amdgpu_bl0 (code=exited, status=1/FAILURE)
   Main PID: 947 (code=exited, status=1/FAILURE)

Oct 31 14:33:25 Ideapad5 systemd[1]: Starting Load/Save Screen Backlight Brightness of backlight:amdgpu_bl0...
Oct 31 14:33:25 Ideapad5 systemd-backlight[947]: amdgpu_bl0: Failed to write system 'brightness' attribute: No such device or address
Oct 31 14:33:25 Ideapad5 systemd[1]: systemd-backlight@backlight:amdgpu_bl0.service: Main process exited, code=exited, status=1/FAILURE
Oct 31 14:33:25 Ideapad5 systemd[1]: systemd-backlight@backlight:amdgpu_bl0.service: Failed with result 'exit-code'.
Oct 31 14:33:25 Ideapad5 systemd[1]: Failed to start Load/Save Screen Backlight Brightness of backlight:amdgpu_bl0.

Offline

#12 2020-10-31 19:20:38

drew_klx300
Member
Registered: 2020-10-31
Posts: 2

Re: Cannot restore backlight on AMD VGA after systemd upgrade

jpegxguy,

I came up with a work around. The screen starts at full brightness then restores once this new systemd service  runs.

cat /usr/lib/systemd/system/fix-brightness.service
[Unit]
Description= run this last so it works right

[Service]
Type=idle
ExecStart=/home/drew/fix-brightness.sh

[Install]
WantedBy=multi-user.target

cat fix-brightness.sh
#! /bin/bash
systemctl start systemd-backlight@backlight\:amdgpu_bl0

systemctl enable fix-brighness makes it run on reboot.

idle means run it last, which I think is mainly intended or debug. There should be a after= that works as well, but I don't know enough about systemd to figure that out.

Offline

#13 2020-11-17 11:30:48

Tids
Member
Registered: 2016-02-04
Posts: 5

Re: Cannot restore backlight on AMD VGA after systemd upgrade

jpegxguy wrote:

Did this patch actually land in Linux 5.9? (the "Applied, thanks!" suggests so)

It was applied to 5.8.6 and it looks like it wasnt for next (5.9)

EDIT:
Need to correct myself. patch is in 5.9. But for some reason it still doesn't work


EDIT2:
It only happens for me with kernel option "quiet". So no silent boot for me.
Check your

journalctl -b -u systemd-backlight@backlight:amdgpu_bl0.service

If it tells you

amdgpu_bl0: Failed to write system 'brightness' attribute: No such device or address

systemd tries to restore before the backlight system is up. I could workaround this by booting without "quiet" option

Last edited by Tids (2020-11-17 13:13:45)

Offline

#14 2020-12-19 13:34:21

nanoone
Member
Registered: 2020-12-19
Posts: 2

Re: Cannot restore backlight on AMD VGA after systemd upgrade

Tids wrote:

systemd tries to restore before the backlight system is up. I could workaround this by booting without "quiet" option

Exactly
This bug still exists in kernel 5.9
Hasn't someone found a solution?

Offline

#15 2020-12-19 15:28:39

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 12,935

Re: Cannot restore backlight on AMD VGA after systemd upgrade

try configuring Early KMS , it often solves race conditions like this.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#16 2020-12-19 16:56:55

nanoone
Member
Registered: 2020-12-19
Posts: 2

Re: Cannot restore backlight on AMD VGA after systemd upgrade

Lone_Wolf wrote:

try configuring Early KMS , it often solves race conditions like this.

I added amdgpu to modules
Now it looks like this:

MODULES=(amdgpu)

Then I regenerated initframs:

mkinitcpio -P

After reboot, the problem still remains

Offline

#17 2020-12-19 21:52:35

digitalone
Member
Registered: 2011-08-19
Posts: 350

Re: Cannot restore backlight on AMD VGA after systemd upgrade

Offline

#18 2021-02-10 11:18:28

ninelore
Member
Registered: 2021-02-10
Posts: 1

Re: Cannot restore backlight on AMD VGA after systemd upgrade

i just found out that the bug with backlight restoration on boot does not occur when you add

fbcon=nodefer

to the kernel params. So something must be wrong with the deferred takeover

Offline

#19 2021-02-10 11:25:35

digitalone
Member
Registered: 2011-08-19
Posts: 350

Re: Cannot restore backlight on AMD VGA after systemd upgrade

OpenSuse has a temporary fix on this issue.

https://bugzilla.opensuse.org/show_bug.cgi?id=1180749

Offline

#20 2021-03-03 02:59:21

jpegxguy
Member
From: Earth
Registered: 2018-06-18
Posts: 38

Re: Cannot restore backlight on AMD VGA after systemd upgrade

I just tried with fbcon=nodefer passed to the kernel, and it does work!

But then of course, I don't get the manufacturer logo pleasantly showing up, just a couple of black screens with varying brightness.

I wanted to say that I my solution until now had been to set

Restart=on-failure
RestartSec=5s

in a service override for systemd-backlight@backlight\:amdgpu_bl0.service, but I had also tried

BindsTo=sys-devices-pci0000:00-0000:00:08.1-0000:04:00.0-backlight-amdgpu_bl0.device
After=sys-devices-pci0000:00-0000:00:08.1-0000:04:00.0-backlight-amdgpu_bl0.device

to no avail.

Interesting posts over in the openSUSE bugzilla, but that requires patching amdgpu, and we don't even know if it's the best way to solve the problem.


hi

Offline

#21 2021-03-03 03:28:51

jpegxguy
Member
From: Earth
Registered: 2018-06-18
Posts: 38

Re: Cannot restore backlight on AMD VGA after systemd upgrade

Without a kernel patch, the choice is between
1) fbcon=nodefer: no error, but no manufacturer logo
2) manufacturer logo. but visible boot error on first run of the backlight restore service.

you don't need the RestartSec=5s that I have there. Basically it fails only the first time. The Restart=on-failure is just another way of accomplishing what the dummy service mentioned here is doing: rerunning the service, which succeds the second time.

For now I'll keep the pretty logo. the error message goes away when getty appears anyhow, so it's only visible for some milliseconds. Of course, I'd rather it wasn't there at all.

Last edited by jpegxguy (2021-03-03 03:29:44)


hi

Offline

#22 2021-03-03 07:32:01

digitalone
Member
Registered: 2011-08-19
Posts: 350

Re: Cannot restore backlight on AMD VGA after systemd upgrade

Or you can disable systemd backlight restoration service and enable a specific service for brillo.

Offline

#23 2021-05-05 23:14:07

filip-hejsek
Member
Registered: 2021-05-05
Posts: 1

Re: Cannot restore backlight on AMD VGA after systemd upgrade

It's possible to prevent the error while keeping the logo by printing something to console just before restoring brightness. This is what i used:

[Unit]
Description=Print something to console to fix brightness
DefaultDependencies=no
Before=systemd-backlight@backlight:amdgpu_bl0.service

[Service]
Type=oneshot
ExecStart=/bin/echo
StandardOutput=tty

[Install]
WantedBy=systemd-backlight@backlight:amdgpu_bl0.service

Offline

#24 2021-06-05 03:46:06

LinuxEN
Member
Registered: 2021-06-05
Posts: 1

Re: Cannot restore backlight on AMD VGA after systemd upgrade

I did it with this

cat /etc/systemd/system/startup-brightness.service

[Unit]
Description=Set lower brightness on startup
After=systemd-backlight@backlight:amdgpu_bl0.service

[Service]
Type=oneshot
ExecStart=/bin/bash -c 'echo 25 > /sys/class/backlight/amdgpu_bl0/brightness'
ExecStart=systemctl start --now systemd-backlight@backlight:amdgpu_bl0

[Install]
WantedBy=systemd-backlight@backlight:amdgpu_bl0.service
WantedBy=multi-user.target

Offline

#25 2021-07-17 21:29:52

jpegxguy
Member
From: Earth
Registered: 2018-06-18
Posts: 38

Re: Cannot restore backlight on AMD VGA after systemd upgrade

Hi, I'm using 5.14.0-rc1-1-mainline while testing for a different issue https://bbs.archlinux.org/viewtopic.php?id=266358
(miffe's repo)

And on this version so far I haven't seen systemd-backlight fail during system boot. Try it as well


hi

Offline

Board footer

Powered by FluxBB