webketje/tuxedo-backlight-control

No such thing as /sys/devices/platform/tuxedo_keyboard/state on my laptop

xevilstar opened this issue · 15 comments

backlight color red
Traceback (most recent call last):
File "/usr/local/bin/backlight", line 69, in
backlight.state = 1
File "/usr/share/tuxedo-backlight-control/backlight_control.py", line 122, in state
self.set_device_param('state', str(value))
File "/usr/share/tuxedo-backlight-control/backlight_control.py", line 70, in set_device_param
filehandle = open(BacklightControl.DEVICE_PATH + prop, mode='w')
PermissionError: [Errno 13] Permission denied: '/sys/devices/platform/tuxedo_keyboard/state'
root@ghost:# ls /sys/devices/platform/tuxedo_keyboard/state
ls: cannot access '/sys/devices/platform/tuxedo_keyboard/state': No such file or directory
root@ghost:# lsmod|grep tuxedo
tuxedo_io 20480 0
tuxedo_keyboard 49152 3 tuxedo_io,uniwill_wmi,clevo_wmi
sparse_keymap 16384 2 asus_wmi,tuxedo_keyboard

Permission denied: '/sys/devices/platform/tuxedo_keyboard/state'
root@ghost:/usr/src/kernel# ls /sys/devices/platform/tuxedo_keyboard
driver driver_override input modalias power subsystem uevent
root@ghost:/usr/src/kernel# cat /sys/devices/platform/tuxedo_keyboard/state
cat: /sys/devices/platform/tuxedo_keyboard/state: No such file or directory
root@ghost:/usr/src/kernel# cat /sys/devices/platform/tuxedo_keyboard/
driver/ input/ power/ uevent
driver_override modalias subsystem/
root@ghost:/usr/src/kernel# ls /sys/devices/platform/tuxedo_keyboard/
driver driver_override input modalias power subsystem uevent

@xevilstar this unfortunately does not provide sufficient info. Your issue hints at tuxedo_keyboard not being correctly installed.
If files are missing at /sys/devices/platform/tuxedo_keyboard/ it means tuxedo_keyboard is not properly installed, possibly because your laptop model is not supported. Did you try to reboot after installing tuxedo_keyboard? Rebooting has been reported to solve an issue previously.

To fully track the issue, the following info is needed:

  • your laptop model - is it compatible?
  • your OS (=Debian)
  • the version of tuxedo_keyboard that you tried to install
  • the version of tuxedo-backlight-control that you installed
  • how you ran tuxedo backlight control (backlight ui command? backlight CLi? desktop launcher?)

@xevilstar Cool vendor, pcspecialist.it. Ok so your laptop is definitely a Clevo-compatible model (same debug values as I)

I am using the cli from bash/root account

So you say that the CLI works? Why do you use the root account? I think last time I tried to upgrade the Linux kernel to latest stable (I'm on 5.4.0) it didn't work out-of-the-box either, I think tuxedo_keyboard binds itself to a specific kernel version and needs to be reinstalled

I have reinstalled it (it is now in my dkms configuration) but it still doesn't find the state file in the sys path all other files are created

I'd like to find out why that file is missing in my /sys tuxedo_keyboard path

Maybe you can just create it yourself as root and it will work after that? echo "0" > /sys/devices/platform/tuxedo_keyboard/state
FYI, this is what ls -la /sys/devices/platform/tuxedo_keyboard yields on my laptop:

-rw-r--r--  1 root root 4096 Mar 10 10:46 brightness
-rw-r--r--  1 root root 4096 Mar 10 10:46 color_center
-rw-r--r--  1 root root 4096 Mar 10 10:46 color_extra
-rw-r--r--  1 root root 4096 Mar 10 10:46 color_left
-rw-r--r--  1 root root 4096 Mar 10 10:46 color_right
lrwxrwxrwx  1 root root    0 Mar 17 23:06 driver -> ../../../bus/platform/drivers/tuxedo_keyboard
-rw-r--r--  1 root root 4096 Mar 17 23:06 driver_override
-r--r--r--  1 root root 4096 Mar 17 23:06 extra
drwxr-xr-x  3 root root    0 Mar 17 23:06 input
-r--r--r--  1 root root 4096 Mar 17 23:06 modalias
-rw-r--r--  1 root root 4096 Mar 10 10:44 mode
drwxr-xr-x  2 root root    0 Mar 17 23:06 power
-rw-r--r--  1 root root 4096 Mar 11 17:13 state
lrwxrwxrwx  1 root root    0 Mar 17 23:06 subsystem -> ../../../bus/platform
-rw-r--r--  1 root root 4096 Mar 17 23:06 uevent

ls -la /sys/devices/platform/tuxedo_keyboard/
total 0
drwxr-xr-x 4 root root 0 Mar 18 08:29 .
drwxr-xr-x 30 root root 0 Mar 18 08:29 ..
lrwxrwxrwx 1 root root 0 Mar 18 08:29 driver -> ../../../bus/platform/drivers/tuxedo_keyboard
-rw-r--r-- 1 root root 4096 Mar 18 10:13 driver_override
drwxr-xr-x 3 root root 0 Mar 18 08:29 input
-r--r--r-- 1 root root 4096 Mar 18 10:13 modalias
drwxr-xr-x 2 root root 0 Mar 18 10:13 power
lrwxrwxrwx 1 root root 0 Mar 18 08:29 subsystem -> ../../../bus/platform
-rw-r--r-- 1 root root 4096 Mar 18 08:29 uevent

Ah I thought you said only the state file was missing, but all files keeping track of your keyboard state through SysFS are missing (brightness, 4x color_*, mode, state), so I can't help with that. But definitely tuxedo_keyboard was not installed properly.

ls /sys/devices/platform/tuxedo_keyboard/
driver driver_override input modalias power subsystem uevent

not installed properly ? what am I missing here ?

Clone the Git Repo:

git clone https://github.com/tuxedocomputers/tuxedo-keyboard.git

cd tuxedo-keyboard

git checkout release

Build the Module:

make clean && make

The DKMS route:

Add as DKMS Module:

Install the Module:

make clean

sudo make dkmsinstall

Load the Module with modprobe:

modprobe tuxedo_keyboard

or

sudo modprobe tuxedo_keyboard

You might also want to activate tuxedo_io module the same way if you are using TCC.

uname -a
Linux ghost 5.18.3-amd64 #1 SMP PREEMPT_DYNAMIC Fri Jun 10 11:11:28 CEST 2022 x86_64 GNU/Linux