Next: , Previous: , Up: Services   [Contents][Index]


10.8.9 Sound Services

The (gnu services sound) module provides a service to configure the Advanced Linux Sound Architecture (ALSA) system, which makes PulseAudio the preferred ALSA output driver.

Scheme Variable: alsa-service-type

This is the type for the Advanced Linux Sound Architecture (ALSA) system, which generates the /etc/asound.conf configuration file. The value for this type is a alsa-configuration record as in this example:

(service alsa-service-type)

See below for details about alsa-configuration.

Data Type: alsa-configuration

Data type representing the configuration for alsa-service.

alsa-plugins (default: alsa-plugins)

alsa-plugins package to use.

pulseaudio? (default: #t)

Whether ALSA applications should transparently be made to use the PulseAudio sound server.

Using PulseAudio allows you to run several sound-producing applications at the same time and to individual control them via pavucontrol, among other things.

extra-options (default: "")

String to append to the /etc/asound.conf file.

Individual users who want to override the system configuration of ALSA can do it with the ~/.asoundrc file:

# In guix, we have to specify the absolute path for plugins.
pcm_type.jack {
  lib "/home/alice/.guix-profile/lib/alsa-lib/libasound_module_pcm_jack.so"
}

# Routing ALSA to jack:
# <http://jackaudio.org/faq/routing_alsa.html>.
pcm.rawjack {
  type jack
  playback_ports {
    0 system:playback_1
    1 system:playback_2
  }

  capture_ports {
    0 system:capture_1
    1 system:capture_2
  }
}

pcm.!default {
  type plug
  slave {
    pcm "rawjack"
  }
}

See https://www.alsa-project.org/main/index.php/Asoundrc for the details.

Scheme Variable: pulseaudio-service-type

This is the type for the PulseAudio sound server. It exists to allow system overrides of the default settings via pulseaudio-configuration, see below.

Warning: This service overrides per-user configuration files. If you want PulseAudio to honor configuration files in ~/.config/pulse you have to unset the environment variables PULSE_CONFIG and PULSE_CLIENTCONFIG in your ~/.bash_profile.

Warning: This service on its own does not ensure, that the pulseaudio package exists on your machine. It merely adds configuration files for it, as detailed below. In the (admittedly unlikely) case, that you find yourself without a pulseaudio package, consider enabling it through the alsa-service-type above.

Data Type: pulseaudio-configuration

Data type representing the configuration for pulseaudio-service.

client-conf (default: '())

List of settings to set in client.conf. Accepts a list of strings or a symbol-value pairs. A string will be inserted as-is with a newline added. A pair will be formatted as “key = value”, again with a newline added.

daemon-conf (default: '((flat-volumes . no)))

List of settings to set in daemon.conf, formatted just like client-conf.

script-file (default: (file-append pulseaudio "/etc/pulse/default.pa"))

Script file to use as default.pa.

system-script-file (default: (file-append pulseaudio "/etc/pulse/system.pa"))

Script file to use as system.pa.

Scheme Variable: ladspa-service-type

This service sets the LADSPA_PATH variable, so that programs, which respect it, e.g. PulseAudio, can load LADSPA plugins.

The following example will setup the service to enable modules from the swh-plugins package:

(service ladspa-service-type
         (ladspa-configuration (plugins (list swh-plugins))))

See http://plugin.org.uk/ladspa-swh/docs/ladspa-swh.html for the details.


Next: , Previous: , Up: Services   [Contents][Index]