Page 1 of 1

AVL 23.1: issue with backlight

Posted: Fri Feb 16, 2024 3:19 am
by seriousness
Hi there,

booting with acpi_backlight=native is the only way to get screen brightness control working on my Samsung RV520.

Code: Select all

System:
  Kernel: 6.6.9-1-liquorix-amd64 [6.6-11~mx23ahs] arch: x86_64 bits: 64 compiler: gcc v: 12.2.0 parameters: audit=0
    intel_pstate=disable rcupdate.rcu_expedited=1 BOOT_IMAGE=/boot/vmlinuz-6.6.9-1-liquorix-amd64
    root=UUID=<filter> ro threadirqs quiet acpi_backlight=native init=/lib/systemd/systemd
  Desktop: Enlightenment v: 0.25.4 vt: 7 dm: LightDM v: 1.26.0 Distro: AVL_MXE-23.1-20240120_x64
    Enlightened January 15 2024 base: Debian GNU/Linux 12 (bookworm)
Machine:
  Type: Laptop System: SAMSUNG product: RV420/RV520/RV720/E3530/S3530/E3420/E3520 v: 0.1
    serial: <superuser required> Chassis: type: 9 v: 0.1 serial: <superuser required>
  Mobo: SAMSUNG model: RV420/RV520/RV720/E3530/S3530/E3420/E3520 v: FAB1
    serial: <superuser required> UEFI-[Legacy]: Phoenix v: 03PQ date: 07/08/2011
Battery:
  ID-1: BAT1 charge: 32.0 Wh (80.0%) condition: 40.0/48.8 Wh (81.8%) volts: 10.7 min: 11.1
    model: SAMSUNG Electronics type: Li-ion serial: N/A status: not charging
CPU:
  Info: model: Intel Core i5-2410M bits: 64 type: MT MCP arch: Sandy Bridge gen: core 2 level: v2
    built: 2010-12 process: Intel 32nm family: 6 model-id: 0x2A (42) stepping: 7 microcode: 0x2F
  Topology: cpus: 1x cores: 2 tpc: 2 threads: 4 smt: enabled cache: L1: 128 KiB
    desc: d-2x32 KiB; i-2x32 KiB L2: 512 KiB desc: 2x256 KiB L3: 3 MiB desc: 1x3 MiB
  Speed (MHz): avg: 2623 high: 2694 min/max: 800/2301 boost: enabled scaling:
    driver: acpi-cpufreq governor: ondemand cores: 1: 2411 2: 2694 3: 2694 4: 2693 bogomips: 18358
  Flags: avx ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
  Vulnerabilities:
  Type: gather_data_sampling status: Not affected
  Type: itlb_multihit status: KVM: VMX disabled
  Type: l1tf mitigation: PTE Inversion; VMX: conditional cache flushes, SMT vulnerable
  Type: mds mitigation: Clear CPU buffers; SMT vulnerable
  Type: meltdown mitigation: PTI
  Type: mmio_stale_data status: Unknown: No mitigations
  Type: retbleed status: Not affected
  Type: spec_rstack_overflow status: Not affected
  Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via prctl
  Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization
  Type: spectre_v2 mitigation: Retpolines, IBPB: conditional, IBRS_FW, STIBP: conditional, RSB
    filling, PBRSB-eIBRS: Not affected
  Type: srbds status: Not affected
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: NVIDIA GF119M [GeForce GT 520M] vendor: Samsung Co driver: nouveau v: kernel non-free:
    series: 390.xx+ status: legacy-active (EOL~late 2022) arch: Fermi code: GF1xx process: 40/28nm
    built: 2010-16 pcie: gen: 1 speed: 2.5 GT/s lanes: 16 ports: active: LVDS-1
    empty: HDMI-A-1,VGA-1 bus-ID: 01:00.0 chip-ID: 10de:1050 class-ID: 0300 temp: 66.0 C
  Device-2: Silicon Motion WebCam SC-0311139N type: USB driver: uvcvideo bus-ID: 1-1.4:3
    chip-ID: 2232:1020 class-ID: 0e02 serial: <filter>
  Display: x11 server: X.Org v: 1.21.1.7 compositor: enlightenment driver: X: loaded: modesetting
    unloaded: fbdev,vesa dri: nouveau gpu: nouveau display-ID: :0.0 screens: 1
  Screen-1: 0 s-res: 1366x768 s-dpi: 96 s-size: 361x203mm (14.21x7.99") s-diag: 414mm (16.31")
  Monitor-1: LVDS-1 model: Seiko Epson 0x5441 built: 2011 res: 1366x768 hz: 60 dpi: 101
    gamma: 1.2 size: 344x194mm (13.54x7.64") diag: 395mm (15.5") ratio: 16:9 modes: max: 1366x768
    min: 640x350
  API: OpenGL v: 4.3 Mesa 23.1.2-1~mx23ahs renderer: NVD9 direct-render: Yes
