helloSystem / ISO

helloSystem Live and installation ISO
https://github.com/helloSystem/
BSD 3-Clause "New" or "Revised" License
808 stars 58 forks source link

Setting screen brightness does not work on Acer TravelMate B 117 (Braswell) #97

Closed probonopd closed 2 years ago

probonopd commented 3 years ago

sysctl hw.acpi.video.lcd0.brightness just gets ignored.

% kldstat | grep acpi
35    1 0xffffffff841f2000     20f0 acpi_wmi.ko
36    1 0xffffffff841f5000     2b88 acpi_video.ko

xbacklight does not do anything either.

% sudo intel_backlight                       
Current backlight value: -2147483648% (0/0)

Is also not working.

How to set brightness here?

probonopd commented 3 years ago

intel_backlight seems to be stuck at -2147483648% on this device:

Users-TravelMate-B117-M% intel_backlight decr

Current backlight value: -2147483648% (0/0)
set backlight to -2147483648% (0/0)

How to fix this?

Users-TravelMate-B117-M% sudo kldstat | grep acpi
29    1 0xffffffff82fbf000     20c0 acpi_wmi.ko
30    1 0xffffffff82fc2000     2a80 acpi_video.ko
Users-TravelMate-B117-M% sysctl -a | grep lcd
hw.acpi.video.lcd0.levels: 100 30 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
hw.acpi.video.lcd0.economy: 30
hw.acpi.video.lcd0.fullpower: 100
hw.acpi.video.lcd0.brightness: 100
hw.acpi.video.lcd0.active: 0

Users-TravelMate-B117-M% sudo sysctl hw.acpi.video.lcd0.active=1  
hw.acpi.video.lcd0.active: 0 -> 0

lcd0 is not active. Why? Is that a problem?

Users-TravelMate-B117-M% sysctl sys.class.backlight.intel_backlight.bl_device.actual_brightness
sysctl: unknown oid 'sys.class.backlight.intel_backlight.bl_device.actual_brightness'
Users-TravelMate-B117-M% sysctl sys.class.backlight.intel_backlight.bl_device.max_brightness
sysctl: unknown oid 'sys.class.backlight.intel_backlight.bl_device.max_brightness'

When I do this, nothing changes:

Users-TravelMate-B117-M% sysctl hw.acpi.video.lcd0.brightness=50

hw.acpi.video.lcd0.brightness: 100
sysctl: hw.acpi.video.lcd0.brightness=50: Operation not permitted
Users-TravelMate-B117-M% sudo sysctl hw.acpi.video.lcd0.brightness=50

hw.acpi.video.lcd0.brightness: 100 -> 50
Users-TravelMate-B117-M% sudo sysctl hw.acpi.video.lcd0.brightness=10
hw.acpi.video.lcd0.brightness: 50 -> 10

This is the system:

Users-TravelMate-B117-M% inxi -Fz                 
System:    Kernel: FreeBSD 12.2-RELEASE amd64 bits: 64 Desktop: Openbox 3.6 
           OS: FreeBSD 12.2-RELEASE 
Machine:   Permissions: Unable to run dmidecode. Root privileges required. 
Battery:   Permissions: Unable to run dmidecode. Root privileges required. 
CPU:       Info: Quad Core model: Intel Celeron N3160 bits: 64 type: MCP cache: L2: N/A 
           Speed: 1600 MHz min/max: 480/1601 MHz 
           Core speeds (MHz): No speed data found for 4 cores. 
Graphics:  Device-1: Intel Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Integrated 
           Graphics 
           driver: vgapci 
           Display: x11 server: X.Org 1.20.11 driver: loaded: modesetting 
           resolution: 1366x768~60Hz 
           OpenGL: renderer: Mesa DRI Intel HD Graphics 400 (BSW) v: 4.6 Mesa 20.2.3 

References:

kettle-7 commented 3 years ago

You're using vga graphics.

Does kldload i915kms work?

probonopd commented 3 years ago
Users-TravelMate-B117-M% sudo kldload i915kms
Password:
kldload: can't load i915kms: module already loaded or in kernel

Users-TravelMate-B117-M% cat /usr/local/etc/X11/xorg.conf.d/10-video-initgfx.conf 
Section "Device"
    Identifier    "Intel Graphics"
    Driver        "modesetting"
    BusID         "PCI:0:2:0"
