Skip to main content
Tweeted twitter.com/super_user/status/1466286013337292808
Spelling and grammar. Attempt clarity improvements
Source Link
Dave M
  • 13.2k
  • 25
  • 37
  • 48

So I was wondering and looking if someone has been able to make the following.

I think is the way it should work, not the default way (neither in WINDOWS, I checked since I have dual boot). I just look for a solution in linuxLinux.

I am using Linux Mint and the computer is a ThinkpadThinkPad x390 Model 20Q0CTO1WW


 

More insight about the problem and some "advances": More insight about the problem and some "advances":

So I found this old topic related to my issue https://askubuntu.com/questions/125367/enabling-mic-mute-button-and-light-on-lenovo-thinkpads?noredirect=1&lq=1

I figurefigured out that if I was able to enable it, I would be able to disable or change it's behavior.

So, I was able to map the microphone function key to the "power led" by creating a file in /etc/acpi/events/lenovo-mutemic:

By doing this I am able to make the power button blink when the mic is on, and stay steady when mic is off. But the microphone ledLED works as default. Moreover when I press the microphone mute key both processes are triggered (the original which turns it off, and also the new one that turns it on again.)

I could remove from the script above the amixer sset command and have a reminder that the mic is on by having the power button blink, but this does not solve the annoying mic ledLED button when the mic is off.

Here is where I have trouble with: Here is what I have trouble with:

Here is wherewhat I have troubletrouble with, first. First the thinkpad_acpi.c file is not downloaded with the wget command and I haven't been able to compile the ones I have downloaded even without patching them.

So I was wondering and looking if someone has been able to make the following.

I think is the way it should work, not the default way (neither in WINDOWS, I checked since I have dual boot). I just look for a solution in linux.

I am using Linux Mint and the computer is a Thinkpad x390 Model 20Q0CTO1WW


 

More insight about the problem and some "advances":

So I found this old topic related to my issue https://askubuntu.com/questions/125367/enabling-mic-mute-button-and-light-on-lenovo-thinkpads?noredirect=1&lq=1

I figure out that if I was able to enable it, I would be able to disable or change it's behavior.

So, I was able to map the microphone function key to the "power led" by creating a file in /etc/acpi/events/lenovo-mutemic:

By doing this I am able to make the power button blink when the mic is on, and stay steady when mic is off. But the microphone led works as default. Moreover when I press the microphone mute key both processes are triggered (the original which turns it off, and also the new one that turns it on again.)

I could remove from the script above the amixer sset command and have a reminder that the mic is on by having the power button blink, but this does not solve the annoying mic led button when the mic is off.

Here is where I have trouble with:

Here is where I have trouble with, first the thinkpad_acpi.c file is not downloaded with the wget command and I haven't been able to compile the ones I have downloaded even without patching them.

I was wondering and looking if someone has been able to make the following.

I think is the way it should work, not the default way (neither in WINDOWS, I checked since I have dual boot). I just look for a solution in Linux.

I am using Linux Mint and the computer is a ThinkPad x390 Model 20Q0CTO1WW

More insight about the problem and some "advances":

I found this old topic related to my issue https://askubuntu.com/questions/125367/enabling-mic-mute-button-and-light-on-lenovo-thinkpads?noredirect=1&lq=1

I figured out that if I was able to enable it, I would be able to disable or change it's behavior.

I was able to map the microphone function key to the "power led" by creating a file in /etc/acpi/events/lenovo-mutemic:

By doing this I am able to make the power button blink when the mic is on, and stay steady when mic is off. But the microphone LED works as default. Moreover when I press the microphone mute key both processes are triggered (the original which turns it off, and also the new one that turns it on again.)

I could remove from the script above the amixer sset command and have a reminder that the mic is on by having the power button blink, but this does not solve the annoying mic LED button when the mic is off.

Here is what I have trouble with:

Here is what I have trouble with. First the thinkpad_acpi.c file is not downloaded with the wget command and I haven't been able to compile the ones I have downloaded even without patching them.

minor change
Link
CREATlVE
  • 56
  • 1
  • 4

Changing thinkpad microphone mute ledLED behaviour

Some advances and more insight about the problem
Source Link
CREATlVE
  • 56
  • 1
  • 4

More insight about the problem and some "advances":

So I found this old topic related to my issue https://askubuntu.com/questions/125367/enabling-mic-mute-button-and-light-on-lenovo-thinkpads?noredirect=1&lq=1

I figure out that if I was able to enable it, I would be able to disable or change it's behavior.

So, I was able to map the microphone function key to the "power led" by creating a file in /etc/acpi/events/lenovo-mutemic:

event=button/f20 F20 00000080 00000000 K 
action=/etc/acpi/lenovo-mutemic.sh

And the bash script /etc/acpi/lenovo-mutemic.sh:

#!/bin/bash
INPUT_DEVICE="'Capture'"
YOUR_USERNAME=$USER
if amixer sget $INPUT_DEVICE,0 | grep '\[on\]' ; then
    amixer sset $INPUT_DEVICE,0 toggle
    echo "0 on" > /proc/acpi/ibm/led
    su $YOUR_USERNAME -c 'DISPLAY=":0.0" notify-send -t 50 \
            -i microphone-sensitivity-muted-symbolic "Mic MUTED"'
else
    amixer sset $INPUT_DEVICE,0 toggle                       
    su $YOUR_USERNAME -c 'DISPLAY=":0.0" notify-send -t 50 \
            -i microphone-sensitivity-high-symbolic "Mic ON"'
    echo "0 blink" > /proc/acpi/ibm/led 
fi

