-
-
Notifications
You must be signed in to change notification settings - Fork 394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EmuELEC 4.0 on OGA: Brightness is not saved across reboots #470
Comments
If you set brightness via the hotkey, does it also happen ? |
In short: Yes If i change brightness via hotkey, this change can be seen in the system settings. So it makes no difference if you change brightness via hotkey or menu. |
Ok thanks, I will look into it. |
The problem is the different range of "brightness.level" in emuelec.conf (0..100) and "/sys/class/backlight/backlight/brightness" (0..255). This works so far for me on my OGA, no idea if it works for other devices:
|
Thank you, I will test it out |
I don't understand this part
you set one value to the /sys/class, but another to the .conf file? and this works? |
Ok I guess it does, since the value gets converted directly. Thanks for the fix I will push it |
This works on my OGA. |
its set here
and its saved on |
max_brightness on OGA is 255 and i mistakenly assumed it is 255 on all devices. if [ "${1}" == "bright" ]; then
STEPS="5"
CURBRIGHT=$(cat /sys/class/backlight/backlight/brightness)
MAXSYSBRIGHT=$(cat /sys/class/backlight/backlight/max_brightness)
CURRENTBRIGHT=$(($CURBRIGHT*100/$MAXSYSBRIGHT))
MAXBRIGHT="100"
MINBRIGHT="2"
if [ "${2}" == "+" ]; then
STEPBRIGHT=$(($CURRENTBRIGHT+$STEPS))
elif [ "${2}" == "-" ]; then
STEPBRIGHT=$(($CURRENTBRIGHT-$STEPS))
else
STEPBRIGHT=${2}
fi
[ "$STEPBRIGHT" -ge "$MAXBRIGHT" ] && STEPBRIGHT="$MAXBRIGHT"
[ "$STEPBRIGHT" -le "$MINBRIGHT" ] && STEPBRIGHT="$MINBRIGHT"
#echo "Setting bright to $STEPBRIGHT"
NEWVAL=$(($STEPBRIGHT*$MAXSYSBRIGHT/100))
echo "${NEWVAL}" > /sys/class/backlight/backlight/brightness
set_ee_setting "brightness.level" $STEPBRIGHT
fi |
Thank you! |
If you wish you can open a PR, or I can push the fix, let me know. |
Please push the fix... |
Describe the bug
No matter what value is set for brightness, it is reset to something different after reboot
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Brightness should be saved across reboots
EmuELEC version:
Device
The text was updated successfully, but these errors were encountered: