BSD DevCenter
oreilly.comSafari Books Online.Conferences.

advertisement


Using Sound on FreeBSD
Pages: 1, 2



As of the writing of this article, all of the xmms-related ports installed flawlessly, with the following exceptions:

  • /usr/ports/graphics/xmms-avi is currently marked as broken with a fix being worked on by the maintainer.

  • /usr/ports/graphics/xmms-xvs gave me a libxml error.

  • The source for /usr/ports/misc/xosd no longer appears to be available.

  • I was able to install /usr/ports/graphics/xmms-iris but it killed xmms whenever I tried to enable the iris plugin.

  • I was able to install both /usr/ports/graphics/xmms-fishmatic and /usr/ports/audio/xmms-gdancer, but neither showed any fishies or dancing comic book heroes. If you've had success with either port, email me the necessary magic and I'll include it in the next article.

  • Finally, I didn't bother installing /usr/ports/audio/xmms-kde, as it is for KDE2 and I'm using KDE3. Besides, I prefer to add shortcuts directly to my panel rather than using the KDE menu.

Now, let's take a quick tour of xmms. Instead of repeating the basic usage that is already well-documented at the xmms Web site, I'll instead give some first-hand tips to get you started. I'll assume that your CD-ROM and sound card are installed properly and that you were successful in getting FreeBSD to recognize your particular sound card.

Let's start with a music CD-ROM. From your Window Manager, start xmms and press Ctrl-P to bring up the Preferences screen. You'll note the various plugins tabs that I referred to earlier, and you'll recognize the plugins that you chose to install from the ports collection.

Related Reading

Unix Power Tools
By Shelley Powers, Jerry Peek, Tim O'Reilly, Mike Loukides

In the Audio I/O Plugins tab, click on CD Audio Player, then the Configure button. Under the Device tab, ensure your device is set to /dev/acd0c and the directory to /cdrom. Then, click on the CD Info tab if you would like to configure a CDDB server. CDDB servers are great, as they contain information regarding audio CDs, such as the names of the CD and artist, and the names of the songs on the CD. However, they do require you to be attached to the Internet when you first load an audio CD so that you can download that information. If you'd like that feature, click on Use CDDB and type in the name of your favorite CDDB server in the CDDB server type-in section. I use freedb.freedb.org.

Save your changes, insert an audio CD into your CD_ROM drive, and wait for the light to stop flashing. Then, click on the eject icon in xmms. Instead of ejecting the CD, xmms will give you a pop-up window, where you can choose which files to load. Navigate to /cdrom and you should see all of the CD's tracks in the file section. (If you don't, you probably forgot to change the permissions on /dev/acd0c.) Click on "Add all files in directory." If you chose to use a CDDB server and this is the first time you've played this CD, be patient; it takes a minute or two to download the details. Once the files are added, click on Close and you should see the name of each track in your Playlist. If you don't see a Playlist, click on the PL button to open up the Playlist window. If the various xmms icons for playing, stopping, and moving through the tracks aren't intuitive to you, spend a bit of time at www.xmms.org/documentation.html to familiarize yourself with the available features.

The xmms utility can play more than CDs. I tend to have eclectic music tastes, which means the CDs I like are rarely in stock in my community. Fortunately, the Internet is a great resource for discovering new artists. How else would I have known that I enjoy Jewish reggae, Middle Eastern pop, East Indian blues, electronica remixes of the classics, and even the occasional gothic rock? My spare time is usually spent finding and listening to new MP3s, so I always have a list of CDs to order when I visit my favorite music shop.

I use Mozilla, and since I have already installed the plugger port (see previous article), I simply have to click on the "play" hyperlink when I find an interesting MP3 on the Internet. You can also tell Mozilla to use xmms to play MP3s by going to Mozilla's Edit menu -> Preferences -> Helper Applications -> New Type. Type in "mp3" in the first three fields and "/usr/X11R6/bin/xmms" in the "Application to use" field.

In my home directory, I've created a directory called mp3s to store the MP3s I'd like to listen to while my CDs are on order. To tell xmms to play these mp3s, I press Shift-L and double-click on the directory where the MP3s are stored.

If you've installed the xmms-liveice plugin, you can also listen to Shoutcast. Head over to www.shoutcast.com, find something interesting, and click on the Tune In! button. When your browser asks you what to do with this type of file, choose to "Open using an application" and use /usr/X11R6/bin/xmms. When you get tired of listening, use the stop icon on xmms. If you don't want to be asked every time, go into Mozilla's Preferences -> Helper Applications -> New Type. Give the type a description, a file extension of "pls", a MIME type of "audio/x-scpls" and the application to use, "/usr/X11R6/bin/xmms." Hmmm, I may never need to turn on a radio again.

You'll find more stations at www.icecast.org. Most of these stations use a different MIME type, so go back into Helper Applications. This time, use an extension of "mpu" and a MIME type of "audio/x-mpegurl." I've had less luck with this MIME type; some stations come in fine, some sound like chipmunks on speed. If you know the workaround for this, let me know and I'll include it in the next article.

If you like to be visually entertained while listening to music, press Ctrl-P to open up the Preferences and click on Visualization Plugins. Highlight one of the plugins you installed, then click on "Enable plugin". I liked xmms-jess the best, with xmms-goom a close second. If you get tired of being entertained, re-click the enable button to toggle off the plugin. I've found that my screen freezes if I try to enable more than two visualization plugins at once.

While we're on visualization, let's take a look at skins. The first time you ran xmms a skins directory called .xmms/Skins was created for you in your home directory. Head over to www.xmms.org/skins.html and if you see a skin you like, download it to your Skins directory. To apply the new skin, press Alt-S and highlight the new skin to get an instant preview.

I also found that www.spacefem.com/xmms.shtml had a very nice collection of skins. If you're into skins, you'll find that most of the skins on the Internet are advertised as Winamp skins. Don't let that deter you; save them to your Skins directory and like magic they'll work on xmms. For example, I did an Internet search for the popular "mooamp" skin and now my xmms has its own "ecowlizer." Don't let the extension of the skin scare you off; my Skins directory has tar.gz, zip, wsz and png files all coexisting nicely together. So, feel free to spend some time browsing through www.winamp-skins.com.

If you've installed smpeg-xmms, you can also watch movies with the "mpg" extension. Simply press l (the letter ell) to select the previously- saved movie file. This plugin can be configured to display the movie in a centered window, in doublesize mode, or in fullscreen mode. To get you started, the Library of Congress has an extensive movie collection at lcweb.loc.gov/rr/mopic/ndlmps.html.

One of my favorite features is the alarm that gets installed with the xmms-alarm plugin. Use Ctrl-P to open up Preferences and click on the Effect/General Plugins tab. Highlight Alarm and go into the Configure button to set the alarm time and days. Unless you like to be jolted out of bed, don't set the volume to 100%. If you don't set a Playlist in the Options tab, you'll wake up to whatever song happens to be selected on your Playlist. Just make sure xmms is started before going to bed, if you want it to wake you up in the morning.

This should get you started on using xmms. In the next article, I'll finish the multimedia series by taking a look at DVD players, RealPlayer, and some miscellaneous ports to enhance your multimedia desktop.

Dru Lavigne is a network and systems administrator, IT instructor, author and international speaker. She has over a decade of experience administering and teaching Netware, Microsoft, Cisco, Checkpoint, SCO, Solaris, Linux, and BSD systems. A prolific author, she pens the popular FreeBSD Basics column for O'Reilly and is author of BSD Hacks and The Best of FreeBSD Basics.


Read more FreeBSD Basics columns.

Return to the BSD DevCenter.




Sponsored by: