Wednesday, April 11, 2012

Adjust sound volume in FreeBSD

I just managed to get FreeBSD 9.0-RELEASE working very well on my old Dell E520, including 3D effects, emerald window decoration, conky and cairo-dock.
Looks very well and I'll post about this soon, particularly as I went through quite some trials and tribulations to get everything working well.

One unexpected difficulty was the sound volume when playing Last.Fm.
Well, I could hear it comfortably enough when the volume slider in the gnome-panel was at max. But, it was just about enough and I wanted more flexibility.

As is normal, the FreeBSD handbook has extensive detail on setting up a sound card. However, very little is provided on how to rectify a low sound volume problem.
The secret is to use the mixer command in your terminal.

Use mixer to check the setting for all sound devices. Here's what I got on the E520

$ mixer
Mixer vol      is currently set to  97:97
Mixer pcm      is currently set to  80:80
Mixer speaker  is currently set to  75:75
Mixer rec      is currently set to  75:75
Recording source: mic

To increase, for example, the pcm output, use the -s switch like this:

$ mixer -s pcm 100

This gave me just what I was looking for.
Incidentally, I also tried the /boot/device.hints hack suggested in section 8.2.4 of the Handbook, but this did nothing for me.
Indeed, if I set hint.pcm.0.vol="100" and added this to /boot/device.hints, and rebooted, mixer still showed pcm as 75:75

No comments:

Post a Comment