Am 20.07.25 um 01:39 schrieb Nikita Krasnov:
Hello!
I have a Xiaomi RedmiBook Pro 16 laptop and I suspect it is missing a
driver.
The laptop has a top row of F1-F12 buttons that can also control volume,
brightness and many other things. Most of them work fine and produce a
completely valid output (shown via `acpi_listen` from the `acpid`
package):
button/mute MUTE 00000080 00000000
button/volumedown VOLDN 00000080 00000000
button/volumeup VOLUP 00000080 00000000
video/brightnessdown BRTDN 00000087 00000000
video/brightnessup BRTUP 00000086 00000000
But then there is a "Mute mic" key (F4 button with an image of a
crossed-out microphone). It has an LED that lights up and down when the
button is being pressed, but there is no keycode, no dmesg message and
no _valid_ ACPI event — the message in `acpi_listen` is always the same,
no matter the state of the button. Pressing the button multiple times
produces the same output:
wmi PNP0C14:00 00000020 00000000
Might be a good time to mention that I nave 0 experience with ACPI, WMI
and drivers in general... I tried debugging the issue further and got
some data, but I lack the proper knowledge to interpret it.
Running `acpidump -b` (from `acpica-tools` package) generated some .dat
files which I then decompiled with `iasl -d` (from the same
`acpica-tools` package).
# acpidump -b
# iasl -d dsdt.dat
The resulting `dsdt.dsl` file has some code that mentions "PNP0C14".
I've attached this file with this email.
Hi,
please share the whole output of acpidump as the DSDT contains only two unrelated
WMI devices.
I also tried restarting the kernel with this configuration (NixOS
shenanigans; not sure what exactly it does there), but that didn't seem
to produce any extra files or directories on the system (in /sys and
/dev).
boot.initrd.availableKernelModules = [
"xhci_pci"
"thunderbolt"
"nvme"
"usb_storage"
"sd_mod"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" "wmi-sysfs" "wmi" "acpi_call" ];
boot.extraModulePackages = [ ];
Those additional modules will likely not help you, i suspect that we need
to extend the xiaomi-wmi driver a bit to add support for additional keyboard
events.
Here is some extra info that might be relevant:
$ ls /dev/wmi
ls: cannot access '/dev/wmi': No such file or directory
$ ls -1 /sys/bus/wmi/devices
05901221-D566-11D1-B2F0-00A0C9062910
05901221-D566-11D1-B2F0-00A0C9062910-1
05901221-D566-11D1-B2F0-00A0C9062910-2
05901221-D566-11D1-B2F0-00A0C9062910-3
1DCEAF0A-4D63-44BB-BD0C-0D6281BFDDC5
1F13AB7F-6220-4210-8F8E-8BB5E71EE969
2BC49DEF-7B15-4F05-8BB7-EE37B9547C0B
3F9E3C26-B077-4F86-91F5-37FF64D8C7ED
46C93E13-EE9B-4262-8488-563BCA757FEF
657B6048-310C-4A90-A211-10A17922A0AF
A6FEA33E-DABF-46F5-BFC8-460D961BEC9F
B60BFB48-3E5B-49E4-A0E9-8CFFE1B3434B
F80A5498-23F3-4053-A244-B39067EC476F
FA78E245-2C0F-4CA1-91CF-15F34E474850
$ ls /sys/bus/wmi/devices/2BC49DEF-7B15-4F05-8BB7-EE37B9547C0B/
driver_override expensive guid instance_count
modalias object_id power subsystem uevent
$ uname -a
Linux 6.15.5 #1-NixOS SMP PREEMPT_DYNAMIC x86_64 GNU/Linux
$ ls /proc/acpi
button wakeup
$ sudo cat /proc/acpi/button/lid/LID0/state
state: open
$ sudo cat /proc/acpi/wakeup
Device S-state Status Sysfs node
AWAC S4 *enabled platform:ACPI000E:00
XDCI S4 *disabled
XHCI S4 *enabled pci:0000:00:14.0
HDAS S4 *disabled pci:0000:00:1f.3
I3C0 S4 *disabled
CNVW S4 *disabled pci:0000:00:14.3
RP01 S4 *disabled
PXSX S4 *disabled
RP02 S4 *disabled
PXSX S4 *disabled
RP03 S4 *disabled
PXSX S4 *disabled
RP04 S4 *disabled
PXSX S4 *disabled
RP05 S4 *disabled
PXSX S4 *disabled
RP06 S4 *disabled
PXSX S4 *disabled
RP07 S4 *disabled
PXSX S4 *disabled
RP08 S4 *disabled
PXSX S4 *disabled
RP09 S4 *enabled pci:0000:00:06.0
PXSX S4 *disabled pci:0000:01:00.0
RP10 S4 *disabled
PXSX S4 *disabled
RP11 S4 *disabled
PXSX S4 *disabled
RP12 S4 *disabled
PXSX S4 *disabled
TXHC S4 *enabled pci:0000:00:0d.0
TDM0 S4 *enabled pci:0000:00:0d.2
TDM1 S4 *disabled
TRP0 S4 *disabled
PXSX S4 *disabled
TRP1 S4 *enabled pci:0000:00:07.0
PXSX S4 *disabled
TRP2 S4 *disabled
PXSX S4 *disabled
TRP3 S4 *disabled
PXSX S4 *disabled
As I said, I don't actually understand what I'm doing here, but I'd
really like to learn! It would be really cool if I ended up having to
write and contribute my first driver!
Sorry if I am somehow posting this incorrectly. This is my first time
communicating here, just trying my best.
You already provided a lot of data, good job :).
I think that we do not need another driver in this case, as the xiaomi-wmi driver
is responsible for handling WMI events on Xiaomi devices. I can check what needs
to be done in order to add support for those additional keyboard events, but for
that i need the full output of acpidump.
Thanks,
Armin Wolf
P.S. CC'ing W_Armin@xxxxxx, linux@xxxxxxxxxxxxxx and fengwk94@xxxxxxxxx
since I've got the impression you have some experience with this.