SOLVED How do I set a hotkey for toggling the microphone on/off?

Forum rules
Before you post please read how to get help
jamesd1
Level 3
Level 3
Posts: 127
Joined: Fri Jul 06, 2018 3:00 pm

SOLVED How do I set a hotkey for toggling the microphone on/off?

Post by jamesd1 » Thu May 23, 2019 1:10 pm

How do I set a hotkey for toggling the microphone on/off either naively or with autokey?
Last edited by jamesd1 on Fri May 24, 2019 8:50 am, edited 1 time in total.
Thanks,

James

Linux Mint 19.1 MATE, Tessa

gm10
Level 19
Level 19
Posts: 9271
Joined: Thu Jun 21, 2018 5:11 pm

Re: How do I set a hotkey for toggling the microphone on/off?

Post by gm10 » Thu May 23, 2019 4:08 pm

Mint menu > Keyboard shortcuts

(come on, that couldn't have been hard to find...)

jamesd1
Level 3
Level 3
Posts: 127
Joined: Fri Jul 06, 2018 3:00 pm

Re: How do I set a hotkey for toggling the microphone on/off?

Post by jamesd1 » Thu May 23, 2019 4:53 pm

Thanks but I went through the shortcuts and while there is a toggle for the speaker, I saw no toggle for microphone.
The microphone icon only appears when voice input is in use and you can mute it with mouse but don't see any key control.
Thanks,

James

Linux Mint 19.1 MATE, Tessa

gm10
Level 19
Level 19
Posts: 9271
Joined: Thu Jun 21, 2018 5:11 pm

Re: How do I set a hotkey for toggling the microphone on/off?

Post by gm10 » Thu May 23, 2019 5:31 pm

Microphone is the 7th option from the top. At least in MATE 1.23, count may differ on yours.

jamesd1
Level 3
Level 3
Posts: 127
Joined: Fri Jul 06, 2018 3:00 pm

Re: How do I set a hotkey for toggling the microphone on/off?

Post by jamesd1 » Thu May 23, 2019 5:53 pm

in Desktop: MATE 1.20.1 Distro: Linux Mint 19.1 Tessa there are 10 items under "Sound" the 7th is not microphone and I see no mic listed.
Thanks,

James

Linux Mint 19.1 MATE, Tessa

gm10
Level 19
Level 19
Posts: 9271
Joined: Thu Jun 21, 2018 5:11 pm

Re: How do I set a hotkey for toggling the microphone on/off?

Post by gm10 » Thu May 23, 2019 5:55 pm

You don't have this?
mike.png

jamesd1
Level 3
Level 3
Posts: 127
Joined: Fri Jul 06, 2018 3:00 pm

Re: How do I set a hotkey for toggling the microphone on/off?

Post by jamesd1 » Thu May 23, 2019 6:11 pm

No, mine only has 10 entries and no microphone.

Was going to paste in a screen shot but don't see how to. How do you do that or was that a url image?
Thanks,

James

Linux Mint 19.1 MATE, Tessa

gm10
Level 19
Level 19
Posts: 9271
Joined: Thu Jun 21, 2018 5:11 pm

Re: How do I set a hotkey for toggling the microphone on/off?

Post by gm10 » Thu May 23, 2019 6:42 pm

My bad, I didn't realize Mint doesn't have the feature. Apparently the earliest version that has it is MATE 1.21.2: https://github.com/mate-desktop/mate-se ... 84f7d64a75

Instead you can create a custom shortcut with this command:

Code: Select all

amixer set Capture toggle
Not as nice as the MATE 1.21.2+ built-in feature because no media keys support and no OSD but you still got the icon to see when it's muted.

jamesd1
Level 3
Level 3
Posts: 127
Joined: Fri Jul 06, 2018 3:00 pm

Re: How do I set a hotkey for toggling the microphone on/off?

Post by jamesd1 » Thu May 23, 2019 7:36 pm

The command gave:

james@james-desktop:~$ amixer set Capture toggle
Simple mixer control 'Capture',0
Capabilities: cvolume cswitch
Capture channels: Front Left - Front Right
Limits: Capture 0 - 31
Front Left: Capture 17 [55%] [12.00dB] [off]
Front Right: Capture 17 [55%] [12.00dB] [off]
james@james-desktop:~$
Thanks,

James

Linux Mint 19.1 MATE, Tessa

User avatar
MrEen
Level 14
Level 14
Posts: 5110
Joined: Mon Jun 12, 2017 8:39 pm

Re: How do I set a hotkey for toggling the microphone on/off?

Post by MrEen » Thu May 23, 2019 8:04 pm

If you run it again, you should see this:

Code: Select all

Simple mixer control 'Capture',0
Capabilities: cvolume cswitch
Capture channels: Front Left - Front Right
Limits: Capture 0 - 31
Front Left: Capture 17 [55%] [12.00dB] [on]
Front Right: Capture 17 [55%] [12.00dB] [on]

jamesd1
Level 3
Level 3
Posts: 127
Joined: Fri Jul 06, 2018 3:00 pm

Re: How do I set a hotkey for toggling the microphone on/off?

Post by jamesd1 » Thu May 23, 2019 8:14 pm

Yes, I see that. But what do I enter to toggle the microphone? :) :)
Thanks,

James

Linux Mint 19.1 MATE, Tessa

gm10
Level 19
Level 19
Posts: 9271
Joined: Thu Jun 21, 2018 5:11 pm

Re: How do I set a hotkey for toggling the microphone on/off?

Post by gm10 » Thu May 23, 2019 8:16 pm

