LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Laptop and Netbook (https://www.linuxquestions.org/questions/linux-laptop-and-netbook-25/)
-   -   Mute volume on HP EliteBook 6930p using Linux Mint 17.3 (Cinnamon) (https://www.linuxquestions.org/questions/linux-laptop-and-netbook-25/mute-volume-on-hp-elitebook-6930p-using-linux-mint-17-3-cinnamon-4175561170/)

ilijagosp 12-10-2015 03:19 PM

Mute volume on HP EliteBook 6930p using Linux Mint 17.3 (Cinnamon)
 
Hello everyone, my first post here.

New to Linux Mint, but have been running linux periodically since the 2000s (RedHat, Slackware, Mandrake, Ubuntu etc).

I installed Mint to give it a go on my HP Elitebook 6930p, since I "upgraded" to Win10 2 weeks ago and was very frustrated. I don't like where Microsoft is going with desktop design and functionality, privacy issues notwithstanding.

My main issue is the "Mute" media keyboard button. On a cold start of the laptop, it works just fine. The led changes color to orange and the OSD shows on the screen with the volume muted. Volume up/down work fine.

After resume from sleep mode/suspend, the led color of the button changes, the sound is muted, it is just that this is not recognized by Cinnamon in the volume status icon or through OSD. Volume up/down buttons work fine, with OSD.

This happens exactly the same way on 17.2 and 17.3. As this is the most used media shortcut on my keyboard, please help me with some instructions on how to resolve this issue.

Thank you and have a good day.

joe_2000 12-10-2015 03:51 PM

Hi and welcome to LQ.

I keep having issues with volume / media keys - so usually I end up mapping custom shortcuts to commands that do what I need.
It's a bit of a workaround but the advantage is that the resulting solutions are usually portable between different machines.

So if you want to go that direction, step one is to find the command that mutes / unmutes your sound.

On my machine, the following works:
Code:

amixer set Master toggle
If it says something along the lines "amixer: command not found" you'll have to install amixer first, I think it is part of alsa-utils on Ubuntu / Mint.
If then it still does not work you might have to put something else instead of "Master". Just type
Code:

amixer
and see what output you get. On my machine I get this (the names of each control are given in single quotes):

Code:

$ amixer
Simple mixer control 'Master',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback 0 - 64
  Mono: Playback 52 [81%] [-12.00dB] [on]
Simple mixer control 'Headphone',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 64
  Mono:
  Front Left: Playback 52 [81%] [-12.00dB] [on]
  Front Right: Playback 52 [81%] [-12.00dB] [on]
Simple mixer control 'Speaker',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 64
  Mono:
  Front Left: Playback 64 [100%] [0.00dB] [on]
  Front Right: Playback 64 [100%] [0.00dB] [on]
Simple mixer control 'Bass Speaker',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 64
  Mono:
  Front Left: Playback 64 [100%] [0.00dB] [on]
  Front Right: Playback 64 [100%] [0.00dB] [on]
Simple mixer control 'PCM',0
  Capabilities: pvolume
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 255
  Mono:
  Front Left: Playback 255 [100%] [0.00dB]
  Front Right: Playback 255 [100%] [0.00dB]
Simple mixer control 'Mic',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 31
  Mono:
  Front Left: Playback 0 [0%] [-34.50dB] [off]
  Front Right: Playback 0 [0%] [-34.50dB] [off]
Simple mixer control 'Mic Boost',0
  Capabilities: volume
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 3
  Front Left: 0 [0%] [0.00dB]
  Front Right: 0 [0%] [0.00dB]
Simple mixer control 'IEC958',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [off]
Simple mixer control 'IEC958 Default PCM',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'Capture',0
  Capabilities: cvolume cswitch
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 31
  Front Left: Capture 0 [0%] [-16.50dB] [off]
  Front Right: Capture 0 [0%] [-16.50dB] [off]
Simple mixer control 'Auto-Mute Mode',0
  Capabilities: enum
  Items: 'Disabled' 'Enabled'
  Item0: 'Enabled'
Simple mixer control 'Digital',0
  Capabilities: cvolume
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 120
  Front Left: Capture 60 [50%]
  Front Right: Capture 60 [50%]
Simple mixer control 'Internal Mic',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 31
  Mono:
  Front Left: Playback 0 [0%] [-34.50dB] [off]
  Front Right: Playback 0 [0%] [-34.50dB] [off]
Simple mixer control 'Internal Mic Boost',0
  Capabilities: volume
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 3
  Front Left: 0 [0%] [0.00dB]
  Front Right: 0 [0%] [0.00dB]

If this works for you, too (even after suspend/resume) all you need to do is choose a shortcut that you want to use for mute/unmute and map it to a script that calls this command. The script could look like this:
Code:

#!/bin/bash
amixer set Master toggle

Do not forget to make it executable with
Code:

chmod +x /path/to/script.sh
As far as choosing the shortcut is concerned: if the Fn keys give me trouble I typically resolve to the windows key + the F-key that has the relevant symbol on it. How to assign the shortcut varies between desktop environments, I think in Cinnamon it's somewhere in the "keyboard" menu.

ilijagosp 12-11-2015 02:30 AM

I truly thank you for the detailed reply.

As the mute button functionally works even after suspend, I would not go into mapping a different shortcut. I would like to resolve this by somehow answering why Cinnamon does not _visually_ recognize the mute command (in statusbar or OSD), while the sound still gets muted/unmuted as I press the button. The action mute/unmute is recognized by Mint/Cinnamon, it is just not visually shown.

As it is working without any issue after a cold start, I would say that only some process within Cinnamon has a problem after resume from suspend. Maybe discover which process it is, and make a script to restart it after resume?

If this is not possible for reasons not known to me, I would probably leave it as-is.

Best regards.

BW-userx 12-18-2015 07:48 AM

I've got an Elightbook 6930p (using it right now) but I got Void Linux on it, I don't much bother with all of them lights touch buttons, I'd rather they where a real button, but I picked this up at a pawnshop for under a 100$- though too I am using i3 WM and just use my little VOL applet on the bar to turn it up or down and ear plugs, not that this has anything to do with your problem, just that I seen someone else with the same LapTop as me, wow. and it is now being used as a linux box wow wow, kelw ;)


All times are GMT -5. The time now is 01:14 AM.