7.4. Sound and video

7.4.1. Sound card configuration

Most Linux distributions provide tools that probe your system for sound cards. Most currently available plug-and-play sound cards should be recognized automatically. If you can hear the samples, just click OK and everything will be set up for you.

If your card is not detected automatically, you may be presented with a list of sound cards and/or of sound card properties from which to choose. After that, you will have to provide the correct I/O port, IRQ and DMA settings. Information about these settings can be found in your sound card documentation. If you are on a dual boot system with MS Windows, this information can be found in the Windows Control Panel as well.

7.4.2. If automatic sound card detection fails

If your soundcard is not supported by default, you will need to apply other techniques. These are described in the Linux Sound HOWTO.

7.4.3. Sound and video playing

7.4.3.1. CD playing and copying

The cdp package comes with most distributions and provides cdp or cdplay, a text-based CD player. Desktop managers usually include a graphical tool, such as the gnome-cd player in Gnome, that can be started from a menu.

Be sure to understand the difference between an audio CD and a data CD. You do not have to mount an audio CD into the file system in order to listen to it. This is because the data on such a CD are not Linux file system data; they are accessed and sent to the audio output channel directly, using a CD player program. If your CD is a data CD containing .mp3 files, you will first need to mount it into the file system, and then use one of the programs that we discuss below in order to play the music. How to mount CDs into the file system is explained in Section 7.6.5.

The cdparanoia tool from the package with the same name reads audio directly as data from the CD, without analog conversions, and writes data to a file or pipe in different formats, of which .wav is probably the most popular. Various tools for conversion to other formats, such as .mp3, come with most distributions or are downloadable as separate packages. The GNU project provides several CD playing, ripping and encoding tools, database managers; see the Free Software Directory, Audio section for detailed information.

Audio-CD creation is eased, among many others, with the kaudiocreator tool from the KDE suite. It comes with clear information from the KDE Help Center and is included on systems that have the kdemultimedia package installed.

CD burning is covered in general in Section 9.2.2.

7.4.3.2. Playing music files

7.4.3.2.1. mp3 files

The popular .mp3 format is widely supported on Linux machines. Most distributions include multiple programs that can play these files; xmms, which is presented in the screenshot below, is probably the most wide-spread.

Figure 7-1. Xmms mp3 player

Some distributions don't allow you to play MP3's without modifying your configuration, this is due to license restrictions on the MP3 tools. With the xmms player, you now need the "xmms-mp3" plugin. If error messages indicate that licensing is the trouble, the following procedure describes the path of least resistance:

  • Download and install apt-get, for instance from http://www.freshrpms.net:

    rpm -Uvh /var/tmp/xmms-mp3-1.2.7-21.p.fr1

  • Run the following commands to prepare your system for use with the apt package manager:

    apt-get update

    apt-get upgrade

  • Install the xmms-mp3 plugin:

    apt-get install xmms-mp3

  • (Don't forget to log out of the root account because you've finished modifying your system now) - Play your favorite music:

    xmms /my/music/dot.mp3

See Section 7.6 for more on the commands for managing packages.

Start xmms from a menu, or from the command line like this:


debby:~/mp3> xmms music.mp3

Alternatively, enter the command xmms *.mp3 for playing all .mp3 files in a directory.

Both Gnome and KDE incorporate other graphical mp3 players, look in your menus.

7.4.3.2.2. Other formats

An overview of other common sound playing and manipulating software:

  • Ogg Vorbis: Free audio format: see the GNU audio directory for tools - they might be included in your distribution as well.

  • Real audio and video: realplay from RealNetworks.

  • SoX or Sound eXchange: actually a sound converter, comes with the play program. Plays .wav, .ogg and various other formats, including raw binary formats.

  • Playmidi: a MIDI player, see the GNU directory.

  • AlsaPlayer: from the Advanced Linux Sound Architecture project, see the AlsaPlayer web site.

  • KMediaPlayer: base for the KDE multimedia tools.

  • mplayer: plays just about anything, including mp3 files. More info on the MPlayerHQ website.

Check your system documentation for particular tools!

7.4.3.3. Volume control

aumix and alsamixer are two common text tools for adjusting audio controls. The alsamixer has a graphical interface when started from the menu or as gnome-alsamixer from the command line. The kmix tool does the same in KDE.

Regardless of how you choose to listen to music or other sounds, remember that there may be other people who may not be interested in hearing you or your computer. Try to be courteous, especially in office environments. And use a quality head-set.

7.4.3.4. Video playing, streams and television watching

Various players are available:

  • xine: a free video player

  • ogle: DVD player

  • mplayer: Movie Player for Linux

  • gstreamer: upcoming project developing the GStreamer library and accompanying tools for audio and video recording, editing and playing, to be included in Gnome. See http://www.gstreamer.net for more.

  • totem: plays both audio and video files, audio CDs, VCD and DVD.

  • realplay: from RealNetworks.

  • helixplay: a Real alternative, see HelixDNA.

Most likely, you will find one of these in your graphical menus.

TLDP released a new document recently that is very appropriate for this section. It is entitled DVD Playback HOWTO and describes the different tools available for viewing movies on a system that has a DVD drive. It is a fine addition to the DVD HOWTO that explains installation of the drive.

For watching TV there is choice of the following tools, among many others for watching and capturing TV, video and other streams:

  • tvtime: great program with station management, interaction with teletext, film mode and much more.

  • zapping: Gnome-specific TV viewer.

  • xawtv: X11 TV viewer.