Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Doq

macrumors 6502a
Original poster
Dec 8, 2019
533
798
The Lab DX
Okay, I made a thread for this for visibility purposes, though it's not much. A known issue with some PowerBooks, specifically G4s with the ambient light sensor, is that there's a chance that on startup it'll kill the brightness and you have to spend several minutes trying to turn it back up to be viewable if you're lucky.

While I don't have a proper fix that isn't 'disable i2c_dev and lose keyboard and brightness controls', I sure do have a workaround that (mostly) rectifies at least the fidgeting with the brightness part.

Much like everything else in the Linux world, the display brightness is exposed to the user as a text file with a single number value. On THE KING, it's located at /sys/class/backlight/radeon_b10/brightness and that's probably where the brightness is located on all affected PowerBooks. This value is a decimal representation of a byte, and thus has valid values from 0 to 255, 255 being 100% brightness.

So what I believe happens is, but I don't know for sure, is that when the i2c_dev module is initialised, both the display and the keyboard brightness are set to 0. This is probably correct as evidenced by the existence of a service that restores the brightness saved on shutdown. However, something goes wrong with this service firing, resulting in the display brightness staying at 0. With this hypothesis, a proper fix would likely be tweaking the brightness restoring service so that it actually works. This workaround is likely no longer necessary if this is done, though I also have noticed that the value saved on shutdown is also corrupt, so, it's just a pile of yikes.

So the workaround for this is: create a late-firing service to set the brightness to something higher than 0. It's as follows:

  1. Create a script that sets the brightness to some large number. I used 200, but you can use whatever from 0 to 255.
  2. Create a service that runs this script on boot.

Below is my service file and the script. I'm using Bedrock Linux with Debian's systemd, so adaptation of at least the service file will be necessary for other init systems.

Code:
/lib/systemd/system/dlsd-backlight-fix.service

[Unit]
Description=Workaround Brightness Bug on ALS PowerBooks

[Service]
Type=oneshot
ExecStart=/usr/local/bin/dlsd-fix
TimeoutSec=30s

[Install]
WantedBy=multi-user.target

Code:
/usr/local/bin/dlsd-fix

#!/bin/bash
# I found that not having this sleep command results in the brightness-setting
# echo to fire too soon, resulting in no brightness still.
sleep 7
echo 200 > /sys/class/backlight/radeon_b10/brightness

After that, # systemctl enable dlsd-backlight-fix or the equivalent for your init system of choice and you should be on your way. Hope this helps even a little for the backlight issue for PBG4 users.
 

Doq

macrumors 6502a
Original poster
Dec 8, 2019
533
798
The Lab DX
You can definitely do this on 15" models, but 17" models have them integrated into the keyboard/trackpad assembly and AFAIK they're not removable without permanent modification.

I'll have to pop open THE KING again to be 100% for sure certain though.
 
  • Like
Reactions: micahgartman

PC mcLinMorph

macrumors member
Nov 8, 2021
61
33
Okay, I made a thread for this for visibility purposes, though it's not much. A known issue with some PowerBooks, specifically G4s with the ambient light sensor, is that there's a chance that on startup it'll kill the brightness and you have to spend several minutes trying to turn it back up to be viewable if you're lucky.

While I don't have a proper fix that isn't 'disable i2c_dev and lose keyboard and brightness controls', I sure do have a workaround that (mostly) rectifies at least the fidgeting with the brightness part.

Much like everything else in the Linux world, the display brightness is exposed to the user as a text file with a single number value. On THE KING, it's located at /sys/class/backlight/radeon_b10/brightness and that's probably where the brightness is located on all affected PowerBooks. This value is a decimal representation of a byte, and thus has valid values from 0 to 255, 255 being 100% brightness.

So what I believe happens is, but I don't know for sure, is that when the i2c_dev module is initialised, both the display and the keyboard brightness are set to 0. This is probably correct as evidenced by the existence of a service that restores the brightness saved on shutdown. However, something goes wrong with this service firing, resulting in the display brightness staying at 0. With this hypothesis, a proper fix would likely be tweaking the brightness restoring service so that it actually works. This workaround is likely no longer necessary if this is done, though I also have noticed that the value saved on shutdown is also corrupt, so, it's just a pile of yikes.

So the workaround for this is: create a late-firing service to set the brightness to something higher than 0. It's as follows:

  1. Create a script that sets the brightness to some large number. I used 200, but you can use whatever from 0 to 255.
  2. Create a service that runs this script on boot.

Below is my service file and the script. I'm using Bedrock Linux with Debian's systemd, so adaptation of at least the service file will be necessary for other init systems.

Code:
/lib/systemd/system/dlsd-backlight-fix.service

[Unit]
Description=Workaround Brightness Bug on ALS PowerBooks

[Service]
Type=oneshot
ExecStart=/usr/local/bin/dlsd-fix
TimeoutSec=30s

[Install]
WantedBy=multi-user.target

Code:
/usr/local/bin/dlsd-fix

#!/bin/bash
# I found that not having this sleep command results in the brightness-setting
# echo to fire too soon, resulting in no brightness still.
sleep 7
echo 200 > /sys/class/backlight/radeon_b10/brightness

After that, # systemctl enable dlsd-backlight-fix or the equivalent for your init system of choice and you should be on your way. Hope this helps even a little for the backlight issue for PBG4 users.
Thank you, Thank you, Thank you!
Nice to run this old machine with a fresh Linux distro installed and beeing able to use this absolutely essential functionality!!
I don't know why anybody would disconnect any sensor though (but i'm no engineer)
 

3922434

Cancelled
Aug 24, 2023
123
41
I'm a bit of a newbie when it comes to Linux, but I'm comfortable in the terminal. How can I go about doing this? I know that many issues are resolved in the latest Debian with Grub, but I need Debian 10/11 for a legacy application. I'm using @wicknix sid remix, which is essentially Debian with a modified fix for the Grub error that occurred in versions 10 and 11… I don't mind sacrificing backlight, but I'd prefer to have a process triggered to adjust brightness. That makes more sense to me. Thanks in advance, everyone!
 
  • Like
Reactions: wicknix

Doq

macrumors 6502a
Original poster
Dec 8, 2019
533
798
The Lab DX
The absolute paths to each file is at the top of each code block. Using nano (likely sudo nano) you'd create these files either by typing them in or pasting them over SSH or etc.

After this is done, make sure you set the script to executable with sudo chmod +x /usr/local/bin/dlsd-fix, and then enable the systemd service with sudo systemctl enable dlsd-backlight-fix.

Of course if you're already logged in as root then sudo is not required.
 

3922434

Cancelled
Aug 24, 2023
123
41
ok so when I’m using nano which I understand do I use .service when I’m saving by hitting ctrl x and than Y?
 

3922434

Cancelled
Aug 24, 2023
123
41
So basically cd into each directory and copy what you have above and then save the file in the .services extension and then enable each script by running the command to make it executable? Or am I completely off?
 
Last edited:

Doq

macrumors 6502a
Original poster
Dec 8, 2019
533
798
The Lab DX
So basically cd into each directory and copy what you have above and then save the file in the .services extension and then enable each script by running the command to make it executable? Or am I completely off?
Pretty much correct.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.