[SOLVED] Can't adjust brightness on my laptop

Questions about hardware, drivers and peripherals
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
scippie75

[SOLVED] Can't adjust brightness on my laptop

Post by scippie75 »

Note: quite new to Mint, not to linux, but never went in very deep.

I recently installed Mint 18.1Cinnamon 64-bit on my laptop (because I want to gradually try to never use Windows again) and almost everything works perfectly. But the one important thing that keeps me from using it all the time is that the brightness won't work - battery usage is higher than necessary and can't use it in the bedroom at night.

Mint recognizes the keystrokes FN+F8 & FN+F9, it shows the on-screen display of the brightness icon with a bar showing a level on it. I can change this level but my screen stays fully lit whatever level I choose. There is also a bar I can manually slide in the power screen.

I have tried putting acpi_backlight=vendor in the grub configuration as one post on this forum suggested, it didn't help: now the FN keys do nothing (no on screen indicator) and the bar in the power screen is grayed out and can't be used. Adding the acpi_osi=Linux didn't help.

I also found a suggestion that I should change the xorg.conf file but I don't seem to have that file

I also found (based on another post) these files on the system. On my system there is a /sys/class/backlight/acpi_video0/brightness file containing the level that is set in the system. Changing this value doesn't help. Under /sys/devices/... there are also brightness files and also bl_power files. Changing any of those doesn't do anything either.

So as I'm not at all the expert here, I'm lost now.
Can anyone help me with this?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
erik2282

Re: Can't adjust brightness on my laptop

Post by erik2282 »

What the brand and model of your laptop?
scippie75

Re: Can't adjust brightness on my laptop

Post by scippie75 »

erik2282 wrote:What the brand and model of your laptop?
BTO X-BOOK 17CL63 with NVidia GTX970M
It's not a very well known brand but it uses standardized hardware and I would recommend it to anyone :)
User avatar
Pjotr
Level 24
Level 24
Posts: 20135
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland) 🇳🇱
Contact:

Re: Can't adjust brightness on my laptop

Post by Pjotr »

Please generate an overview of your system like this:
- Launch a terminal window (this is how to launch a terminal window);
- make the terminal window full screen, to avoid chopped lines;
- copy/paste this command into the terminal:

Code: Select all

inxi -Fxz
(if you type: the letter F is a capital letter)

Press Enter.

Copy/paste the output in your next message.
Tip: 10 things to do after installing Linux Mint 21.3 Virginia
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
scippie75

Re: Can't adjust brightness on my laptop

Post by scippie75 »

Pjotr wrote:...Copy/paste the output in your next message.
Ah, the man himself... your tips have been helpful plenty...

Code: Select all

$ inxi -Fxz
System:    Host: bto2-mint Kernel: 4.4.0-57-generic x86_64 (64 bit gcc: 5.4.0)
           Desktop: Cinnamon 3.2.7 (Gtk 3.18.9-1ubuntu3.1) Distro: Linux Mint 18.1 Serena
Machine:   System: Notebook (portable) product: P7xxDM(-G)
           Mobo: Notebook model: P7xxDM(-G) Bios: American Megatrends v: 1.05.03 date: 09/19/2015
CPU:       Quad core Intel Core i7-6700K (-HT-MCP-) cache: 8192 KB
           flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx) bmips: 32066
           clock speeds: max: 4200 MHz 1: 1069 MHz 2: 2072 MHz 3: 3792 MHz 4: 1056 MHz 5: 962 MHz 6: 900 MHz
           7: 2050 MHz 8: 993 MHz
Graphics:  Card: NVIDIA GM204M [GeForce GTX 970M] bus-ID: 01:00.0
           Display Server: X.Org 1.18.4 drivers: nvidia (unloaded: fbdev,vesa,nouveau)
           Resolution: 1920x1080@60.02hz
           GLX Renderer: GeForce GTX 970M/PCIe/SSE2 GLX Version: 4.5.0 NVIDIA 367.57 Direct Rendering: Yes
Audio:     Card-1 NVIDIA GM204 High Definition Audio Controller driver: snd_hda_intel bus-ID: 01:00.1
           Card-2 Intel Sunrise Point-H HD Audio driver: snd_hda_intel bus-ID: 00:1f.3
           Sound: Advanced Linux Sound Architecture v: k4.4.0-57-generic
Network:   Card-1: Qualcomm Atheros Killer E2400 Gigabit Ethernet Controller
           driver: alx port: d000 bus-ID: 3b:00.0
           IF: enp59s0 state: down mac: <filter>
           Card-2: Qualcomm Atheros QCA6174 802.11ac Wireless Network Adapter
           driver: ath10k_pci v: backported bus-ID: 3e:00.0
           IF: wlp62s0 state: up mac: <filter>
Drives:    HDD Total Size: 1512.3GB (1.7% used) ID-1: /dev/sda model: Samsung_SSD_850 size: 1000.2GB
           ID-2: /dev/sdb model: PLEXTOR_PX size: 512.1GB
