Sound and multimedia keys on FreeBSD May 26, 2009
Posted by tkjacobsen in FreeBSD.Tags: FreeBSD, x11, xorg
trackback
This post is part of the series: FreeBSD on my laptop
This on is pretty easy. Basically I just had to load the driver. This is done permanently by adding:
snd_hda_load="YES"
to /boot/loader.conf.
In kde the phonon framework locks the sound channel. Thus I enable 4 channels in total, so I can also get sound from non-kde apps like firefox/flash and virtualbox. This is done with the following lines in /etc/sysctl.conf
dev.pcm.0.play.vchans=4
dev.pcm.0.rec.vchans=4
To enable the multimedia keys (mute, volume up, volume down) I had to define the correct mapping for X. This is done with the following commands:
xmodmap -e 'keycode 140 = XF86AudioMute'
xmodmap -e 'keycode 176 = XF86AudioRaiseVolume'
xmodmap -e 'keycode 174 = XF86AudioLowerVolume'
I added this to a (executable) script in ~/.kde4/Autostart. Another possiblity is to add it to .xprofile or something. The actual keycodes have been found using xev: just open it in a terminal and start pressing keys. It will then tell you the keycodes.
Resources:
The FreeBSD Handbook, 7.2 Setting Up the Sound Card
[...] Sound and multimedia keys [...]