openDsh / dash

Join us on Slack! https://join.slack.com/t/opendsh/shared_invite/zt-la398uly-a6eMH5ttEQhbtE6asVKx4Q
GNU General Public License v3.0
238 stars 69 forks source link

wrong path for brightness control on rpi 4 #149

Open konradmoesch opened 10 months ago

konradmoesch commented 10 months ago

Issue

Make sure you are running the latest version before reporting an issue.

Hardware

Device Connection Method Screen Mobile Device Android Auto Version
Raspberry Pi 4 4GB USB Cable Official Raspberry 7" Screen OnePlus Nord v.1.EXAMPLE

Installation Method: Install.sh and rpi.sh

Description of problem:

Brightness of official 7" Touchscreen cannot be changed, although udev rule is written. Manual change of sys/class/backlight/10-0045/brightness works though

Expected Result:

Brightness should be changeable using the official_rpi brightness plugin

Problem-relevant steps to reproduce:

  1. start dash
  2. try changing brightness
  3. nothing happens

Additional info:

In plugins/brightness/official_rpi/official_rpi.hpp the path has to be changed to sys/class/backlight/10-0045/brightness (was/is sys/class/backlight/rpi_backlight/brightness)

More info: https://forums.raspberrypi.com/viewtopic.php?t=324587

rsjudka commented 4 months ago

hmmm I swear I thought this was fixed 😤 i know we have a couple places where we detect which pi is being used... might have to do something like that here

maybe try to enumerate displays or something fancier too

breakingspell commented 1 month ago

As it were, I actually ended up without the vc4-kms-v3d driver that remaps the brightness control when setting up bookworm on an Rpi4, so the mapping fell back to the previous sys/class/backlight/rpi_backlight/brightness. This meant the existing udev rule and path in plugins/brightness/official_rpi/official_rpi.hpp worked for me, but enabling the KMS driver does alter the path to 10-0045 and will require a few lines to address.

Also, I noticed rpi.sh does not properly detect 64-bit Rpi OS to set the brightness udev rule in the first place. This is already fixed in install.sh (just opened a PR for it).

Lastly, I've also found the default slider range is too narrow (76-255). 76 is still fairly bright, setting this to 25 minimum gives me a good highway dim at the bottom end of the slider.

Testing this new range along with toggling the KMS driver off and on to try and funnel in a smart fix to detect what driver/mapping is in place. It works when it's mapped correctly!

rsjudka commented 1 month ago

thanks for the PR, will look at it!

and thanks for the feedback on the brightness, not a dash-user so i dont know how usability of it is :)

breakingspell commented 1 month ago

For sure! I think i've figured out a solution to source the proper path: less dynamic than intended, but with this specific display we know it will be only one of the two paths.

The brightness range adjustment certainly makes a difference too, I made a late drive the other night and it was perfect at 25 minimum. I've noted it in the PR as well, but the brightness controls do apply for all displays, not just the specific RPi panel. This could be a problem for users with third party HDMI displays?