Sound and Music

 < Day Day Up > 

Linux has a reputation of lacking good support for sound and multimedia applications in general. Certainly, there is less sound card support than that found in Microsoft Windows. (However, Microsoft no longer supports the Microsoft Sound Card, but Linux users still enjoy support for it, no doubt just to annoy the folks in Redmond.) However, Unix has always had good multimedia support as David Taylor, Unix author and guru, points out:

"The original graphics work for computers was done by Evans & Sutherland on Unix systems. The innovations at MIT's Media Lab were done on Unix workstations. In 1985, we at HP Labs were creating sophisticated multimedia immersive work environments on Unix workstations, so maybe Unix is more multimedia than suggested. Limitations in Linux support doesn't mean Unix had the same limitations. I think it was more a matter of logistics, with hundreds of sound cards and thousands of different possible PC configurations."

That last sentence sums it up quite well. Unix had a limited range of hardware to support; Linux has hundreds of sound cards. Sound card device driver support has been long lacking from manufacturers, and there is still no single standard for the sound subsystem in Linux.

In this section, you learn about sound cards, sound file formats, and the sound applications provided with Fedora Core Linux.

Sound Cards

Fedora supports a wide variety of sound hardware and software. Two models of sound card drivers compete for prominence in today's market:

  • ALSA, the Advanced Linux Sound Architecture, which is entirely open source.

  • OSS, the Open Sound System, which offers free and commercial drivers.

Fedora uses ALSA because ALSA is the sound architecture for the 2.6 series kernels.

ALSA supports a long list of sound cards. You can review the list at http://www.alsa-project.org/alsa-doc/. If your sound card is not supported, it might be supported in the commercial version of OSS. You can download a trial version of commercial software and test your sound card at http://www.opensound.com/download.cgi.

TIP

You can check the directory /usr/src/linux-2.6/ for documentation for each sound module. Be aware, however, that the documentation is likely to be out-of-date. Although even this out-of-date documentation can be useful, you should research any new sound card you might purchase to ascertain its level of support in Linux. Use http://www.google.com/linux to search Linux websites and Linux newsgroups for mention of any sound card you are using.


Fedora detects most sound cards during the original installation. If you add or replace a sound card after the initial install, the Kudzu "new hardware configuration" utility will automatically detect and configure it at the next reboot. To configure the sound card at any other time, use the system-config-soundcard graphical tool. The graphical tool can be found under the System Settings menu as the Soundcard Detection menu item. For additional details about configuring your sound card, refer to Chapter 4.

Recording Sound

Fedora provides a number of tools that enable you to control volume, mix, and other sound recording functions. The Kmix sound mixer acts as a virtual mixing board, taking sound inputs from different sources, enabling you to adjust their individual volumes, mute them, and listen to them through your sound card.

If you need to control sound from command line, use the alsamixer command, which can be used to adjust balance or volume in text mode using the left and right cursor keys to select a channel and the up and down keys to adjust the volume.

 $ alsamixer  

The Sound Recorder, shown in Figure 10.4, along with the Volume Control application, is provided to enable you to play and record .wav files. You can use the SoX utility (covered later in this chapter) to convert the recorded sound if necessary.

Figure 10.4. Simplicity in design and layout make the Sound Recorder and Volume Control applications easy to use.


Sound Formats

A number of formats exist for storing sound recordings. Some of these formats are associated with specific technologies, and others are used strictly for proprietary reasons. Fedora supports several of the most popular sound formats, including

  • raw (.raw) More properly known as headerless format, audio files using this format contain an amorphous variety of specific settings and encodings. All other sound files contain a short section of code at the beginning a header that identifies the format type.

  • MP3 (.mp3) A popular, but commercially licensed, format for the digital encoding used by many Linux and Windows applications. MP3 is not supported by any software included with Fedora (which advises you to use the open source Ogg-Vorbis format instead).

  • WAV (.wav) The popular uncompressed Windows audio-visual sound format. It is often used as an intermediate file format when encoding audio.

  • Ogg-Vorbis (.ogg) Fedora preferred audio encoding format. You will enjoy better compression, audio playback, and freedom from lawsuits by using this open-source encoding format for your audio files.

NOTE

Because of patent and licensing issues, Fedora has removed support for the MPEG, MPEG2, and MPEG3 (MP3) file formats in Fedora Core Linux. Although we cannot offer any legal advice, it appears that individuals using MP3 software are okay; it's just that Fedora cannot distribute the code because it sells its distribution. It seems at this point perfectly all right for you to obtain an MP3-capable version of Xmms (for example), which is a Winamp clone that plays MPEG1/2/3 files. (You learn more about Xmms in the "Music Players" section later in this chapter.) You can get Xmms directly from http://www.xmms.org/ because that group has permission to distribute the MP3 code.

