jump to navigation

Sound and multimedia keys on FreeBSD May 26, 2009

Posted by tkjacobsen in FreeBSD.
Tags: , ,
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

Advertisement

Comments»

1. FreeBSD on my laptop « Troels Kofoed Jacobsen’s blog - July 5, 2009

[...] Sound and multimedia keys [...]


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.