# Volume control with Fn keys



## Wrexxman (Jun 27, 2013)

Howdy,

I have been able to set[]up (and play) sound, but, I cannot control the volume with the Fn-cursor up and Fn-cursor down keys (Acer Aspire _O_ne netbook).

I have searched and added the following to my /boot/loader.conf:



```
acpi_asus_load="YES"
```
  (I know _asus_ and not _acer_, but cannot find a _acpi_acer_)


```
acpi_video_load="YES"
```
 (this activated some of the Fn keys)

Is there something I am missing?  I am using audio/mpg123 which has volume control, but I would prefer to do it from the keyboard.


----------



## fonz (Jun 27, 2013)

Wrexxman said:
			
		

> I cannot control the volume with the Fn-cursor up and Fn-cursor down keys (Acer Aspire _O_ne netbook).


I also have an Acer Aspire One netbook. Most of the Fn keys work out of the box, but the volume control keys apparently don't. It might be possible to get them to work with a bit of tinkering, but I wouldn't know how off the top of my head.


----------



## shepper (Jun 27, 2013)

It is likely that Fn + the up cursor generates XF86AudioRaiseVolume. You can check by running the X.org utility [cmd=]xev[/cmd] in a terminal.  Once you have the key code then you can bind that keycode to a command.

Binding a keycode is desktop specific. I use the following entry in ~/.config/openbox/rc.xml for openbox in OpenBSD.
The syntax for the mixer command is different in FreeBSD so do not copy this blindly.

```
<keybind key="XF86AudioRaiseVolume">
      <action name="Execute">
        <command>amixer set Master Front 5%+ unmute</command>
      </action>
    </keybind>
    <keybind key="XF86AudioLowerVolume">
      <action name="Execute">
        <command>amixer set Master Front 5%- unmute</command>
      </action>
    </keybind>
    <keybind key="XF86AudioMute">
      <action name="Execute">
        <command>amixer set Master Front toggle</command>
      </action>
    </keybind>
```

You should be able to "net' additional guidance specific to your desktop with the search containing your desktop name and "keybind".

You will also want to review the FreeBSD documentation in mixer()


----------



## Wrexxman (Jun 27, 2013)

@fonz - Thanks for the input, reassuring to read that I am not the only one.

@shepper - Thanks, but I do not have X._O_rg installed.  I am doing my best to keep this machine GUI free.


----------



## shepper (Jun 27, 2013)

> Thanks, but I do not have X.Org installed. I am doing my best to keep this machine GUI free



The above posts do not fully describe your goals but inferring that you want to play music mp3's you may want to look at musicpd with an mpd frontend like ncmpc.  Ncmpc is an ncurses front end that lets you manage your music collection (FLAC's, MP3's, OGG's) .  The default setup uses the - (minus) and + (plus) keys to change volume.

From the OpenBSD man page for ncmpc


> KEYS
> When ncmpc starts it tries to read user-defined key bindings from the
> ~/.ncmpc/keys file. If no user-defined key bindings are found then
> ncmpc tries to load the global key bindings from $SYSCONFDIR/ncmpc/keys
> ...


----------