jamesd1 wrote:
Thu May 23, 2019 8:14 pm
Yes, I see that. But what do I enter to toggle the microphone? :) :)
That command, that's why I gave it to you. Duh! :P

jamesd1
Level 3
Level 3
Posts: 127
Joined: Fri Jul 06, 2018 3:00 pm

Re: How do I set a hotkey for toggling the microphone on/off?

Post by jamesd1 » Thu May 23, 2019 8:18 pm

The command:

amixer set Capture toggle

Does not itself toggle the mic; it just lists info that does not tell me what to enter to toggle the mic.

So how do I toggle it?
Thanks,

James

Linux Mint 19.1 MATE, Tessa

jamesd1
Level 3
Level 3
Posts: 127
Joined: Fri Jul 06, 2018 3:00 pm

Re: How do I set a hotkey for toggling the microphone on/off?

Post by jamesd1 » Thu May 23, 2019 8:21 pm

I Googled "amixer set Capture toggle" and 15 minutes later was no wiser.

I Googled this form with "amixer set Capture toggle" and was also no wiser.

Linux is a tougher road than nerds like to think. :)
Thanks,

James

Linux Mint 19.1 MATE, Tessa

User avatar
MrEen
Level 14
Level 14
Posts: 5110
Joined: Mon Jun 12, 2017 8:39 pm

Re: How do I set a hotkey for toggling the microphone on/off?

Post by MrEen » Thu May 23, 2019 8:29 pm

When it reports:

Code: Select all

Simple mixer control 'Capture',0
Capabilities: cvolume cswitch
Capture channels: Front Left - Front Right
Limits: Capture 0 - 31
Front Left: Capture 17 [55%] [12.00dB] [off]
Front Right: Capture 17 [55%] [12.00dB] [off]
Your mic is off. (Correction: your mic is muted. Not necessarily the same as off.)

If you try to record something, you'll notice a lack of sound in the recording.

jamesd1
Level 3
Level 3
Posts: 127
Joined: Fri Jul 06, 2018 3:00 pm

Re: How do I set a hotkey for toggling the microphone on/off?

Post by jamesd1 » Thu May 23, 2019 8:40 pm

I'm not trying to toggle the audio output.
I'm trying to toggle the audio input that shows in the Panel as a Microphone with or without a line through it according to its status.

The command you gave does not change mute unmute status of the microphone nor does it affect my sound output.

Thanks for your help.
Thanks,

James

Linux Mint 19.1 MATE, Tessa

User avatar
MrEen
Level 14
Level 14
Posts: 5110
Joined: Mon Jun 12, 2017 8:39 pm

Re: How do I set a hotkey for toggling the microphone on/off?

Post by MrEen » Thu May 23, 2019 8:45 pm

Capture is input, not output. I'm not sure about the strike-though icon though.

I just tested this. On pavucontrol's Input Devices tab the icon for mute shows the appropriate setting when I toggle in the terminal.

Maybe your mic is on another sound card that also has a Capture control, in which case you'd need this:

Code: Select all

amixer -c# set Capture toggle
Replace # with the number of the sound card as shown with arecord -l

gm10
Level 19
Level 19
Posts: 9271
Joined: Thu Jun 21, 2018 5:11 pm

Re: How do I set a hotkey for toggling the microphone on/off?

Post by gm10 » Thu May 23, 2019 8:56 pm

Well, the command works for me, icon and all. It's the command for controlling the ALSA sound system's default input device. If you're using some other input driver then refer to the documentation of that for I cannot help you with that.

User avatar
MrEen
Level 14
Level 14
Posts: 5110
Joined: Mon Jun 12, 2017 8:39 pm

Re: How do I set a hotkey for toggling the microphone on/off?

Post by MrEen » Thu May 23, 2019 9:08 pm

gm10 wrote:
Thu May 23, 2019 8:56 pm
Well, the command works for me, icon and all. It's the command for controlling the ALSA sound system's default input device. If you're using some other input driver then refer to the documentation of that for I cannot help you with that.
I believe it is supposed to act on the default card, but in my case (still on 18.3, so 2016 versions of most software) I have to specify -c2 for my (default) card #2 mixer controls. HDMI is card #0, and that I can understand, but loopback is #1 and I never bothered to configure that otherwise.

jamesd1
Level 3
Level 3
Posts: 127
Joined: Fri Jul 06, 2018 3:00 pm

Re: How do I set a hotkey for toggling the microphone on/off?

Post by jamesd1 » Thu May 23, 2019 9:47 pm

Under hardware/sound I found:
Choose a device for sound input:
© AK5370 I/F A/D Converter Analog Mono
©) Built-in Audio Analog Stereo

The above has a radio box that toggles the Microphone

--------------------------

Still don't know what to do.

I tried
amixer -c3 set Capture toggle

with numbers 1 to 3 and all gave:

Unable to find simple control 'Capture',0

and with zero it gives:

james@james-desktop:~$ amixer -c0 set Capture toggle
Simple mixer control 'Capture',0
Capabilities: cvolume cswitch
Capture channels: Front Left - Front Right
Limits: Capture 0 - 31
Front Left: Capture 17 [55%] [12.00dB] [on]
Front Right: Capture 17 [55%] [12.00dB] [on]
james@james-desktop:~$ ^C
james@james-desktop:~$
Last edited by jamesd1 on Thu May 23, 2019 10:06 pm, edited 2 times in total.
Thanks,

James

Linux Mint 19.1 MATE, Tessa

Post Reply

Return to “MATE”