# sndioctl output.mute: no such control



## jjuel (Feb 12, 2021)

So I have a script that I used on OpenBSD with dwmblocks in order to display the volume in the DWM bar. It used sndioctl to check for mute and change an icon based on this. 

```
#!/bin/sh

set -A _vol "🔈" "🔉" "🔊"

_v=$(sndioctl -n output.level | awk '{ print int($0*100) '})
  [[ $(sndioctl -n output.mute) -eq 1 ]] \
    && echo -n "🔇 " \
    || echo -n "${_vol[$(($_v*3/101))]} "
  echo -n "$_v%"
```
But for some reason despite showing that it should be there in the man page it is not there. So just want to know why output.mute doesn't work when output.level does.

As a side note the mute button on the keyboard works as it should. However, volume up and down did not. I added a command for those keys in DWM with mixer. Unfortunately when the mixer volume level gets down to around 50% it is basically no sound. Just wondering if there is a better way to use the built in media keys. Thanks!


----------



## George (Feb 12, 2021)

I wouldn't bother with sndio(7), and just use mixer(8).
For some laptops there are special drivers that activate the function keys, e.g. acpi_ibm(4).

For me, `sndioctl` complains that there is no control device under /dev.


----------



## jjuel (Feb 13, 2021)

I have rewritten the script using mixer(). It works good. However, mixer doesn't seem to work great. Once it gets down to around 40% you really have to hold it up to your ear in order to hear anything. So strange.


----------

