User Tools

Site Tools


alsa_only_audio

This is an old revision of the document!


ALSA-only audio on Linux

this is a guide on how to setup ALSA to be enjoyable by itself without an audio server.

I will be showing changes to /etc/asound.conf as to effect all users (including daemons such as MPD). you can also use ~/.asoundrc for setup specific to your user.

dmix

dmix is a software mixer for audio output. it will allow multiple programs to simultaneously play sound at the same time.

in asound.conf, the following configuration could be used to create a software mixer that can be accessed by multiple users.

/etc/asound.conf
pcm.mixer {
  type dmix
  ipc_key 1024
  ipc_key_add_uid false  # remove these two lines to only allow
  ipc_perm 0666          #  one user to use the mixer at a time.
 
  slave {
    pcm "hw:1,1"         # hardware output device to use.
  }
}
 
pcm.!default plug:mixer  # set the default device to the mixer.

S/PDIF surround sound

the a52 alsa plugin can be used to output Dolby Digital 5.1 (or lower) multichannel audio through S/PDIF.

you must have the plugin installed. look in your distribution's repositories for a package similar to “alsa-plugins”. it may be in a separate package such as “alsa-plugins-a52”, as on Alpine Linux.

here is an example configuration:

/etc/asound.conf
pcm.surround {
        type a52
        slavepcm "hw:1,1"
 
        channels 6
        bitrate 1000
        rate 48000
        format S16_LE
}
alsa_only_audio.1751934535.txt.gz · Last modified: by ethan

Except where otherwise noted, content on this wiki is licensed under the following license: CC0 1.0 Universal
CC0 1.0 Universal Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki