You are not logged in.

#1 2024-08-16 22:39:25

kockahonza
Member
Registered: 2018-06-23
Posts: 10

RGB Keyboard on ASUS Vivobook S 16 (5606)

Hi, I just got myself a nice new laptop and I'm trying to set it all up, however for the first time in my arch experience I am really stuck and cannot find any more information online - I cannot get the RGB backlight on the keyboard to work.

The laptop is as listed in the topic or here: https://www.asus.com/laptops/for-home/v … led-s5606/ . As far as I understand the backlight is a single zone RGB and personally I don't really care about any of the colors I just want a simple white light (preferably toggleable). I got the laptop with Windows installed which I did boot into once (to test the laptop) but did not finish the setup and then removed it as I installed arch.

Since then whenever the laptop is in any way on (including in the BIOS) the keyboard keeps cycling between various colors. I have looked around in the BIOS and there is no option that looks at all related to the keyboard or LEDs, I have also updated the BIOS and had another looks after that with no change. The keyboard has a function key that looks like it is intended for the keyboard backlight under F4 which does not do anything in the BIOS or when linux is running. I have checked with wev on wayland and xev on X11 as well but the function key produces no code (a bad sign as far as I understand), the others like for changing screen brightness do. I have had a look in "/sys/class/leds" which has a couple including "asus::kbd_backlight" which has both a "brightness" and "max_brightness" (which is 3) files. However which I can echo to "brightness" it has no effect. besides that there are also directories for capslock, numlock and scrolllock leds of which the only physically present is the capslock one -- which actually works, as in I can toggle the LED by echoing to its "brightness" file. Finally there is also "/sys/class/leds/phy0-led" which also does nothing.

I have also tried to install the packages asusctl and linux-firmware-asus from the ASUS Linux project but they had no effect and the asusctl command complained Aura (or something like that) not being detected, which makes sense as the project targets ASUS ROG and TUF Gaming laptops not vivobooks or any others.

Finally, I have noticed that I cannot really find an obvious keyboard in the outputs of lspci or lsusb. I am not sure if this is normal or perhaps the sign of some missing driver/firmware etc. (which is what I am in some ways hoping for). I include output from various system commands including I thought might help:
journalctl -b
hwinfo
hwinfo --short

cpu:
                       Intel(R) Core(TM) Ultra 9 185H, 1730 MHz
                       Intel(R) Core(TM) Ultra 9 185H, 1900 MHz
                       Intel(R) Core(TM) Ultra 9 185H, 400 MHz
                       Intel(R) Core(TM) Ultra 9 185H, 2003 MHz
                       Intel(R) Core(TM) Ultra 9 185H, 400 MHz
                       Intel(R) Core(TM) Ultra 9 185H, 400 MHz
                       Intel(R) Core(TM) Ultra 9 185H, 2000 MHz
                       Intel(R) Core(TM) Ultra 9 185H, 400 MHz
                       Intel(R) Core(TM) Ultra 9 185H, 400 MHz
                       Intel(R) Core(TM) Ultra 9 185H, 400 MHz
                       Intel(R) Core(TM) Ultra 9 185H, 400 MHz
                       Intel(R) Core(TM) Ultra 9 185H, 400 MHz
                       Intel(R) Core(TM) Ultra 9 185H, 1000 MHz
                       Intel(R) Core(TM) Ultra 9 185H, 400 MHz
                       Intel(R) Core(TM) Ultra 9 185H, 1000 MHz
                       Intel(R) Core(TM) Ultra 9 185H, 400 MHz
                       Intel(R) Core(TM) Ultra 9 185H, 400 MHz
                       Intel(R) Core(TM) Ultra 9 185H, 400 MHz
                       Intel(R) Core(TM) Ultra 9 185H, 400 MHz
                       Intel(R) Core(TM) Ultra 9 185H, 1000 MHz
                       Intel(R) Core(TM) Ultra 9 185H, 400 MHz
                       Intel(R) Core(TM) Ultra 9 185H, 400 MHz
keyboard:
  /dev/input/event2    AT Translated Set 2 keyboard
mouse:
  /dev/input/mice      ASCP1201:00 093A:3017 Mouse
  /dev/input/mice      ASCP1201:00 093A:3017 Touchpad
monitor:
                       ATNA60BX01-1 LCD Monitor
graphics card:
                       Intel VGA compatible controller
sound:
                       Intel Multimedia audio controller
storage:
                       Intel RAID bus controller
                       Sandisk Non-Volatile memory controller
network:
  wlan0                Intel WLAN controller
network interface:
  wlan0                WLAN network interface
  lo                   Loopback network interface
disk:
  /dev/nvme0n1         Sandisk WD PC SN560 SDDPNQE-1T00-1102
  /dev/sda             ASolid USB
  /dev/zram0           Disk
partition:
  /dev/nvme0n1p1       Partition
  /dev/nvme0n1p2       Partition
  /dev/nvme0n1p3       Partition
  /dev/sda1            Partition
  /dev/sda2            Partition
usb controller:
                       Intel USB Controller
                       Intel USB Controller
                       Intel USB Controller
bios:
                       BIOS
bridge:
                       Intel ISA bridge
                       Intel PCI bridge
                       Intel PCI bridge
                       Intel Host bridge
                       Intel PCI bridge
hub:
                       Linux Foundation 2.0 root hub
                       Linux Foundation 3.0 root hub
                       Linux Foundation 2.0 root hub
                       Linux Foundation 3.0 root hub
memory:
                       Main Memory
bluetooth:
                       Intel Bluetooth Device
unknown:
                       FPU
                       DMA controller
                       PIC
                       Keyboard controller
                       PS/2 Controller
                       Intel System peripheral
                       Intel Serial bus controller
                       Intel Signal processing controller
                       Intel Communication controller
                       Intel Serial bus controller
                       Intel Serial bus controller
                       Intel System peripheral
                       Intel Processing accelerators
                       Intel RAM memory
                       Intel SMBus
                       Intel Signal processing controller
                       Shinetech USB2.0 FHD UVC WebCam

lspci

0000:00:00.0 Host bridge: Intel Corporation Device 7d01 (rev 04)
0000:00:02.0 VGA compatible controller: Intel Corporation Meteor Lake-P [Intel Arc Graphics] (rev 08)
0000:00:04.0 Signal processing controller: Intel Corporation Meteor Lake-P Dynamic Tuning Technology (rev 04)
0000:00:06.0 System peripheral: Intel Corporation RST VMD Managed Controller
0000:00:07.0 PCI bridge: Intel Corporation Meteor Lake-P Thunderbolt 4 PCI Express Root Port #0 (rev 10)
0000:00:07.1 PCI bridge: Intel Corporation Meteor Lake-P Thunderbolt 4 PCI Express Root Port #1 (rev 10)
0000:00:08.0 System peripheral: Intel Corporation Meteor Lake-P Gaussian & Neural-Network Accelerator (rev 20)
0000:00:0a.0 Signal processing controller: Intel Corporation Meteor Lake-P Platform Monitoring Technology (rev 01)
0000:00:0b.0 Processing accelerators: Intel Corporation Meteor Lake NPU (rev 04)
0000:00:0d.0 USB controller: Intel Corporation Meteor Lake-P Thunderbolt 4 USB Controller (rev 10)
0000:00:0d.2 USB controller: Intel Corporation Meteor Lake-P Thunderbolt 4 NHI #0 (rev 10)
0000:00:0e.0 RAID bus controller: Intel Corporation Volume Management Device NVMe RAID Controller Intel Corporation
0000:00:14.0 USB controller: Intel Corporation Meteor Lake-P USB 3.2 Gen 2x1 xHCI Host Controller (rev 20)
0000:00:14.2 RAM memory: Intel Corporation Device 7e7f (rev 20)
0000:00:14.3 Network controller: Intel Corporation Meteor Lake PCH CNVi WiFi (rev 20)
0000:00:15.0 Serial bus controller: Intel Corporation Meteor Lake-P Serial IO I2C Controller #0 (rev 20)
0000:00:15.1 Serial bus controller: Intel Corporation Meteor Lake-P Serial IO I2C Controller #1 (rev 20)
0000:00:16.0 Communication controller: Intel Corporation Meteor Lake-P CSME HECI #1 (rev 20)
0000:00:1f.0 ISA bridge: Intel Corporation Device 7e02 (rev 20)
0000:00:1f.3 Multimedia audio controller: Intel Corporation Meteor Lake-P HD Audio Controller (rev 20)
0000:00:1f.4 SMBus: Intel Corporation Meteor Lake-P SMBus Controller (rev 20)
0000:00:1f.5 Serial bus controller: Intel Corporation Meteor Lake-P SPI Controller (rev 20)
10000:e0:06.0 PCI bridge: Intel Corporation Device 7e4d (rev 20)
10000:e1:00.0 Non-Volatile memory controller: Sandisk Corp WD Black SN770 / PC SN740 256GB / PC SN560 (DRAM-less) NVMe SSD (rev 01)

lsusb

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 002: ID 3277:0060 Shinetech USB2.0 FHD UVC WebCam
Bus 003 Device 003: ID 8087:0033 Intel Corp. AX211 Bluetooth
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 004 Device 002: ID 24a9:205a ASolid USB

Any help or tips would be very much appreciated as I am really starting to lose it over these cycling colours...

Last edited by kockahonza (2024-08-16 22:40:20)

Offline

#2 2024-08-17 13:46:19

MineGame159
Member
Registered: 2024-08-17
Posts: 2

Re: RGB Keyboard on ASUS Vivobook S 16 (5606)

I also got the same laptop a few days ago (with an AMD CPU but that doesn't matter). And I ran into the same issue, "asus::kbd_backlight/brightness" doesn't actually change the brightness but changing the brightness of the caps lock LED works fine. I didn't get it to work but I dig deeper and found more details about the issue so I am going to write them here if anyone else wants to look at it.

1. I found out the backlight is controlled through ACPI method calls, throught Windows I was able to confirm that the asus-wmi Linux module has the correct device and method IDs and that the ACPI method is being executed correctly and is returning 1 as the result. Which means success.
2. So I moved on to dump the ACPI DSDT table and then decompile it with iasl. In the decompiled file I was able to locate the ACPI function that is responsible for changing the brigthness. All it does is that it writes the value to a hardcoded memory location. That location is 0xFEDD8B24.
3. Through /dev/mem I could see that by pressing the FN+F4 key combination it was correctly writing the values 0x80, 0x81, 0x82 and 0x83 (brigthness levels 0 - 3) to that memory address. I even tried writing to that address manually but still no luck, the keyboard just wouldn't react.
4. As a I last resort I booted into Windows, installed WinDbg and attached it to the kernel. Through the debugger I tried writing the values to that same memory location and there it was. Simply writing that single byte changed the brigthness of the keyboard backlight.

That is as far as I was able to get. The remaining question is, why is the keyboard not responding to memory writes in Linux, but does in Windows.

Offline

#3 2024-08-17 16:39:32

kockahonza
Member
Registered: 2018-06-23
Posts: 10

Re: RGB Keyboard on ASUS Vivobook S 16 (5606)

Hi, thanks for the reply and tips, it's nice to know it's not just me!

Now, I am not really familiar with this level of linux kernel/drivers so I don't necessarily understand all of what you're saying but it has given me some direction in where to look, thank you, of course I will keep you updated if I get anywhere. For now the only thing I have noticed that might be worth mentioning is that pressing the backlight change key (Fn+F4) generates an ACPI event (seen through journalctl). This is probably unrelated but I though it is a bit weird as the key itself is not sent over (why would ASUS send one to the OS but not the other). I just thought I'd let you know just in case this ACPI communication could in any way get confused with the one you are talking about, but perhaps you are already aware of this.

Offline

#4 2024-08-17 17:31:00

MineGame159
Member
Registered: 2024-08-17
Posts: 2

Re: RGB Keyboard on ASUS Vivobook S 16 (5606)

I don't know what ACPI even you mean because for me pressing the key combo does not print anything in journalctl. Maybe you have some debug option turned on but it is most probably the same ACPI method call I was talking about earlier.

I have also found out that in Windows if I want the "trick" with writing to that memory location to work and change the brightness I need to have the "Asus Optimization" service started. If I disable it then writing to that memory location no longer updates the keyboard brightness.

I am kinda on the limit of what I can find out but if I figure something else I will keep you updated too.

Offline

#5 2024-08-17 17:38:49

kockahonza
Member
Registered: 2018-06-23
Posts: 10

Re: RGB Keyboard on ASUS Vivobook S 16 (5606)

Hey, sorry I should have been clearer, you need acpid installed and its systemd service (also named acpid started) to get the printouts in journalctl (perhaps best run with -f as instructed in acpid). If I understand things correctly the events are sent regardless but naturally somethings needs to actually look out for them (and log them to the journal). And as annoying as it may be I somewhat suspect that maybe that acpi event is the same thing as writing to the memory you mention and then perhaps the "Asus Optimization" service is running and looking out for it and then changing the keyboard via some other channel not ACPI. However as mentioned before this really isn't my are of expertise.

Offline

#6 2024-09-08 18:03:47

PisonJay
Member
Registered: 2024-05-23
Posts: 2

Re: RGB Keyboard on ASUS Vivobook S 16 (5606)

Just figured out. New ASUS laptops seem to enter an OOBE state at startup where you cannot adjust keyboard backlight.
Need to explicitly mark OOBE done by setting PCI0.SBRG.EC0.OOBS to 1 by calling DEVS(0x5002f, 0x1) in WMI.
You can try following script,

# Run as root
cd /sys/kernel/debug/asus-nb-wmi
echo 0x5002f > dev_id
echo 1 > ctrl_param
cat devs

Then Fn+F4 kbd backlight control should work.

Last edited by PisonJay (2024-09-08 18:46:20)

Offline

#7 2024-09-08 19:57:59

kockahonza
Member
Registered: 2018-06-23
Posts: 10

Re: RGB Keyboard on ASUS Vivobook S 16 (5606)

WOW, well done and thanks so much both for finding this and sharing! This is excellent smile. I can confirm this works, after executing the cat command the function key switches between 4 brightness levels of white background lighting, exactly what I need at least.

Offline

#8 2024-09-09 11:57:47

lukeglory
Member
Registered: 2024-09-08
Posts: 4

Re: RGB Keyboard on ASUS Vivobook S 16 (5606)

PisonJay wrote:

Just figured out. New ASUS laptops seem to enter an OOBE state at startup where you cannot adjust keyboard backlight.
Need to explicitly mark OOBE done by setting PCI0.SBRG.EC0.OOBS to 1 by calling DEVS(0x5002f, 0x1) in WMI.
You can try following script,

# Run as root
cd /sys/kernel/debug/asus-nb-wmi
echo 0x5002f > dev_id
echo 1 > ctrl_param
cat devs

Then Fn+F4 kbd backlight control should work.


The script works, but every time I restart my PC it stops working.
Is there a way to make it run every time I start it?

Offline

#9 2024-09-09 16:36:31

kockahonza
Member
Registered: 2018-06-23
Posts: 10

Re: RGB Keyboard on ASUS Vivobook S 16 (5606)

Hi again, so sadly I've found some limitations of the current fix. I find that it'll work at first, but after a reboot or hibernation the keyboard goes back to cycling colors and does not react to running the commands above. Please let me know if you find any way around this.

Also, I've put together a simple systemd service to run the current fix script and a PKGBUILD file so that it can be installed via pacman, it's here in case anybody want to use it. It'll run the script on boot.

Offline

#10 2024-09-10 22:04:09

kockahonza
Member
Registered: 2018-06-23
Posts: 10

Re: RGB Keyboard on ASUS Vivobook S 16 (5606)

Hi again, so I think I've figures things out. The issues I was having were partially because the systemd service was not being run after hibernate and partially idk why but after reboot it just doesn't work. That said, I've added two more lines to make it

cd /sys/kernel/debug/asus-nb-wmi
echo 0x5002f > dev_id
echo 0 > ctrl_param
cat devs
echo 1 > ctrl_param
cat devs

which in my eyes makes it a bit of a reset before doing what the original thing did and this does the trick. I've updated the code in the github and I've tried to add it to the AUR under the same name which seems to work for me for now, but it's my first time doing this so I'll see if something's gone wrong or not.

Offline

#11 2024-09-10 23:50:58

archaeologist
Member
Registered: 2024-09-09
Posts: 25

Re: RGB Keyboard on ASUS Vivobook S 16 (5606)

works on asus vivobook s15 (m5506wa) ty

Offline

#12 2024-09-11 08:26:50

kockahonza
Member
Registered: 2018-06-23
Posts: 10

Re: RGB Keyboard on ASUS Vivobook S 16 (5606)

Should also note that as this has been reported to also work on the Zenbook UM5606 there's a decent chance the kernel patch that is a part of this and which is recommended here would also work. Fixing this in the kernel is almost definitely a better option and so I hope this is being propagated into the mainline linux kernel and soon this won't be needed, but I struggle to understand whether that is happening or not. Notably that kernel also includes other patches and I wonder which of them might also be useful for the vivobook laptops or whether they are being brought into the main kernel.

Offline

#13 2024-09-22 18:29:52

jellysheep
Member
Registered: 2012-11-13
Posts: 6

Re: RGB Keyboard on ASUS Vivobook S 16 (5606)

@PisonJay: Thanks so much, you made my day! This also works on a recent Asus Vivobook S14 (model M5406WA).
The slowly cycling colors were acceptable, but after suspend/wakeup, the colors jumped wildly which was quite distracting.

Offline

Board footer

Powered by FluxBB