Error with Touch Display at shutdowntime


Using volumio (last version 2.773) with Touch Display plugin (version 1.1.7), I have an error message at shutdown time, concerning screen brightness.

The error says:

Erreur de réglage de la luminosité de l'écran: Error: EACCES: permission denied, open '/sys/devices/platform/rpi_backlight/backlight/rpi_backlight/brightness'

I solved this by changing manually to 666 the rights on the file, which apparently solves the issue…
I guess that something is missing somewhere in the plugin installation.

Hi dk31,

did you install the plugin before the touchscreen got connected?

Also please check if the file /etc/udev/rules.d/99-backlight.rules exists and report back. If the file should be missing execute sudo sh -c "echo 'SUBSYSTEM==\"backlight\", RUN+=\"/bin/chmod 0666 /sys/devices/platform/rpi_backlight/backlight/rpi_backlight/brightness\"' > /etc/udev/rules.d/99-backlight.rules" to create it.

Edit: Corrected code.


Thanks for the fast reply.

So, the answer is no. The Display was connected before installation: I used it with an older version of Volumio. I use an integrated device, it’s a bit cumbersome to disconnect the display when installing a new version.

This file did not exist.

I ran your command in two steps: first “sudo -s”, and then “echo …”, otherwise I get a "permission denied error:

sudo echo "SUBSYSTEM==\"backlight\", RUN+=\"/bin/chmod 0666 /sys/devices/platform/rpi_backlight/backlight/rpi_backlight/brightness\"" > /etc/udev/rules.d/99-backlight.rules
-bash: /etc/udev/rules.d/99-backlight.rules: Permission denied
sudo -s
root@volumio-sub:/home/volumio# echo "SUBSYSTEM==\"backlight\", RUN+=\"/bin/chmod 0666 /sys/devices/platform/rpi_backlight/backlight/rpi_backlight/brightness\"" > /etc/udev/rules.d/99-backlight.rules

Now the file exists.

root@volumio-sub:/home/volumio# ls -l /etc/udev/rules.d/99-backlight.rules 
-rw-r--r-- 1 root root 118 May 23 20:09 /etc/udev/rules.d/99-backlight.rules
root@volumio-sub:/home/volumio# more /etc/udev/rules.d/99-backlight.rules 
SUBSYSTEM=="backlight", RUN+="/bin/chmod 0666 /sys/devices/platform/rpi_backlight/backlight/rpi_backlight/brightness"

But, as I changed to permissions manually… Hope it helps… I’ll tell you if I see this error again.


Thanks for your feedback and your hint regarding my suggestion how to create 99-backlight.rules. My command only works when included in a script file. The correct one liner would be sudo sh -c "echo 'SUBSYSTEM==\"backlight\", RUN+=\"/bin/chmod 0666 /sys/devices/platform/rpi_backlight/backlight/rpi_backlight/brightness\"' > /etc/udev/rules.d/99-backlight.rules" I edited my previous post accordingly.

During plugin install the backlight rules file should get created if the device is a pi and the brightness file exists in /sys/devices/platform/rpi_backlight/backlight/rpi_backlight. The brightness file would of course not be present (and therefore the backlight rules file not be created) if the touchscreen is not connected while the plugin is installing. But as this does not apply to your case I am wondering why the backlight rules file was missing all the same.

Could you test what the result of echo $(awk '/VOLUMIO_HARDWARE=/' /etc/*-release | sed 's/VOLUMIO_HARDWARE=//' | sed 's/\"//g') is?


Here it is:

volumio@volumio-sub:~$ echo $(awk '/VOLUMIO_HARDWARE=/' /etc/*-release | sed 's/VOLUMIO_HARDWARE=//' | sed 's/\"//g')

I run a PI3B+, with a 7" touch display.

And here is the rpi_backlight directory after a fresh restart:

ls -l /sys/devices/platform/rpi_backlight/backlight/rpi_backlight
total 0
-r--r--r-- 1 root root 4096 May 24 09:41 actual_brightness
-rw-r--r-- 1 root root 4096 May 24 09:41 bl_power
-rw-rw-rw- 1 root root 4096 May 24 09:38 brightness
lrwxrwxrwx 1 root root    0 May 24 09:41 device -> ../../../rpi_backlight
-r--r--r-- 1 root root 4096 May 23 21:58 max_brightness
drwxr-xr-x 2 root root    0 May 24 09:41 power
lrwxrwxrwx 1 root root    0 May 23 21:58 subsystem -> ../../../../../class/backlight
-r--r--r-- 1 root root 4096 May 23 21:58 type
-rw-r--r-- 1 root root 4096 May 23 21:58 uevent

Looks good to me.


Thanks a lot.

Yes, all that looks good :slight_smile:

Though seeing all conditions for creating the backlight rules file fulfilled makes me even more riddling why that file either was not created on plugin install or why and when it has been deleted afterwards…

I think I will modify the plugin in a way that it will adjust the permissions of the brightness file on its own each time the plugin starts (not using UDEV any longer) anyway. This would prevent the problem in the case where the plugin got installed prior to the screen. And if need be the user would also be able to easily reapply the necessary permissions just by restarting the plugin.

I agree it’s better to get void of any unattended situation in the order the things were made.

Making the chown through the plugin at each restart should be ok, it’s better to do the same thing each time, you’re sure it’s done…

Maybe I’m a but curious, but what is the use for changing the brightness of the screen before shutting down?

At shutdown, one usually sync file systems, close everything, but why changing the brightness?

Purpose is to have full brightness when displaying a start and/or shutting down screen (e.g. with Volumio logo). :slight_smile:

OK, thanks

Actually there are more reasons:

The Raspberry Pi original touchscreen saves the brightness value internally. So if a user should disconnect the display after shutting down Volumio the display will stay on the last set brightness value. As one can’t know if the next system where the display gets connected allows to adjust the brightness I decided to set the brightness to factory default which is maximum brightness.

Further the more the plugin has the ability to automatically adjust the screen brightness depending on the ambient brightness if a suitable hardware sensor is installed (I have :wink: ) This description is a little outdated but not regarding auto brightness. If you use auto brightness and power down the system in a dark environment the display would have a low brightness value which would not fit during a boot process in a then possibly bright environment. By nature the plugin needs to have finished starting before it can take over and begin to regulate the brightness as a function of the ambient brightness again.


Got it thanks, that’s clear.

I’m not sure that “pure” audiophile listeners will add something to their volumio device not strictly related to music, like a light sensor… Maybe I’m wrong.

But screen brightness is an interesting point.

Could I suggest this?

  • 2 levels of brightness: one for the day, one for the night
  • the plugin allows to modify both of them easily
  • default values could be 80% and 40%.
  • the switch is done automatically (of course, daytime must be accurate on Volumio for this)
  • all this can be checked/unchecked in the plugin preference setting.

Such things exist on Desktops PCs (Night Mode in Ubuntu for example), or onboard screens in cars, GPS screens, etc…


Could be, but as often as I see lossy compressed audio being used… :wink: And btw I did not perceive a bad influence on sound quality after implementing the light sensor. :slight_smile:

Thanks for the suggestion, will surely think about it. At the moment Volumio does not set the timezone/local time automatically and also has no configuration option for this. Maybe this will change in the future.

Yes, you’re right. I noticed also that I was stuck in UTC time in Volumio… This could be easily changed if needed.

And I did not mean that the sensor would have an influence on sound, I’m sure it doesn’t. What I meant was that a lot of “amateur” of music just care about music, nothing else, so they would not integrate any hardware which is not in this scope.

But you’re right, some (other) people only listen to mp3 or wma…