How can I enable microphone mute button on Thinkpad W520?












4















I'm using Ubuntu 12.04. I've read Enabling Mic Mute button and light on Lenovo Thinkpads but the acpi_listen doesn't produce any output in the terminal (for any of the media buttons, Even the working ones)



And xev doesn't output anything for this Mic mute button.










share|improve this question
















bumped to the homepage by Community 6 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • Possible Dublicate askubuntu.com/questions/125367/…

    – basketball
    Mar 11 '14 at 21:07











  • In my case, only the mic button doesn't output anything with acpi_listen. I get events with xev tho.

    – berbt
    Oct 12 '15 at 11:47











  • @basketball nope

    – berbt
    Oct 12 '15 at 11:48
















4















I'm using Ubuntu 12.04. I've read Enabling Mic Mute button and light on Lenovo Thinkpads but the acpi_listen doesn't produce any output in the terminal (for any of the media buttons, Even the working ones)



And xev doesn't output anything for this Mic mute button.










share|improve this question
















bumped to the homepage by Community 6 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • Possible Dublicate askubuntu.com/questions/125367/…

    – basketball
    Mar 11 '14 at 21:07











  • In my case, only the mic button doesn't output anything with acpi_listen. I get events with xev tho.

    – berbt
    Oct 12 '15 at 11:47











  • @basketball nope

    – berbt
    Oct 12 '15 at 11:48














4












4








4


2






I'm using Ubuntu 12.04. I've read Enabling Mic Mute button and light on Lenovo Thinkpads but the acpi_listen doesn't produce any output in the terminal (for any of the media buttons, Even the working ones)



And xev doesn't output anything for this Mic mute button.










share|improve this question
















I'm using Ubuntu 12.04. I've read Enabling Mic Mute button and light on Lenovo Thinkpads but the acpi_listen doesn't produce any output in the terminal (for any of the media buttons, Even the working ones)



And xev doesn't output anything for this Mic mute button.







12.04 laptop lenovo thinkpad microphone






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 13 '17 at 12:24









Community

1




1










asked May 23 '12 at 12:27









vangopvangop

33626




33626





bumped to the homepage by Community 6 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 6 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • Possible Dublicate askubuntu.com/questions/125367/…

    – basketball
    Mar 11 '14 at 21:07











  • In my case, only the mic button doesn't output anything with acpi_listen. I get events with xev tho.

    – berbt
    Oct 12 '15 at 11:47











  • @basketball nope

    – berbt
    Oct 12 '15 at 11:48



















  • Possible Dublicate askubuntu.com/questions/125367/…

    – basketball
    Mar 11 '14 at 21:07











  • In my case, only the mic button doesn't output anything with acpi_listen. I get events with xev tho.

    – berbt
    Oct 12 '15 at 11:47











  • @basketball nope

    – berbt
    Oct 12 '15 at 11:48

















Possible Dublicate askubuntu.com/questions/125367/…

– basketball
Mar 11 '14 at 21:07





Possible Dublicate askubuntu.com/questions/125367/…

– basketball
Mar 11 '14 at 21:07













In my case, only the mic button doesn't output anything with acpi_listen. I get events with xev tho.

– berbt
Oct 12 '15 at 11:47





In my case, only the mic button doesn't output anything with acpi_listen. I get events with xev tho.

– berbt
Oct 12 '15 at 11:47













@basketball nope

– berbt
Oct 12 '15 at 11:48





@basketball nope

– berbt
Oct 12 '15 at 11:48










1 Answer
1






active

oldest

votes


















0














This solution should work for all Thinkpads with a mute button which also has a built-in light. It may also work for other Thinkpads.



Apart from the notification bubbles:



enter image description hereenter image description here



There are two possible "hardware" indicators (to show that mute is on or off):




  1. The Power button light (green) will blink to show when mute is on


  2. The Mic mute button light (orange) will be on or off to show mute status (just like in Windows)



    Solution 2 requires a patched thinkpad_acpi kernel module, and is only recommended for advanced users who know what they are doing. This is because the patch is not included by the thinkpad_acpi developers by default, (See this discussion for more details).




Common Steps





a. Determining the Mic-Mute hotkey code and Mic input device




  • Open terminal with Ctrl+Alt+T

  • Run acpi_listen, and press the mute key

  • Note the result, which should be something like:
    ibm/hotkey HKEY 00000080 0000101b


  • Then run amixer scontrols, you should see one of the following in the output:




