Sophie

Sophie

distrib > Mandriva > 9.1 > ppc > media > updates > by-pkgid > 18785641029f14f23cccc82925607ace > files > 114

libalsa2-docs-0.9.0-0.14rc7.1mdk.ppc.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>PCM (digital audio) plugins</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.2.18 -->
<center>
<a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="modules.html">Modules</a> &nbsp; <a class="qindex" href="annotated.html">Data Structures</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Data Fields</a> &nbsp; <a class="qindex" href="globals.html">Globals</a> &nbsp; <a class="qindex" href="pages.html">Related Pages</a> &nbsp; <a class="qindex" href="examples.html">Examples</a> &nbsp; </center>
<hr><h1><a name="pcm_plugins">PCM (digital audio) plugins</a>
</h1>
<p>
PCM plugins extends functionality and features of PCM devices. The plugins take care about various sample conversions, sample copying among channels and so on.
<p>
<h2><a name="pcm_plugins_slave">Slave definition</a>
</h2>
<p>
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).
<p>
<div class="fragment"><pre>pcm_slave.NAME {
        pcm STR         # PCM name
<span class="preprocessor">        # or</span>
<span class="preprocessor"></span>        pcm { }         # PCM definition
        format STR      # Format or <span class="stringliteral">"unchanged"</span>
        channels INT    # Count of channels or <span class="stringliteral">"unchanged"</span> string
        rate INT        # Rate in Hz or <span class="stringliteral">"unchanged"</span> string
        period_time INT # Period time in us or <span class="stringliteral">"unchanged"</span> string
        buffer_time INT # Buffer time in us or <span class="stringliteral">"unchanged"</span> string
}
</pre></div>
<p>
Example:
<p>
<div class="fragment"><pre>pcm_slave.slave_rate44100Hz {
        pcm <span class="stringliteral">"hw:0,0"</span>
        rate 44100
}

