๐ ACPI Volume Control
๐ก Newskategorie: Linux Tipps
๐ Quelle: reddit.com
Hi everyone, I recently installed Rocky Linux on a Lenovo Thinkpad T460. I love the OS, it is very stable, smooth, and all the correct drivers are installed by default compared to something like debian or even fedora (despite also being RHEL). I just have one issue, and that is with ACPI events for volume control.
โ
Lenovo Thinkpad T460 Function Keys
I have attached an image of the function keys for the Lenovo T460. The function keys F5 and F6 are used to control brightness. The function key F8 is used to control wifi. These function keys I have successfully mapped to acpi events inside /etc/acpi/events
with corresponding acpi actions inside /etc/apci/actions
. Essentially, for brightness I have a script that increases/decreases the number in /sys/class/backlight/intel_backlight/brightness
. For wifi, I use rfkill to block/unblock the wifi card.
However, for function keys F1-F4, while recognized by acpid (acpi_listen), I have made configuration files in "/etc/acpi/events" and "/etc/acpi/actions", but I am unable to use them to configure my audio settings. Here is a table that organizes the output for each key from "acpi_listen".
โ
Key | "acpi_listen" Output |
---|---|
F1 (Audio Sink Mute) | button/mute MUTE 00000080 00000000 K |
F2 (Audio Sink Volume Down) | button/volumedown VOLDN 00000080 00000000 K |
F3 (Audio Sink Volume Up) | button/volumeup VOLUP 00000080 00000000 K |
F4 (Audio Source Mute) | button/f20 F20 00000080 00000000 K |
As you can see, the function keys are recognized by acpid, and therefore should be mappable. For their mapping, I have created the following events under /etc/acpi/events
.
For F1 (Audio Sink Mute):
$ cat /etc/acpi/events/FnF1-mute #FnF1 button/mute MUTE 00000080 00000000 K event=button/mute action=/etc/acpi/actions/FnF1-mute.sh $ cat /etc/acpi/actions/FnF1-mute.sh #!/bin/sh # Mute audio via pulseaudio pactl set-sink-mute @DEFAULT_SINK@ toggle
For F2 (Audio Sink Volume Down):
$ cat /etc/acpi/events/FnF2-volumedown #FnF2 button/volumedown VOLDN 00000080 00000000 K event=button/volumedown action=/etc/acpi/actions/FnF2-volumedown.sh $ cat /etc/acpi/actions/FnF2-volumedown.sh #!/bin/sh # Decrease the volume via pulseaudio pactl set-sink-volume @DEFAULT_SINK@ -1%
For F3 (Audio Sink Volume Up):
$ cat /etc/acpi/events/FnF3-volumeup #button/volumeup VOLUP 00000080 00000000 K event=button/mute action=/etc/acpi/actions/FnF3-volumeup.sh $ cat /etc/acpi/actions/FnF3-volumeup.sh #!/bin/sh #Increase the volume via pulseaudio pactl set-sink-volume @DEFAULT_SINK@ +1%
For F4 (Audio Source Mute):
$ cat /etc/acpi/events/FnF4-micmute #button/f20 F20 00000080 00000000 K event=button/f20 action=/etc/acpi/actions/FnF4-micmute.sh $ cat /etc/acpi/events/FnF4-micmute.sh #!/bin/sh # Mute the mic via pulseaudio pactl set-source-mute @DEFAULT_SOURCE@ toggle
All of the scripts utilize pulseaudio, and all of them work when run manually. I have also modified the scripts to use alsa (amixer) and still they only work manually, not when addressed via acpid.
I have made sure to have the thinkpad_acpi module enabled, as rocky linux comes with it by default. Here is the output of dmesg for the thinkpad_acpi module:
$ dmesg | grep thinkpad [ 6.141329] thinkpad_acpi: ThinkPad ACPI Extras v0.26 [ 6.142450] thinkpad_acpi: http://ibm-acpi.sf.net/ [ 6.143723] thinkpad_acpi: ThinkPad BIOS R06ET64W (1.38 ), EC unknown [ 6.145132] thinkpad_acpi: Lenovo ThinkPad T460, model 20FMS0LG06 [ 6.179525] thinkpad_acpi: radio switch found; radios are enabled [ 6.185779] thinkpad_acpi: This ThinkPad has standard ACPI backlight brightness control, supported by the ACPI video driver [ 6.187368] thinkpad_acpi: Disabling thinkpad-acpi brightness events by default... [ 6.204283] thinkpad_acpi: rfkill switch tpacpi_bluetooth_sw: radio is unblocked [ 6.230795] thinkpad_acpi: Standard ACPI backlight interface available, not loading native one [ 6.242915] thinkpad_acpi: battery 2 registered (start 0, stop 100) [ 6.258431] input: ThinkPad Extra Buttons as /devices/platform/thinkpad_acpi/input/input21
I would really appreciate any help on fixing this, as I am genuinely confused. The brightness and wifi scripts work fine via acpi for the hotkeys F5, F6, and F8. I am just unable to adjust audio via hotkeys F1-F4.
[link] [comments] ...