By doing this I am able to make the power button blink when the mic is on, and stay steady when mic is off. But the microphone led works as default. Moreover when I press the microphone mute key both processes are triggered (the original which turns it off, and also the new one that turns it on again.)

I could remove from the script above the amixer sset command and have a reminder that the mic is on by having the power button blink, but this does not solve the annoying mic led button when the mic is off.

What this post suggests to control the mic led is to modify a kernel module:

Add MICMUTE=/sys/devices/platform/thinkpad_acpi/leds/tpacpi::micmute/brightness to the previous script and echo 1 > $MICMUTE // echo 0 > $MICMUTE to control this led.

Here is where I have trouble with:

  • They suggest installing headers and built tools for your kernel with:

    sudo apt-get install linux-headers-$(uname -r) build-essential

  • Make a temporary dir for trying the modified module:

    mkdir ~/tpacpi && cd ~/tpacpi

  • Download the source file thinkpad_acpi.c from the Ubuntu Kernel git repository:

wget -Othinkpad_acpi.c "http://kernel.ubuntu.com/git?p=ubuntu/ubuntu-$(lsb_release -sc).git;\
a=blob_plain;f=drivers/platform/x86/thinkpad_acpi.c;hb=HEAD" 
  • Patch it with (copy and paste the full line):
sed -i -e 's/"tpacpi::thinkvantage",/"tpacpi::thinkvantage",\n\t"tpacpi::unknown_led4",\n\t"tpacpi::micmute",/g' -e 's/0x1081U/0x5081U/g' -e 's/0x1fffU/0x5fffU/g' thinkpad_acpi.c
  • Download a "Makefile":
wget -OMakefile http://pastebin.com/raw.php?i=ybpnxeUT
  • Type make to compile it:

Here is where I have trouble with, first the thinkpad_acpi.c file is not downloaded with the wget command and I haven't been able to compile the ones I have downloaded even without patching them.

My kernel is: 5.3.0-46-generic


More insight about the problem and some "advances":

So I found this old topic related to my issue https://askubuntu.com/questions/125367/enabling-mic-mute-button-and-light-on-lenovo-thinkpads?noredirect=1&lq=1

I figure out that if I was able to enable it, I would be able to disable or change it's behavior.

So, I was able to map the microphone function key to the "power led" by creating a file in /etc/acpi/events/lenovo-mutemic:

event=button/f20 F20 00000080 00000000 K 
action=/etc/acpi/lenovo-mutemic.sh

And the bash script /etc/acpi/lenovo-mutemic.sh:

#!/bin/bash
INPUT_DEVICE="'Capture'"
YOUR_USERNAME=$USER
if amixer sget $INPUT_DEVICE,0 | grep '\[on\]' ; then
    amixer sset $INPUT_DEVICE,0 toggle
    echo "0 on" > /proc/acpi/ibm/led
    su $YOUR_USERNAME -c 'DISPLAY=":0.0" notify-send -t 50 \
            -i microphone-sensitivity-muted-symbolic "Mic MUTED"'
else
    amixer sset $INPUT_DEVICE,0 toggle                       
    su $YOUR_USERNAME -c 'DISPLAY=":0.0" notify-send -t 50 \
            -i microphone-sensitivity-high-symbolic "Mic ON"'
    echo "0 blink" > /proc/acpi/ibm/led 
fi

By doing this I am able to make the power button blink when the mic is on, and stay steady when mic is off. But the microphone led works as default. Moreover when I press the microphone mute key both processes are triggered (the original which turns it off, and also the new one that turns it on again.)

I could remove from the script above the amixer sset command and have a reminder that the mic is on by having the power button blink, but this does not solve the annoying mic led button when the mic is off.

What this post suggests to control the mic led is to modify a kernel module:

Add MICMUTE=/sys/devices/platform/thinkpad_acpi/leds/tpacpi::micmute/brightness to the previous script and echo 1 > $MICMUTE // echo 0 > $MICMUTE to control this led.

Here is where I have trouble with:

  • They suggest installing headers and built tools for your kernel with:

    sudo apt-get install linux-headers-$(uname -r) build-essential

  • Make a temporary dir for trying the modified module:

    mkdir ~/tpacpi && cd ~/tpacpi

  • Download the source file thinkpad_acpi.c from the Ubuntu Kernel git repository:

wget -Othinkpad_acpi.c "http://kernel.ubuntu.com/git?p=ubuntu/ubuntu-$(lsb_release -sc).git;\
a=blob_plain;f=drivers/platform/x86/thinkpad_acpi.c;hb=HEAD" 
  • Patch it with (copy and paste the full line):
sed -i -e 's/"tpacpi::thinkvantage",/"tpacpi::thinkvantage",\n\t"tpacpi::unknown_led4",\n\t"tpacpi::micmute",/g' -e 's/0x1081U/0x5081U/g' -e 's/0x1fffU/0x5fffU/g' thinkpad_acpi.c
  • Download a "Makefile":
wget -OMakefile http://pastebin.com/raw.php?i=ybpnxeUT
  • Type make to compile it:

Here is where I have trouble with, first the thinkpad_acpi.c file is not downloaded with the wget command and I haven't been able to compile the ones I have downloaded even without patching them.

My kernel is: 5.3.0-46-generic

added 55 characters in body
Source Link
CREATlVE
  • 56
  • 1
  • 4
Loading
added 217 characters in body
Source Link
K7AAY
  • 9.7k
  • 6
  • 35
  • 67
Loading
I added the exact laptop model
Source Link
CREATlVE
  • 56
  • 1
  • 4
Loading
Source Link
CREATlVE
  • 56
  • 1
  • 4
Loading