Advanced Linux Sound Architecture - Concepts

Concepts

This section provides an overview of basic concepts pertaining to ALSA.

Typically, ALSA supports up to eight cards, numbered 0 through 7; each card is a physical or logical kernel device capable of input, output, or control of sound, and card number 0 is used by default when no particular card is specified. Furthermore, each card may also be addressed by its id, which is an explanatory string such as "Headset" or "ICH9".

A card has devices, numbered starting at 0; a device may be of playback type, meaning it outputs sound from the computer, or some other type such as capture, control, timer, or sequencer; device number 0 is used by default when no particular device is specified.

A device may have subdevices, numbered starting at 0; a subdevice represents some relevant sound endpoint for the device, such as a speaker pair. If the subdevice is not specified, or if subdevice number -1 is specified, then any available subdevice is used.

A card's interface is a description of an ALSA protocol for accessing the card; possible interfaces include: hw, plughw, default, and plug:dmix. The hw interface provides direct access to the kernel device, but no software mixing or stream adaptation support. The plughw and default enable sound output where the hw interface would produce an error.

An application typically describes sound output by combining all of the aforementioned specifications together in a device string, which has one of the following forms (which are case sensitive):

  • interface:card,device,subdevice
  • interface:CARD=1,DEV=3,SUBDEV=2.

An ALSA stream is a data flow representing sound; the most common stream format is PCM that must be produced in such a way as to match the characteristics or parameters of the hardware, including:

  • sampling rate: 44.1 kHz on home stereos, and 48 kHz on home theaters
  • sample width: measured in some number of bits per sample (such as 8, 16, 24, or 32 bits/sample)
  • sample encoding
  • number of channels: 1 for mono, 2 for stereo, or 6 for AC-3/IEC958

Also, ALSA needs a buffer parameter that determines how often CPU attention is required to supply sound data.

Read more about this topic:  Advanced Linux Sound Architecture

Famous quotes containing the word concepts:

    It is impossible to dissociate language from science or science from language, because every natural science always involves three things: the sequence of phenomena on which the science is based; the abstract concepts which call these phenomena to mind; and the words in which the concepts are expressed. To call forth a concept, a word is needed; to portray a phenomenon, a concept is needed. All three mirror one and the same reality.
    Antoine Lavoisier (1743–1794)

    Science is a dynamic undertaking directed to lowering the degree of the empiricism involved in solving problems; or, if you prefer, science is a process of fabricating a web of interconnected concepts and conceptual schemes arising from experiments and observations and fruitful of further experiments and observations.
    James Conant (1893–1978)