Simple mixer control 'Internal Mic',0


or




Simple mixer control 'Capture',0


Depending on what you see, "Internal Mic" or "Capture" is your input device.



b. Create the Mic-Mute ACPI event handler




  • Open terminal, type gksudo gedit /etc/acpi/events/lenovo-mutemic to open the editor.

  • In the editor, paste in the following, where the first line should be the code shown in the previous section by acpi_listen:


    event=ibm/hotkey HKEY 00000080 0000101b
    action=/etc/acpi/lenovo-mutemic.sh


  • Save and exit the editor.




Choosing either the Power Light or Mic Mute indicators





c-1. Mic-Mute script with Power Button indicator




  • Do this if you want an easy solution and do not want to use the patched kernel module (see C-2).

  • Open terminal, type gksudo gedit /etc/acpi/lenovo-mutemic.sh


  • In the editor, paste:




    #!/bin/bash
    INPUT_DEVICE="'Internal Mic'"
    YOUR_USERNAME="place_your_username_here"
    if amixer sget $INPUT_DEVICE,0 | grep '[on]' ; then
    amixer sset $INPUT_DEVICE,0 toggle
    echo "0 blink" > /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 on" > /proc/acpi/ibm/led
    fi


  • Replace value of INPUT_DEVICE variable with Capture if that is your input device name (leave all the ticks intact).


  • Replace value of YOUR_USERNAME variable with the account name of the user you want to send notifications to

  • Save and exit the editor.

  • Now run the following (from the terminal):


    sudo chmod +x /etc/acpi/lenovo-mutemic.sh
    sudo service acpid restart


  • Jump to the Testing section (d) to confirm that it works.


c-2. Mic-mute with official Mic-mute Indicator Light



