Using Sound on FreeBSD
by Dru Lavigne09/19/2002
In today's article, I'd like to continue configuring a multimedia workstation by concentrating on sound. First, I'll quickly demonstrate how to get sound working, then I'll move on to some of the sound-related ports in the ports collection.
If you haven't read the multimedia section of the FreeBSD handbook lately, you'll be pleasantly surprised. It has been totally revamped and is definitely the first place to go to see if your sound card is supported, and if so, how to get it working under FreeBSD.
My system has a SoundBlaster PCI 128, so I simply need to add the pcm
device to my kernel configuration file in order to enable that soundcard.
Since I also plan on using a DVD player, I'll include the option to
optimize the CPU for multimedia applications. Multimedia applications also
use something known as LDT, which may or may not already be in your kernel
configuration file; if it isn't, add it. These are the three lines I added
to my kernel configuration file:
options CPU_ENABLE_SSE #used by DVD
options USER_LDT #used by many apps
device pcm #used by SoundBlaster
I then rebuilt my kernel using the instructions found at http://www.freebsd.org/handbook/kernelconfig-building.html.
There are several sysctl values that can be tweaked to improve
multimedia performance. Two of them are read-only, meaning that you must
place these values in the file /boot/loader.conf, like so:
hw.ata.atapi_dma="1"
hw.ata.ata_dma="1"
The other four values are placed in the file /etc/sysctl.conf. Note that, unlike the previous file, you don't use quotations around the values in this file:
kern.ipc.shmmax=67108864
kern.ipc.shmall=32768
hw.snd.pcm0.vchans=4
hw.snd.maxautovchans=4
If your soundcard doesn't use the pcm device, don't include that third
sysctl value dealing with pcm0. If you use pcm1 instead of pcm0, change the 0 to a 1 when you add that sysctl value. Also note that you will need to reboot in order for all of your changes to take effect.
The first time I rebooted into my new kernel, I noticed something odd when I tried to mount a data CD-ROM: I kept getting this error message:
cd9660: /dev/acd0c: Device not configured
Normally, this error message indicates that there isn't a data CD in the
CD-ROM bay. Since this wasn't the case, a search through the mailing lists
revealed that this also occurs if you use cvsup to upgrade from FreeBSD
4.5 to 4.6, which I had. To update the necessary device drivers, I
became the superuser and:
cd /dev
cp /usr/src/etc/MAKEDEV .
rm acd*
./MAKEDEV acd0
While I'm in this directory, I'll also change the permissions to the CD-ROM device file, so I'll be able to play audio CD-ROMs as a regular user, instead of having to become the superuser:
chmod 666 /dev/acd0c
Now I can start building some sound applications. I've tried most of the
applications in the audio section of the ports collection, and I can
honestly say that you'll be hard pressed to find a sweeter sound-playing
utility than xmms. It is skinnable, even though it looks great by
default; it has dozens of audio, visualization, and other plugins; it
plays MP3s, MPEGs, WAVs, and Shoutcast, as well as CDs, and supports the use of
CDDB servers. Thorough documentation of how to use its features can be
found at www.xmms.org, along with screenshots, plugins, and skins.
To install this utility:
cd /usr/ports/audio/xmms
make install clean
I also installed all of the available plugins from the ports collection.
Since there are several dozen, I'll list where they are located in
the ports collection, along with a brief description and where they can
be configured in xmms:
-----
These plugins, once installed, can be configured in the Audio I/O Plugins tab of Preferences:
/usr/ports/audio/xmms-a52dec #a52/a53 decoder
/usr/ports/audio/xmms-bonk #plays bonk files
/usr/ports/audio/xmms-crossfade #allows crossfading
/usr/ports/audio/xmms-fc #future composer input
/usr/ports/audio/xmms-mad #uses libmad
/usr/ports/audio/xmms-musepack #mpegplus
/usr/ports/audio/xmms-osssurround #surround sound
/usr/ports/audio/xmms-shn #shorten compressed audio
/usr/ports/audio/xmms-sid #plays sid files
/usr/ports/graphics/smpeg-xmms #mpeg video support
/usr/ports/audio/xmms-sndfile #libsndfile files
/usr/ports/audio/xmms-tfmx #plays tfmx tunes
These plugins, once installed, can be configured in the Effect/General Plugins tab of Preferences:
/usr/ports/x11-clocks/xmms-alarm #alarm
/usr/ports/audio/xmms-crystality #remasters mp3 sound
/usr/ports/audio/xmms-ladspa #provides ladspa
/usr/ports/audio/xmms-liveice #icecast streaming audio
/usr/ports/audio/xmms-pipe #named pipe control
/usr/ports/audio/xmms-quix3dn #3-d sound effect
/usr/ports/audio/xmms-sndstretch #change pitch or speed
/usr/ports/audio/xmms-volnorm #volume normalizer
These plugins, once installed, can be configured in the Visualization Plugins tab of Preferences:
/usr/ports/graphics/xmms-blursk #blur scope
/usr/ports/graphics/xmms-finespectrum #fine grain spectrum
/usr/ports/graphics/xmms-gforce #music visualization
/usr/ports/graphics/xmms-goom #cool music visualization
/usr/ports/graphics/xmms-infinity #full screen interactive
/usr/ports/graphics/xmms-jess #awesome music visualization
/usr/ports/graphics/xmms-paranormal #spectrum analyzer
-----
Pages: 1, 2 |