My Photo

dca ALSA plugin

The "dca" ALSA plugin may be useful for playing multichannel sound from arbitrary ALSA applications through an SPDIF link, by encoding it to DTS format on the fly. This is needed because the SPDIF link cannot carry enough bits per second to transport the raw uncompressed 5.1 audio.

The "alsa-plugins" package contains a similar "a52" plugin for on-the-fly AC3 encoding.

These plugins should not be used with HDMI connections, unless the video card imposes the same audio bandwidth limitations as the SPDIF link. The HDMI standard defines enough bandwidth so that the uncompressed 5.1 PCM stream fits even at 192 kHz sample rate.

The "dca" ALSA plugin should work in real time on any modern CPU. Here on Intel Core i5 @ 1.20 GHz (i.e. in powersaving mode) it eats ~40% of a single core.

To use the "dca" ALSA plugin, add the following line to your $HOME/.asoundrc file or to /etc/asound.conf:

<confdir:pcm/dca.conf>

It will create an additional ALSA device for each of your sound cards that have an SPDIF output. The name of the device will be similar to "dca:CARD=Intel,DEV=0", or, for the default card, simply "dca".

The ALSA plugin can be used with PulseAudio. To do so, add the following lines to the end of the /usr/share/pulseaudio/alsa-mixer/profile-sets/default.conf file:

[Mapping iec958-dts-surround-51]
description = DTS
device-strings = dca:%f
channel-map = front-left,front-right,rear-left,rear-right,front-center,lfe
priority = 3
direction = output

Later they may be added to the default profile upstream. After restarting PulseAudio, it will see an additional "DTS" output profile and allow you to select it in the volume control application such as pavucontrol or gnome-volume-control.

© Alexander E. Patrakov