DeviceNames

From AlsaProject
Revision as of 12:54, 21 April 2012 by Tanuk (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The available device names depends on the available hardware and the system configuration. This page describes the "well-known" device names, which should be available whenever the hardware supports them. The system may contain also other device names, but their semantics are not standardized. (TODO: Should a52 and/or dca be added to the playback device names?)

Contents

Playback device names

default

This is the recommended device name for most applications. The default device will usually use Pulseaudio or dmix, i.e. software mixing, which ensures that your application won't prevent other audio applications from working at the same time, in case the hardware doesn't provide mixing support itself.

front

  • Direct access to the hardware.
  • Analog output.
  • Two channels.
  • Channel map: front-left, front-right.

rear

  • Direct access to the hardware.
  • Analog output.
  • Two channels.
  • Channel map: rear-left, rear-right.

center_lfe

  • Direct access to the hardware.
  • Analog output.
  • Two channels.
  • Channel map: front-center, lfe.

side

  • Direct access to the hardware.
  • Analog output.
  • Two channels.
  • Channel map: side-left, side-right.

surround40

  • Direct access to the hardware.
  • Analog output.
  • Four channels.
  • Channel map: front-left, front-right, rear-left, rear-right.

surround41

  • Direct access to the hardware.
  • Analog output.
  • Five channels.
  • Channel map: front-left, front-right, rear-left, rear-right, lfe.

surround50

  • Direct access to the hardware.
  • Analog output.
  • Five channels.
  • Channel map: front-left, front-right, rear-left, rear-right, front-center.

surround51

  • Direct access to the hardware.
  • Analog output.
  • Six channels.
  • Channel map: front-left, front-right, rear-left, rear-right, front-center, lfe.

surround71

  • Direct access to the hardware.
  • Analog output.
  • Eight channels.
  • Channel map: front-left, front-right, rear-left, rear-right, front-center, lfe, side-left, side-right.

spdif or iec958

  • Direct access to the hardware.
  • Digital output.
  • Two channels.
  • Channel map: front-left, front-right.
  • With appropriately formatted data, this device can also be used to transmit compressed surround audio. TODO: Point to some documentation.

hdmi

  • Direct access to the hardware.
  • HDMI output.
  • Two channels.
  • Channel map: front-left, front-right.
  • TODO: HDMI supports also more than stereo audio. However, I think I've heard that there are some complications with that. More details needed.

hw

This is always available if the hardware supports playback at all, but the semantics are not defined, so avoid using this for other things than mono output. This should also be fine if you only target specific hardware that you know for sure how it behaves when using the "hw" device name.

plughw

TODO: What's this?

Capture device names

TODO: Are there other valid device names than "default" and "hw"? Pulseaudio uses "front", but I'm not totally sure if it's officially supported. At least it seems that in practice "front" is often not available for capture, even if the card supports stereo capture.

default

This is the recommended device name for most applications. The default device will usually use Pulseaudio or dmix (TODO: confirm that dmix really is used also for capture), which ensures that your application won't prevent other audio applications from working at the same time, in case the hardware doesn't support multiple simultaneous capture streams.

hw

This is always available if the hardware supports capture at all, but the semantics are not defined, so avoid using this for other things than mono input. This should also be fine if you only target specific hardware that you know for sure how it behaves when using the "hw" device name.

The "plug:" prefix

Each of the device names can be prefixed with "plug:". For example: "plug:front". The "plug" plugin implements sample rate conversion and sample format conversion. If one wishes to only have sample format conversion, there is an alsa api call to disable the resampling feature in the "plug" plugin.

#if SND_LIB_VERSION >= 0x010009
/* Restrict a configuration space to contain only real hardware rates */
err = snd_pcm_hw_params_set_rate_resample(this->audio_fd, params, 0);
#endif

Multiple sound cards

If the user has more than one sound card, e.g:

0 [ICH5 ]: ICH4 - Intel ICH5
Intel ICH5 with ALC650F at irq 201
1 [Audigy2 ]: Audigy2 - Audigy 4 [SB0610]
Audigy 4 [SB0610] (rev.0, serial:0x10211102) at 0x8400, irq 209
2 [Audigy2_1 ]: Audigy2 - Audigy 4 PRO [SB0380]
Audigy 4 PRO [SB0380] (rev.4, serial:0x20071102) at 0x8800, irq 217

The application can select which sound card to use. e.g. to use card 2, one would use:

plug:default:Audigy2_1
plug:front:Audigy2_1

one could also use:

plug:front:2

but using the name is better, as it tracks the card name even if on the next reboot the card number changes, for example, due to USB audio devices.


Original created on 2007-01-14 by unknown.

Custom Search
Personal tools
Namespaces

Variants
Actions
Navigation
wiki
Toolbox