pcm.rate44100Hz {
        type plug
        slave slave_rate44100Hz
}
</pre></div>
<p>
The equivalent configuration (in one compound):
<p>
<div class="fragment"><pre>pcm.rate44100Hz {
        type plug
        slave {
                pcm <span class="stringliteral">"hw:0,0"</span>
                rate 44100
        }
}
</pre></div>
<p>
<h2><a name="pcm_plugins_hw">Plugin: hw</a>
</h2>
<p>
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.
<p>
<div class="fragment"><pre>pcm.name {
        type hw                 # Kernel PCM
        card INT/STR            # Card name (string) or number (integer)
        [device INT]            # Device number (<span class="keywordflow">default</span> 0)
        [subdevice INT]         # Subdevice number (<span class="keywordflow">default</span> -1: first available)
        [mmap_emulation BOOL]   # Enable mmap emulation <span class="keywordflow">for</span> ro/wo devices
}
</pre></div>
<p>
<h3><a name="pcm_plugins_hw_funcref">Function reference</a>
</h3>
<p>
<ul>
<li><a class="el" href="pcm__hw_8c.html#a38">snd_pcm_hw_open()</a> <li><a class="el" href="pcm__hw_8c.html#a39">_snd_pcm_hw_open()</a> </ul>
<h2><a name="pcm_plugins_shm">Plugin: shm</a>
</h2>
<p>
This plugin communicates with aserver via shared memory. It is a raw communication without any conversions, but it can be expected worse performance.
<p>
<div class="fragment"><pre>pcm.name {
        type shm                # Shared memory PCM
        server STR              # Server name
        pcm STR                 # PCM name
}
</pre></div>
<p>
<h3><a name="pcm_plugins_shm_funcref">Function reference</a>
</h3>
<p>
<ul>
<li><a class="el" href="pcm__shm_8c.html#a40">snd_pcm_shm_open()</a> <li><a class="el" href="pcm__shm_8c.html#a41">_snd_pcm_shm_open()</a> </ul>
<h2><a name="pcm_plugins_null">Plugin: Null</a>
</h2>
<p>
This plugin discards contents of a PCM stream or creates a stream with zero samples.
<p>
Note: This implementation uses devices /dev/null (playback, must be writable) and /dev/full (capture, must be readable).
<p>
<div class="fragment"><pre>pcm.name {
        type null               # Null PCM
}
</pre></div>
<p>
<h3><a name="pcm_plugins_null_funcref">Function reference</a>
</h3>
<p>
<ul>
<li><a class="el" href="pcm__null_8c.html#a34">snd_pcm_null_open()</a> <li><a class="el" href="pcm__null_8c.html#a35">_snd_pcm_null_open()</a> </ul>
<h2><a name="pcm_plugins_copy">Plugin: copy</a>
</h2>
<p>
This plugin copies samples from master copy PCM to given slave PCM. The channel count, format and rate must match for both of them.
<p>
<div class="fragment"><pre>pcm.name {
        type copy               # Copy PCM
        slave STR               # Slave name
<span class="preprocessor">        # or</span>
<span class="preprocessor"></span>        slave {                 # Slave definition
                pcm STR         # Slave PCM name
<span class="preprocessor">                # or</span>
<span class="preprocessor"></span>                pcm { }         # Slave PCM definition
        }
}
</pre></div>
<p>
<h3><a name="pcm_plugins_copy_funcref">Function reference</a>
</h3>
<p>
<ul>
<li><a class="el" href="pcm__copy_8c.html#a10">snd_pcm_copy_open()</a> <li><a class="el" href="pcm__copy_8c.html#a11">_snd_pcm_copy_open()</a> </ul>
<h2><a name="pcm_plugins_linear">Plugin: linear</a>
</h2>
<p>
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.
<p>
<div class="fragment"><pre>pcm.name {
        type linear             # Linear conversion PCM
        slave STR               # Slave name
<span class="preprocessor">        # or</span>
<span class="preprocessor"></span>        slave {                 # Slave definition
                pcm STR         # Slave PCM name
<span class="preprocessor">                # or</span>
<span class="preprocessor"></span>                pcm { }         # Slave PCM definition
        }
}
</pre></div>
<p>
<h3><a name="pcm_plugins_linear_funcref">Function reference</a>
</h3>
<p>
<ul>
<li><a class="el" href="pcm__linear_8c.html#a10">snd_pcm_linear_open()</a> <li><a class="el" href="pcm__linear_8c.html#a11">_snd_pcm_linear_open()</a> </ul>
<h2><a name="pcm_plugins_lfloat">Plugin: linear&lt;-&gt;float</a>
</h2>
<p>
This plugin converts linear to float samples and float to linear samples from master linear&lt;-&gt;float conversion PCM to given slave PCM. The channel count, format and rate must match for both of them.
<p>
<div class="fragment"><pre>pcm.name {
        type lfloat             # Linear&lt;-&gt;Float conversion PCM
        slave STR               # Slave name
<span class="preprocessor">        # or</span>
<span class="preprocessor"></span>        slave {                 # Slave definition
                pcm STR         # Slave PCM name
<span class="preprocessor">                # or</span>
<span class="preprocessor"></span>                pcm { }         # Slave PCM definition
        }
}
</pre></div>
<p>
<h3><a name="pcm_plugins_lfloat_funcref">Function reference</a>
</h3>
<p>
<ul>
<li><a class="el" href="pcm__lfloat_8c.html#a10">snd_pcm_lfloat_open()</a> <li><a class="el" href="pcm__lfloat_8c.html#a11">_snd_pcm_lfloat_open()</a> </ul>
<h2><a name="pcm_plugins_mulaw">Plugin: Mu-Law</a>
</h2>
<p>
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.
<p>
<div class="fragment"><pre>pcm.name {
        type mulaw              # Mu-Law conversion PCM
        slave STR               # Slave name
<span class="preprocessor">        # or</span>
<span class="preprocessor"></span>        slave {                 # Slave definition
                pcm STR         # Slave PCM name
<span class="preprocessor">                # or</span>
<span class="preprocessor"></span>                pcm { }         # Slave PCM definition
        }
}
</pre></div>
<p>
<h3><a name="pcm_plugins_mulaw_funcref">Function reference</a>
</h3>
<p>
<ul>
<li><a class="el" href="pcm__mulaw_8c.html#a13">snd_pcm_mulaw_open()</a> <li><a class="el" href="pcm__mulaw_8c.html#a14">_snd_pcm_mulaw_open()</a> </ul>
<h2><a name="pcm_plugins_alaw">Plugin: A-Law</a>
</h2>
<p>
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.
<p>
<div class="fragment"><pre>pcm.name {
        type alaw               # A-Law conversion PCM
        slave STR               # Slave name
<span class="preprocessor">        # or</span>
<span class="preprocessor"></span>        slave {                 # Slave definition
                pcm STR         # Slave PCM name
<span class="preprocessor">                # or</span>
<span class="preprocessor"></span>                pcm { }         # Slave PCM definition
        }
}
</pre></div>
<p>
<h3><a name="pcm_plugins_alaw_funcref">Function reference</a>
</h3>
<p>
<ul>
<li><a class="el" href="pcm__alaw_8c.html#a13">snd_pcm_alaw_open()</a> <li><a class="el" href="pcm__alaw_8c.html#a14">_snd_pcm_alaw_open()</a> </ul>
<h2><a name="pcm_plugins_adpcm">Plugin: Ima-ADPCM</a>
</h2>
<p>
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.
<p>
<div class="fragment"><pre>pcm.name {
        type adpcm              # Ima-ADPCM conversion PCM
        slave STR               # Slave name
<span class="preprocessor">        # or</span>
<span class="preprocessor"></span>        slave {                 # Slave definition
                pcm STR         # Slave PCM name
<span class="preprocessor">                # or</span>
<span class="preprocessor"></span>                pcm { }         # Slave PCM definition
        }
}
</pre></div>
<p>
<h3><a name="pcm_plugins_adpcm_funcref">Function reference</a>
</h3>
<p>
<ul>
<li><a class="el" href="pcm__adpcm_8c.html#a16">snd_pcm_adpcm_open()</a> <li><a class="el" href="pcm__adpcm_8c.html#a17">_snd_pcm_adpcm_open()</a> </ul>
<h2><a name="pcm_plugins_route">Plugin: Route &amp; Volume</a>
</h2>
<p>
This plugin converts channels and applies volume during the conversion. The format and rate must match for both of them.
<p>
<div class="fragment"><pre>pcm.name {
        type route              # Route &amp; Volume conversion PCM
        slave STR               # Slave name
<span class="preprocessor">        # or</span>
<span class="preprocessor"></span>        slave {                 # Slave definition
                pcm STR         # Slave PCM name
<span class="preprocessor">                # or</span>
<span class="preprocessor"></span>                pcm { }         # Slave PCM definition
        }
}
</pre></div>
<p>
<h3><a name="pcm_plugins_route_funcref">Function reference</a>
</h3>
<p>
<ul>
<li><a class="el" href="pcm__route_8c.html#a14">snd_pcm_route_open()</a> <li><a class="el" href="pcm__route_8c.html#a17">_snd_pcm_route_open()</a> </ul>
<h2><a name="pcm_plugins_rate">Plugin: Rate</a>
</h2>
<p>
This plugin converts a stream rate. The input and output formats must be linear.
<p>
<div class="fragment"><pre>pcm.name {
        type rate               # Rate PCM
        slave STR               # Slave name
<span class="preprocessor">        # or</span>
<span class="preprocessor"></span>        slave {                 # Slave definition
                pcm STR         # Slave PCM name
<span class="preprocessor">                # or</span>
<span class="preprocessor"></span>                pcm { }         # Slave PCM definition
        }
}
</pre></div>
<p>
<h3><a name="pcm_plugins_rate_funcref">Function reference</a>
</h3>
<p>
<ul>
<li><a class="el" href="pcm__rate_8c.html#a16">snd_pcm_rate_open()</a> <li><a class="el" href="pcm__rate_8c.html#a17">_snd_pcm_rate_open()</a> </ul>
<h2><a name="pcm_plugins_plug">Automatic conversion plugin</a>
</h2>
<p>
This plugin converts channels, rate and format on request.
<p>
<div class="fragment"><pre>pcm.name {
        type plug               # Automatic conversion PCM
        slave STR               # Slave name
<span class="preprocessor">        # or</span>
<span class="preprocessor"></span>        slave {                 # Slave definition
                pcm STR         # Slave PCM name
<span class="preprocessor">                # or</span>
<span class="preprocessor"></span>                pcm { }         # Slave PCM definition
                [format STR]    # Slave format (<span class="keywordflow">default</span> nearest) or <span class="stringliteral">"unchanged"</span>
                [channels INT]  # Slave channels (<span class="keywordflow">default</span> nearest) or <span class="stringliteral">"unchanged"</span>
                [rate INT]      # Slave rate (<span class="keywordflow">default</span> nearest) or <span class="stringliteral">"unchanged"</span>
        }
        route_policy STR        # route policy <span class="keywordflow">for</span> automatic ttable generation
<span class="preprocessor">                                # STR can be 'default', 'average', 'copy', 'duplicate'</span>
<span class="preprocessor"></span><span class="preprocessor">                                # average: result is average of input channels</span>
<span class="preprocessor"></span><span class="preprocessor">                                # copy: only first channels are copied to destination</span>
<span class="preprocessor"></span><span class="preprocessor">                                # duplicate: duplicate first set of channels</span>
<span class="preprocessor"></span><span class="preprocessor">                                # default: copy policy, except for mono capture - sum</span>
<span class="preprocessor"></span>        ttable {                # Transfer table (bi-dimensional compound of cchannels * schannels numbers)
                CCHANNEL {
                        SCHANNEL REAL   # route value (0.0 - 1.0)
                }
        }
}
</pre></div>
<p>
<h3><a name="pcm_plugins_plug_funcref">Function reference</a>
</h3>
<p>
<ul>
<li>snd_pcm_plug_open() <li>_snd_pcm_plug_open() </ul>
<h2><a name="pcm_plugins_file">Plugin: File</a>
</h2>
<p>
This plugin stores contents of a PCM stream to file.
<p>
<div class="fragment"><pre>pcm.name {
        type file               # File PCM
        slave STR               # Slave name
<span class="preprocessor">        # or</span>
<span class="preprocessor"></span>        slave {                 # Slave definition
                pcm STR         # Slave PCM name
<span class="preprocessor">                # or</span>
<span class="preprocessor"></span>                pcm { }         # Slave PCM definition
        }
        file STR                # Filename
        or
        file INT                # File descriptor number
        [format STR]            # File format (only <span class="stringliteral">"raw"</span> at the moment)
}
</pre></div>
<p>
<h3><a name="pcm_plugins_file_funcref">Function reference</a>
</h3>
<p>
<ul>
<li><a class="el" href="pcm__file_8c.html#a34">snd_pcm_file_open()</a> <li><a class="el" href="pcm__file_8c.html#a35">_snd_pcm_file_open()</a> </ul>
<h2><a name="pcm_plugins_multi">Plugin: Multiple streams to One</a>
</h2>
<p>
This plugin converts multiple streams to one.
<p>
<div class="fragment"><pre>pcm.name {
        type multi              # Multiple streams conversion PCM
        slaves {                # Slaves definition
                ID STR          # Slave PCM name
<span class="preprocessor">                # or</span>
<span class="preprocessor"></span>                ID {
                        pcm STR         # Slave PCM name
<span class="preprocessor">                        # or</span>
<span class="preprocessor"></span>                        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
}
</pre></div>
<p>
<h3><a name="pcm_plugins_multi_funcref">Function reference</a>
</h3>
<p>
<ul>
<li><a class="el" href="pcm__multi_8c.html#a34">snd_pcm_multi_open()</a> <li><a class="el" href="pcm__multi_8c.html#a35">_snd_pcm_multi_open()</a> </ul>
<h2><a name="pcm_plugins_share">Plugin: Share</a>
</h2>
<p>
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<b> unknown reference! </b>.
<p>
<div class="fragment"><pre>pcm.name {
        type share              # Share PCM
        slave STR               # Slave name
<span class="preprocessor">        # or</span>
<span class="preprocessor"></span>        slave {                 # Slave definition
                pcm STR         # Slave PCM name
        }
        bindings {
                N INT           # Slave channel INT <span class="keywordflow">for</span> client channel N
        }
}
</pre></div>
<p>
<h3><a name="pcm_plugins_share_funcref">Function reference</a>
</h3>
<p>
<ul>
<li><a class="el" href="pcm__share_8c.html#a45">snd_pcm_share_open()</a> <li><a class="el" href="pcm__share_8c.html#a46">_snd_pcm_share_open()</a> </ul>
<h2><a name="pcm_plugins_hooks">Plugin: hooks</a>
</h2>
<p>
<div class="fragment"><pre><span class="preprocessor"># Hook arguments definition</span>
<span class="preprocessor"></span>hook_args.NAME {
        ...                     # Arbitrary arguments
}

<span class="preprocessor"># PCM hook type</span>
<span class="preprocessor"></span>pcm_hook_type.NAME {
        [lib STR]               # Library file (<span class="keywordflow">default</span> libasound.so)
        [install STR]           # Install function (<span class="keywordflow">default</span> _snd_pcm_hook_NAME_install)
}

<span class="preprocessor"># PCM hook definition</span>
<span class="preprocessor"></span>pcm_hook.NAME {
        type STR                # PCM Hook type (see pcm_hook_type)
        [args STR]              # Arguments <span class="keywordflow">for</span> install function (see hook_args)
        # or
        [args { }]              # Arguments <span class="keywordflow">for</span> install function
}

<span class="preprocessor"># PCM hook plugin</span>
<span class="preprocessor"></span>pcm.NAME {
        type hooks              # PCM with hooks
        slave STR               # Slave name
<span class="preprocessor">        # or</span>
<span class="preprocessor"></span>        slave {                 # Slave definition
                pcm STR         # Slave PCM name
<span class="preprocessor">                # or</span>
<span class="preprocessor"></span>                pcm { }         # Slave PCM definition
        }
        hooks {
                ID STR          # Hook name (see pcm_hook)
                # or
                ID { }          # Hook definition (see pcm_hook)
        }
}
</pre></div>
<p>
Example:
<p>
<div class="fragment"><pre>        hooks.0 {
                type ctl_elems
                hook_args [
                        {
                                name <span class="stringliteral">"Wave Surround Playback Volume"</span>
                                preserve <span class="keyword">true</span>
                                lock <span class="keyword">true</span>
                                value [ 0 0 ]
                        }
                        {
                                name <span class="stringliteral">"EMU10K1 PCM Send Volume"</span>
                                index { @func private_pcm_subdevice }
                                lock <span class="keyword">true</span>
                                value [ 0 0 0 0 0 0 255 0 0 0 0 255 ]
                        }
                ]
        }
</pre></div>
<p>
<h3><a name="pcm_plugins_hooks_funcref">Function reference</a>
</h3>
<p>
<ul>
<li>The function ctl_elems - <a class="el" href="pcm__hooks_8c.html#a43">_snd_pcm_hook_ctl_elems_install()</a> - installs CTL settings described by given configuration. <li><a class="el" href="pcm__hooks_8c.html#a32">snd_pcm_hooks_open()</a> <li><a class="el" href="pcm__hooks_8c.html#a34">_snd_pcm_hooks_open()</a> </ul>
<h2><a name="pcm_plugins_ladpsa">Plugin: LADSPA &lt;-&gt; ALSA</a>
</h2>
<p>
This plugin allows to apply a set of LADPSA plugins. The input and output format is always <a class="el" href="group___p_c_m.html#a70a102">SND_PCM_FORMAT_FLOAT</a> (note: this type can be either little or big-endian depending on architecture).
<p>
The policy duplicate means that there must be only one binding definition for channel zero. This definition is automatically duplicated for all channels.
<p>
Instances of LADSPA plugins are created dynamically.
<p>
<div class="fragment"><pre>pcm.name {
        type ladspa             # ALSA&lt;-&gt;LADSPA PCM
        slave STR               # Slave name
<span class="preprocessor">        # or</span>
<span class="preprocessor"></span>        slave {                 # Slave definition
                pcm STR         # Slave PCM name
<span class="preprocessor">                # or</span>
<span class="preprocessor"></span>                pcm { }         # Slave PCM definition
        }
        [path STR]              # Path (directory) with LADSPA plugins
        plugins |               # Definition <span class="keywordflow">for</span> both directions
        playback_plugins |      # Definition <span class="keywordflow">for</span> playback direction
        capture_plugins {       # Definition <span class="keywordflow">for</span> capture direction
                N {             # Configuration <span class="keywordflow">for</span> LADPSA plugin N
                        [id INT]        # LADSPA plugin ID (<span class="keywordflow">for</span> example 1043)
                        [label STR]     # LADSPA plugin label (<span class="keywordflow">for</span> 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
<span class="preprocessor">                                        # or</span>
<span class="preprocessor"></span>                                        STR INT or REAL # STR - control port name, INT or REAL - control value
                                }
                        }
                }
        }
}
</pre></div>
<p>
<h3><a name="pcm_plugins_ladspa_funcref">Function reference</a>
</h3>
<p>
<ul>
<li><a class="el" href="pcm__ladspa_8c.html#a34">snd_pcm_ladspa_open()</a> <li><a class="el" href="pcm__ladspa_8c.html#a35">_snd_pcm_ladspa_open()</a> </ul>
<hr><address style="align: right;"><small>Generated on Wed Apr 2 16:06:36 2003 for ALSA project - the C library reference by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 
width=110 height=53></a>1.2.18 </small></address>
</body>
</html>