EndSection

This brings the question, why is it not used (by initgfx) on my system...

probonopd commented 3 years ago

Adding 0x22b1 to /etc/initgfx_device.db results in

Users-TravelMate-B117-M% cat /usr/local/etc/X11/xorg.conf.d/10-video-initgfx.conf
Section "Device"
    Identifier    "Intel Graphics"
    Driver        "intel"
    Option        "AccelMethod"    "uxa"
    Option        "TripleBuffer"   "true"
    Option        "HotPlug"        "true"
EndSection

But as soon as picom is started, the system becomes unbearably slow. Not sure whether this is a picom issue.

probonopd commented 3 years ago

In any case, the other aspects have not improved:

Users-TravelMate-B117-M% inxi -Fz
(...)
Graphics:  Device-1: Intel Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Integrated 
           Graphics 
           driver: vgapci 
           Display: x11 server: X.Org 1.20.11 driver: loaded: intel resolution: 1366x768~60Hz 
           OpenGL: renderer: Mesa DRI Intel HD Graphics 400 (BSW) v: 4.6 Mesa 20.2.3 

Users-TravelMate-B117-M% sysctl hw.acpi.video.lcd0.active
hw.acpi.video.lcd0.active: 0

Users-TravelMate-B117-M% sysctl -a | grep lcd
hw.acpi.video.lcd0.levels: 100 30 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
hw.acpi.video.lcd0.economy: 30
hw.acpi.video.lcd0.fullpower: 100
hw.acpi.video.lcd0.brightness: 100
hw.acpi.video.lcd0.active: 0

Users-TravelMate-B117-M% sudo sysctl hw.acpi.video.lcd0.fullpower=10             
Password:
hw.acpi.video.lcd0.fullpower: 100 -> 10

Users-TravelMate-B117-M% sudo sysctl hw.acpi.video.lcd0.brightness=10
hw.acpi.video.lcd0.brightness: 10 -> 10

Users-TravelMate-B117-M% sudo intel_backlight 1                                                
Current backlight value: -2147483648% (0/0)
set backlight to -2147483648% (0/0)

Still cannot control the backlight brightness.

probonopd commented 3 years ago

Opened https://github.com/nomadbsd/NomadBSD/issues/90 upstream.

kettle-7 commented 3 years ago

If i915kms is loaded...

Then why doesn't it appear to be being used?

kettle-7 commented 3 years ago

Not sure whether this is a picom issue.

Try KWin.

probonopd commented 3 years ago

If i915kms is loaded...

Then why doesn't it appear to be being used?

That is the :100: question.

evadot commented 2 years ago

A lot of newer backlight won't work without drm modules loaded. In my testing acpi_video won't work too on those laptops. intel_backlight is a piece of garbage that should never have existed. The correct way to deal with those backlight is to use drm-kmod and backlight(8) on FreeBSD >= 13.

probonopd commented 2 years ago

Thank you very much @evadot. I confirm that using backlight(8) is working on FreeBSD 13.

Maybe it would be good to mention that the drm.ko kernel module must be loaded and intel_backlight.ko should not be loaded on the man page for backlight(8).

probonopd commented 2 years ago

backlight(8) is now also bound to the brightness keys:

https://github.com/helloSystem/ISO/commit/3b814ebfe7e2aa02b4dc45398b6ec3c64d4ccb62

evadot commented 2 years ago

Thank you very much @evadot. I confirm that using backlight(8) is working on FreeBSD 13.

Maybe it would be good to mention that the drm.ko kernel module must be loaded and intel_backlight.ko should not be loaded on the man page for backlight(8).

backlight doesn't need drm, the drm drivers install their backlight. On arm systems I don't need drm to have the backlight. intel_backlight isn't a kmod and was never part of base so I don't think that we should add a note in the man page.

probonopd commented 2 years ago

OK, I understand. So happy that it is working now. :+1:

kettle-7 commented 2 years ago

By contrast, some computers do need kms drivers in order for the brightness controls to work.

probonopd commented 2 years ago

By contrast, some computers do need kms drivers in order for the brightness controls to work.

Do you have an example?