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
}
}
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 }
pcm.name { type shm # Shared memory PCM server STR # Server name pcm STR # PCM name }
Note: This implementation uses devices /dev/null (playback, must be writable) and /dev/full (capture, must be readable).
pcm.name { type null # Null PCM }
pcm.name { type copy # Copy PCM slave STR # Slave name # or slave { # Slave definition pcm STR # Slave PCM name # or pcm { } # Slave PCM definition } }
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 } }
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 } }
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 } }
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 } }
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 } }
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 } }
pcm.name { type rate # Rate PCM slave STR # Slave name # or slave { # Slave definition pcm STR # Slave PCM name # or pcm { } # Slave PCM definition } }
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) } } }
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) }
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 }
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 ] } ] }
pcm.name { type dmix # Direct mix ipc_key INT # unique IPC key ipc_key_add_uid BOOL # add current uid to unique IPC key slave STR # or slave { # Slave definition pcm STR # slave PCM name # or pcm { } # slave PCM definition format STR # format definition rate INT # rate definition channels INT period_time INT # in usec # or period_size INT # in bytes buffer_time INT # in usec # or buffer_size INT # in bytes periods INT # when buffer_size or buffer_time is not specified } bindings { # note: this is client independent!!! N INT # maps slave channel to client channel N } }
pcm.name { type dshare # Direct sharing ipc_key INT # unique IPC key ipc_key_add_uid BOOL # add current uid to unique IPC key slave STR # or slave { # Slave definition pcm STR # slave PCM name # or pcm { } # slave PCM definition format STR # format definition rate INT # rate definition channels INT period_time INT # in usec # or period_size INT # in bytes buffer_time INT # in usec # or buffer_size INT # in bytes periods INT # when buffer_size or buffer_time is not specified } bindings { # note: this is client independent!!! N INT # maps slave channel to client channel N } }
pcm.name { type dsnoop # Direct snoop ipc_key INT # unique IPC key ipc_key_add_uid BOOL # add current uid to unique IPC key slave STR # or slave { # Slave definition pcm STR # slave PCM name # or pcm { } # slave PCM definition format STR # format definition rate INT # rate definition channels INT period_time INT # in usec # or period_size INT # in bytes buffer_time INT # in usec # or buffer_size INT # in bytes periods INT # when buffer_size or buffer_time is not specified } bindings { # note: this is client independent!!! N INT # maps slave channel to client channel N } }
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 } } } } }