Tuxedo BC1710 Keyboard Backlight

Last updated on: 15 January, 2020

Summary: A few pointers on how to re-enable keyboard backlight after waking up Tuxedo Book BC1710 from S3 state (suspend to RAM) on Debian 10.

The Problem

Keyboard backlight of Tuxedo Book BC1710 remains turned off after Debian 10 comes out from S3 sleep state. Debian 10 is not officially supported by Tuxedo Computers.

Solution Which Worked for Me

First, make sure that you installed tuxedo_keyboard DKMS from Tuxedo Computers repository, or compiled it from source, and that it works. The most straightforward way of telling if it works or not, is to change backlight color in .conf file, which you will find in /etc/modprobe.d/ (you’ll need to create it if it doesn’t exist), and restart the module to see if the configuration file has any effect on the backlight. Here’s an example of my tuxedo_keyboard.conf. It’s tells the backlight LEDs to use a nice light brown color, and a not-too-bright light coming from the diodes, which fits well with papirus-folders' balanced brown mode:

options tuxedo_keyboard
	mode=0
	brightness=64
	color_left=0xFFA94F
	color_center=0xFFA94F
	color_right=0xFFA94F

We can test our settings by removing the DKMS module from the kernel and re-enabling it afterwards. To remove tuxedo_keyboard module, use the following shell command:

modprobe -r tuxedo_keyboard

Then, we can use the following command to restart the module:

modprobe tuxedo_keyboard

Both commands require root privileges, so depending on your security policy, you might need to prefix them with sudo or just execute them as root user.

If everything works fine, and the colors of the keyboard backlight match the colors from your tuxedo_keyboard.conf file, you can proceed to the second step — telling systemd what it is supposed to do with the tuxedo_keyboard module when you order your operating system to enter S3 suspend state.

My private investigation led me to believe that the main problem with tuxedo_keyboard DKMS not restarting after system wake-up comes from the fact that it is not properly shut down when the system hits the S3 state. So the first step we need to do is to tell systemd to unload it before Debian falls asleep. However, once the module is unloaded, we need to tell the system to load the module again, once our computer wakes up. Otherwise, we would still face the problem of missing keyboard backlight.

We can define our suspend and wake-up rules in lib/systemd/system-sleep (superuser access required). Let’s create a keyboard_backlight.sh script inside this path, with the following contents:

#!/bin/sh
case $1/$2 in
  pre/*)
    sudo modprobe -r tuxedo_keyboard
  ;;
  post/*)
    sudo modprobe tuxedo_keyboard
  ;;
esac

Instructions that come after pre/*) and before the first ;; line will be executed just before the system enters S3 state. Similarly, whatever goes between post/*) and ;; following it, will be executed upon system wake-up. So in the code above, we’re telling systemd to remove tuxedo_keyboard DKMS before the system goes to sleep, and reload it right after it wakes up.

I have not tested this solution with S4 state (suspend to disk, a.k.a. hibernate) because I don’t use it on any of my machines due to large amount of RAM they have, but I think that the solution should work with it. If you can verify this, please drop me an e-mail.