Brightness icon indicating copy to clipboard operation
Brightness copied to clipboard

Instant crash when changing brightness. Changing "primary" first solves it.

Open CrashTD opened this issue 3 years ago • 4 comments

Describe the bug When i want to change the brightness right after starting the program i get this crash:

warning: output None not found; ignoring
xrandr: Need crtc to set gamma on.
Traceback (most recent call last):
  File "/usr/share/brightness-controller/init.py", line 277, in change_value_pbr
    Executor.execute_command(cmd_value)
  File "/usr/share/brightness-controller/util/executor.py", line 23, in execute_command
    subprocess.check_output(string_cmd, shell=True)
  File "/usr/lib/python3.10/subprocess.py", line 420, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib/python3.10/subprocess.py", line 524, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command 'xrandr        --output None         --brightness 0.9900000000000007        --gamma 1.0000000000000007:1.0000000000000007:1.0000000000000007' returned non-zero exit status 1.
/usr/bin/brightness-controller: Zeile 4: 198596 Abgebrochen             (Speicherabzug geschrieben) python init.py

But first selecting a different "Primary Brightness" works fine. Or switching to a different and then switching back works as well. from that point on i can change brightness and primary as often i want with no problem.

Desktop (please complete the following information):

  • OS: 5.16.11-2-MANJARO

Additional context Maybe related to the fact that my display setup is a mess. using 3 displays connected in different ways (1 DP, 1 HDMI, 1 DVI). xrandr -q.txt

CrashTD avatar Mar 11 '22 10:03 CrashTD

Please share the output of

xrandr --listactivemonitors

as well.

LordAmit avatar Mar 18 '22 06:03 LordAmit

Monitors: 3
 0: +*HDMI-A-0 1920/521x1080/293+1680+0  HDMI-A-0
 1: +DisplayPort-0 1680/474x1050/297+0+30  DisplayPort-0
 2: +DVI-D-0 1680/459x1050/296+3600+0  DVI-D-0

CrashTD avatar Mar 18 '22 17:03 CrashTD

@apandada1 , can you also please share the raw output of the following?

xrandr --listactivemonitors > xrandr_list.txt

LordAmit avatar May 11 '22 06:05 LordAmit

Sorry about the delay, I was away. This is the output of xrandr --listactivemonitors in my home desktop running Manjaro.

Monitors: 1
 0: +*VGA1 1600/440x900/250+0+0  VGA1

In case you need more than one monitor I will connect the laptop to an external monitor, and post the output.

archisman-panigrahi avatar May 15 '22 08:05 archisman-panigrahi

@CrashTD , I think I figured out the problem - it is possibly due to the mistaken assumption that people will have at most two displays 🤦

Basically, this.

        if self.no_of_displays == 1:
            self.display1 = self.displays[0]
        elif self.no_of_displays == 2:
            self.display1 = self.displays[0]
            self.display2 = self.displays[1]

https://github.com/LordAmit/Brightness/commit/5d877de0256f0e78836bab1a23b882a0fe57b427 should be able to fix it.

Unsure how you installed Brightness Controller, but if you installed it from the source, try pulling the latest changes

Also tagging @apandada1 to test it out.

LordAmit avatar Sep 10 '22 07:09 LordAmit

bingo, that fixed it. thanks!

CrashTD avatar Sep 16 '22 17:09 CrashTD