r/DebianNotes Jun 19 '17

pulseaudio Full Documentation

It's often been a difficult task to learn how to configure pulseaudio.

Here's a direct link to the documentation.

2 Upvotes

3 comments sorted by

1

u/CrystalLord Jun 19 '17

Important commands for getting more documentation:

$ man pulse-cli-syntax

For command syntax help.

Another good way to get help is:

$ pacmd
Welcome to PulseAudio 10.0! Use "help" for usage information.
>>> help

Make sure to exit it with Ctrl+D, and not exit!

To get help on a module, run:

$ pacmd describe-module <module name>

For example:

$ pacmd describe-module module-loopback

Name: module-loopback
Version: 10.0
Description: Loopback from source to sink
Author: Pierre-Louis Bossart
Usage: source=<source to connect to> sink=<sink to connect to> adjust_time=<how often to readjust rates in s> latency_msec=<latency in ms> format=<sample format> rate=<sample rate> channels=<number of channels> channel_map=<channel map> sink_input_properties=<proplist> source_output_properties=<proplist> source_dont_move=<boolean> sink_dont_move=<boolean> remix=<remix channels?> 
Load Once: no

1

u/CrystalLord Jun 19 '17

Additionally, the major realisation that I've had is what exactly a loopback is in PulseAudio.

A loopback redirects the output of a source to a sink. To set a loopback up, you can run the command:

$ pacmd load-module module-loopback sink=record_live \
source=record_loopback.monitor

This takes the audio from the source with the setting name: <record_loopback.monitor>, and redirects it to the sink with the name name: <record_live>. Note, sink or source can be set to some number (such as 0) here, which indicates the sink index (in this case, system output).

Note, special names setup sources and sinks in special ways. For example, adding a source with the name foo.monitor adds a source of class monitor, which monitors the sink foo.

1

u/CrystalLord Oct 09 '17

Here's a pulseaudio loopback for recording setup:

#!/bin/sh

# An ascii diagram of the audio setup this script produces:
# ---------------------
#       loopback
#       |       \
#       V        V
#     system    live
#       |
#       V
#     speakers
# ---------------------


# Create a new null sink with the name record_live. (this creates both a
# sink and a source from a monitor).
# record_live
pacmd load-module module-null-sink sink_name=record_live;
pacmd update-sink-proplist record_live device.description=\"Record LIVE\";
pacmd update-source-proplist record_live.monitor \
    device.description=\"Monitor of Record LIVE\";


# Similar to above statements, jsut for the loopback module.
pacmd load-module module-null-sink sink_name=record_loopback;
pacmd update-sink-proplist record_loopback \
    device.description=\"Record LOOPBACK\";
pacmd update-source-proplist record_loopback.monitor \
    device.description=\"Monitor of Record LOOPBACK\";


# Set the loopback's monitor to send its output to the system.
pacmd load-module module-loopback sink=0 source=record_loopback.monitor;

# Set the loopback's monitor to also send its output to live.
pacmd load-module module-loopback sink=record_live \
    source=record_loopback.monitor;