Partition: ID-1: / size: 63G used: 6.9G (12%) fs: ext4 dev: /dev/sdb5
           ID-2: /home size: 62G used: 16G (27%) fs: ext4 dev: /dev/sda5
           ID-3: swap-1 size: 1.00GB used: 0.00GB (0%) fs: swap dev: /dev/dm-0
RAID:      No RAID devices: /proc/mdstat, md_mod kernel module present
Sensors:   System Temperatures: cpu: 56.0C mobo: N/A gpu: 0.0:53C
           Fan Speeds (in rpm): cpu: N/A
Info:      Processes: 233 Uptime: 3:52 Memory: 1472.0/32126.4MB Init: systemd runlevel: 5 Gcc sys: 5.4.0
           Client: Shell (bash 4.3.461) inxi: 2.2.35
User avatar
Pjotr
Level 24
Level 24
Posts: 20135
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland) 🇳🇱
Contact:

Re: Can't adjust brightness on my laptop

Post by Pjotr »

Try this progressive scheme:
https://sites.google.com/site/easylinux ... adjustable
(item 6, left column)
Tip: 10 things to do after installing Linux Mint 21.3 Virginia
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
scippie75

Re: Can't adjust brightness on my laptop

Post by scippie75 »

Pjotr wrote:Try this progressive scheme:
https://sites.google.com/site/easylinux ... adjustable
(item 6, left column)
Fantastic! The xbacklight command seems to work. How can I make the Fn-keys use that command?
User avatar
Pjotr
Level 24
Level 24
Posts: 20135
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland) 🇳🇱
Contact:

Re: Can't adjust brightness on my laptop

Post by Pjotr »

scippie75 wrote:
Pjotr wrote:Try this progressive scheme:
https://sites.google.com/site/easylinux ... adjustable
(item 6, left column)
Fantastic! The xbacklight command seems to work. How can I make the Fn-keys use that command?
I don't think that's possible.... You can always use the terminal as a workaround, of course. At least until a BIOS update or a kernel update solves this issue fundamentally.

In the mean time this workaround will prevent this issue from driving you crazy. :mrgreen:
Tip: 10 things to do after installing Linux Mint 21.3 Virginia
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
scippie75

Re: Can't adjust brightness on my laptop

Post by scippie75 »

Pjotr wrote:I don't think that's possible.... You can always use the terminal as a workaround, of course. At least until a BIOS update or a kernel update solves this issue fundamentally.
Ah that's too bad. Is this something I need to notify somewhere? I'm new here so...

Also, since you seem to be an expert, may I be so bold to ask if you know what's going on with my other problem: viewtopic.php?f=53&t=236462 ?
User avatar
Pjotr
Level 24
Level 24
Posts: 20135
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland) 🇳🇱
Contact:

Re: Can't adjust brightness on my laptop

Post by Pjotr »

scippie75 wrote:may I be so bold to ask if you know what's going on with my other problem: viewtopic.php?f=53&t=236462 ?
You already have help from JeremyB there. He's a wifi guru. :)
Tip: 10 things to do after installing Linux Mint 21.3 Virginia
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
scippie75

Re: Can't adjust brightness on my laptop

Post by scippie75 »

Pjotr wrote:I don't think that's possible.... You can always use the terminal as a workaround, of course. At least until a BIOS update or a kernel update solves this issue fundamentally.
I am considered a C++ expert, is this something I can 'hack' myself? Maybe even contribute?
Where do I start if I would be willing to make time for that?
User avatar
Pjotr
Level 24
Level 24
Posts: 20135
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland) 🇳🇱
Contact:

Re: Can't adjust brightness on my laptop

Post by Pjotr »

I don't know.... I'm not a programmer myself, just an experienced end user. Strictly an amateur sysadmin, not a coding magician. :mrgreen:

An easy "hack" might be, to assign an xbacklight command to a certain key, like the left and right Windows (Microsoft) keys on your keyboard. Suppose you've set xbacklight at 70 (office or classroom brightness) in the startup applications; then you might assign the left Windows key to invoke a setting of 50 (bedroom brightness), and the right Windows key to 100 (bright day with lots of sunlight shining on the screen).

The respective terminal commands are of course: xbacklight -set 50 and xbacklight -set 100.

But then again, it's perhaps easiest to simply use the memory of the terminal for that: you can recall previously issued commands by (repeatedly) pressing the arrow "up" key.
Tip: 10 things to do after installing Linux Mint 21.3 Virginia
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
scippie75

Re: Can't adjust brightness on my laptop

Post by scippie75 »

Pjotr wrote:I don't know.... I'm not a programmer myself, just an experienced end user. Strictly an amateur sysadmin, not a coding magician. :mrgreen:
You actually gave me an idea about this!

