# How to mute/unmute the master volume?



## sHagen (Oct 16, 2018)

Hello,

I feel a little bad for asking this here, but after reading various man pages and searching the web, maybe my question is not all too stupid.

How can I mute and unmute the master volume?

I'm looking for something like:

  # mixer vol mute
  # mixer vol unmute
  # mixer vol toggle

I can "fake mute" by setting "mixer vol 0", but then I can't restore the volume to the level it had before.
I'm currently on 11.2-RELEASE.

I want to use this in a script which should work hardware independent. Therefore I'm looking for a CLI solution that works with base tools.

Any idea if this is possible?

Best Regards,
Stefan

EDIT: Before someone tells me - yes I can solve this via script by saving and restoring the current volume. This is what I will do when there is no better solution.


----------



## aragats (Oct 17, 2018)

I couldn't find a solution either.
I ended up with a script which toggles *mixer pcm* between 0 and 100 and keeps the current *mixer vol*.
Thus I don't have to store the volume explicitly.


----------

