0

Laptop: HP Envy 15
OS: Ubuntu 22.04 LTS

The mic mute key of the laptop doesn't work, but other media/function keys work, e.g. brightness up/down, speaker mute, volume up/down, previous/next, play/pause. I used evtest to see if the key-press detected and found out that some keys don't emit EV_KEY but some of them keeps working although no EV_KEY is emitted.

This is the output of evtest, I add some comments to show what key is pressed.

Event: time 1664250299.376050, type 17 (EV_LED), code 0 (LED_NUML), value 0

Brightness down, works.

Event: time 1664250299.376050, type 4 (EV_MSC), code 4 (MSC_SCAN), value ab Event: time 1664250299.376050, -------------- SYN_REPORT ------------ Event: time 1664250299.429235, type 4 (EV_MSC), code 4 (MSC_SCAN), value ab Event: time 1664250299.429235, -------------- SYN_REPORT ------------

Brightness up, works.

Event: time 1664250303.397435, type 4 (EV_MSC), code 4 (MSC_SCAN), value ab Event: time 1664250303.397435, -------------- SYN_REPORT ------------ Event: time 1664250303.462580, type 4 (EV_MSC), code 4 (MSC_SCAN), value ab Event: time 1664250303.462580, -------------- SYN_REPORT ------------

Speaker mute, works.

Event: time 1664250308.917516, type 4 (EV_MSC), code 4 (MSC_SCAN), value a0 Event: time 1664250308.917516, type 1 (EV_KEY), code 113 (KEY_MUTE), value 1 Event: time 1664250308.917516, -------------- SYN_REPORT ------------ Event: time 1664250308.971993, type 4 (EV_MSC), code 4 (MSC_SCAN), value a0 Event: time 1664250308.971993, type 1 (EV_KEY), code 113 (KEY_MUTE), value 0 Event: time 1664250308.971993, -------------- SYN_REPORT ------------

Mic mute, doesn't work.

Event: time 1664250331.832285, type 4 (EV_MSC), code 4 (MSC_SCAN), value 82 Event: time 1664250331.832285, -------------- SYN_REPORT ------------ Event: time 1664250331.917810, type 4 (EV_MSC), code 4 (MSC_SCAN), value 82 Event: time 1664250331.917810, -------------- SYN_REPORT ------------ Event: time 1664250331.922914, type 4 (EV_MSC), code 4 (MSC_SCAN), value 58 Event: time 1664250331.922914, -------------- SYN_REPORT ------------

Some QAs/threads say that media keys that don't work is probably driver-related problem. However, I hope there's some workaround to solve this, since the key-press event is still detectable. Please help me getting the mic mute key working.

What I've done so far

/etc/udev/hwdb.d/some-name.hwdb:

# Doesn't work.
evdev:name:AT Translated Set 2 keyboard:*
 ID_INPUT_KEY=1
 KEYBOARD_KEY_82=key_micmute

Doesn't work.

evdev:name:AT Translated Set 2 keyboard:* KEYBOARD_KEY_82=f20

fikr4n
  • 1,255
  • Did you try an external keyboard to rule out that the laptop one is defective? Did you try booting from Live Media and using Try Ubuntu to see if it is still an issue? – David Sep 27 '22 at 06:46

1 Answers1

0

Ok, so I can propose an alternative instead of a solution because i am facing the same problem in my HP Probook 640 G8.

I essentially wrote a shell script and made my own hotkey to mute/unmute the mic, now if you get no other solutions, you can try this one.

I mapped the script to F8 which is same as the mute function on my laptop. But keep in mind that you have to press F8 and not the function key, so to mute via this method, you have to press the Fn key with F8 key or turn on Fn lock.

  • Step 1:

Open any text editor and paste this code

#!/bin/bash
amixer set Capture toggle

if amixer get Capture | grep 'off'; then icon="audio-input-microphone-muted-symbolic" notify-send --hint=int:transient:1 -i $icon "Mic switched: off" else icon="audio-input-microphone-symbolic" notify-send --hint=int:transient:1 -i $icon "Mic switched: on" fi

Save the file as mute.sh

  • Step 2:

Navigate to the file in file manager.

Right-Click and select Open with Terminal.

Paste this command and press Enter:

sudo chmod +x mute.sh
  • Step 3:

Open Settings and go to Keyboard Shortcuts

Add a new shortcut, you can use any combination, I used F8.

Paste the path to the file in the command field. Save and Done.

Keyboard shortcut

  • Thanks, but I've done a simpler method than that by simply adding a shortcut in Settings > Keyboard > Keyboard Shortcuts > Sound and Media > Microphone mute/unmute, without additional script. However my question is not about it. – fikr4n Sep 27 '22 at 07:53
  • I didn't knew that shortcut was available, Thanks! – Anantpatel Sep 27 '22 at 08:58