Setting up the script




  • Please do not use this method if you are not familiar with the terminal/shell.

  • This will require compiling a patched thinkpad_acpi module and has been verified to work with Ubuntu Precise 12.04 and Quantal 12.10, kernels 3.2.0-23 and 3.2.0-24 and 3.5.0-21.

  • Let's create the script first: /etc/acpi/lenovo-mutemic.sh should be as in section c-1, with the following additions:



  • Insert this line after the header (#!/bin/bash):



    MICMUTE=/sys/devices/platform/thinkpad_acpi/leds/tpacpi::micmute/brightness



  • After the first echo... line, insert:



    echo 1 > $MICMUTE



  • And after the second echo... line, insert:



    echo 0 > $MICMUTE


  • You can find an example of what the full script should look like in this paste



  • Then:



    sudo chmod +x /etc/acpi/lenovo-mutemic.sh
    sudo service acpid restart


  • Confirm that pressing the mute button results in a blinking power light; pressing again gives a steady power light.



Building, testing and installing the kernel module





  • Install (or ensure) you have the headers and built tools for your currently running kernel with:



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



  • Make a temporary directory and change to it:



    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",nt"tpacpi::unknown_led4",nt"tpacpi::micmute",/g' -e 's/0x1081U/0x5081U/g' -e 's/0x1fffU/0x5fffU/g' thinkpad_acpi.c



  • In the same folder where thinkpad_acpi.c has been downloaded, you will need a "Makefile". You can download it directly from this Pastebin, using:



    wget -OMakefile http://pastebin.com/raw.php?i=ybpnxeUT


    OR paste the below into a file called Makefile:




    obj-m += thinkpad_acpi.o

    all:
    make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules

    clean:
    make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean


  • Now type make to create the module; you will see a thinkpad_acpi.ko file in the folder when done.



  • Test the patched module after loading it with:



    sudo rmmod thinkpad_acpi && sudo insmod thinkpad_acpi.ko


  • Now confirm that pressing the mic button will turn the orange mic light on/off AND the power light blinking/steady.



  • If confirmed, do the following to replace your current thinkpad_acpi module:




    TPDIR=/lib/modules/$(uname -r)/kernel/drivers/platform/x86
    sudo mv $TPDIR/thinkpad_acpi.ko $TPDIR/thinkpad_acpi.ko.stock
    sudo mv /where/you/built/it/tpacpi_micmute/thinkpad_acpi.ko $TPDIR/thinkpad_acpi.ko


  • Comment out or delete the power led lines in lenovo-micmute.sh





d. Testing




  • Apart from your choice of indicator, you can also confirm mute via the following:


Mic Input




  • Click on the volume icon on the top right, and sound settings at the bottom:

  • Switch to the "Input" tab.


  • Now have fun pressing the Mic Mute button, you should see it reflected in:




    1. The Mute checkbox in the window

    2. Notification bubbles (won't appear instantly if you press the Mic Mute more than once every few seconds!)

    3. Your chosen indicator: the blinking power button light or the built-in Mic Mute light.




Answer found on Enabling Mic Mute button and light on Lenovo Thinkpads






share|improve this answer


























  • I've tried this solution. But after rebooting, it didn't work. I tried to do it again, but now acpi_listen doesn't output anything.

    – Quaxton Hale
    Mar 12 '14 at 0:10











  • edit - don't mind me

    – berbt
    Oct 12 '15 at 11:39













Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f141162%2fhow-can-i-enable-microphone-mute-button-on-thinkpad-w520%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














This solution should work for all Thinkpads with a mute button which also has a built-in light. It may also work for other Thinkpads.



Apart from the notification bubbles:



enter image description hereenter image description here



There are two possible "hardware" indicators (to show that mute is on or off):




  1. The Power button light (green) will blink to show when mute is on


  2. The Mic mute button light (orange) will be on or off to show mute status (just like in Windows)



    Solution 2 requires a patched thinkpad_acpi kernel module, and is only recommended for advanced users who know what they are doing. This is because the patch is not included by the thinkpad_acpi developers by default, (See this discussion for more details).




Common Steps





a. Determining the Mic-Mute hotkey code and Mic input device




  • Open terminal with Ctrl+Alt+T

  • Run acpi_listen, and press the mute key

  • Note the result, which should be something like:
    ibm/hotkey HKEY 00000080 0000101b


  • Then run amixer scontrols, you should see one of the following in the output:




Simple mixer control 'Internal Mic',0


or




Simple mixer control 'Capture',0


Depending on what you see, "Internal Mic" or "Capture" is your input device.



b. Create the Mic-Mute ACPI event handler




  • Open terminal, type gksudo gedit /etc/acpi/events/lenovo-mutemic to open the editor.

  • In the editor, paste in the following, where the first line should be the code shown in the previous section by acpi_listen:


    event=ibm/hotkey HKEY 00000080 0000101b
    action=/etc/acpi/lenovo-mutemic.sh


  • Save and exit the editor.




Choosing either the Power Light or Mic Mute indicators





c-1. Mic-Mute script with Power Button indicator




  • Do this if you want an easy solution and do not want to use the patched kernel module (see C-2).

  • Open terminal, type gksudo gedit /etc/acpi/lenovo-mutemic.sh


  • In the editor, paste:




    #!/bin/bash
    INPUT_DEVICE="'Internal Mic'"
    YOUR_USERNAME="place_your_username_here"
    if amixer sget $INPUT_DEVICE,0 | grep '[on]' ; then
    amixer sset $INPUT_DEVICE,0 toggle
    echo "0 blink" > /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 on" > /proc/acpi/ibm/led
    fi


  • Replace value of INPUT_DEVICE variable with Capture if that is your input device name (leave all the ticks intact).


  • Replace value of YOUR_USERNAME variable with the account name of the user you want to send notifications to

  • Save and exit the editor.

  • Now run the following (from the terminal):


    sudo chmod +x /etc/acpi/lenovo-mutemic.sh
    sudo service acpid restart


  • Jump to the Testing section (d) to confirm that it works.


c-2. Mic-mute with official Mic-mute Indicator Light



Setting up the script




  • Please do not use this method if you are not familiar with the terminal/shell.

  • This will require compiling a patched thinkpad_acpi module and has been verified to work with Ubuntu Precise 12.04 and Quantal 12.10, kernels 3.2.0-23 and 3.2.0-24 and 3.5.0-21.

  • Let's create the script first: /etc/acpi/lenovo-mutemic.sh should be as in section c-1, with the following additions:



  • Insert this line after the header (#!/bin/bash):



    MICMUTE=/sys/devices/platform/thinkpad_acpi/leds/tpacpi::micmute/brightness



  • After the first echo... line, insert:



    echo 1 > $MICMUTE



  • And after the second echo... line, insert:



    echo 0 > $MICMUTE


  • You can find an example of what the full script should look like in this paste



  • Then:



    sudo chmod +x /etc/acpi/lenovo-mutemic.sh
    sudo service acpid restart


  • Confirm that pressing the mute button results in a blinking power light; pressing again gives a steady power light.



Building, testing and installing the kernel module





  • Install (or ensure) you have the headers and built tools for your currently running kernel with:



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



  • Make a temporary directory and change to it:



    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",nt"tpacpi::unknown_led4",nt"tpacpi::micmute",/g' -e 's/0x1081U/0x5081U/g' -e 's/0x1fffU/0x5fffU/g' thinkpad_acpi.c



  • In the same folder where thinkpad_acpi.c has been downloaded, you will need a "Makefile". You can download it directly from this Pastebin, using:



    wget -OMakefile http://pastebin.com/raw.php?i=ybpnxeUT


    OR paste the below into a file called Makefile:




    obj-m += thinkpad_acpi.o

    all:
    make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules

    clean:
    make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean


  • Now type make to create the module; you will see a thinkpad_acpi.ko file in the folder when done.



  • Test the patched module after loading it with:



    sudo rmmod thinkpad_acpi && sudo insmod thinkpad_acpi.ko


  • Now confirm that pressing the mic button will turn the orange mic light on/off AND the power light blinking/steady.



  • If confirmed, do the following to replace your current thinkpad_acpi module:




    TPDIR=/lib/modules/$(uname -r)/kernel/drivers/platform/x86
    sudo mv $TPDIR/thinkpad_acpi.ko $TPDIR/thinkpad_acpi.ko.stock
    sudo mv /where/you/built/it/tpacpi_micmute/thinkpad_acpi.ko $TPDIR/thinkpad_acpi.ko


  • Comment out or delete the power led lines in lenovo-micmute.sh





d. Testing




  • Apart from your choice of indicator, you can also confirm mute via the following:


Mic Input




  • Click on the volume icon on the top right, and sound settings at the bottom:

  • Switch to the "Input" tab.


  • Now have fun pressing the Mic Mute button, you should see it reflected in:




    1. The Mute checkbox in the window

    2. Notification bubbles (won't appear instantly if you press the Mic Mute more than once every few seconds!)

    3. Your chosen indicator: the blinking power button light or the built-in Mic Mute light.




Answer found on Enabling Mic Mute button and light on Lenovo Thinkpads






share|improve this answer


























  • I've tried this solution. But after rebooting, it didn't work. I tried to do it again, but now acpi_listen doesn't output anything.

    – Quaxton Hale
    Mar 12 '14 at 0:10











  • edit - don't mind me

    – berbt
    Oct 12 '15 at 11:39


















0














This solution should work for all Thinkpads with a mute button which also has a built-in light. It may also work for other Thinkpads.



Apart from the notification bubbles:



enter image description hereenter image description here



There are two possible "hardware" indicators (to show that mute is on or off):




  1. The Power button light (green) will blink to show when mute is on


  2. The Mic mute button light (orange) will be on or off to show mute status (just like in Windows)



    Solution 2 requires a patched thinkpad_acpi kernel module, and is only recommended for advanced users who know what they are doing. This is because the patch is not included by the thinkpad_acpi developers by default, (See this discussion for more details).




Common Steps





a. Determining the Mic-Mute hotkey code and Mic input device




  • Open terminal with Ctrl+Alt+T

  • Run acpi_listen, and press the mute key

  • Note the result, which should be something like:
    ibm/hotkey HKEY 00000080 0000101b


  • Then run amixer scontrols, you should see one of the following in the output:




Simple mixer control 'Internal Mic',0


or




Simple mixer control 'Capture',0


Depending on what you see, "Internal Mic" or "Capture" is your input device.



b. Create the Mic-Mute ACPI event handler




  • Open terminal, type gksudo gedit /etc/acpi/events/lenovo-mutemic to open the editor.

  • In the editor, paste in the following, where the first line should be the code shown in the previous section by acpi_listen:


    event=ibm/hotkey HKEY 00000080 0000101b
    action=/etc/acpi/lenovo-mutemic.sh


  • Save and exit the editor.




Choosing either the Power Light or Mic Mute indicators





c-1. Mic-Mute script with Power Button indicator




  • Do this if you want an easy solution and do not want to use the patched kernel module (see C-2).

  • Open terminal, type gksudo gedit /etc/acpi/lenovo-mutemic.sh


  • In the editor, paste:




    #!/bin/bash
    INPUT_DEVICE="'Internal Mic'"
    YOUR_USERNAME="place_your_username_here"
    if amixer sget $INPUT_DEVICE,0 | grep '[on]' ; then
    amixer sset $INPUT_DEVICE,0 toggle
    echo "0 blink" > /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 on" > /proc/acpi/ibm/led
    fi


  • Replace value of INPUT_DEVICE variable with Capture if that is your input device name (leave all the ticks intact).


  • Replace value of YOUR_USERNAME variable with the account name of the user you want to send notifications to

  • Save and exit the editor.

  • Now run the following (from the terminal):


    sudo chmod +x /etc/acpi/lenovo-mutemic.sh
    sudo service acpid restart


  • Jump to the Testing section (d) to confirm that it works.


c-2. Mic-mute with official Mic-mute Indicator Light



Setting up the script




  • Please do not use this method if you are not familiar with the terminal/shell.

  • This will require compiling a patched thinkpad_acpi module and has been verified to work with Ubuntu Precise 12.04 and Quantal 12.10, kernels 3.2.0-23 and 3.2.0-24 and 3.5.0-21.

  • Let's create the script first: /etc/acpi/lenovo-mutemic.sh should be as in section c-1, with the following additions:



  • Insert this line after the header (#!/bin/bash):



    MICMUTE=/sys/devices/platform/thinkpad_acpi/leds/tpacpi::micmute/brightness



  • After the first echo... line, insert:



    echo 1 > $MICMUTE



  • And after the second echo... line, insert:



    echo 0 > $MICMUTE


  • You can find an example of what the full script should look like in this paste



  • Then:



    sudo chmod +x /etc/acpi/lenovo-mutemic.sh
    sudo service acpid restart


  • Confirm that pressing the mute button results in a blinking power light; pressing again gives a steady power light.



Building, testing and installing the kernel module





  • Install (or ensure) you have the headers and built tools for your currently running kernel with:



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



  • Make a temporary directory and change to it:



    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",nt"tpacpi::unknown_led4",nt"tpacpi::micmute",/g' -e 's/0x1081U/0x5081U/g' -e 's/0x1fffU/0x5fffU/g' thinkpad_acpi.c



  • In the same folder where thinkpad_acpi.c has been downloaded, you will need a "Makefile". You can download it directly from this Pastebin, using:



    wget -OMakefile http://pastebin.com/raw.php?i=ybpnxeUT


    OR paste the below into a file called Makefile:




    obj-m += thinkpad_acpi.o

    all:
    make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules

    clean:
    make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean


  • Now type make to create the module; you will see a thinkpad_acpi.ko file in the folder when done.



  • Test the patched module after loading it with:



    sudo rmmod thinkpad_acpi && sudo insmod thinkpad_acpi.ko


  • Now confirm that pressing the mic button will turn the orange mic light on/off AND the power light blinking/steady.



  • If confirmed, do the following to replace your current thinkpad_acpi module:




    TPDIR=/lib/modules/$(uname -r)/kernel/drivers/platform/x86
    sudo mv $TPDIR/thinkpad_acpi.ko $TPDIR/thinkpad_acpi.ko.stock
    sudo mv /where/you/built/it/tpacpi_micmute/thinkpad_acpi.ko $TPDIR/thinkpad_acpi.ko


  • Comment out or delete the power led lines in lenovo-micmute.sh





d. Testing




  • Apart from your choice of indicator, you can also confirm mute via the following:


Mic Input




  • Click on the volume icon on the top right, and sound settings at the bottom:

  • Switch to the "Input" tab.


  • Now have fun pressing the Mic Mute button, you should see it reflected in:




    1. The Mute checkbox in the window

    2. Notification bubbles (won't appear instantly if you press the Mic Mute more than once every few seconds!)

    3. Your chosen indicator: the blinking power button light or the built-in Mic Mute light.




Answer found on Enabling Mic Mute button and light on Lenovo Thinkpads






share|improve this answer


























  • I've tried this solution. But after rebooting, it didn't work. I tried to do it again, but now acpi_listen doesn't output anything.

    – Quaxton Hale
    Mar 12 '14 at 0:10











  • edit - don't mind me

    – berbt
    Oct 12 '15 at 11:39
















0












0








0







This solution should work for all Thinkpads with a mute button which also has a built-in light. It may also work for other Thinkpads.



Apart from the notification bubbles:



enter image description hereenter image description here



There are two possible "hardware" indicators (to show that mute is on or off):




  1. The Power button light (green) will blink to show when mute is on


  2. The Mic mute button light (orange) will be on or off to show mute status (just like in Windows)



    Solution 2 requires a patched thinkpad_acpi kernel module, and is only recommended for advanced users who know what they are doing. This is because the patch is not included by the thinkpad_acpi developers by default, (See this discussion for more details).




Common Steps





a. Determining the Mic-Mute hotkey code and Mic input device




  • Open terminal with Ctrl+Alt+T

  • Run acpi_listen, and press the mute key

  • Note the result, which should be something like:
    ibm/hotkey HKEY 00000080 0000101b


  • Then run amixer scontrols, you should see one of the following in the output:




Simple mixer control 'Internal Mic',0


or




Simple mixer control 'Capture',0


Depending on what you see, "Internal Mic" or "Capture" is your input device.



b. Create the Mic-Mute ACPI event handler




  • Open terminal, type gksudo gedit /etc/acpi/events/lenovo-mutemic to open the editor.

  • In the editor, paste in the following, where the first line should be the code shown in the previous section by acpi_listen:


    event=ibm/hotkey HKEY 00000080 0000101b
    action=/etc/acpi/lenovo-mutemic.sh


  • Save and exit the editor.




Choosing either the Power Light or Mic Mute indicators





c-1. Mic-Mute script with Power Button indicator




  • Do this if you want an easy solution and do not want to use the patched kernel module (see C-2).

  • Open terminal, type gksudo gedit /etc/acpi/lenovo-mutemic.sh


  • In the editor, paste:




    #!/bin/bash
    INPUT_DEVICE="'Internal Mic'"
    YOUR_USERNAME="place_your_username_here"
    if amixer sget $INPUT_DEVICE,0 | grep '[on]' ; then
    amixer sset $INPUT_DEVICE,0 toggle
    echo "0 blink" > /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 on" > /proc/acpi/ibm/led
    fi


  • Replace value of INPUT_DEVICE variable with Capture if that is your input device name (leave all the ticks intact).


  • Replace value of YOUR_USERNAME variable with the account name of the user you want to send notifications to

  • Save and exit the editor.

  • Now run the following (from the terminal):


    sudo chmod +x /etc/acpi/lenovo-mutemic.sh
    sudo service acpid restart


  • Jump to the Testing section (d) to confirm that it works.


c-2. Mic-mute with official Mic-mute Indicator Light



Setting up the script




  • Please do not use this method if you are not familiar with the terminal/shell.

  • This will require compiling a patched thinkpad_acpi module and has been verified to work with Ubuntu Precise 12.04 and Quantal 12.10, kernels 3.2.0-23 and 3.2.0-24 and 3.5.0-21.

  • Let's create the script first: /etc/acpi/lenovo-mutemic.sh should be as in section c-1, with the following additions:



  • Insert this line after the header (#!/bin/bash):



    MICMUTE=/sys/devices/platform/thinkpad_acpi/leds/tpacpi::micmute/brightness



  • After the first echo... line, insert:



    echo 1 > $MICMUTE



  • And after the second echo... line, insert:



    echo 0 > $MICMUTE


  • You can find an example of what the full script should look like in this paste



  • Then:



    sudo chmod +x /etc/acpi/lenovo-mutemic.sh
    sudo service acpid restart


  • Confirm that pressing the mute button results in a blinking power light; pressing again gives a steady power light.



Building, testing and installing the kernel module





  • Install (or ensure) you have the headers and built tools for your currently running kernel with:



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



  • Make a temporary directory and change to it:



    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",nt"tpacpi::unknown_led4",nt"tpacpi::micmute",/g' -e 's/0x1081U/0x5081U/g' -e 's/0x1fffU/0x5fffU/g' thinkpad_acpi.c



  • In the same folder where thinkpad_acpi.c has been downloaded, you will need a "Makefile". You can download it directly from this Pastebin, using:



    wget -OMakefile http://pastebin.com/raw.php?i=ybpnxeUT


    OR paste the below into a file called Makefile:




    obj-m += thinkpad_acpi.o

    all:
    make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules

    clean:
    make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean


  • Now type make to create the module; you will see a thinkpad_acpi.ko file in the folder when done.



  • Test the patched module after loading it with:



    sudo rmmod thinkpad_acpi && sudo insmod thinkpad_acpi.ko


  • Now confirm that pressing the mic button will turn the orange mic light on/off AND the power light blinking/steady.



  • If confirmed, do the following to replace your current thinkpad_acpi module:




    TPDIR=/lib/modules/$(uname -r)/kernel/drivers/platform/x86
    sudo mv $TPDIR/thinkpad_acpi.ko $TPDIR/thinkpad_acpi.ko.stock
    sudo mv /where/you/built/it/tpacpi_micmute/thinkpad_acpi.ko $TPDIR/thinkpad_acpi.ko


  • Comment out or delete the power led lines in lenovo-micmute.sh





d. Testing




  • Apart from your choice of indicator, you can also confirm mute via the following:


Mic Input




  • Click on the volume icon on the top right, and sound settings at the bottom:

  • Switch to the "Input" tab.


  • Now have fun pressing the Mic Mute button, you should see it reflected in:




    1. The Mute checkbox in the window

    2. Notification bubbles (won't appear instantly if you press the Mic Mute more than once every few seconds!)

    3. Your chosen indicator: the blinking power button light or the built-in Mic Mute light.




Answer found on Enabling Mic Mute button and light on Lenovo Thinkpads






share|improve this answer















This solution should work for all Thinkpads with a mute button which also has a built-in light. It may also work for other Thinkpads.



Apart from the notification bubbles:



enter image description hereenter image description here



There are two possible "hardware" indicators (to show that mute is on or off):




  1. The Power button light (green) will blink to show when mute is on


  2. The Mic mute button light (orange) will be on or off to show mute status (just like in Windows)



    Solution 2 requires a patched thinkpad_acpi kernel module, and is only recommended for advanced users who know what they are doing. This is because the patch is not included by the thinkpad_acpi developers by default, (See this discussion for more details).




Common Steps





a. Determining the Mic-Mute hotkey code and Mic input device




  • Open terminal with Ctrl+Alt+T

  • Run acpi_listen, and press the mute key

  • Note the result, which should be something like:
    ibm/hotkey HKEY 00000080 0000101b


  • Then run amixer scontrols, you should see one of the following in the output:




Simple mixer control 'Internal Mic',0


or




Simple mixer control 'Capture',0


Depending on what you see, "Internal Mic" or "Capture" is your input device.



b. Create the Mic-Mute ACPI event handler




  • Open terminal, type gksudo gedit /etc/acpi/events/lenovo-mutemic to open the editor.

  • In the editor, paste in the following, where the first line should be the code shown in the previous section by acpi_listen:


    event=ibm/hotkey HKEY 00000080 0000101b
    action=/etc/acpi/lenovo-mutemic.sh


  • Save and exit the editor.




Choosing either the Power Light or Mic Mute indicators





c-1. Mic-Mute script with Power Button indicator




  • Do this if you want an easy solution and do not want to use the patched kernel module (see C-2).

  • Open terminal, type gksudo gedit /etc/acpi/lenovo-mutemic.sh


  • In the editor, paste:




    #!/bin/bash
    INPUT_DEVICE="'Internal Mic'"
    YOUR_USERNAME="place_your_username_here"
    if amixer sget $INPUT_DEVICE,0 | grep '[on]' ; then
    amixer sset $INPUT_DEVICE,0 toggle
    echo "0 blink" > /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 on" > /proc/acpi/ibm/led
    fi


  • Replace value of INPUT_DEVICE variable with Capture if that is your input device name (leave all the ticks intact).


  • Replace value of YOUR_USERNAME variable with the account name of the user you want to send notifications to

  • Save and exit the editor.

  • Now run the following (from the terminal):


    sudo chmod +x /etc/acpi/lenovo-mutemic.sh
    sudo service acpid restart


  • Jump to the Testing section (d) to confirm that it works.


c-2. Mic-mute with official Mic-mute Indicator Light



Setting up the script




  • Please do not use this method if you are not familiar with the terminal/shell.

  • This will require compiling a patched thinkpad_acpi module and has been verified to work with Ubuntu Precise 12.04 and Quantal 12.10, kernels 3.2.0-23 and 3.2.0-24 and 3.5.0-21.

  • Let's create the script first: /etc/acpi/lenovo-mutemic.sh should be as in section c-1, with the following additions:



  • Insert this line after the header (#!/bin/bash):



    MICMUTE=/sys/devices/platform/thinkpad_acpi/leds/tpacpi::micmute/brightness



  • After the first echo... line, insert:



    echo 1 > $MICMUTE



  • And after the second echo... line, insert:



    echo 0 > $MICMUTE


  • You can find an example of what the full script should look like in this paste



  • Then:



    sudo chmod +x /etc/acpi/lenovo-mutemic.sh
    sudo service acpid restart


  • Confirm that pressing the mute button results in a blinking power light; pressing again gives a steady power light.



Building, testing and installing the kernel module





  • Install (or ensure) you have the headers and built tools for your currently running kernel with:



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



  • Make a temporary directory and change to it:



    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",nt"tpacpi::unknown_led4",nt"tpacpi::micmute",/g' -e 's/0x1081U/0x5081U/g' -e 's/0x1fffU/0x5fffU/g' thinkpad_acpi.c



  • In the same folder where thinkpad_acpi.c has been downloaded, you will need a "Makefile". You can download it directly from this Pastebin, using:



    wget -OMakefile http://pastebin.com/raw.php?i=ybpnxeUT


    OR paste the below into a file called Makefile:




    obj-m += thinkpad_acpi.o

    all:
    make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules

    clean:
    make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean


  • Now type make to create the module; you will see a thinkpad_acpi.ko file in the folder when done.



  • Test the patched module after loading it with:



    sudo rmmod thinkpad_acpi && sudo insmod thinkpad_acpi.ko


  • Now confirm that pressing the mic button will turn the orange mic light on/off AND the power light blinking/steady.



  • If confirmed, do the following to replace your current thinkpad_acpi module:




    TPDIR=/lib/modules/$(uname -r)/kernel/drivers/platform/x86
    sudo mv $TPDIR/thinkpad_acpi.ko $TPDIR/thinkpad_acpi.ko.stock
    sudo mv /where/you/built/it/tpacpi_micmute/thinkpad_acpi.ko $TPDIR/thinkpad_acpi.ko


  • Comment out or delete the power led lines in lenovo-micmute.sh





d. Testing




  • Apart from your choice of indicator, you can also confirm mute via the following:


Mic Input




  • Click on the volume icon on the top right, and sound settings at the bottom:

  • Switch to the "Input" tab.


  • Now have fun pressing the Mic Mute button, you should see it reflected in:




    1. The Mute checkbox in the window

    2. Notification bubbles (won't appear instantly if you press the Mic Mute more than once every few seconds!)

    3. Your chosen indicator: the blinking power button light or the built-in Mic Mute light.




Answer found on Enabling Mic Mute button and light on Lenovo Thinkpads







share|improve this answer














share|improve this answer



share|improve this answer








edited Apr 13 '17 at 12:23









Community

1




1










answered Mar 11 '14 at 21:17









basketballbasketball

81214




81214













  • I've tried this solution. But after rebooting, it didn't work. I tried to do it again, but now acpi_listen doesn't output anything.

    – Quaxton Hale
    Mar 12 '14 at 0:10











  • edit - don't mind me

    – berbt
    Oct 12 '15 at 11:39





















  • I've tried this solution. But after rebooting, it didn't work. I tried to do it again, but now acpi_listen doesn't output anything.

    – Quaxton Hale
    Mar 12 '14 at 0:10











  • edit - don't mind me

    – berbt
    Oct 12 '15 at 11:39



















I've tried this solution. But after rebooting, it didn't work. I tried to do it again, but now acpi_listen doesn't output anything.

– Quaxton Hale
Mar 12 '14 at 0:10





I've tried this solution. But after rebooting, it didn't work. I tried to do it again, but now acpi_listen doesn't output anything.

– Quaxton Hale
Mar 12 '14 at 0:10













edit - don't mind me

– berbt
Oct 12 '15 at 11:39







edit - don't mind me

– berbt
Oct 12 '15 at 11:39




















draft saved

draft discarded




















































Thanks for contributing an answer to Ask Ubuntu!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f141162%2fhow-can-i-enable-microphone-mute-button-on-thinkpad-w520%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

數位音樂下載

When can things happen in Etherscan, such as the picture below?

格利澤436b