- Loopback 2 0 0 – Route Audio Between Applications Freeware
- Loopback 2 0 0 – Route Audio Between Applications Free Printable
- Loopback 2 0 0 – Route Audio Between Applications Free Download
- Loopback 2 0 0 – Route Audio Between Applications Free Online
VB-Audio CABLE is a Windows Audio Driver working as Virtual Audio Cable. Thanks to its Multi-Format Audio Engine, VB-CABLE can be used without any configuration! Ready to work with all Audio Application using MME, KS, DX, KS or WASAPI interfaces. Berkeley Electronic Press Selected Works.
Home • About • Community • Download • Documentation • Planet |
- Loadable Modules
- Device Drivers
- Protocols
- Saving/restoring settings
- X Window System
- Volume Control
- Bluetooth
- RTP/SDP/SAP Transport
- RAOP Sink (Wireless Network Sound aka Apple Airtunes)
- JACK Connectivity
- Filters
- Miscellaneous
To show all currently loaded modules with their arguments, run
pacmd
and enter the CLI command list-modules
. The following loadable modules are provided with the PulseAudio distribution:Device Drivers
All device driver modules support the following parameters:
- sink_name, source_name
- Name for the sink (resp. source). Allowed characters in the name are a-z, A-Z, numbers, period (.) and underscore (_). The length must be 1-128 characters.
- format
- The sample format, see supported audio formats for possible values (defaults to
s16
)
- The sample format, see supported audio formats for possible values (defaults to
- rate
- The sample rate (defaults to 44100)
- channels
- Audio channels (defaults to 2)
- channel_map
- Channel map. A list of comma-separated channel names. The currently defined channel names are: left, right, mono, center, front-left, front-right, front-center, rear-center, rear-left, rear-right, lfe, subwoofer, front-left-of-center, front-right-of-center, side-left, side-right, aux0, aux1 to aux15, top-center, top-front-left, top-front-right, top-front-center, top-rear-left, top-rear-right, top-rear-center, (Default depends on the number of channels and the driver)
Since 0.9.16
- sink_properties, source_properties
- Set additional properties of the sink/source. For example, you can set the description directly when the module is loaded by setting this parameter.
- This is the same as using the update-sink-proplist command after the sink is setup, either with
pacmd
or indefault.pa
.
module-pipe-sink
Provides a simple test sink that writes the audio data to a FIFO special file in the file system. The sink name defaults to fifo_output.
The following option is supported:
- file
- The name of the FIFO special file to use. (defaults to: /tmp/music.output)
module-pipe-source
Provides a simple test source that reads the audio data from a FIFO special file in the file system. The source name defaults to fifo_input.
The following option is supported:
- file
- The name of the FIFO special file to use. (defaults to: /tmp/music.input)
module-null-sink
Provides a simple null sink. All data written to this sink is silently dropped. This sink is clocked using the system time. All sinks have a corresponding 'monitor' source which makes the null sink a practical way to plumb output to input.
In addition to the common sink arguments (
sink_name
, sink_properties
, format
, rate
, channels
and channel_map
), this module supports the following arguments:- formats
- Since 13.0. List of encoding formats, separated by semicolons. For example:
pcm;ac3-iec61937
allows applications to play normal PCM or AC3-encoded audio to the null sink. See supported audio formats for possible values. By default the null sink accepts only PCM audio.
- Since 13.0. List of encoding formats, separated by semicolons. For example:
module-alsa-sink
Provides a playback sink for devices supported by the Advanced Linux Sound Architecture (ALSA). The sink name defaults to alsa_output.
You should (almost) never need to load this module manually. Let module-udev-detect look for the supported cards and then select the profile you want, that will make the right sinks show up.
In addition to the general device driver options described above this module supports:
- device
- The ALSA device to use. (defaults to 'default')
- fragments
- The desired fragments when opening the device. (defaults to 12)
- fragment_size
- The desired fragment size in bytes when opening the device (defaults to 1024)
- tsched
- Since 0.9.11. Use system-timer based model (aka glitch-free). Defaults to 1 (enabled). If your hardware does not return accurate timing information (e.g. Creative sound cards) you can try to set tsched=0 to enable the interupt based timing which was used in 0.9.10 and before.
- mmap name
- String to prefix to the automatically determined sink name.
- device_id tsched_buffer_size, tsched_watermark ignore_dB
- Ignore dB information from the device
- control
- Name of mixer control. Since 14.0: If there are multiple controls with the same name, the control index can be added to the name using a comma as the separator. For example:
Headphone,1
- Name of mixer control. Since 14.0: If there are multiple controls with the same name, the control index can be added to the name using a comma as the separator. For example:
- namereg_fail
- Boolean
- deferred_volume
- Syncronize sw and hw volume changes in IO-thread
- fixed_latency_range
- Since 2.0. Boolean. Normally when there's an alsa underrun, and timer based scheduling is used, the alsa sink will raise the minimum latency that applications can get to avoid further underruns. If this option is enabled, the minimum latency will stay constant even if underruns occur.
module-alsa-source
Provides a recording source for devices supported by the Advanced Linux Sound Architecture (ALSA). The source name defaults to alsa_input.
You should (almost) never need to load this module manually. Let module-udev-detect look for the supported cards and then select the profile you want, that will make the right sources show up.
This module supports device=, fragments=, fragment_size= and tsched= arguments the same way as module-alsa-sink. Also mmap, name, device, control, tsched_buffer_size, tsched_watermark, ignore_dB, namereg_fail, fixed_latency_range
module-alsa-card
Creates a PulseAudio card for an ALSA card. The 'device_id' argument is mandatory, it tells PulseAudio which ALSA card to use.
- card_name
- Name for the PulseAudio card.
- card_properties
- Extra properties to be stored in the card's property list.
- sink_name
- Name to be used by the card's sinks. If the card has any profiles that have multiple sinks, then this argument can't be used, because the sink names can't all be the same.
- sink_properties
- Extra properties to be stored in the property lists of the card's sinks.
- source_name
- Name to be used by the card's sources. If the card has any profiles that have multiple sources, then this argument can't be used, because the source names can't all be the same.
- namereg_fail
- A boolean. If 'true', loading the card will fail if there already exists a card with the same name. If 'false', a suffix is added to the card name if there already exists a card with the same name.
- profile
- The initial profile to activate when loading the module.
- profile_set
- Profile set configuration file. Can be an absolute path, or relative to the standard profile-sets directory.
- device_id
- The alsa card identifier. Can be the card index or the name. See
/proc/asound/cards
for the list of available cards and their identifiers.
- The alsa card identifier. Can be the card index or the name. See
- format
- The sample format to be used by the card's sinks and sources. See supported audio formats for possible values.
- rate
- The sample rate to be used by the card's sinks and sources.
- name
- The 'device_id' argument is used by default as a part of the card name (if 'card_name' is not given), and also in the card's sink and source names. If you're not happy with that for some reason, this argument can be given to be a substitute for 'device_id' in the card, sink and source names.
- tsched
- A boolean. If 'true', the sinks and sources of this card will use the timer-based scheduling.
- ignore_dB
- A boolean. If 'true', any decibel information given by the ALSA drivers will be ignored (useful if that information is wrong).
- fragments
- The number of fragments to be used in the sink and source buffers. Only effective if the timer-based scheduling is disabled.
- fragment_size
- The size of one fragment (in bytes) to be used in the sink and source buffers. Only effective if the timer-based scheduling is disabled.
- mmap
- A boolean. If 'true', PulseAudio will access ALSA using the mmap interface.
- tsched_buffer_size
- The total sink and source buffer size in bytes. Only effective if the timer-based scheduling is enabled.
- tsched_buffer_watermark
- The buffer fill level (in bytes) at which the sinks must refill the buffer. Only effective if the timer-based scheduling is enabled.
- deferred_volume
- A boolean. If 'true', PulseAudio will slightly delay hardware volume changes in order to synchronize the changes with software volume changes.
- fixed_latency_range
- A boolean. Normally when there's an alsa underrun or overrun, and timer-based scheduling is used, the alsa sink or source will raise the minimum latency that applications can get to avoid further underruns or overruns. If this option is enabled, the minimum latency will stay constant even if underruns or overruns occur.
- use_ucm
- A boolean. If 'true', the card will use the ALSA Use Case Manager interface for configuration, if it's available. If 'false', or if there's no UCM configuration for the card, PulseAudio's own profile and path configuration files will be used instead.
module-oss
Provides both a sink and a source for playback, resp. recording on Open Sound System (OSS) compatible devices. This module supports the following options:
- record, playback
- Accepts a boolean value for enabling the playback, resp. recording on this device. (defaults: to 1)
- device
- The OSS device to use. (defaults to /dev/dsp),
- mmap
- Accepts a boolean value for enabling (resp. disabling) memory mapped (mmap()) access to the input/output buffers of the audio device. This provides better latency behaviour but is less compatible. (defaults: to 1).
- fragments, fragment_size
- As in module-alsa-sink.
The sink name (resp. source name) defaults to oss_output (resp. oss_input).
module-solaris
Provides a sink and source for the Solaris audio device.
In addition to the general device driver options described above this module supports:
- record, playback
- Accepts a boolean value for enabling the playback, resp. recording on this device. (defaults: to 1)
- device
- Audio device filename
- buffer_length
- Record buffer length in ms.
module-waveout
Provides both a sink and source for the Win32 audio device. This module supports the following options:
- record, playback
- Accepts a boolean value for enabling the playback, resp. recording on this device. (defaults: to 1)
- device
- Accepts an integer specifying the Windows audio device to be opened. If not set the ?WaveMapper service is used.
- fragments, fragment_size
- As in module-alsa-sink.
The sink name (resp. source name) defaults to wave_output (resp. wave_input).
module-combine
Renamed to module-combine-sink in 1.0. See module-combine-sink for the documentation for this module.
module-combine-sink
Since 1.0 (prior to 1.0 this same module was available with name 'module-combine'). This combines two or more sinks into one. A new virtual sink is allocated. All data written to it is forwarded to all connected sinks. In equidistant intervals the sample rates of the output sinks is recalculated: i.e. even when the sinks' crystals deviate (which is normally the case) output appears synchronously to the human ear. The resampling required for this may be very CPU intensive.
- sink_name
- The name for the combined sink. (defaults to 'combined')
- sink_properties
- Since 0.9.15. Property list for the combined sink.
- slaves
- Name of sinks to link into the combined think, separated by commas.
- adjust_time
- Time in seconds when to readjust the sample rate of all sinks. Zero means that readjustment should be disabled. Default: 10.
- resample_method
- Resampling algorithm to use when adjusting to the sample rate differences between the slave sinks. TODO: Create a page, and add a link to it here, that explains all the different resamplers that are available. While waiting for that to happen, users can refer to
man pulse-daemon.conf
, more specifically theresample-method
option documentation.
- Resampling algorithm to use when adjusting to the sample rate differences between the slave sinks. TODO: Create a page, and add a link to it here, that explains all the different resamplers that are available. While waiting for that to happen, users can refer to
- format, rate, channels, channel_map
- Parameters for the combined sink. See the Device Drivers section at the top of this page for details.
module-remap-sink
Since 0.9.7. The module creates a new virtual sink, which connects to a master sink using a virtual stream. The virtual stream's channel map is configurable, which makes it possible to control which channels of the master sink will be used. The channel map of the virtual sink itself can be configured too. This allows, for example, creating a virtual stereo sink that only plays to the rear channels of a surround master sink.
Whenever a stream has different channels than the sink it connects to, pulseaudio may apply a remixing algorithm. This remixing is also applied to the virtual stream created by module-remap-sink, unless the 'remix' argument is set to 'no'. This is a stupid default, because usually you only want to play to the master sink channels that you configured with the 'master_channel_map' argument, so remember to pass 'remix=no' when loading module-remap-sink.
- sink_name
- The name for the new virtual sink.
- master
- The name of the sink of which channels you're remapping.
- channels
- Channel count of the new sink.
- channel_map
- List of the channels that this sink will accept.
- master_channel_map
- The channels in the master sink, where the channels listed in channel_map will be relayed to. channel_map and master_channel_map must have equal number of channels listed, because the channels will be mapped based on their position in the list, i.e. the first channel in channel_map will be relayed to the first channel in master_channel_map and so on.
- remix
- Allow remixing of the virtual stream. The default is 'yes' for some strange reason, but probably you want to set this to 'no'.
Here's an example for creating a virtual stereo sink that will play to the rear channels of the master sink. Replace MASTER_SINK_NAME with the real name of the master sink.
module-remap-source
Since 4.0. This creates a virtual source ('remapped source') on top of another source ('master source'), with a different channel map.
- source_name
- Name for the remapped source.
- source_properties
- Extra properties for the remapped source.
- master
- Name or index of the master source.
- master_channel_map
- The master source's channels from which audio should be captured.
- format
- The remapped source sample format. See supported audio formats for possible values.
- rate
- The remapped source sample rate.
- channels
- The number of channels of the remapped source. This is rarely useful, because the number of channels is already implied by the channel_map and master_channel_map arguments, and the channels argument can't conflict with those other arguments. If neither channel_map nor master_channel_map is specified, then this can be used to control the channel count of the remapped source, but in that case the module is pretty useless, because no remapping will be done.
- channel_map
- The channel map of the remapped source. This must have the same number of channels as master_channel_map. The remapping happens so that the first channel in master_channel_map is copied to the first channel in channel_map etc.
- remix
- A boolean. This can be used for disabling remixing for the stream that is created between the master source and the remapped source. If this is set to 'yes', the remixing behaviour will be the same as all other streams (which depends on configuration elsewhere). Remixing means that if the master source has channels that are not listed in master_channel_map, those channels may be mixed to the channels that are listed in master_channel_map. Likewise, if master_channel_map has channels that the master source doesn't actually have, then other channels may be used as a substitute for the missing channels. This is often undesirable when using module-remap-source, so it's a common thing to disable remixing.
Here's an example for swapping the channels of a stereo source. We assume that the system has a stereo source named 'alsa_input.pci-0000_00_1b.0.analog-stereo'.
module-tunnel-{sink,source}
Tunnel a remote sink/source to a local 'ghost' sink/source. Requires a running PulseAudio daemon on the remote server with module-native-protocol-tcp loaded. See Network Setup for reasons on whether to use a tunnel or direct connection to the remote server.
- server
- The server to connect to
- source
- The source on the remote server. Only available for module-tunnel-source.
- sink
- The sink on the remote server. Only available for module-tunnel-sink.
- cookie
- The authentication cookie file to use.
- auto
- Since 5.0. A boolean. If this is set to true, then the default connection parameters and default remote device are gathered from the environment in the same way as applications do. This is usually a bad idea: the default server is very likely the same server where the tunnel module is being loaded, so enabling this option carelessly will probably cause the local server to connect to itself.
module-tunnel-sink-new
Since 5.0
This is a reimplementation of module-tunnel-sink. Once this new version is ready, it will be renamed to module-tunnel-sink and the old implementation will be removed. Note that if you load the module in some configuration file or script, that will break when the rename will happen.
- sink_name
- Name for the local sink.
- sink_properties
- Additional properties for the local sink.
- server
- The server to connect to. (mandatory argument)
- sink
- The remote sink to connect to.
- format
- The sample format of the local sink (the local format is also what will be used in the stream that is sent over the network). See supported audio formats for possible values.
- channels
- The number of channels of the local sink (the local channel count is also what will be used in the stream that is sent over the network).
- channel_map
- The channel map of the local sink.
- rate
- The sample rate of the local sink (the local sample rate is also what will be used in the stream that is sent over the network).
- cookie
- The cookie file to be used when authenticating to the remote server.
module-tunnel-source-new
Since 5.0
This is a reimplementation of module-tunnel-source. Once this new version is ready, it will be renamed to module-tunnel-source and the old implementation will be removed. Note that if you load the module in some configuration file or script, that will break when the rename will happen.
- source_name
- Name for the local source.
- source_properties
- Additional properties for the local source.
- server
- The server to connect to. (mandatory argument)
- source
- The remote source to connect to.
- format
- The sample format of the local source (the local format is also what will be used in the stream that is received over the network). See supported audio formats for possible values.
- channels
- The number of channels of the local source (the local channel count is also what will be used in the stream that is received over the network).
- channel_map
- The channel map of the local source.
- rate
- The sample rate of the local source (the local sample rate is also what will be used in the stream that is received over the network).
- cookie
- The cookie file to be used when authenticating to the remote server.
module-esound-sink
Create a playback sink using an ESOUND server as backend. Whenever you can, try to omit this module since it has many disadvantages including bad latency and even worse latency measurement.
This module lacks the channel_map argument.
- server
- The server to connect to
- cookie
- The authentication cookie file to use.
Protocols
module-cli
Provides the user with a simple command line interface on the controlling TTY of the daemon. This module may not be loaded more than once.
- exit_on_eof
- Accepts a binary numerical argument specifying whether the daemon should exit after an EOF was received from STDIN (default: 0)
module-cli-protocol-{unix,tcp}
An implementation of a simple command line based protocol for controlling the PulseAudio daemon. If loaded, the user may connect with tools like
netcat
, telnet
or bidilink
to the listening sockets and execute commands the same way as with module-cli.Beware: Users are not authenticated when connecting to this service.
This module exists in two versions: with the suffix -unix the service will listen on an UNIX domain socket in the local file system. With the suffix -tcp it will listen on a network transparent TCP/IP socket. (Both IPv6 and IPv4 - if available)
This module supports the following options:
- port (only for -tcp)
- The port number to listen on (defaults to 4712)
- loopback (only for -tcp)
- Removed in 0.9.3: Accepts a numerical binary value. If 1 the socket is bound to the loopback device, i.e. not publicly accessible. (defaults to 1)
- listen (only for -tcp)
- The IP address to listen on. If specified, supersedes the value specified in loopback=
- socket (only for -unix)
- The UNIX socket name (defaults to /tmp/pulse/cli)
module-simple-protocol-{unix,tcp}
An implementation of a simple protocol which allows playback by using simple tools like netcat. Just connect to the listening socket of this module and write the audio data to it, or read it from it for playback, resp. recording.
Beware! Users are not authenticated when connecting to this service.
See module-cli-protocol-{unix,tcp} for more information about the two possible suffixes of this module.
In addition to the options supported by module-cli-protocol-*, this module supports:
- rate, format, channels
- Sample format for streams connecting to this service. See supported audio formats for possible values for the format argument.
- playback, record
- Enable/disable playback/recording
- sink, source
- Specify the sink/source this service connects to
module-esound-protocol-{unix,tcp}
An implementation of a protocol compatible with the Enlightened Sound Daemon (ESOUND, esd). When you load this module you may access the PulseAudio daemon with tools like esdcat, esdrec or even esdctl. Many applications, such as XMMS, include support for this protocol.
See module-cli-protocol-{unix,tcp} for more information about the two possible suffixes of this module.
In addition to the options supported by module-cli-protocol-*, this module supports:
- sink, source
- Specify the sink/source this service connects to
- auth-anonymous
- If set to 1 no authentication is required to connect to the service
- auth-cookie
- New in 0.9.12: Name of the cookie file for authentication purposes. Defaults to '.esd_auth'. The homedir of the user running pulse is automatically prepended to non-absolute paths.
- auth-cookie-enabled
- New in 0.9.12: enable/disable auth-cookie authentication, takes a boolean value (0 or 1). Defaults to 1.
- cookie
- The old name for auth-cookie. Don't use this, it's only here for compatibility with versions before 0.9.12.
- auth-ip-acl (only for -tcp}
- New in 0.9.3: A semicolon separated list of IP address range to which anonymous access is allowed.
Example:auth-ip-acl=10.11.12.13;192.168.50.0/24;127.0.0.0/8
- New in 0.9.3: A semicolon separated list of IP address range to which anonymous access is allowed.
module-native-protocol-{unix,tcp}
The native protocol of PulseAudio.
See module-cli-protocol-{unix,tcp} for more information about the two possible suffixes of this module.
In addition to the options supported by module-cli-protocol-*, this module supports:
- auth-anonymous
- If set to true, no authentication is required to connect to the service
- auth-group (only for -unix)
- Members of the specified unix group may access the server without further authentication. If the daemon is running in system-wide mode (
--system
passed when starting up) defaults topulse-access
, otherwise is disabled.
- Members of the specified unix group may access the server without further authentication. If the daemon is running in system-wide mode (
- auth-group-enable (only for -unix)
- Enable/disable auth-group authentication, takes a boolean value. If
auth-group=
is specified or started in system-wide mode defaults to true, otherwise false.
- Enable/disable auth-group authentication, takes a boolean value. If
- auth-cookie
- Path to the cookie file. If the path is relative, the cookie will be searched from the normal configuration directories. The cookie file contains random data that is used as a shared secret between the server and the clients.
- auth-cookie-enabled
- Enable/disable auth-cookie authentication, takes a boolean value. Defaults to true.
- cookie
- The old name for auth-cookie. Don't use this, it's only here for compatibility with versions before 0.9.12.
- auth-ip-acl (only for -tcp}
- A semicolon separated list of IP address range to which anonymous access is allowed. Example: auth-ip-acl=10.11.12.13;192.168.50.0/24;127.0.0.0/8
- srbchannel (only for -unix)
- Enable/disable the srbchannel communication mechanism, takes a boolean value.
module-native-protocol-fd
This is used internally when auto spawning a new daemon. Don't use it directly.
module-http-protocol-tcp
A proof-of-concept HTTP module, which can be used to introspect the current status of the PulseAudio daemon using HTTP. Just load this module and point your browser to http://localhost:4714/. This module takes the same arguments as module-cli-protocol-tcp.
Saving/restoring settings
module-default-device-restore
Since 0.9.7. Automatically restore the default sink and source (configuration is saved in a file)
module-card-restore
Automatically restore profile of cards.
module-device-restore
Since 0.9.11. Automatically restore the volume/mute state of devices (configuration is saved in a GDBM database)
- restore_volume
- Restore volume (default to true)
- restore_muted
- Restore mute state (default to true)
Since 0.9.16
- restore_port
- Restore port (default to true)
module-stream-restore
Since 0.9.11. Automatically restore the volume/mute/device state of streams (configuration is saved in a GDBM database)
- restore_volume
- Restore volume (default to true)
- restore_muted
- Restore mute state (default to true)
- restore_device
- Restore the selected sink/source (default to true)
- on_hotplug
- Since 0.9.16. Recheck streams when new device becomes available. (default to true)
- on_rescue
- Since 0.9.16. Recheck streams when device becomes unavailable. (default to true)
- fallback_table
- Since 2.0. File name for a fallback table, containing stream-restore entries (with volume only). The file name can be absolute or relative to the configuration directory. When module-stream-restore is loaded, each fallback entry is saved to the database if that entry didn't already exist. The original purpose was to have a way to configure initial volumes for streams already before the first boot. If this argument is not specified, 'stream-restore.table' will be loaded if it happens to exist (by default it doesn't). The file format is explained in the example file.
module-device-manager
Since 0.9.20. Implement a history of devices and a per-role device priority list routing scheme. This module was primary written to enable the routing system employed in KDE to work at a lower level. It is conditionally loaded via the start-pulsaudio-kde script which only runs when working with KDE sessions. The longer term goal for this module is for the functionality to be integrated into PA more fully. See Software/PulseAudio/RFC/PriorityRouting
- do_routing
- Enable the routing mode.
X Window System
module-x11-bell
Intercepts X11 bell events and plays a sample from the sample cache on each occurence.
- display
- X11 display to connect to. If ommited defaults to the value of $DISPLAY
- sample
- The sample to play. If omitted defaults to x11-bell. Note that this is not a file name, but a name that is given to the sample when the sample is loaded. This module doesn't load any sample itself. Instead, use load-sample with pacmd or in default.pa.
- sink
- Name of the sink to play the sample on. If omitted defaults to the default sink.
module-x11-publish
Publishes the access credentials to the PulseAudio server in the X11 root window. The following properties are used: PULSE_SERVER, POYLP_SINK, PULSE_SOURCE, PULSE_COOKIE. This is very useful when using SSH or any other remote login tool for logging into other machines and getting audio playback to your local speakers. The PulseAudio client libraries make use of this data automatically. Instead of using this module you may use the tool pax11publish which may be used to access, modify and import credential data from/to the X11 display.
- display
- X11 display to connect to. If omitted defaults to the value of $DISPLAY
- sink
- Name of the default sink. If omitted this property isn't stored in the X11 display.
- source
- Name of the default source. If omitted this property isn't stored in the X11 display.
- cookie
- Name of the cookie file of the cookie to store in the X11 display. If omitted the cookie of an already loaded protocol module is used.
module-x11-xsmp
Since 0.9.7. Register to the X11 session manager
- session_manager
- Session manager to connect to. If omitted defaults to the value of $SESSION_MANAGER
- display
- X11 display to connect to. If omitted defaults to the value of $DISPLAY
Volume Control
Common options to both modules
- sink
- The sink to control
Since 1.0
- volume_limit
- Volume limit.
- volume_step
- Volume change step size
module-mmkbd-evdev
Adjust the volume of a sink when the special multimedia buttons of modern keyboards are pressed.
- device
- Linux input device ('evdev', defaults to /dev/input/event0)
module-lirc
Adjust the volume of a sink when the volume buttons of an infrared remote control are pressed (through LIRC).
- config
- The LIRC configuration file
- appname
- The application name to pass to LIRC (defaults to PulseAudio)
Here is a sample ~/.lircrc entry configured to forward signals to PulseAudio. Note that you may have to change the button names (Vol_Up, Vol_Down..) to match those in your /etc/lirc/lircd.conf.
Available configs include: volume-up, volume-down, mute, mute-toggle and reset.
Bluetooth
module-bluetooth-discover
Detects available bluetooth audio devices using BlueZ.
Some hardware uses alsa devices for the SCO link (used by the HSP/HFP and HFGW profiles). This is called the 'SCO over PCM' mode. For such hardware, the alsa sink and source need to be specified with the 'sco_sink' and 'sco_source' arguments. This feature is only available with BlueZ 4.
- headset
- The backend for HSP/HFP. Supported values: 'native', 'ofono', 'auto'. The native backend doesn't have any extra dependencies. The ofono backend depends on oFono. Available with BlueZ 5 only.
- sco_sink
- Name of the alsa sink that should be used in the 'SCO over PCM' mode. Available with BlueZ 4 only.
- sco_source
- Name of the alsa source that should be used in the 'SCO over PCM' mode. Available with BlueZ 4 only.
module-bluetooth-policy
Takes care of any bluetooth specific policy. Currently two features are implemented:
- Switch the card profile automatically to 'hfgw' or 'a2dp_source' when the remote end starts playing audio.
- Load module-loopback automatically for A2DP and HFGW sources, so that the received audio is automatically played back to some output.
- Switch the card automatically between HSP/HFP and A2DP for headsets based on heuristics
Supported arguments:
- a2dp_source
- A boolean argument controlling whether the module-loopback loading should be enabled for A2DP sources.
- hfgw
- A boolean argument controlling whether the module-loopback loading should be enabled for HFGW sources.
- auto_switch
- An integer argument controlling whether Bluetooth devices (like headsets) should be switched between HFP and A2DP modes based on active streams
- If set to 0, this is disabled
- If set to 1, the switch happens when a capture stream with the 'media.role' property set to 'phone' appears (default)
- If set to 2, the switch happens based on some heuristics to detect whether there is a real need for a capture device to be available
module-bluetooth-proximity
Since 0.9.11 Bluetooth proximity volume control
- sink
- The sink to adjust the volume
- hci
- hci device
RTP/SDP/SAP Transport
PulseAudio can stream audio data to an IP multicast group or unicast address via the standard protocols RTP, SAP and SDP (RFC3550, RFC3551, RFC2327, RFC2327). This can be used for multiple different purposes: for sharing a single microphone on multiple computers on the local LAN, for streaming music from a single controlling PC to multiple PCs with speakers or to implement a simple 'always-on' teleconferencing solution.
The current implementation is designed to be used exclusively in local area networks, though Internet use is theoretically supported. Only uncompressed audio is supported, hence you won't be able to transmit more than a few streams at the same time over a standard LAN.
PulseAudio implements both a sender and a receiver for RTP traffic. The sender announces itself via SAP/SDP on the same multicast group or unicast address that it sends RTP data to. The receiver picks up the SAP/SDP announcements and creates a playback stream for each session. Alternatively you can use any RTP capable client to receive and play back the RTP data (such as mplayer, see How To Listen To The Rtp Stream).
module-rtp-send
This is the sender side of the RTP/SDP/SAP implementation. It reads audio data from an existing source and forwards it to the network encapsulated in RTP. In addition it sends SAP packets with an SDP session description.
In combination with the monitor source of module-null-sink you can use this module to create an RTP sink.
- source
- The source to read the audio data from.
- format
- The sample format. See supported audio formats for possible values.
- channels
- The number of channels.
- rate
- The sample rate.
- destination_ip
- Since 4.0. Destination multicast group or unicast address for both RTP and SAP packets.
- source_ip
- Since 4.0. On a multi-homed system, you may wish RTP to be used only on a specific interface. The interface can be selected by specifying the source IP address.
- port
- Destination port number of the RTP traffic. Keep in mind that the RFC suggests to use only even port numbers for RTP traffic.
- mtu
- Maximum payload size for RTP packets.
- loop
- Takes a boolean value, specifying whether locally generated RTP traffic should be looped back to the local host.
- ttl
- The 'time to live' value.
- inhibit_auto_suspend
- Since 5.0. The policy for interacting with the automatic source suspension logic. module-suspend-on-idle suspends devices when no streams are connected to them, or if all connected streams are marked to be ignored by module-suspend-on-idle. This argument controls whether and when the stream that module-rtp-send creates is marked to be ignored by module-suspend-on-idle. There are three options: 'always', 'never' and 'only_with_non_monitor_sources'. The 'always' option prevents module-suspend-on-idle from ever suspending the source, the 'never' option allows module-suspend-on-idle to always suspend the source and the 'only_with_non_monitor_sources' option allows module-suspend-on-idle to suspend monitor sources, but not 'regular' sources. The important case where this argument really matters is when module-rtp-send is connected to a monitor source. You should choose the 'always' option if you want to send silence to the network when nothing is playing to the monitored sink. You should choose the 'only_with_non_monitor_sources' option if you want to pause the RTP stream when nothing is playing to the monitored sink. The 'never' option is not really useful, because it doesn't make sense to suspend non-monitor sources like microphones. The 'never' option only exists as a logical complement the 'always' option - if you find the 'never' option useful anyway, we'd be interested to hear about your use case.
module-rtp-recv
This is the receiver side of the RTP/SDP/SAP implementation. It picks up SAP session announcements and creates an RTP playback stream for each.
In combination with module-null-sink you can use this module to create an RTP source.
- sink
- The sink to connect to. If omitted defaults to the default sink.
- sap_address
- The address used to listen for SAP announcements, defaults to 224.0.0.56. It can be either a multicast group or a unicast address.
- latency_msec
- The desired latency due to local buffering (the network latency and buffering at the sender's end are beyond PulseAudio's control and knowledge, so they aren't counted here).
RAOP Sink (Wireless Network Sound aka Apple Airtunes)
PulseAudio can stream audio data to products that support the RAOP protocol.
module-raop-discover
mDNS/DNS-SD Service Discovery of RAOP devices
module-raop-sink
The main module used to create a virtual output device which pipes all audio to the RAOP device.
- sink_name
- The name of the sink (see Modules)
- server
- The server to connect to
- sink_properties, format, rate, channels
- All supported as per Modules
JACK Connectivity
PulseAudio can be hooked up to a JACK Audio Connection Kit server which is a specialized sound server used for professional audio production on Unix/Linux. Both a PulseAudio sink and a source are available. For each channel a port is created in the JACK server.
module-jack-sink
This module implements a PulseAudio sink that connects to JACK and registers as many output ports as requested.
- sink_name
- The name for the PulseAudio sink. If omitted defaults to jack_out.
- sink_properties
- Extra properties to be stored in the sink's property list.
- server_name
- The JACK server to connect to. If omitted defaults to the default server.
- client_name
- The client name to tell the JACK server. If omitted defaults to PulseAudio.
- channels
- Number of channels to register. If omitted defaults to the number of physical playback ports of the JACK server.
- channel_map
- Channel map. A list of comma-separated channel names. Must have the same number of channels as the channels argument.
- connect
- Takes a boolean value. If enabled (the default) PulseAudio will try to connect its ports to the physical playback ports of the JACK server
module-jack-source
This module implements a PulseAudio source that connects to JACK and registers as many input ports as requested. Takes the same arguments as module-jack-sink, except for sink_name which is replaced by source_name (with a default of jack_in) and sink_properties which is replaced by source_properties for obvious reasons.
module-jackdbus-detect
This module automatically adds JACK sinks and sources whenever the JACK server is started. For this to work, you need to use JACK 2, and enable JACK's D-Bus interface.
- channels
- The number of channels to create for both module-jack-sink and module-jack-source. If omitted, the sink will use the number of physical output ports and the source will use the number of physical input ports registered in the JACK server.
- sink_name, sink_properties
- Will be passed through to module-jack-sink as-is. Since 15.0
- sink_client_name
- Will be passed through to module-jack-sink as client_name. Since 15.0
- sink_channels
- Will be passed through to module-jack-sink as channels. Overrides the unified sink/source channels argument. Since 14.0
- sink_channel_map
- Will be passed through to module-jack-sink as channel_map. Since 15.0
- source_name, source_properties
- Will be passed through to module-jack-source as-is. Since 15.0
- source_client_name
- Will be passed through to module-jack-source as client_name. Since 15.0
- source_channels
- Will be passed through to module-jack-source as channels. Overrides the unified sink/source channels argument. Since 14.0
- source_channel_map
- Will be passed through to module-jack-source as channel_map. Since 15.0
- connect
- Takes a boolean value. If enabled (the default) PulseAudio will try to connect its ports to the physical playback ports of the JACK server.
Filters
These modules create a virtual sink and/or source on top of a given sink and source and filter the data flowing through.
module-echo-cancel
Used to perform acoustic echo cancellation between a designated sink and source. Since 1.0
- source_name
- Name to give the virtual source that is created
- source_properties
- Properties to set on the virtual source
- source_master
- Name of the source to filter
- sink_name
- Name to give the virtual sink that is created
- sink_properties
- Properties to set on the virtual sink
- sink_master
- Name of sink to filter
- autoloaded
- Set if this module is being loaded automatically. Don't set this manually unless you know what you're doing.
- use_volume_sharing
- Whether to use volume sharing with master sink/source
- adjust_time
- How often to readjust sync between sink and source (in seconds)
- adjust_threshold
- Since 2.0. How much drift to readjust after (in milliseconds)
- format
- The sample format of the virtual sink and source. See supported audio formats for possible values.
- rate
- The sample rate of the virtual sink and source.
- channels
- The number of channels of the virtual sink and source.
- channel_map
- The channel map of the virtual sink and source.
- use_master_format
- Use format/rate/channels from the master source and sink
- aec_method
- Specific AEC implementation to use ('speex', 'webrtc', 'adrian' (not a very good canceller) or 'null').
- aec_args
- Parameters for the AEC engine. In case there are multiple arguments, enclose the value in quotes and separate the arguments with spaces, like this: aec_args='arg1=value1 arg2=value2'. The set of supported arguments vary depending on the selected AEC method.
- speex:
- (to be documented)
- webrtc:
- (most arguments are yet to be documented)
- beamforming
- A boolean, set to true to enable beamforming. When enabling this, the 'mic_geometry' argument has to be given too. The 'target_direction' argument can be used to configure the beamforming target direction.
- mic_geometry
- The microphone positions for beamforming. The value is a list of numbers (coordinates). For example, a microphone array containing two mics would require six numbers: 'x1,y1,z1,x2,y2,z2'. In that example, the first three numbers specify the coordinates of the first mic relative to the center of the microphone array, and the last three numbers specify the coordinates of the second mic. All distances are given in meters.'x' is the horizontal coordinate, with positive values being to the right from the mic array's perspective.'y' is the depth coordinate, with positive values being in front of the array.'z' is the vertical coordinate, with positive values being above the array.
As an example, if you have a webcam with 2 microphones 8cm apart, and you want to point it forwards, you could usepactl load-module module-echo-cancel use_master_format=1 aec_method='webrtc' aec_args='beamforming=1 mic_geometry=-0.04,0,0,0.04,0,0'
- target_direction
- The target position relative to the centre of the mic array, for beamforming. The value is a list of three numbers (a spherical point): 'a,e,r'. 'a' is the azimuth of the target in radians. Zero radians azimuth points to the right of the mic array, and positive angles move in a counter-clockwise direction. 'e' is the elevation of the target in radians. Zero radians elevation means that the target is on the same level horizontally as the center of the array, and positive angles go upwards. 'r' is the radius, i.e. the distance from the center of the array (in meters).
- adrian:
- (to be documented)
- null:
- (to be documented)
- save_aec
- If set, saves AEC data in /tmp/aec_*
module-equalizer-sink
General purpose equalizer that can be applied over a given sink. Since 1.0
- sink_name
- Name to give the virtual sink that is created
- sink_properties
- Properties to set on the virtual sink
- sink_master
- Name of sink to filter
- autoloaded
- Set if this module is being loaded automatically. Don't set this manually unless you know what you're doing.
- use_volume_sharing
- Whether to use volume sharing with master sink/source
module-ladspa-sink
Adds signal processing (for example equalizing) to a sink with a LADSPA plugin.
The module shows up as a separate sink.
- sink_name
- Name for this sink.
- sink_properties
- Extra properties to be stored in the sink's property list.
- master
- The sink where the processed audio is forwarded to.
- channels, rate, channel_map
- Normal sink parameters. It's best to leave these unspecified, so that the master sink parameters will be used.
- plugin
- The name of the .so file that contains the desired filter without the '.so' part. Specify only the file name, not the full directory path. The directories where the plugin files are searched from can be specified with the environment variable LADSPA_PATH. Multiple directories can be specified using colon (:) as the separator. If the environment variable isn't set, '$libdir/ladspa:/usr/local/lib/ladspa:/usr/lib/ladspa' is used instead ($libdir is specified at build time, so the default search path should include the directory where your distribution installs LADSPA plugins).
- label
- One plugin file may contain multiple plugins, which are identified by a label. Specify it here.
- control
- If the plugin has control input ports, you have to specify their values here. That is done by simply listing the numeric values using comma as the separator. Default values can be used by leaving the number out. Examples: Plugin with five control ports, leaving the third to the default value:
control=0.34,-2.3,0.00346,5
Plugin with three control ports, leaving all to the default values:control=,
- If the plugin has control input ports, you have to specify their values here. That is done by simply listing the numeric values using comma as the separator. Default values can be used by leaving the number out. Examples: Plugin with five control ports, leaving the third to the default value:
- input_ladspaport_map
- Comma separated list of input LADSPA audio port names. The list is matched with the sink channel map so that each LADSPA port in the list is assigned for the corresponding channel channel map. If this argument is not given, the ports are assigned in the order that the plugin lists them.
- output_ladspaport_map
- Comma separated list of output LADSPA audio port names. The list is matched with the sink channel map so that each LADSPA port in the list is assigned for the corresponding channel channel map. If this argument is not given, the ports are assigned in the order that the plugin lists them.
An example: adding an equalizer to a normal alsa sink (on Debian the mbeq plugin is in the
swh-plugins
package).The control values can't be modified at run-time, so it can be a problem to figure out good control values for the plugin. The writer of this documentation used JACK Rack to find the values. This is a good solution if you already are familiar with Jack, but if you're not, this is one more thing to learn. If someone knows a handier way to fiddle with the parameters, please edit this page.
Control output ports are ignored.
module-virtual-surround-sink
Simulates surround sound when using headphones.
The module shows up as a separate sink. You can set the following parameters:
- sink_name
- Name for this sink.
- sink_properties
- Properties to set on the virtual sink.
- master
- The sink where the processed audio is forwarded to.
- hrir
- The hrir file that should be used. The module will convolve the input signal with the HRIR to create the output signal.
The hrir file is expected to have a channel map corresponding to the desired virtual surround sink, for example the standard 5.1 or 7.1 channel map. Each channel should contain the HRIR data for the left ear corresponding to the channel's speaker position.
Example:
You might want to put this line in ~/.config/pulse/default.pa since the HRIR file for best results can be different for every user.
Some HRIR files can be found here and here.The HRIR file from the first link was recorded using a dummy head. It was designed to work well for most people.The second link contains many HRIR files that where recorded using real heads. You should play back the files in the demos folder. Then, you should decide which gives you the best impression of a noise moving around your head in a circle. You can find the corresponding HRIR file for this module in the hrirs folder.
Miscellaneous
module-allow-passthrough
Since 10.0. This module ensures that passthrough streams are always allowed to play on sinks. The default policy in PulseAudio is to only allow exclusive access if nothing else is currently using the sink. With this module, all the existing streams are muted (by being re-routed to the null sink) when a passthrough stream comes in, allowing the passthrough stream to exclusively use the sink.
This is particularly useful with media centers and HTPC boxes (e.g. Kodi media center) where we usually always want to be able to start a video even if an external notification sound happened to be playing at the same time.
module-always-sink
Since 0.9.11. Always keeps at least one sink loaded even if it's a null one
- sink_name
- The name for the new virtual sink.
module-console-kit
Since 0.9.11. Create a client for each ConsoleKit session of this user
This module doesn't do anything on systems that use systemd, so this module can be loaded at the same time with module-systemd-login.
module-detect
This module is deprecated on systems where udev is available. Please use module-udev-detect instead.
Automatically detect the available sound hardware and load modules for it. Supports OSS, ALSA, Solaris and Win32 output drivers, and the information is taken directy from them, not through udev.
Do not use this together with module-udev-detect!
The parameter:
- just-one
- If set to 1 the module will only try to load a single sink/source and than stop.
module-esound-compat-spawnfd
This is a compatibility module for libesd based autospawning of PulseAudio. Don't use it directly.
module-esound-compat-spawnpid
This is a compatibility module for libesd based autospawning of PulseAudio. Don't use it directly.
module-filter-apply
Tracks when a stream is created, moved and properties list changed.
Checks if this is a group filter, which uses a paired source and sink and therefore requires a paired source output and sink input.In this case, the filter is loaded only if the paired stream exists as well.
Two streams are considered paired if they have the same 'filter.apply' property and the same stream group identifier.Currently, the only group filter is 'echo-cancel'.
Checks if the user did specify additional module paraterer via the 'filter.apply..parameters' property.
Loads the 'module-' module. The 'master' or the 'source_master' and 'sink_master' arguments are set to the name of the source or sink to which the stream or paired streams are currently connected.If the user did specify additional parameters, they are also passed to the module.
Finds the newly loaded filter source or sink.
Moves the stream or paired streams to the filter source or sink.
Parameters:
- autoclean
- Unload unused filters every ten seconds if true. Default: true.
module-filter-heuristics
Tracks when a stream is created or moved.
Converts the 'filter.want' to 'filter.apply' property, unless is filtered out.
The filtering list is hard-coded, and currently there is only one situation where 'echo-cancel' is filtered out for 'phone' intended role.
module-loopback
Since 0.9.16. This allows one to route audio from a source directly back to a sink. This module performs adaptive resampling to adjust for slight differences in the clock speeds of the source and sink devices. This prevents the latency from drifting too far from the target specified in the latency_msec parameter. The resampling can be quite CPU intensive.
- source
- The name of the input source to connect to. If not specified the source will be picked automatically. You can use a tool like pavucontrol to move the loopback stream to the right source.
- sink
- The name of the sink the audio is forwarded to. If not specified the sink will be picked automatically.
- adjust_time
- How often to readjust the sample rates in seconds. Defaults to 10.
- latency_msec
- The desired latency in milliseconds, from 1 to 2000. Defaults to 200. (Note that this is only a friendly request, the actual latency might be higher or lower than this value.)
- format
- The sample format. See supported audio formats for possible values. Defaults to that of the specified source, or if that's unspecified, then to that of the specified sink, or that's unspecified too, then to that of the source that the loopback gets assigned.
- rate
- The sample rate. Defaults to that of the specified source, or if that's unspecified, then to that of the specified sink, or that's unspecified too, then to that of the source that the loopback gets assigned.
- channels
- Number of source channels to use. Defaults to that of the specified source, or if that's unspecified, then to that of the specified sink, or that's unspecified too, then to that of the source that the loopback gets assigned.
- channel_map
- List of the channels to connect to the sink.
- sink_input_properties
- Since 1.0. Property list for the playback stream object.
- source_output_properties
- Since 1.0. Property list for the capture stream object.
- source_dont_move
- Since 1.0. Takes a boolean value. Disallows moving the capture stream to some other than the initial source. Defaults to 'false'.
- sink_dont_move
- Since 1.0. Takes a boolean value. Disallows moving the playback stream to some other than the initial sink. Defaults to 'false'.
- remix
- Since 1.0. Takes a boolean value. If the channel map of the capture stream doesn't match the source's channel map, or the channel map of the playback stream doesn't match the sink's channel map, the mismatch has to be handled somehow. If remixing isn't disabled in the global server configuration, by default the audio will get remixed. This parameter can be used to disable remixing for the loopback streams (but if remixing is disabled in the global server configuration, this parameter can't be used for forcing remixing - setting this parameter simply has no effect at all).
module-match
Adjust the volume of a playback stream automatically based on its name.
- table
- The regular expression matching table file to use (defaults to ~/.pulse/match.table)
The table file should contain a regexp and volume on each line, separated by spaces. An example:
The volumes of all streams with titles starting with sample: are automatically set to 32000. (FYI: All sample cache streams start with sample:)
module-position-event-sounds
Since 0.9.11. Position event sounds between L and R depending on the position on screen of the widget triggering them.
module-rescue-streams
Automatically route a stream whose sink has become unavailable (e.g. USB hw plugged out) to another working sink.
module-role-ducking
This module lowers the volume of less important streams when a more important stream appears, and raises the volume back up once the important stream has finished (this is called 'ducking'). The decision whether a stream has high or low priority is made based on the stream role (the media.role property). By default, 'music' and 'video' streams are ducked, and 'phone' streams trigger the ducking.
- trigger_roles
- Comma separated list of roles that will trigger ducking.
- ducking_roles
- Comma separated list of roles that will be ducked.
- global
- A boolean. If true, ducking will be applied to all streams that have a ducking role. If false, ducking will be applied only to streams that are connected to the same device as the triggering stream.
- volume
- Attenuation to be used while ducking. The value can be given either as a percentage (for example, '40%'), in decibels (for example, '-20dB') or as a plain integer between 0 and 65536 (this is the representation that PulseAudio uses for volume internally).
module-sine
Creates a sink input and generates a sine waveform stream.
- sink
- The sink to connect to. If omitted defaults to the default sink.
- frequency
- The frequency to generate in Hertz. Defaults to 440.
module-sine-source
Hedge 19 2 7. Creates a source and generates a sine waveform stream.
- source_name
- Name for the source. (defaults to sine_input)
- rate
- Sample rate for the source.
- frequency
- The frequency to generate in Hertz. Defaults to 440.
module-suspend-on-idle
Since 0.9.11. Disconnects sinks and sources from their backend after a predetermined amount of idle time. Idle time is accumulated when the sink/source in question is not connected to any streams.
Advantages: Saves power. ALSA uses considerably more CPU cycles when pulseaudio has to send empty data to the soundcard during idle. If you don't plan to have an active stream all the time, set the timer to a low value for best power savings.
Disadvantages: When pulseaudio gives up the backend, and the backend is not capable of mixing, errant applications can grab the sound device and hold exclusive control over it, making pulseaudio stop working. If pulseaudio does not give up the backend, errant applications won't be able to play sound, but they will not disrupt pulseaudio's operation either. This scenario is possible 99% of the time, since most users run an ALSA sink/source without a card that has software mixing. An 'errant application' would, for example, try to open hw:0 or front:0 rather than the 'default' ALSA device.
- timeout
- Time, in seconds, which must elapse before a sink or source is deemed idle.
module-switch-on-connect
Since 1.0. Whenever a new sink or source appears, this module will switch the default sink/source to be the new sink/source. Prior to PulseAudio 14.0, the module also moved all currently running streams to the new sink/source (now it's done automatically by the core when the default device changes).
Earlier this module was required to automatically switch to a newly plugged in USB sound card, but nowadays USB sound cards have higher priority than internal sound cards, so they automatically become the default sink (unless you have manually configured the default sink to be something else) and the need for this module is greatly reduced. But if you run into a situation where you're creating a new sink and PulseAudio isn't making it the default sink automatically, this module can help.
This module can be used together with module-switch-on-port-available, the two modules do different things.
This module is not loaded by default, beacuse it's a bit too aggressive. If the user sets the default sink or source manually, that choice gets forgotten when plugging in a new sound card, which can be undesirable. That said, some distributions alter the default configuration to include module-switch-on-connect.
- blacklist
- Since 14.0. Takes a regular expression. The regular expression is matched against device names, and devices that match are ignored. An empty string disables the blacklist. Default: 'hdmi'.
- ignore_virtual
- Since 12.0. Takes a boolean value. If set to true, new virtual sinks and sources don't trigger a device switch. Default: true.
- only_from_unavailable
- Since 6.0. Takes a boolean value. If set to true, the device switch is only done if the current default device is currently marked as unavailable. Default: false.
module-switch-on-port-available
Since 2.0. Automatically switches the card profile and/or device port when a port changes its availablility status. In practice this happens when plugging in or out something to/from a 3.5mm connector (not on USB sound cards, though, since they don't support jack detection) or a HDMI connector.
This module is recommended in most setups, and is part of the default configuration. In particular, this is very useful on laptops to automatically switch between headphones and internal speakers when headphones are plugged in and out.
This module can be used together with module-switch-on-connect, the two modules do different things.
module-systemd-login
Since 2.0. Create a client for each login session of this user.
This module doesn't do anything on systems that don't use systemd, so this module can be loaded at the same time with module-console-kit.
module-udev-detect
Since 0.9.16. Detects ALSA audio devices on the system using udev.
- tsched
- Enable timer based scheduling?
- tsched_buffer_size
- Since 4.0. Buffer size in bytes when timer based scheduling is enabled.
- fixed_latency_range
- Since 2.0. Boolean. Normally when there's an alsa underrun or overrun, and timer based scheduling is used, the alsa sink or source will raise the minimum latency that applications can get to avoid further underruns or overruns. If this option is enabled, the minimum latency will stay constant even if underruns or overruns occur.
- ignore_dB
- Ignore the decibel information that ALSA provides?
- deferred_volume
- Since 1.0. Synchronize sw and hw volume changes?
- use_ucm
- Since 4.0. PulseAudio uses ALSA UCM configuration by default if it's available. This argument can be used to disable UCM.
module-zeroconf-discover
Discover sinks/sources on other PulseAudio servers using mDNS Zeroconf.
module-zeroconf-publish
Publish all local sinks/sources using mDNS Zeroconf. For more information, see Network Setup.
< PulseAudio
- 6HDMI output configuration
- 7Surround sound systems
- 8PulseAudio over network
- 11PulseAudio through JACK
- 12PulseAudio through JACK issues
- 20Swap left/right channels
- 24Mixing additional audio into the microphone's audio
Set default input source
List available input sources
The
*
in front of the index indicates the current default input.To set a system wide default, add the source name in the
default.pa
file:For temporary use
Tip: The default source can be referred as
@DEFAULT_SOURCE@
in commands, for example: $ pactl set-source-mute @DEFAULT_SOURCE@ toggle
.Set the default output sink
To list the output sinks available, type the following command:
The
*
in front of the index indicates the current default output.To set a system wide default, add the source name in the
default.pa
file:When done then you can logout/login or restart PulseAudio manually for these changes to take effect.
Note:- The numbering of sinks is not guaranteed to be persistent, so all sinks in the
default.pa
file should be identified by the name. - For quick identification at runtime (e.g. to manage sound volume), you can use the sink index instead of the sink name:
- To avoid unnecessary overriding of 100% normal volume it is better to use alternative utilities for managing of sound. See the forum thread for more information.
Tip: The default sink can be referred as
@DEFAULT_SINK@
in commands, for example: $ pactl set-sink-volume @DEFAULT_SINK@ +5%
.Set the default output sink profile
Sometimes PulseAudio neglects to load the desired profile on start (e.g. a profile for having #Independent analog and digital outputs on the same card). To change the default profile, append the following to
Note:default.pa
:You could also use
<cardindex>
instead of <symbolic-name>
, but using <symbolic-name>
ensures referencing the correct device. <cardindex>
is dynamic, and changes when a new device is plugged in.Find
<symbolic-name>
by running pacmd list-cards
:In this case, I want to use the device with index number 2, so
<symbolic-name>
should be alsa_card.pci-0000_00_14.2
.To find
<profilename>
, set the desired profile manually, then run pacmd list-cards
:In this case,
default.pa
should now be changed to this:You can test your configuration by running
pactl set-card-profile <symbolic-name> <profilename>
.Independent analog and digital outputs on the same card
Sound cards may have both analog and digital (iec958) outputs. Pulseaudio does not generate combined profiles by default, you can choose either digital or analog profiles.
The easiest way to make both outputs available is to add a combined profile to the end of default profile configuration file:
This way a defined profile is added to the end of the list of available profiles.
Although this works, pulseaudio has a nasty habit of falling back to auto-generated profiles, so you may eventually need to set your card back to the combined profile. The best way to overcome this is by writing a custom config with disabled
auto-profiles
. Copy default.conf
to custom-profile.conf
, and edit it to suit your needs (this example is for stereo output/input):Now that you have your custom profile you need to tell pulseaudio to use it. This can be done by defining an udev rule:
First get relevant information about your sound card:
Now create a config file:
Now tell udev to reload sound subsystem
udevadm trigger -ssound
(as the root user) and restart pulseaudio. Your sound card should now use only the defined profile and have both analog and digital outputs available.Simultaneous HDMI and analog output
PulseAudio allows for simultaneous output to multiple sources. In this example, some applications are configured to use HDMI while others are configured to use analog. Multiple applications are able to receive audio at the same time.
Or by using the the
pacmd
command: Shred 1 2 6. The key to a configuration like this is to understand that whatever is selected in pavucontrol under Configuration > Internal Audio is the default device. Load pavucontrol > Configuration and select HDMI as the profile.
To setup the analog device as a secondary source, add the following to the
/etc/pulse/default.pa
configuration at the beginning, before any other modules are loaded: Restart PulseAudio, run pavucontrol and select the 'Output Devices' tab. Three settings should be displayed:
- Internal Audio Digital Stereo (HDMI)
- Internal Audio
- Simultaneous output to Internal Audio Digital Stereo (HDMI), Internal Audio
Now start a program that will use PulseAudio such as MPlayer, VLC, mpd, etc. and switch to the 'Playback' tab. A drop-down list should be available for the running program to select one of the three sources.
Also see this thread for a variation on this theme and PulseAudio FAQ.
HDMI output configuration
As outlined in https://download.nvidia.com/XFree86/gpu-hdmi-audio-document/index.html#_issues_in_pulseaudio unless the HDMI port is the firstoutput, PulseAudio will not be able to have any audio when using certain graphics cards with HDMI audio support. This is because of a bug in PulseAudio where it will only select the first HDMI output on a device. A work around posted further down is to first find which HDMI output is working by using the aplay utility from ALSA.
The original title for this section indicated the problem is specific to nVidia cards. As seen in this forum thread other cards are affected as well. The rest of the section will use an nVidia card as a case-study but the solution should carry over for people using other affected cards.
Finding HDMI output
Then find the working output by listing the available cards
In case your HDMI port is wired to the NVIDIA card, but aplay does not detect an NVIDIA audio card, follow NVIDIA/Troubleshooting#No audio over HDMI.
Testing for the correct card
Now a list of the detected cards is known, users will need to test for which one is outputting to the TV/monitor
where 1 is the card and 3 is the device substitute in the values listed from the previous section. If there is no audio, then try substituting a different device (on my card I had to use card 1 device 7)
Manually configuring PulseAudio to detect the Nvidia HDMI
Having identified which HDMI device is working, PulseAudio can be forced to use it via an edit to
/etc/pulse/default.pa
:where the 1 is the card and the 7 is the device found to work in the previous section
restart pulse audio
open the sound settings manager, make sure that under the hardware tab the graphics cards HDMI audio is set to 'Digital Stereo (HDMI) Output' (My graphics card audio is called 'GF100 High Definition Audio Controller').
Then, open the output tab. There should now be two HDMI outputs for the graphics card. Test which one works by selecting one of them, and then using a program to play audio. For example, use VLC to play a movie, and if it does not work, then select the other.
Automatically switch audio to HDMI
Create a script to switch to the desired audio profile if an HDMI cable is plugged in:
Make the script executable:
Create a udev rule to run this script when the status of the HDMI change:
To make the change effective don't forget to reload the udev rules:
A reboot might be required.
Surround sound systems
Many people have a surround sound card, but have speakers for just two channels, so PulseAudio cannot really default to a surround sound setup. To enable all of the channels, edit
/etc/pulse/daemon.conf
: uncomment the default-sample-channels line (i.e. remove the semicolon from the beginning of the line) and set the value to 6. For a 5.1 setup, or 8 for a 7.1 setup etc.If your channels are not correclty mapped or the volume controls for the individual channels do not work as expected in pavucontrol, and you have a HDMI and an analog soundcard, then try to add the following line to
/etc/pulse/default.pa
Note that this example is for a 5.1 setup.
After doing the edit, restart PulseAudio.
Splitting front/rear
Connect speakers to front analog output and headphones to rear output. It would be useful to split front/rear to separate sinks. Add to
/etc/pulse/default.pa
:Make sure to replace alsa_output.pci-0000_05_00.0.analog-surround-40 with the sound card name shown in 'pacmd list-sinks'.Now you have 2 additional sinks which can be used separately. You can choose 'sink_name' freely, as long as there is no sink with that name already. The 'remix' parameter controls whether the audio should be down-/upmixed to match the channels in the sink.
Tip: If pulseaudio fails with
master sink not found
, comment out the remapping lines, start PulseAudio and verify your card output is set to the one you specified (e.g. analog surround 4.0). Alternatively, try using a sink index[broken link: invalid section] instead of a sink name.Splitting 7.1 into 5.1+2.0
Similar to the example above, you can also split a 7.1 configuration into 5.1 surround and stereo output devices.Set your card to 7.1 mode, then add the following lines to
/etc/pulse/default.pa
:Make sure to replace alsa_output.pci-0000_00_14.2 with your sound card name, get it by running 'pacmd list-sinks'.This configuration will use the front/rear/center+lfe (green/black/orange) jacks for the 5.1 sink and the side (grey) jack for the stereo sink.It will also downmix any audio to stereo for the stereo sink, but will not touch the 5.1 output.
Tip: If pulseaudio fails with
master sink not found
, comment out the remapping lines, start PulseAudio and verify your card output is set to analog surround 7.1. Alternatively, try using a sink index[broken link: invalid section] instead of a sink name.Disabling LFE remixing
By default, PulseAudio remixes the number of channels to the default-sample-channels and since version 7 it also remixes the LFE channel. If you wish to disable LFE remixing, uncomment the line:
and replace yes with no:
then restart Pulseaudio.
Binaural Headphones
ladspa-bs2bAUR provides a plugin to simulate surround sound on stereo headphones. To use it, find your headphones with:
Load the plugin (new sink_name is up to you, master=headphone's sink name):
Use pavucontrol to transfer streams to the new sink, or: Tidy up 5 0 8.
PulseAudio over network
One of PulseAudio's unique features is its ability to stream audio from clients over TCP to a server running the PulseAudio daemon reliably within a LAN. Ensure that client and server systems agree on the time (i.e., use NTP), or audio streams may be choppy or may not work at all. For a more detailed guide visit the Official PulseAudio Documentation
Enable the TCP module on the server(the computer that actually outputs sound), edit
/etc/pulse/default.pa
to add or uncomment:Or you can use the
paprefs
gui application (root is not required):To make sure module-native-protocol-tcp is loaded on the server, you can use:
It is a requirement that both the client and server share the same cookie. Ensure that the clients and server share the same cookie file found under
~/.config/pulse/cookie
. It does not matter whose cookie file you use (the server or a client's), just that the server and client(s) share the same one.If it is undesirable to copy the cookie file from clients, anonymous clients can access the server by passing
auth-anonymous
to module-native-protocol-tcp
on the server (again in /etc/pulse/default.pa
):It is also possible to authenticate based on client IP address:
Change the LAN IP subnet to match that of those clients you wish to have access to the server.
Selecting the Server
For a single shell or command you can set the environment variable
$PULSE_SERVER
to the host name or IP address of the desired PulseAudio server.Alternatively you can create or modify
~/.pulse/client.conf
or /etc/pulse/client.conf
to set a default-server persistently.Selecting the Server with Zeroconf
Note: This section is known to be unreliable for some people.
For the remote PulseAudio server to appear in the PulseAudio Device Chooser (
pasystray
), load the appropriate zeroconf modules, and enable the Avahidaemon. On both machines, the client and server, installpulseaudio-zeroconf then start and enableavahi-daemon.service
.On the server, add
load-module module-zeroconf-publish
to /etc/pulse/default.pa
. On the client, add load-module module-zeroconf-discover
to /etc/pulse/default.pa
. Now redirect any stream or complete audio output to the remote PulseAudio server by selecting the appropriate sink.If you have issues with the remote syncs appearing on the client, try restarting the Avahi daemon on the server to rebroadcast the available interfaces.
Run the graphical PulseAudio Volume Control
pavucontrol
. Under the Output Devices tab, you should see the local and remote output devices. Under the Playback tab, to the left of the 'X' Mute Audio button, you should see a box containing the name of an output device. That box is actually a button, which will display a drop-down radio-button list of the available output devices, with one output device selected. Selecting an output device from the list will allow the audio stream to be switched to the PulseAudio server associated with that output device. This control is not at all obvious until you have used it, and is especially useful with a remote Headless sound server.Similarly, under the Input Devices tab, local and remote input devices will be seen. And under the Recording tab, there will be a box, to the left of the 'X' Mute Audio button, with the name of an input device which is actually a button which will display a drop-down radio-button list of available input devices.
Run
pavucontrol
on the local or remote host associated with the audio stream to be directed. For instance, run pavucontrol
on the remote host to direct the remote audio output to the local host. Run pavucontrol
on the local host to direct the local audio output to some remote host.Setting up simultaneous inputs or outputs is a different thing. Search about 'monitor' and 'module-combine-sink' for that.
Switching the PulseAudio server used by local X clients
To switch between servers on the client from within X, the
pax11publish
command can be used. For example, to switch from the default server to the server at hostname foo:Or to switch back to the default:
Instead of telling the PulseAudio server to stream audio (as described above), this will edit PulseAudio variables on the X11 root window, which will instruct the PulseAudio client libraries to connect to a PulseAudio server other than
localhost
. As such, the programs will no longer interact with the local pulseaudio
process, which can then be stopped. Programs such as pactl
, pacmd
or pavucontrol
will need to also run with the appropriate PULSE_SERVER
environment/X variable to control the remote PulseAudio server.Note that for the switch to become apparent, the programs using Pulse must be restarted, or their PulseAudio client library otherwise reinitialized (completely stopping and restarting playback may be enough). To make this setting permanent, edit
default-server
in ~/.config/pulse/client.conf
or /etc/pulse/client.conf
.When everything else seems to fail
The following is a quick fix and NOT a permanent solution
On the server:
Go to Network Access -> Enable access to local sound devices (Also check both 'Allow discover' and 'Don't require authentication').
On the client:
ALSA monitor source
To be able to record from a monitor source (a.k.a. 'What-U-Hear', 'Stereo Mix'), use
pactl list
to find out the name of the source in PulseAudio (e.g. alsa_output.pci-0000_00_1b.0.analog-stereo.monitor
). Then add lines like the following to /etc/asound.conf
or ~/.asoundrc
:Now you can select
pulse_monitor
as a recording source.Alternatively, you can use pavucontrol to do this: make sure you have set up the display to 'All input devices', then select 'Monitor of [your sound card]' as the recording source.
Monitor specific output
It is possible to monitor a specific output, for example to stream audio from a music player into a VOIP application.Simply create a null output device:
In Pulseaudio Volume Control (pavucontrol), under the 'Playback' tab, change the output of an application to <name>, and in the recording tab change the input of an application to 'Monitor of <name>'. Audio will now be outputted from one application into the other.
PulseAudio through JACK
The JACK Audio Connection Kit is popular for audio work, and is widely supported by Linux audio applications. It fills a similar niche as PulseAudio, but with more of an emphasis on professional audio work. It can offer lower latency audio monitoring along with greater control of input and output of multi-i/o sound devices.
The KXStudio method
This configuration requires the jack2 package.
JACK now has native features for bridging between ALSA, PulseAudio, and JACK. This will allow you to simultaneously have JACK and PulseAudio running with both outputting at the same time, with no config editing or terminal commands required.
If you have qjackctl installed, make sure that it is not running (it might be running minified in the system tray). Also ensure that no
jackd
process is running (use ps xw
in a terminal to check).Install cadence, as well as pulseaudio-jack. Once installed and started, JACK bridge configuration is found in the bottom right of the window. The ALSA audio bridge should be set to ALSA -> PulseAudio -> JACK, and the PulseAudio bridge should be enabled. Make sure in
pavucontrol
that all output devices besides Jack sink are muted, and all input devices besides Jack input are muted. Start JACK using the Force Restart button, and if it starts successfully PulseAudio programs should begin outputting to JACK.The manual sink configuration method
This configuration provides a method of allowing JACK and PulseAudio to run at the same time and output to each other. It uses manual configuration of the systems that bridge between JACK and PulseAudio. This configuration has no reliance on scripts or commands and is entirely based in configuration.
This configuration only works with jack2. To use this configuration, just install the pulseaudio-jack package.
/etc/pulse/default.pa
is already configured to load the modules in pulseaudio-jack if they are present. If you want to be sure, open the file and look for the line:Where
options
can be any options supported by this module, usually channels=2
.As described on the Jack-DBUS Packaging page:
Server auto-launching is implemented as D-Bus call that auto-activates JACK D-Bus service, in case it is not already started, and starts the JACK server. Correct interaction with PulseAudio is done using a D-Bus based audio card 'acquire/release' mechanism. When JACK server starts, it asks this D-Bus service to acquire the audio card and PulseAudio will unconditionally release it. When JACK server stops, it releases the audio card that can be grabbed again by PulseAudio.
module-jackdbus-detect.so
dynamically loads and unloads module-jack-sink and module-jack-source when jackdbus is started and stopped.If PulseAudio sound does not work, check with
pavucontrol
to see if the relevant programs appear in the playback tab. If not, add the following to ~/.asoundrc
or /etc/asound.conf
to redirect ALSA to PulseAudio:If it still does not work, check with
pavucontrol
in the playback tab and make sure the relevant programs are outputting to PulseAudio JACK Sink instead of your audio card (which JACK has control of, so it will not work). Also ensure that in the JACK graph the PulseAudio JACK Source is connected to the system audio output.The shell script method
This method allows JACK and PulseAudio to output at the same time. It mostly relies on shell scripts that are automatically run by QJackCTL to manage aspects of how the JACK sinks and PulseAudio behave.
The basic idea is that killing PulseAudio is a bad idea because it may crash any apps using PulseAudio and disrupt any audio playing.
The flow of how this setup works:
- PulseAudio releases the sound card
- JACK grabs sound card and starts up
- script redirects PulseAudio to JACK
- manually send PulseAudio apps to JACK output (pavucontrol may come in helpful for this)
- use JACK programs etc
- via script, stop redirecting PulseAudio to JACK
- stop JACK and release sound card
- PulseAudio grabs sound card and reroutes audio to it directly
With QJackCTL, set up these scripts:
pulse-jack-pre-start.sh
set it up as the execute script on startup scriptpulse-jack-post-start.sh
set this one up as execute script after startuppulse-jack-pre-stop.sh
'execute script on shutdown'pulse-jack-post-stop.sh
'execute script after shutdown'The PulseAudio kill method
This method relies on shell scripts to automatically kill PulseAudio when JACK is started, and automatically restart it when JACK is stopped. This will result in lower CPU usage than having both running, but can cause errors in already running PulseAudio application and does not allow simultaneous output of both.
Using the settings listed above, use QjackCtl to execute a script upon startup and shutdown to load/unload PulseAudio. Part of the reason users may wish to do this is that the above changes disable PulseAudio's automatic hardware detection modules. This particular setup is for using PulseAudio in an exclusive fashion with JACK, though the scripts could be modified to unload and load an alternate non-JACK setup, but killing and starting PulseAudio while programs might be using it would become problematic.
Note: padevchooser in the following example is deprecated. It is replaced by pasystray
The following example could be used and modified as necessary as a startup script that daemonizes PulseAudio and loads the padevchooser program (optional, needs to be built from AUR) called
jack_startup
: as well as a shutdown script to kill PulseAudio and the Pulse Audio Device Chooser, as another example called
jack_shutdown
also in the home directory: Both scripts need to be made executable:
then with QjackCtl loaded, click on the Setup button and then the Options tab and tick both 'Execute Script after Startup:' And 'Execute Script on Shutdown:' and put either use the .. button or type the path to the scripts (assuming the scripts are in the home directory)
~/jack_startup
and ~/jack_shutdown
making sure to save the changes.PulseAudio through JACK issues
When JACK is started Firefox, Chrome and other apps stop playing video and audio
Firefox/Chrome/etc. is using PulseAudio soundcard sink instead of the JACK sink. Open
pavucontrol
and on the Playback tab switch all audiostreams from something like 'Built-in Audio Analog Stereo' to something like 'Jack sink (PulseAudio JACK Sink)'.After I start JACK the sound from PulseAudio becomes distorted
In QjackCtl click Setup and on the Settings tab, Parameters subtab untick 'Realtime'. In addition, tweaking Sample Rate, Frames/Period and Period/Buffer may help. Look for latency in the bottom right corner, as you still want minimal latency for audio production. Also, I think Sample Rate should match one of the rates supported by your audio interface (
cat /proc/asound/cardN/codec#M
and look for rates
, there could be multiple occurrences).PulseAudio through OSS
Add the following to
/etc/pulse/default.pa
:Then start PulseAudio as usual, making sure that sinks and sources are defined for OSS devices.
PulseAudio from within a chroot
Since a chroot sets up an alternative root for the running/jailing of applications, PulseAudio must be installed within the chroot itself (
pacman -S pulseaudio
within the chroot environment).PulseAudio, if not set up to connect to any specific server (this can be done in
/etc/pulse/client.conf
, through the PULSE_SERVER environment variable, or through publishing to the local X11 properties using module-x11-publish), will attempt to connect to the local pulse server, failing which it will spawn a new pulse server. Each pulse server has a unique ID based on the machine-id value in /var/lib/dbus
. To allow for chrooted apps to access the pulse server, the following directories must be mounted within the chroot:-/dev/shm
should also be mounted for efficiency and good performance. Note that mounting /home would normally also allow sharing of the ~/.pulse
folder.PulseAudio selects the path to the socket via XDG_RUNTIME_DIR, so be sure to drag it along when you chroot as a normal user using sudo (see Sudo#Environment variables).
Disabling automatic spawning of PulseAudio server
Some users may prefer to manually start the PulseAudio server before running certain programs and then stop the PulseAudio server when they are finished. A simple way to accomplish this is to edit
~/.config/pulse/client.conf
or /etc/pulse/client.conf
and change autospawn = yes
to autospawn=no
. Make sure the line is uncommented as well.Now you can manually start the pulseaudio server with
and stop it with
This setting is also respected by the default pulseaudio dektop session startup script
start-pulseaudio-x11
which is executed from /etc/xdg/autostart/pulseaudio.desktop
.Disabling pulseaudio daemon altogether
To disable the pulseaudio daemon completely, and thereby preventing it from starting, one can add
daemon-binary=/bin/true
to the configuration file.Remap stereo to mono
Remap a stereo input-sink to a mono sink by creating a virtual sink. It would be useful if you only have one speaker. Add to
/etc/pulse/default.pa
:(replace alsa_output.pci-0000_00_1f.5.analog-stereo in the sound card name shown from
pacmd list-sinks
)Switch player between virtual mono sink and real stereo sink.
Remap left or right to mono
Particularly useful in the case an audio stream has different content in the left and right channels, such as Japanese television broadcasts with bilingual audio.
Replace
Note:alsa_output.pci-0000_00_1b.0.iec958-ac3-surround-51
(5.1 AC3 on ALC892 Digital) with your own card (pacmd list-sinks
).- master_channel_map is a list of outputs to be remapped to.
- channel_map is a list of inputs to be remapped from.
- A stereo card will not have to specify as many channels, eg.
channels=1 master_channel_map=mono channel_map=right
Remap for broadcasting software
If you do not want to capture sound from the application you need to create Remap sink:
Note: Replace
SINK_NAME
with the real name of the master sink pacmd list-sinks
.Then restart PulseAudio daemon:
Now you need set the
Remap_sink
as the default sound source in broadcast softwareNote: Use environment variable
PULSE_SINK=SINK_NAME
for applications, sound that does not need to be captured.Swap left/right channels
This is the same as 'reverse stereo', where the left and right channels are to be swapped.
First, identify the card you want its channels swapped:
and use the name string for the device you wish to use (the one in square brackets, e.g. [Intel]).
Edit
/etc/pulse/default.pa
and comment out module-hal-detect and module-detect lines.Search for the commented-out line that starts '#load-module module-alsa-sink', uncomment it and change it to
Restart the pulseaudio deamon by running
Using default.pa
Another approach to swapping channels is suggested in [1]:
Loopback 2 0 0 – Route Audio Between Applications Freeware
Using PulseEffects
- Install pulseeffects:
- Using the 'Stereo Tools' application on the left of the PulseEffects UI
- Navigate to the 'Stereo Matrix' page
- Under 'Mode' select 'LR > RL (Stereo Flip Channels)'
The way PulseEffects works is it becomes your primary output device. You'll then need to use the PulseAudio Volume Control pavucontrol tool to set the PulseEffects output to the device you want.
PulseAudio as a minimal unintrusive dumb pipe to ALSA
Some people do not want to run PulseAudio all the time for various reasons. This example will turn the full fledged audio server into an unobstrusive dumb pipe to ALSA devices that automatically starts and stops itself when done, allowing applications that requires PulseAudio to fully function while not touching any ALSA setting nor setting itself as the default ALSA device.
This configuration tells native PA clients to autospawn the daemon when they need it, then the daemon is configured to autoexit as soon as all clients have disconnected. The daemon itself uses a plain simple static configuration that uses your configured
pcm.!default
ALSA devices and nothing more. No replacement of ALSA's default, no playing with mixer levels, nothing but record/playback. Also make sure pulseaudio-alsa is not installed so standard ALSA clients don't default to pulse. Since pulseaudio-alsa contains only a configuration file /etc/asound.conf
, if it's installed as dependency, one could simply comment all contents in /etc/asound.conf
. alsamixer
functions properly as well as any other ALSA clients. Also make sure common frameworks like Xine, Gstreamer and Phonon are configured to use ALSA: by default if they detect PulseAudio is installed they will try to use it before ALSA.Having both speakers and headphones plugged in and switching in software on-the-fly
By design, Pulseaudio automatically turns off Line Out when headphones are plugged in and uses Headphone slider instead. You can observe this behavior in
alsamixer
. What we want is to have Headphone and Line Out sliders working separately and at the same time. This is extremely useful if you want to remap Realtek's jacks to have, say, Rear Green for headphones and Blue for speakers (with the help of hdajackretask
from alsa-tools).To achieve this, you should directly edit Pulseaudio mixer's configuration.
1. We tell pulseaudio that headphones are always plugged in. Edit:
/usr/share/pulseaudio/alsa-mixer/paths/analog-output-lineout.conf
Find:
Change
no
to yes
2. By default, Line Out's volume controlled only by Master, and not by Line Out slider itself. We want to merge Line Out with Master.
Add this snippet to the end of the file:
3. We need to completely cut off Line Out when we use headphones. Edit:
/usr/share/pulseaudio/alsa-mixer/paths/analog-output-headphones.conf
Add this snippet to the end of the file:
Note: On some systems you might need to use
[Element Front]
instead of [Element Line Out]
.Loopback 2 0 0 – Route Audio Between Applications Free Printable
4. Like Pulseaudio, Alsa itself cuts off speakers when headphones are plugged in. Open
alsamixer
(in case of Realtek HDA alsamixer -c0
) and change Auto-Mute mode
to disabled
. Loopback 2 0 0 – Route Audio Between Applications Free Download
5. Restart Pulseaudio
Now you have two separate ports on the same sink in pulseaudio. They mute each other, so you can switch to headphones and this will mute Line Out, and vice versa.To switch between ports you can use Gnome or Plasma sound mixer, or install appropriate desktop extension.
Allowing multiple users to use PulseAudio at the same time
It is sometimes desirable to run some programs as another user on the same desktop of the primary user in order to isolate the software. However, PulseAudio will not accept by default connections by the secondary users, since a PulseAudio daemon is already running for the primary user. However, a PulseAudio UNIX socket can be created in order to accept connections from other users to the main PulseAudio daemon run by the primary user.
First, edit
/etc/pulse/default.pa
or ~/.config/pulse/default.pa
and add a directive for the unix socket to be created:Afterwards, set PulseAudio as a client to the UNIX socket just created in the secondary user:
Now, after restarting the PulseAudio daemon, applications running as the secondary user should be able to play sound through the main PulseAudio daemon running as the primary user without problems.
Mixing additional audio into the microphone's audio
Using a setup of null sinks and loopbacks you can mix arbitrary applications' audio output into your microphone's audio, for example to play sound effects or music on voice chat applications.
The setup suggested here will also play your sound effects back to you and use PulseAudio echo cancellation to prevent the effects from feeding back into your microphone.Despite this, using headphones instead of loudspeakers is probably a good idea.
Overview of the targeted PulseAudio configuration
Symbology:
(Application)
, {Audio source}
, [Audio sink]
, {m} = Monitor of audio sink
Loopback 2 0 0 – Route Audio Between Applications Free Online
- {mic_ec}, [spk_ec]
- Echo cancellation 'clones' of the microphone and speakers
- [vsink_fx]
- Virtual sink into which the sound effects are played
- [vsink_fx_mic]
- Virtual sink where the microphone and the sound effects are mixed together
Applications configuration
The applications providing the sound effects must
- Output to 'vsink_fx'
All other applications, including the voice chat, must
- Record audio from 'Monitor of vsink_fx_mic'
- Output to 'spk_ec'
Accordingly, these devices will be set as default source and default sink; ultimately, controlling which application uses which audio source/sink can be done in the
pavucontrol
graphical PulseAudio volume control panel.No application whatsoever must record from, or output to, the 'real' microphone or speakers, as this would bypass the echo cancellation.
Any echo cancellation or other audio processing provided by the voice chat application should be disabled – PulseAudio is doing this already, and as the application is not aware of the sound effects being played on the speakers, it will likely be ineffective in filtering them from the microphone anyway.
Setup steps
As of August 2020 there is pulse-autoconfAUR, a PulseAudio server dynamic configuration daemon that supports this setup with its 'EchoCancellationWithSourcesMix' preset and that dynamically reacts to e.g. a headset being plugged in our unplugged.
If pulse-autoconfAUR does not work out for your use case, here is the manual way:
- Connect your microphone and headphones and make sure PulseAudio is configured correctly for their use, for example in the 'Configuration' tab in
pavucontrol
- First time only:
- Save the template script below to an executable file of your choice
- Find the
name:
s of your microphone and headphones withpacmd list-sources
andpacmd list-sinks
, respectively - In the script, replace the values of 'microphone' and 'speakers' with the names of your microphone/headphones
- Run the script
- Run your voice chat application and, in
pavucontrol
, make it record audio from 'Monitor of vsink_fx_mic' and output audio to 'spk_ec' - Run your sound effects application(s) and, in
pavucontrol
, make them play to 'vsink_fx'
As for applications that can play sound effects, castersoundboard-gitAUR has been found to work quite well.It however needs to be closed and re-opened when PulseAudio is restarted.
Teardown
The changes that the script makes to the running PulseAudio server are not permanent and will be lost when PulseAudio terminates.
To ditch the custom configuration, just restart PulseAudio, e.g. with
systemctl --user stop pulseaudio.service
. (PulseAudio is socket-activated and will automatically start on demand.)Template script
This script has been inspired by https://askubuntu.com/a/915064 , for more in-depth information also see that post's author's pulseaudio-config GitHub repository.
Retrieved from 'https://wiki.archlinux.org/index.php?title=PulseAudio/Examples&oldid=639245'