I was just able to create a python script (took me 10 minutes) that will watch the /sys/class/backlight/acpi_video0/brightness file for changes (that file changes when you use the Fn keys for brightness, only if the Fn keys are recognized by the OS of course). When the file changes, its contents are then passed to the xbacklight tool. The brightness changes almost instantly with the key presses!

It works perfectly and can be started in the background as a startup program. It has some python modules and the xbacklight as dependencies. For those where xbacklight don't work but another command works, this can be easily adapted.
Maybe this is something you want to add to your website? If so, tell me how I should pass it on to you.

This topic is now [SOLVED] for me :)
scippie75

Re: [SOLVED] Can't adjust brightness on my laptop

Post by scippie75 »

The python script for those who need it.

Make sure you pip install the module watchdog.

Feel free to improve it (and please tell me how to improve it, I'm still quite fresh in Python)!

Code: Select all

#!/usr/bin/env python
import sys
import time
import os
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler

class MyFileSystemEventHandler(FileSystemEventHandler):
        def on_modified(self, event):
                if "brightness" in event.src_path:
                        os.system("xbacklight -set `cat /sys/class/backlight/acpi_video0/brightness`")

if __name__ == "__main__":
        event_handler = MyFileSystemEventHandler()
        observer = Observer()
        observer.schedule(event_handler, "/sys/class/backlight/acpi_video0/", recursive=False)
        observer.start()
        try:
                while True:
                        time.sleep(1)
        except KeyboardInterrupt:
                observer.stop()
        observer.join()
User avatar
Pjotr
Level 24
Level 24
Posts: 20135
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland) 🇳🇱
Contact:

Re: [SOLVED] Can't adjust brightness on my laptop

Post by Pjotr »

Cool solution! Kudo's to you for creating it. That's the true Linux spirit. :)

I might add this to my website at some point (of course with mentioning you as the author), but I've yet to test it...
Tip: 10 things to do after installing Linux Mint 21.3 Virginia
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
scippie75

Re: [SOLVED] Can't adjust brightness on my laptop

Post by scippie75 »

Pjotr wrote:I might add this to my website at some point (of course with mentioning you as the author), but I've yet to test it...
I fully understand :)
wolfpackmars2
Level 1
Level 1
Posts: 11
Joined: Fri May 05, 2017 1:12 pm

Re: [SOLVED] Can't adjust brightness on my laptop

Post by wolfpackmars2 »

I had the same problem. xbacklight worked great. However, as far as I can tell, it is simply changing the brightness of X; or software gamma. It's not actually changing the backlight brightness.

Now, here's the interesting bit. Either using xbacklight activated something in X or putting the laptop to sleep and waking it up did. Suddenly, the brightness function keys work?! And no, I hadn't gotten around to implementing an observer on the brightness file.

Hopefully this information might help pinpoint the original problem so it can be fixed to avoid having to hack a solution in the future.

If anyone can explain why putting the laptop through a sleep cycle might suddenly cause the brightness function to work, I'm curious.

My laptop is the MSI GT72S 6QE Dominator Pro G

I'll try to do more testing later to hopefully repeat this behavior and pinpoint the cause definitively.
scippie75

Re: [SOLVED] Can't adjust brightness on my laptop

Post by scippie75 »

wolfpackmars2 wrote:I had the same problem. xbacklight worked great. However, as far as I can tell, it is simply changing the brightness of X; or software gamma. It's not actually changing the backlight brightness.
That's strange, because I really have more battery life when I lower the brightness this way...
But it makes sense that a program called xbacklight changes the brightness of X.

I haven 't tried putting my laptop to sleep (boots in 15 seconds). But it's interesting indeed.
wolfpackmars2
Level 1
Level 1
Posts: 11
Joined: Fri May 05, 2017 1:12 pm

Re: [SOLVED] Can't adjust brightness on my laptop

Post by wolfpackmars2 »

Confirmed. Putting the laptop through a sleep cycle causes the brightness keys to function normally. xbacklight not required.

However, after rebooting the computer, it will come back up at full brightness and the function keys for brightness will have no effect until the laptop is again put through a sleep cycle.

So.... what's different from when the computer first boots up to when it wakes from sleep? This is a brand new install of Mint 18.1 with stock settings and apps.
User avatar
Pjotr
Level 24
Level 24
Posts: 20135
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland) 🇳🇱
Contact:

Re: [SOLVED] Can't adjust brightness on my laptop

Post by Pjotr »

@wolfpackmars2: Please generate an overview of your system like this:

- Launch a terminal window (this is how to launch a terminal window);

- make the terminal window full screen, to avoid chopped lines;

- copy/paste this command into the terminal:

Code: Select all

inxi -Fxz
(if you type: the letter F is a capital letter)

- Press Enter.

- Copy/paste the output in your next message.
Tip: 10 things to do after installing Linux Mint 21.3 Virginia
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
Locked

Return to “Hardware Support”