Score:1

Cannot change brightness Ubuntu 22.10, Razer Blade 15 2021 Advanced

cy flag

I have scoured the internet, but have not found a solution that works. I downloaded ubuntu for a machine learning workload. However, I am unable to get my brightness controls to work properly. The function keys on the keyboard will change the slider, and I can manually change the slider, but it does not change the brightness level. I cannot even change it using xrandr. I am using kernel 6.2.8, and nvidia-driver-515. (I tried 525, it did not work either.) Any help is appreciated; my eyes are burning.

Ok, some updates after investigation: When the function keys or slider tries to change the brightness, it changes the value in /sys/class/backlight/nvidia_wmi_ec_backlight/brightness file. However, I can manually change the brightness by changing the value in the /sys/class/backlight/nvidia_0/brightness file. It seems the discrepancy is basically getting the gui/function keys to change the value in the nvidia_0/brightness file, not the nvidia_wmi_ec_backlight/brightness file. I am not sure on how to do that.

in flag
From what I have seen over the last few years, most Razer notebooks cannot have their brightness levels changed without a very specific utility that works only in Windows. If you have an OLED display, [this ICC profile *may* help](https://github.com/udifuchs/icc-brightness), but there is no guarantee. Do note that `xrandr` will not work if you're using a Wayland session, which is default for 22.10
Christopher Hansen avatar
cy flag
I was able to use this command to change the brightness to 50%: sudo su -c "echo 50 > /sys/class/backlight/nvidia_0/brightness" However, this is tedious, and was hoping that I could find a way to link the gui slider and function buttons to it
in flag
One option would be to use an `inotify` watcher that updates the correct value when the wrong setting is updated
Score:0
cy flag

Ok, I figured out a fix. I will document it here for future reference in case I need to rebuild my machine, or if someone else has this issue.

  1. Create the following script: (I called it /home/user/brightness.sh)

    #!/bin/bash path=/sys/class/backlight/nvidia_wmi_ec_backlight inotifywait -q -m -e close_write $path | while read -r event; do
    actual_brightness=$(cat $path/brightness)
    scaled_brightness=$(echo "scale=0; (($actual_brightness - 5) * 99) / (255 - 5) + 1" | bc)
    echo "Actual brightness: $actual_brightness, scaled brightness: $scaled_brightness"
    echo $scaled_brightness > /sys/class/backlight/nvidia_0/brightness || echo "Failed to write brightness: $?" done

  2. Allow this script to run with sudo and not require a password. This is fairly simple to do; use this site as a reference: https://www.cyberciti.biz/faq/linux-unix-running-sudo-command-without-a-password/. Or just ask chatgpt.

  3. Add this script to the startup applications as a command. Ex: add the command: sudo /bin/bash /home/user/brightness.sh to run at startup.

I also had an issue with the trackpad not working after waking the machine back up from suspend. I fixed this by following the directions here: Razer Blade 15 Errors on new ubuntu 22 installation ACPI BIOS Error (bug) + trackpad not working after suspending

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.