Audio:
  Device-1: Intel 6 Series/C200 Series Family High Definition Audio vendor: Samsung Co 6
    driver: snd_hda_intel v: kernel bus-ID: 00:1b.0 chip-ID: 8086:1c20 class-ID: 0403
  Device-2: NVIDIA GF119 HDMI Audio vendor: Samsung Co driver: snd_hda_intel v: kernel pcie:
    gen: 1 speed: 2.5 GT/s lanes: 16 bus-ID: 01:00.1 chip-ID: 10de:0e08 class-ID: 0403
  API: ALSA v: k6.6.9-1-liquorix-amd64 status: kernel-api tools: alsamixer,amixer
  Server-1: PipeWire v: 1.0.0 status: active with: 1: pipewire-pulse status: active
    2: wireplumber status: active 3: pipewire-alsa type: plugin 4: pw-jack type: plugin
    tools: pactl,pw-cat,pw-cli,wpctl
Network:
  Device-1: Qualcomm Atheros AR9285 Wireless Network Adapter vendor: Samsung Co driver: ath9k
    v: kernel modules: wl pcie: gen: 1 speed: 2.5 GT/s lanes: 1 bus-ID: 02:00.0 chip-ID: 168c:002b
    class-ID: 0280
  IF: wlp2s0 state: up mac: <filter>
  Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: Samsung Co
    driver: r8169 v: kernel pcie: gen: 1 speed: 2.5 GT/s lanes: 1 port: 2000 bus-ID: 03:00.0
    chip-ID: 10ec:8168 class-ID: 0200
  IF: enp3s0 state: down mac: <filter>
