PCM plugins extends functionality and features of PCM devices. The plugins take care about various sample conversions, sample copying among channels and so on.
The slave plugin can be specified directly with a string or the definition can be entered inside a compound configuration node. Some restrictions can be also specified (like static rate or count of channels).
pcm_slave.NAME { pcm STR # PCM name # or pcm { } # PCM definition format STR # Format or "unchanged" channels INT # Count of channels or "unchanged" string rate INT # Rate in Hz or "unchanged" string period_time INT # Period time in us or "unchanged" string buffer_time INT # Buffer time in us or "unchanged" string }
Example:
pcm_slave.slave_rate44100Hz {
pcm "hw:0,0"
rate 44100
}
pcm.rate44100Hz {
type plug
slave slave_rate44100Hz
}
The equivalent configuration (in one compound):
pcm.rate44100Hz {
type plug
slave {
pcm "hw:0,0"
rate 44100
}
}
This plugin communicates directly with the ALSA kernel driver. It is a raw communication without any conversions. The emulation of mmap access can be optionally enabled, but expect worse latency in the case.
pcm.name { type hw # Kernel PCM card INT/STR # Card name (string) or number (integer) [device INT] # Device number (default 0) [subdevice INT] # Subdevice number (default -1: first available) [mmap_emulation BOOL] # Enable mmap emulation for ro/wo devices }
This plugin communicates with aserver via shared memory. It is a raw communication without any conversions, but it can be expected worse performance.
pcm.name { type shm # Shared memory PCM server STR # Server name pcm STR # PCM name }
This plugin discards contents of a PCM stream or creates a stream with zero samples.
Note: This implementation uses devices /dev/null (playback, must be writable) and /dev/full (capture, must be readable).
pcm.name { type null # Null PCM }
This plugin copies samples from master copy PCM to given slave PCM. The channel count, format and rate must match for both of them.
pcm.name { type copy # Copy PCM slave STR # Slave name # or slave { # Slave definition pcm STR # Slave PCM name # or pcm { } # Slave PCM definition } }
This plugin converts linear samples from master linear conversion PCM to given slave PCM. The channel count, format and rate must match for both of them.
pcm.name { type linear # Linear conversion PCM slave STR # Slave name # or slave { # Slave definition pcm STR # Slave PCM name # or pcm { } # Slave PCM definition } }
This plugin converts linear to float samples and float to linear samples from master linear<->float conversion PCM to given slave PCM. The channel count, format and rate must match for both of them.
pcm.name { type lfloat # Linear<->Float conversion PCM slave STR # Slave name # or slave { # Slave definition pcm STR # Slave PCM name # or pcm { } # Slave PCM definition } }
This plugin converts Mu-Law samples to linear or linear to Mu-Law samples from master Mu-Law conversion PCM to given slave PCM. The channel count, format and rate must match for both of them.
pcm.name { type mulaw # Mu-Law conversion PCM slave STR # Slave name # or slave { # Slave definition pcm STR # Slave PCM name # or pcm { } # Slave PCM definition } }
This plugin converts A-Law samples to linear or linear to A-Law samples from master A-Law conversion PCM to given slave PCM. The channel count, format and rate must match for both of them.
pcm.name { type alaw # A-Law conversion PCM slave STR # Slave name # or slave { # Slave definition pcm STR # Slave PCM name # or pcm { } # Slave PCM definition } }
This plugin converts Ima-ADPCM samples to linear or linear to Mu-Law samples from master Ima-ADPCM conversion PCM to given slave PCM. The channel count, format and rate must match for both of them.
pcm.name { type adpcm # Ima-ADPCM conversion PCM slave STR # Slave name # or slave { # Slave definition pcm STR # Slave PCM name # or pcm { } # Slave PCM definition } }
This plugin converts channels and applies volume during the conversion. The format and rate must match for both of them.
pcm.name { type route # Route & Volume conversion PCM slave STR # Slave name # or slave { # Slave definition pcm STR # Slave PCM name # or pcm { } # Slave PCM definition } }
This plugin converts a stream rate. The input and output formats must be linear.
pcm.name { type rate # Rate PCM slave STR # Slave name # or slave { # Slave definition pcm STR # Slave PCM name # or pcm { } # Slave PCM definition } }
This plugin converts channels, rate and format on request.
pcm.name { type plug # Automatic conversion PCM slave STR # Slave name # or slave { # Slave definition pcm STR # Slave PCM name # or pcm { } # Slave PCM definition [format STR] # Slave format (default nearest) or "unchanged" [channels INT] # Slave channels (default nearest) or "unchanged" [rate INT] # Slave rate (default nearest) or "unchanged" } route_policy STR # route policy for automatic ttable generation # STR can be 'default', 'average', 'copy', 'duplicate' # average: result is average of input channels # copy: only first channels are copied to destination # duplicate: duplicate first set of channels # default: copy policy, except for mono capture - sum ttable { # Transfer table (bi-dimensional compound of cchannels * schannels numbers) CCHANNEL { SCHANNEL REAL # route value (0.0 - 1.0) } } }
This plugin stores contents of a PCM stream to file.
pcm.name { type file # File PCM slave STR # Slave name # or slave { # Slave definition pcm STR # Slave PCM name # or pcm { } # Slave PCM definition } file STR # Filename or file INT # File descriptor number [format STR] # File format (only "raw" at the moment) }
This plugin converts multiple streams to one.
pcm.name { type multi # Multiple streams conversion PCM slaves { # Slaves definition ID STR # Slave PCM name # or ID { pcm STR # Slave PCM name # or pcm { } # Slave PCM definition channels INT # Slave channels } } bindings { # Bindings table N { slave STR # Slave key channel INT # Slave channel } } [master INT] # Define the master slave }
This plugin allows sharing of multiple channels with more clients. The access to each channel is exlusive (samples are not mixed together). It means, if the channel zero is used with first client, the channel cannot be used with second one. If you are looking for a mixing plugin, use the smix plugin unknown reference! .
pcm.name { type share # Share PCM slave STR # Slave name # or slave { # Slave definition pcm STR # Slave PCM name } bindings { N INT # Slave channel INT for client channel N } }
# Hook arguments definition hook_args.NAME { ... # Arbitrary arguments } # PCM hook type pcm_hook_type.NAME { [lib STR] # Library file (default libasound.so) [install STR] # Install function (default _snd_pcm_hook_NAME_install) } # PCM hook definition pcm_hook.NAME { type STR # PCM Hook type (see pcm_hook_type) [args STR] # Arguments for install function (see hook_args) # or [args { }] # Arguments for install function } # PCM hook plugin pcm.NAME { type hooks # PCM with hooks slave STR # Slave name # or slave { # Slave definition pcm STR # Slave PCM name # or pcm { } # Slave PCM definition } hooks { ID STR # Hook name (see pcm_hook) # or ID { } # Hook definition (see pcm_hook) } }
Example:
hooks.0 { type ctl_elems hook_args [ { name "Wave Surround Playback Volume" preserve true lock true value [ 0 0 ] } { name "EMU10K1 PCM Send Volume" index { @func private_pcm_subdevice } lock true value [ 0 0 0 0 0 0 255 0 0 0 0 255 ] } ] }
This plugin allows to apply a set of LADPSA plugins. The input and output format is always SND_PCM_FORMAT_FLOAT (note: this type can be either little or big-endian depending on architecture).
The policy duplicate means that there must be only one binding definition for channel zero. This definition is automatically duplicated for all channels.
Instances of LADSPA plugins are created dynamically.
pcm.name { type ladspa # ALSA<->LADSPA PCM slave STR # Slave name # or slave { # Slave definition pcm STR # Slave PCM name # or pcm { } # Slave PCM definition } [path STR] # Path (directory) with LADSPA plugins plugins | # Definition for both directions playback_plugins | # Definition for playback direction capture_plugins { # Definition for capture direction N { # Configuration for LADPSA plugin N [id INT] # LADSPA plugin ID (for example 1043) [label STR] # LADSPA plugin label (for example 'delay_5s') [filename STR] # Full filename of .so library with LADSPA plugin code [policy STR] # Policy can be 'none' or 'duplicate' input | output { bindings { C INT or STR # C - channel, INT - audio port index, STR - audio port name } controls { I INT or REAL # I - control port index, INT or REAL - control value # or STR INT or REAL # STR - control port name, INT or REAL - control value } } } } }