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 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.

CD burning is covered in Section 9.2.2. Playing music files 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

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

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. 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.

Check your system documentation for particular tools! 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. KMix 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. 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.

  • realplay: from RealNetworks.

  • helixplay: a Real alternative, see HelixDNA.

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

For watching TV there is zapping or xawtv, among many other tools for watching and capturing TV, video and other streams.