Drives:
  Local Storage: total: 465.76 GiB used: 15.12 GiB (3.2%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/sda maj-min: 8:0 vendor: Samsung model: HN-M500MBB size: 465.76 GiB block-size:
    physical: 4096 B logical: 512 B speed: 3.0 Gb/s type: HDD rpm: 5400 serial: <filter> rev: 0001
    scheme: MBR
Partition:
  ID-1: / raw-size: 36 GiB size: 35.14 GiB (97.61%) used: 14.06 GiB (40.0%) fs: ext4 dev: /dev/sda7
    maj-min: 8:7
  ID-2: /home raw-size: 80 GiB size: 78.19 GiB (97.74%) used: 1006 MiB (1.3%) fs: ext4
    dev: /dev/sda8 maj-min: 8:8
Swap:
  Kernel: swappiness: 10 (default 60) cache-pressure: 100 (default)
  ID-1: swap-1 type: partition size: 9 GiB used: 0 KiB (0.0%) priority: -2 dev: /dev/sda6
    maj-min: 8:6
Sensors:
  System Temperatures: cpu: 75.0 C mobo: N/A gpu: nouveau temp: 66.0 C
  Fan Speeds (RPM): N/A
Repos:
  Packages: pm: dpkg pkgs: 2388 libs: 1402 tools: apt,apt-get,aptitude,synaptic pm: rpm pkgs: 0
    pm: flatpak pkgs: 0
  No active apt repos in: /etc/apt/sources.list
  Active apt repos in: /etc/apt/sources.list.d/debian-stable-updates.list
    1: deb http://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware
  Active apt repos in: /etc/apt/sources.list.d/debian.list
    1: deb http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware
    2: deb http://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
  Active apt repos in: /etc/apt/sources.list.d/mx.list
    1: deb http://mxrepo.com/mx/repo/ bookworm main non-free
    2: deb http://mxrepo.com/mx/repo/ bookworm ahs
Info:
  Processes: 291 Uptime: 25m wakeups: 1 Memory: 5.78 GiB used: 1.05 GiB (18.2%) Init: systemd
  v: 252 target: graphical (5) default: graphical tool: systemctl Compilers: gcc: 12.2.0 alt: 12
  Client: shell wrapper v: 5.2.15-release inxi: 3.3.26
Boot Mode: BIOS (legacy, CSM, MBR)
During the boot process, the screen gets black (with init) respectively dark (with systemd).
After logging in, everything works fine.
Somewhere in the internet I read that the /sys/class/backlight/ mechanism has been refurbished and one should remove all acpi_backlight=* boot options...

A workaround could be using software (xrandr) brightness in MX Tweaks, which is not available in AVL 32.1 .

Re: AVL 23.1: issue with backlight

Posted: Fri Feb 16, 2024 11:10 am
by AVLinux
So lightdm is displaying dark but the desktop session is fine?

I had a similar issue pop up installing on my son's Thinkpad but booting systemd fixed it, systemd doesn't work in your case?

Re: AVL 23.1: issue with backlight

Posted: Fri Feb 16, 2024 12:03 pm
by seriousness
Hello Glen,

I read your post, just did not want to append to this quite long thread.

With systemd, lightdm greeter is visible, but quite dark. With init, it's black and I have to log in blindly.

Re: AVL 23.1: issue with backlight

Posted: Fri Feb 16, 2024 1:34 pm
by AVLinux
seriousness wrote: Fri Feb 16, 2024 12:03 pm Hello Glen,

I read your post, just did not want to append to this quite long thread.

With systemd, lightdm greeter is visible, but quite dark. With init, it's black and I have to log in blindly.
Thanks for posting a solution, there is also a backlight module in Enlightenment which is shut off by default but I am not sure if it addresses anything that is outside of the Enlightenment session itself..
shot-2024-02-16_13-25-20.jpg

Re: AVL 23.1: issue with backlight

Posted: Fri Feb 16, 2024 2:00 pm
by Charlie Brown
seriousness wrote: Fri Feb 16, 2024 3:19 am... acpi_backlight=native is the only way ...
Just to make sure: You also tried others? =video especially ? Normally it should keep the last level.

If still not:

Code: Select all

cat /sys/class/backlight/acpi_video0/max_brightness
(Just to make sure, it's 10 here.)

Then, i.e.

Code: Select all

sudo sed -i '/^exit 0/iecho 6 > /sys/class/backlight/acpi_video0/brightness' /etc/rc.local
Reboot.


... Or (alternatively) for 50% just:

Code: Select all

sudo sed -i '/^exit 0/iecho $(($(cat /sys/class/backlight/acpi_video0/max_brightness)/2)) > /sys/class/backlight/acpi_video0/brightness' /etc/rc.local
Reboot.

Re: AVL 23.1: issue with backlight

Posted: Sat Feb 17, 2024 3:56 am
by seriousness
Hello Charles,

yes, I tried the other options.

acpi_backlight=video (which does the same as no option) worked in AVL 21.3, but with only 8 steps.

acpi_backlight=native gives /sys/class/backlight/nv_backlight with values from 0 - 100 .

After login my brightness value is restored, so that's not the problem.

Re: AVL 23.1: issue with backlight

Posted: Sat Feb 17, 2024 8:00 am
by Charlie Brown
Ok. I just mean if you insert the desired value (say 60) into /etc/rc.local before the last (exit 0) line it'll take effect even before login (just for you say login screen is dark)..

You can manually "edit as root" and add i.e.

Code: Select all

echo 60 > /sys/class/backlight/.../whatever-the-file-is

Re: AVL 23.1: issue with backlight

Posted: Sat Feb 17, 2024 12:19 pm
by seriousness
Thanks for this workaround, Charlie Brown!

This helps until someone is able to fix, whatever sets these unusable brightness values during boot.

Re: AVL 23.1: issue with backlight

Posted: Sat Feb 17, 2024 12:26 pm
by AVLinux
Hi,

It will be difficult to effectively 'fix' on my end as it only affects certain systems and if I start putting 'just in case' boot codes or scripts in rc.local then it may potentially negatively affect other systems..

@dolphin_oracle is there something you guys are doing in regular MX installs to mitigate backlight issues? If so I should probably roll it into the AVL default build...

@Charlie Brown sincere thanks for your expertise with these questions, very much appreciated!

Re: AVL 23.1: issue with backlight

Posted: Sat Feb 17, 2024 12:37 pm
by Charlie Brown
@AVLinux You're always welcome, you make me shy, I'm a shy cowboy :biggrin:

Re: AVL 23.1: issue with backlight

Posted: Sat Feb 17, 2024 12:43 pm
by Charlie Brown
In the meantime, in case (you don't have to) you install the Nvidia driver, there'll already be such a line in the conf file that will be created ( Option "RegistryDwords" "EnableBrightnessControl=1 in /etc/X11/xorg.conf.d/20-nvidia.conf )

Re: AVL 23.1: issue with backlight

Posted: Sat Feb 17, 2024 12:54 pm
by dolphin_oracle
@AVLinux we have a brightness-modified-init package that saves and applies backlight settings during sysVinit boot. systemd has its own mechanism.

Re: AVL 23.1: issue with backlight

Posted: Sat Feb 17, 2024 1:07 pm
by AVLinux
Charlie Brown wrote: Sat Feb 17, 2024 12:37 pm @AVLinux You're always welcome, you make me shy, I'm a shy cowboy :biggrin:
Shy maybe but smart... I'm not shy, just a dumb farmboy... :p

Re: AVL 23.1: issue with backlight

Posted: Sat Feb 17, 2024 1:09 pm
by AVLinux
dolphin_oracle wrote: Sat Feb 17, 2024 12:54 pm @AVLinux we have a brightness-modified-init package that saves and applies backlight settings during sysVinit boot. systemd has its own mechanism.
Thanks, great to know, does that init package rely on MX-tweak as a frontend to set parameters?

Re: AVL 23.1: issue with backlight

Posted: Sat Feb 17, 2024 1:21 pm
by dolphin_oracle
AVLinux wrote: Sat Feb 17, 2024 1:09 pm
dolphin_oracle wrote: Sat Feb 17, 2024 12:54 pm @AVLinux we have a brightness-modified-init package that saves and applies backlight settings during sysVinit boot. systemd has its own mechanism.
Thanks, great to know, does that init package rely on MX-tweak as a frontend to set parameters?
all it does is save whatever backlight levels are set already and reapply at login.

its worth mentioning that backlight and brightness in mx tweak aren't the same thing. despite the name of the brightness init script, it affects backlight.

Re: AVL 23.1: issue with backlight

Posted: Sat Feb 17, 2024 1:23 pm
by AVLinux
Understood, thanks!

Re: AVL 23.1: issue with backlight

Posted: Sat Feb 17, 2024 4:52 pm
by seriousness
AVLinux wrote: Fri Feb 16, 2024 1:34 pm there is also a backlight module in Enlightenment which is shut off by default but I am not sure if it addresses anything that is outside of the Enlightenment session itself..
This adds a light bulb to the shelf, which you can click and drag the slider, or just point on it and scroll the mouse wheel (provided that your hardware backlight brightness control works).

Re: AVL 23.1: issue with backlight

Posted: Mon Feb 19, 2024 3:21 am
by seriousness
I found that when I booted with SysVinit, brightness values are not saved on shutdown:

Code: Select all

$ cat /var/cache/brightness-settings-cache/sys/class/backlight/*/*
0
0
0
When /etc/init.d/brightness restores these values on boot, the screen gets black.

Edit: The script works:

Code: Select all

$ sudo service brightness stop
$ cat /var/cache/brightness-settings-cache/sys/class/backlight/nv_backlight/brightness
90
On reboot, it is set to 0 again.

Re: AVL 23.1: issue with backlight

Posted: Mon Feb 19, 2024 9:14 am
by AVLinux
Thanks for the info, I had discovered that the brightness init script is installed in the build by default but apparently it may need some tweaking for AVL..

@dolphin_oracle is the reset to 0 expected?

Re: AVL 23.1: issue with backlight

Posted: Mon Feb 19, 2024 10:06 am
by dolphin_oracle
AVLinux wrote: Mon Feb 19, 2024 9:14 am Thanks for the info, I had discovered that the brightness init script is installed in the build by default but apparently it may need some tweaking for AVL..

@dolphin_oracle is the reset to 0 expected?
no, but there are some cases, particularly with intel graphics parts but maybe with others too, where the backlight values can be inverted. systemd takes care of this, but sysVinit has no function for that. so 100 on systemd might be 0 on sysVinit.

Re: AVL 23.1: issue with backlight

Posted: Mon Feb 19, 2024 10:24 am
by Charlie Brown
You can try this:

"Job Scheduler" , press Ctrl + U (start as root)

Time:

Code: Select all

@reboot
Command:

Code: Select all

echo 60 > /var/cache/brightness-settings-cache/sys/class/backlight/nv_backlight/brightness
Save, close, reboot.


(... Or whatever value you like rather than 60 )


That will be a fixed setting of course. Alternatively:

Code: Select all

echo $(cat /sys/class/backlight/nv_backlight/brightness) > /var/cache/brightness-settings-cache/sys/class/backlight/nv_backlight/brightness

Re: AVL 23.1: issue with backlight  [Solved]

Posted: Mon Feb 19, 2024 11:21 am
by seriousness
https://wiki.archlinux.org/title/Enlightenment says:
1.7.12 Backlight always dimmed

You may find that Enlightenment routinely dims the backlight to 0% on logout and will only restore it to 100% when you log into another Enlightenment session. Enlightenment assumes that whatever comes after it will set the backlight to whatever it prefers, if anything as this is what Enlightenment does at start. This is especially problematic when using another desktop environment alongside Enlightenment that cannot control backlight as the backlight will not automatically be restored to its normal level when using that desktop environment. To fix this issue, open the Enlightenment Settings Panel and, under the Look tab, click on the Composite option. Tick the Don't fade backlight box and click OK.
Will try that tomorrow...

Re: AVL 23.1: issue with backlight

Posted: Mon Feb 19, 2024 11:23 am
by Charlie Brown
Good info. Then probably that's due to DE.

Re: AVL 23.1: issue with backlight

Posted: Mon Feb 19, 2024 11:52 am
by AVLinux
I will say this as more and more Users report issues...

The Enlightenment developer is very outspoken about using systemd with Enlightenment, mentioning sysvinit on their IRC will get you lots of jeers and eye-rolling although in my experience Enlightenment by and large works OK for most purposes with the MX/antiX live system but it seems for the best performance it is probably recommended to switch to systemd once you install AV Linux, I had another post elsewhere about a User that couldn't get the Evolution mail client to work unless he switched boot to systemd and since Evolution is super Gnome-y that shouldn't be a big surprise I suppose. In some recent related experiments with Enlightenment's Moksha fork (ie Bodhi Linux) I found it is even more dependent on systemd to the point of needing a lot of duct tape to work at all with sysvinit..

To be clear I personally have absolutely no preference for any init system and AV Linux tries to be as apolitical as possible and just present a good workstation, my general stance is that if you find systemd boot works better, use it!

Re: AVL 23.1: issue with backlight

Posted: Mon Feb 19, 2024 12:12 pm
by Charlie Brown
Meanwhile I notice just now that I overlooked one point:
To fix this issue, ... Tick the Don't fade backlight box and click OK.
If it was due to a setting (an unchecked setting ootb), then why is it ok on systemd ?

Re: AVL 23.1: issue with backlight

Posted: Mon Feb 19, 2024 12:13 pm
by dolphin_oracle
systemd has the concept of user services, services that run when a user logs in. its possible that sort of thing is in play.

Re: AVL 23.1: issue with backlight

Posted: Fri Feb 23, 2024 3:03 am
by seriousness
I marked this as solved.

If anyone has the same problem and stumbles upon this thread:
To fix this issue, open the Enlightenment Settings Panel and, under the Look tab, click on the Composite option. Tick the "Don't fade backlight" box and click OK.
On your next boot with SysVinit, you have to login blindly once again, but from then on it will work.