Another alternative is to use the Ogg-Vorbis format; it is completely free of restrictions. A ripper for CD music is available from http://www.thekompany.com/projects/tkcoggripper/ and an MP3-to-Ogg converter is available from http://faceprint.com/code/. Or, you could download and install the non-crippled versions of multimedia applications from FreshRPMs at http://www.freshrpms.net/.


Fedora includes software (such as the sox command used to convert between sound formats) so that you can more easily listen to audio files provided in a wide variety of formats, such as AU (from NeXT and Sun), AIFF (from Apple and SGI), IFF (originally from Commodore's Amiga, RA (from Real Audio), and VOC (from Creative Labs).

TIP

To learn more about the technical details of audio formats, read Chris Bagwell's Audio Format FAQ at http://www.cnpbagwell.com/audio.html.


Fedora also offers utilities for converting sound files from one format to another. Conversion utilities come in handy when you want to use a sound in a format not accepted by your current application of choice. A repository of conversion utilities resides at http://ibiblio.org/pub/linux/apps/sound/convert/!INDEX.html and includes MP3 and music CD oriented utilities not found in Fedora. You will have to know how to compile and install from source, however. If you see something useful, have a look at http://www.rpmfind.net/ to locate a binary RPM if you don't feel up to the task.

Fedora does provide sox, a self-described sound translator that will convert music between the AIFF, AU, VAR, DAT, OGG, and WAV formats, among others. It also can be used to change many other parameters of the sound files.

Timidity is a MIDI to WAV converter and player. If you are interested in MIDI and musical instruments, Timidity is a handy application; it handles karaoke files as well, displaying the words to accompany your efforts at singing.

Music Players

Fedora provides music players. One of the most popular is Xmms, a Winamp clone, which in the full version can play not only music, but MPEG1/2/3 video as well. Xmms supports a number of plug-ins that can add dancing, lighted oscilloscope-like displays, redirect its output to other devices, support unusual file formats, sync animations to the music, and otherwise increase its geek appeal exponentially. You can find Xmms as the Media Player item in the Sound & Video menu.

The default music player is Rhythmbox, which is designed to play music files from playlists and Internet radio stations much like Xmms. It is found in the Sound & Video menu as the Music Player menu item.

Kmid, found in the More Sound & Video Applications submenu, is a karaoke and MIDI mapper; it supports external synthesizers. MIDI mappers enable you to map MIDI channels to the synthesizer instruments you want them to control. If you enjoy karaoke, Kmid will also enable you to change the tempo of songs without changing the pitch, and permits the organization of your songs into collections with a selectable play order.

Gnome-CD is the CD Player menu item found in the Sound & Video menu. As the default CD player application, it provides a basic GUI interface for playing CDs in your CD-ROM drive.

Other music and sound-related applications can be found in the Sound & Video menu, and, of course, you are free to install your own selection of applications as well. You might have a problem adding them to the menu, however, so we provide the following tip to enable menu editing in Fedora.

TIP

Menu editing is available in the GNOME/metacity desktop provided as the default Fedora Core desktop, but it is inexplicably disabled. To enable it, workingas root perform the following steps:

 # cd /etc/gnome-vfs-2.0/modules # mv default-modules.conf default-modules.conf.without-menu-editing # cp default-modules.conf.with-menu-editing  default-modules.conf 

Upon restarting GNOME, you can edit the menu by right-clicking on the menu item or by using the URL applications:/// in Nautilus.


Streaming Audio

Streaming audio is for playing games, listening to Internet radio, and other online audio content. Streaming audio is designed to produce an uninterrupted sound output, but it requires the system to perform a content "juggling act." Essentially, the system's audio buffer is continually filled with audio information, which is fed to the buffer through the system's Internet connection. Because of server and connection capabilities, the rate of input might vary. Because audio is used at a constant rate, the trick to managing streaming audio is to always keep the buffer full, although you might not be able to fill it at a constant rate.

Streaming audio is handled in Fedora Core Linux in the .m3u format. The MPEG formats are also used for streaming audio. Although Xmms supports streaming audio, another popular application is the Real Player, available from http://www.real.com/linux/. An excellent resource for music and sound in Linux is http://linux-sound.org/. The Network Audio section of that website contains an extensive list of streaming audio applications.

The Icecast application, not provided with Fedora Core Linux, is a popular streaming audio server. You can use Icecast to serve your MP3 music collection over your home LAN. You can learn more about Icecast at http://www.icecast.org/. A nice tutorial on Icecast is available at http://www.linuxnetmag.com/en/issue4/m4icecast1.html.

TIP

You can also read Chapter 17, "Network Connectivity," to see how to use the Network File System (NFS) to mount a remote directory of music files over your network.


     < Day Day Up > 


    Red Hat Fedora 4 Unleashed
    Red Hat Fedora 4 Unleashed
    ISBN: 0672327929
    EAN: 2147483647
    Year: 2006
    Pages: 361

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net