Sophie

Sophie

distrib > Mageia > 5 > i586 > media > core-release > by-pkgid > 406d9b580cc28afca9442eab7324087d > files > 207

libalsa2-docs-1.0.28-1.mga5.noarch.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.7"/>
<title>ALSA project - the C library reference: PCM (digital audio) plugins</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">ALSA project - the C library reference
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.7 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">PCM (digital audio) plugins </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><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>
<h1><a class="anchor" id="pcm_plugins_slave"></a>
Slave definition</h1>
<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"><div class="line">pcm_slave.NAME {</div>
<div class="line">    pcm STR     # PCM name</div>
<div class="line"><span class="preprocessor">    # or</span></div>
<div class="line">    pcm { }     # PCM definition</div>
<div class="line">    format STR  # Format or <span class="stringliteral">&quot;unchanged&quot;</span></div>
<div class="line">    channels INT    # Count of channels or <span class="stringliteral">&quot;unchanged&quot;</span> <span class="keywordtype">string</span></div>
<div class="line">    rate INT    # Rate in Hz or <span class="stringliteral">&quot;unchanged&quot;</span> <span class="keywordtype">string</span></div>
<div class="line">    period_time INT # Period time in us or <span class="stringliteral">&quot;unchanged&quot;</span> <span class="keywordtype">string</span></div>
<div class="line">    buffer_time INT # Buffer time in us or <span class="stringliteral">&quot;unchanged&quot;</span> <span class="keywordtype">string</span></div>
<div class="line">}</div>
</div><!-- fragment --><p>Example:</p>
<div class="fragment"><div class="line">pcm_slave.slave_rate44100Hz {</div>
<div class="line">    pcm <span class="stringliteral">&quot;hw:0,0&quot;</span></div>
<div class="line">    rate 44100</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line">pcm.rate44100Hz {</div>
<div class="line">    type plug</div>
<div class="line">    slave slave_rate44100Hz</div>
<div class="line">}</div>
</div><!-- fragment --><p>The equivalent configuration (in one compound):</p>
<div class="fragment"><div class="line">pcm.rate44100Hz {</div>
<div class="line">    type plug</div>
<div class="line">    slave {</div>
<div class="line">        pcm <span class="stringliteral">&quot;hw:0,0&quot;</span></div>
<div class="line">        rate 44100</div>
<div class="line">    }</div>
<div class="line">}</div>
</div><!-- fragment --><h1><a class="anchor" id="pcm_plugins_hw"></a>
Plugin: hw</h1>
<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>
<p>The nonblock option specifies whether the device is opened in a non-blocking manner. Note that the blocking behavior for read/write access won't be changed by this option. This influences only on the blocking behavior at opening the device. If you would like to keep the compatibility with the older ALSA stuff, turn this option off.</p>
<div class="fragment"><div class="line">pcm.name {</div>
<div class="line">    type hw         # Kernel PCM</div>
<div class="line">    card INT/STR        # Card name (<span class="keywordtype">string</span>) or number (integer)</div>
<div class="line">    [device INT]        <span class="preprocessor"># Device number (default 0)</span></div>
<div class="line">    [subdevice INT]     # Subdevice number (<span class="keywordflow">default</span> -1: first available)</div>
<div class="line">    [sync_ptr_ioctl BOOL]   # Use SYNC_PTR ioctl rather than the direct mmap access <span class="keywordflow">for</span> control structures</div>
<div class="line">    [nonblock BOOL]     # Force non-blocking open mode</div>
<div class="line">    [format STR]        # Restrict only to the given format</div>
<div class="line">    [channels INT]      # Restrict only to the given channels</div>
<div class="line">    [rate INT]      # Restrict only to the given rate</div>
<div class="line">    [chmap MAP]     # Override channel maps; MAP is a <span class="keywordtype">string</span> array</div>
<div class="line">}</div>
</div><!-- fragment --><h2><a class="anchor" id="pcm_plugins_hw_funcref"></a>
Function reference</h2>
<ul>
<li>
<a class="el" href="pcm__hw_8c.html#a06abf5d78c26a9d8e79fd0428a5c7183" title="Creates a new hw PCM. ">snd_pcm_hw_open()</a> </li>
<li>
<a class="el" href="pcm__hw_8c.html#a7687673b2a39b944c5693043446afaf9" title="Creates a new hw PCM. ">_snd_pcm_hw_open()</a> </li>
</ul>
<h1><a class="anchor" id="pcm_plugins_mmap_emul"></a>
Plugin: mmap_emul</h1>
<div class="fragment"><div class="line">pcm.name {</div>
<div class="line">    type mmap_emul</div>
<div class="line">    slave PCM</div>
<div class="line">}</div>
</div><!-- fragment --><h2><a class="anchor" id="pcm_plugins_mmap_emul_funcref"></a>
Function reference</h2>
<ul>
<li>
<a class="el" href="pcm__hw_8c.html#a7687673b2a39b944c5693043446afaf9" title="Creates a new hw PCM. ">_snd_pcm_hw_open()</a> </li>
</ul>
<h1><a class="anchor" id="pcm_plugins_shm"></a>
Plugin: shm</h1>
<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"><div class="line">pcm.name {</div>
<div class="line">        type shm                # Shared memory PCM</div>
<div class="line">    server STR      # Server name</div>
<div class="line">    pcm STR         # PCM name</div>
<div class="line">}</div>
</div><!-- fragment --><h2><a class="anchor" id="pcm_plugins_shm_funcref"></a>
Function reference</h2>
<ul>
<li>
<a class="el" href="pcm__shm_8c.html#a3684b5fb80a3549a9176cbc7ea9e5181" title="Creates a new shared memory PCM. ">snd_pcm_shm_open()</a> </li>
<li>
<a class="el" href="pcm__shm_8c.html#adc046ce3ea6720d3545bb2158266bc75" title="Creates a new shm PCM. ">_snd_pcm_shm_open()</a> </li>
</ul>
<h1><a class="anchor" id="pcm_plugins_null"></a>
Plugin: Null</h1>
<p>This plugin discards contents of a PCM stream or creates a stream with zero samples.</p>
<p>Note: This implementation uses devices /dev/null (playback, must be writable) and /dev/full (capture, must be readable).</p>
<div class="fragment"><div class="line">pcm.name {</div>
<div class="line">        type null               # Null PCM</div>
<div class="line">    [chmap MAP]     # Provide channel maps; MAP is a <span class="keywordtype">string</span> array</div>
<div class="line">}</div>
</div><!-- fragment --><h2><a class="anchor" id="pcm_plugins_null_funcref"></a>
Function reference</h2>
<ul>
<li>
<a class="el" href="pcm__null_8c.html#ad1e47f314d908607cf908d9859359724" title="Creates a new null PCM. ">snd_pcm_null_open()</a> </li>
<li>
<a class="el" href="pcm__null_8c.html#af964b1e41d92a723748128014026ebd6" title="Creates a new Null PCM. ">_snd_pcm_null_open()</a> </li>
</ul>
<h1><a class="anchor" id="pcm_plugins_copy"></a>
Plugin: copy</h1>
<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"><div class="line">pcm.name {</div>
<div class="line">    type copy       # Copy PCM</div>
<div class="line">    slave STR       # Slave name</div>
<div class="line"><span class="preprocessor">    # or</span></div>
<div class="line">    slave {         # Slave definition</div>
<div class="line">        pcm STR     # Slave PCM name</div>
<div class="line"><span class="preprocessor">        # or</span></div>
<div class="line">        pcm { }     # Slave PCM definition</div>
<div class="line">    }</div>
<div class="line">}</div>
</div><!-- fragment --><h2><a class="anchor" id="pcm_plugins_copy_funcref"></a>
Function reference</h2>
<ul>
<li>
<a class="el" href="pcm__copy_8c.html#a97fb1b1587b7905bbc908cf7d03a727a" title="Creates a new copy PCM. ">snd_pcm_copy_open()</a> </li>
<li>
<a class="el" href="pcm__copy_8c.html#a47dd871325fe6dfe7650443de19e31ba" title="Creates a new copy PCM. ">_snd_pcm_copy_open()</a> </li>
</ul>
<h1><a class="anchor" id="pcm_plugins_linear"></a>
Plugin: linear</h1>
<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"><div class="line">pcm.name {</div>
<div class="line">        type linear             # Linear conversion PCM</div>
<div class="line">        slave STR               # Slave name</div>
<div class="line"><span class="preprocessor">        # or</span></div>
<div class="line">        slave {                 # Slave definition</div>
<div class="line">                pcm STR         # Slave PCM name</div>
<div class="line"><span class="preprocessor">                # or</span></div>
<div class="line">                pcm { }         # Slave PCM definition</div>
<div class="line">                format STR      # Slave format</div>
<div class="line">        }</div>
<div class="line">}</div>
</div><!-- fragment --><h2><a class="anchor" id="pcm_plugins_linear_funcref"></a>
Function reference</h2>
<ul>
<li>
<a class="el" href="pcm__linear_8c.html#ad5aad633e536382e36d128aa074ae2d5" title="Creates a new linear conversion PCM. ">snd_pcm_linear_open()</a> </li>
<li>
<a class="el" href="pcm__linear_8c.html#a705b6ecd46bb7ceb0cfef986404686f8" title="Creates a new linear conversion PCM. ">_snd_pcm_linear_open()</a> </li>
</ul>
<h1><a class="anchor" id="pcm_plugins_lfloat"></a>
Plugin: linear&lt;-&gt;float</h1>
<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"><div class="line">pcm.name {</div>
<div class="line">        type lfloat             # Linear&lt;-&gt;Float conversion PCM</div>
<div class="line">        slave STR               # Slave name</div>
<div class="line"><span class="preprocessor">        # or</span></div>
<div class="line">        slave {                 # Slave definition</div>
<div class="line">                pcm STR         # Slave PCM name</div>
<div class="line"><span class="preprocessor">                # or</span></div>
<div class="line">                pcm { }         # Slave PCM definition</div>
<div class="line">                format STR      # Slave format</div>
<div class="line">        }</div>
<div class="line">}</div>
</div><!-- fragment --><h2><a class="anchor" id="pcm_plugins_lfloat_funcref"></a>
Function reference</h2>
<ul>
<li>
<a class="el" href="pcm__lfloat_8c.html#a1cf1d379cfe222a0205356e72ae1e460" title="Creates a new linear conversion PCM. ">snd_pcm_lfloat_open()</a> </li>
<li>
<a class="el" href="pcm__lfloat_8c.html#a073916f2bcb53f0020b5fd5c371f4fc8" title="Creates a new linear<->float conversion PCM. ">_snd_pcm_lfloat_open()</a> </li>
</ul>
<h1><a class="anchor" id="pcm_plugins_mulaw"></a>
Plugin: Mu-Law</h1>
<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"><div class="line">pcm.name {</div>
<div class="line">        type mulaw              # Mu-Law conversion PCM</div>
<div class="line">        slave STR               # Slave name</div>
<div class="line"><span class="preprocessor">        # or</span></div>
<div class="line">        slave {                 # Slave definition</div>
<div class="line">                pcm STR         # Slave PCM name</div>
<div class="line"><span class="preprocessor">                # or</span></div>
<div class="line">                pcm { }         # Slave PCM definition</div>
<div class="line">                format STR      # Slave format</div>
<div class="line">        }</div>
<div class="line">}</div>
</div><!-- fragment --><h2><a class="anchor" id="pcm_plugins_mulaw_funcref"></a>
Function reference</h2>
<ul>
<li>
<a class="el" href="pcm__mulaw_8c.html#a5180265fc0f22f9eeabaa15555bcd072" title="Creates a new Mu-Law conversion PCM. ">snd_pcm_mulaw_open()</a> </li>
<li>
<a class="el" href="pcm__mulaw_8c.html#aac8ed7d538562e09d0b8bbfe08df3665" title="Creates a new Mu-Law conversion PCM. ">_snd_pcm_mulaw_open()</a> </li>
</ul>
<h1><a class="anchor" id="pcm_plugins_alaw"></a>
Plugin: A-Law</h1>
<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"><div class="line">pcm.name {</div>
<div class="line">        type alaw               # A-Law conversion PCM</div>
<div class="line">        slave STR               # Slave name</div>
<div class="line"><span class="preprocessor">        # or</span></div>
<div class="line">        slave {                 # Slave definition</div>
<div class="line">                pcm STR         # Slave PCM name</div>
<div class="line"><span class="preprocessor">                # or</span></div>
<div class="line">                pcm { }         # Slave PCM definition</div>
<div class="line">                format STR      # Slave format</div>
<div class="line">        }</div>
<div class="line">}</div>
</div><!-- fragment --><h2><a class="anchor" id="pcm_plugins_alaw_funcref"></a>
Function reference</h2>
<ul>
<li>
<a class="el" href="pcm__alaw_8c.html#adfc7fc62627b564e1a6e0a3069730a56" title="Creates a new A-Law conversion PCM. ">snd_pcm_alaw_open()</a> </li>
<li>
<a class="el" href="pcm__alaw_8c.html#a033d4c03b15175509e960689b5d515b0" title="Creates a new A-Law conversion PCM. ">_snd_pcm_alaw_open()</a> </li>
</ul>
<h1><a class="anchor" id="pcm_plugins_adpcm"></a>
Plugin: Ima-ADPCM</h1>
<p>This plugin converts Ima-ADPCM samples to linear or linear to Ima-ADPCM 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"><div class="line">pcm.name {</div>
<div class="line">        type adpcm              # Ima-ADPCM conversion PCM</div>
<div class="line">        slave STR               # Slave name</div>
<div class="line"><span class="preprocessor">        # or</span></div>
<div class="line">        slave {                 # Slave definition</div>
<div class="line">                pcm STR         # Slave PCM name</div>
<div class="line"><span class="preprocessor">                # or</span></div>
<div class="line">                pcm { }         # Slave PCM definition</div>
<div class="line">                format STR      # Slave format</div>
<div class="line">        }</div>
<div class="line">}</div>
</div><!-- fragment --><h2><a class="anchor" id="pcm_plugins_adpcm_funcref"></a>
Function reference</h2>
<ul>
<li>
<a class="el" href="pcm__adpcm_8c.html#afc781f794b0c705552491b6707bf2c86" title="Creates a new Ima-ADPCM conversion PCM. ">snd_pcm_adpcm_open()</a> </li>
<li>
<a class="el" href="pcm__adpcm_8c.html#a71eccece5048625c5648aa4b1077c271" title="Creates a new Ima-ADPCM conversion PCM. ">_snd_pcm_adpcm_open()</a> </li>
</ul>
<h1><a class="anchor" id="pcm_plugins_route"></a>
Plugin: Route &amp; Volume</h1>
<p>This plugin converts channels and applies volume during the conversion. The format and rate must match for both of them.</p>
<p>SCHANNEL can be a channel name instead of a number (e g FL, LFE). If so, a matching channel map will be selected for the slave.</p>
<div class="fragment"><div class="line">pcm.name {</div>
<div class="line">        type route              # Route &amp; Volume conversion PCM</div>
<div class="line">        slave STR               # Slave name</div>
<div class="line"><span class="preprocessor">        # or</span></div>
<div class="line">        slave {                 # Slave definition</div>
<div class="line">                pcm STR         # Slave PCM name</div>
<div class="line"><span class="preprocessor">                # or</span></div>
<div class="line">                pcm { }         # Slave PCM definition</div>
<div class="line">                [format STR]    # Slave format</div>
<div class="line">                [channels INT]  # Slave channels</div>
<div class="line">        }</div>
<div class="line">        ttable {                # Transfer table (bi-dimensional compound of cchannels * schannels numbers)</div>
<div class="line">                CCHANNEL {</div>
<div class="line">                        SCHANNEL REAL   # route value (0.0 - 1.0)</div>
<div class="line">                }</div>
<div class="line">        }</div>
<div class="line">}</div>
</div><!-- fragment --><h2><a class="anchor" id="pcm_plugins_route_funcref"></a>
Function reference</h2>
<ul>
<li>
<a class="el" href="pcm__route_8c.html#ae19a77e8ec26dc93b8be5a93e7391550" title="Creates a new Route & Volume PCM. ">snd_pcm_route_open()</a> </li>
<li>
<a class="el" href="pcm__route_8c.html#abee47f3c05e74d83bf2a96559de9a262" title="Creates a new Route & Volume PCM. ">_snd_pcm_route_open()</a> </li>
</ul>
<h1><a class="anchor" id="pcm_plugins_rate"></a>
Plugin: Rate</h1>
<p>This plugin converts a stream rate. The input and output formats must be linear.</p>
<div class="fragment"><div class="line">pcm.name {</div>
<div class="line">    type rate               # Rate PCM</div>
<div class="line">        slave STR               # Slave name</div>
<div class="line"><span class="preprocessor">        # or</span></div>
<div class="line">        slave {                 # Slave definition</div>
<div class="line">                pcm STR         # Slave PCM name</div>
<div class="line"><span class="preprocessor">                # or</span></div>
<div class="line">                pcm { }         # Slave PCM definition</div>
<div class="line">                rate INT        # Slave rate</div>
<div class="line">                [format STR]    # Slave format</div>
<div class="line">        }</div>
<div class="line">    converter STR           # optional</div>
<div class="line"><span class="preprocessor">    # or</span></div>
<div class="line">    converter [ STR1 STR2 ... ] # optional</div>
<div class="line"><span class="preprocessor">                # Converter type, default is taken from</span></div>
<div class="line"><span class="preprocessor">                # defaults.pcm.rate_converter</span></div>
<div class="line"><span class="preprocessor">}</span></div>
</div><!-- fragment --><h2><a class="anchor" id="pcm_plugins_rate_funcref"></a>
Function reference</h2>
<ul>
<li>
<a class="el" href="pcm__rate_8c.html#acbc33a01e5c38505fb8777e8a3cb808f" title="Creates a new rate PCM. ">snd_pcm_rate_open()</a> </li>
<li>
<a class="el" href="pcm__rate_8c.html#aa2b39b0460f63d709b2244be669c479b" title="Creates a new rate PCM. ">_snd_pcm_rate_open()</a> </li>
</ul>
<h1><a class="anchor" id="pcm_plugins_plug"></a>
Automatic conversion plugin</h1>
<p>This plugin converts channels, rate and format on request.</p>
<div class="fragment"><div class="line">pcm.name {</div>
<div class="line">        type plug               # Automatic conversion PCM</div>
<div class="line">        slave STR               # Slave name</div>
<div class="line"><span class="preprocessor">        # or</span></div>
<div class="line">        slave {                 # Slave definition</div>
<div class="line">                pcm STR         # Slave PCM name</div>
<div class="line"><span class="preprocessor">                # or</span></div>
<div class="line">                pcm { }         # Slave PCM definition</div>
<div class="line">        [format STR]    # Slave format (<span class="keywordflow">default</span> nearest) or <span class="stringliteral">&quot;unchanged&quot;</span></div>
<div class="line">        [channels INT]  # Slave channels (<span class="keywordflow">default</span> nearest) or <span class="stringliteral">&quot;unchanged&quot;</span></div>
<div class="line">        [rate INT]  # Slave rate (<span class="keywordflow">default</span> nearest) or <span class="stringliteral">&quot;unchanged&quot;</span></div>
<div class="line">        }</div>
<div class="line">    route_policy STR    # route policy <span class="keywordflow">for</span> automatic ttable generation</div>
<div class="line"><span class="preprocessor">                # STR can be &#39;default&#39;, &#39;average&#39;, &#39;copy&#39;, &#39;duplicate&#39;</span></div>
<div class="line"><span class="preprocessor">                # average: result is average of input channels</span></div>
<div class="line"><span class="preprocessor">                # copy: only first channels are copied to destination</span></div>
<div class="line"><span class="preprocessor">                # duplicate: duplicate first set of channels</span></div>
<div class="line"><span class="preprocessor">                # default: copy policy, except for mono capture - sum</span></div>
<div class="line">    ttable {        # Transfer table (bi-dimensional compound of cchannels * schannels numbers)</div>
<div class="line">        CCHANNEL {</div>
<div class="line">            SCHANNEL REAL   # route value (0.0 - 1.0)</div>
<div class="line">        }</div>
<div class="line">    }</div>
<div class="line">    rate_converter STR  # type of rate converter</div>
<div class="line"><span class="preprocessor">    # or</span></div>
<div class="line">    rate_converter [ STR1 STR2 ... ]</div>
<div class="line"><span class="preprocessor">                # type of rate converter</span></div>
<div class="line"><span class="preprocessor">                # default value is taken from defaults.pcm.rate_converter</span></div>
<div class="line"><span class="preprocessor">}</span></div>
</div><!-- fragment --><h2><a class="anchor" id="pcm_plugins_plug_funcref"></a>
Function reference</h2>
<ul>
<li>
snd_pcm_plug_open() </li>
<li>
_snd_pcm_plug_open() </li>
</ul>
<h1><a class="anchor" id="pcm_plugins_file"></a>
Plugin: File</h1>
<p>This plugin stores contents of a PCM stream to file or pipes the stream to a command, and optionally uses an existing file as an input data source (i.e., "virtual mic")</p>
<div class="fragment"><div class="line">pcm.name {</div>
<div class="line">        type file               # File PCM</div>
<div class="line">        slave STR               # Slave name</div>
<div class="line"><span class="preprocessor">        # or</span></div>
<div class="line">        slave {                 # Slave definition</div>
<div class="line">                pcm STR         # Slave PCM name</div>
<div class="line"><span class="preprocessor">                # or</span></div>
<div class="line">                pcm { }         # Slave PCM definition</div>
<div class="line">        }</div>
<div class="line">    file STR        # Output filename (or shell command the stream</div>
<div class="line">                # will be piped to <span class="keywordflow">if</span> STR starts with the pipe</div>
<div class="line">                # <span class="keywordtype">char</span>).</div>
<div class="line">                # STR can contain format keys, replaced by</div>
<div class="line"><span class="preprocessor">                # real values corresponding to the stream:</span></div>
<div class="line"><span class="preprocessor">                # %r    rate (replaced with: 48000)</span></div>
<div class="line"><span class="preprocessor">                # %c    channels (replaced with: 2)</span></div>
<div class="line"><span class="preprocessor">                # %b    bits per sample (replaced with: 16)</span></div>
<div class="line"><span class="preprocessor">                # %f    sample format string</span></div>
<div class="line"><span class="preprocessor">                #           (replaced with: S16_LE)</span></div>
<div class="line"><span class="preprocessor">                # %%    replaced with %</span></div>
<div class="line">    or</div>
<div class="line">    file INT        # Output file descriptor number</div>
<div class="line">    infile STR      # Input filename - only raw format</div>
<div class="line">    or</div>
<div class="line">    infile INT      # Input file descriptor number</div>
<div class="line">    [format STR]        # File format (<span class="stringliteral">&quot;raw&quot;</span> or <span class="stringliteral">&quot;wav&quot;</span>)</div>
<div class="line">    [perm INT]      # Output file permission (octal, def. 0600)</div>
<div class="line">}</div>
</div><!-- fragment --><h2><a class="anchor" id="pcm_plugins_file_funcref"></a>
Function reference</h2>
<ul>
<li>
<a class="el" href="pcm__file_8c.html#a2d295a1bebec45e0541de03b86de0703" title="Creates a new File PCM. ">snd_pcm_file_open()</a> </li>
<li>
<a class="el" href="pcm__file_8c.html#a3732156e2f368386a89f2f200c496b0a" title="Creates a new File PCM. ">_snd_pcm_file_open()</a> </li>
</ul>
<h1><a class="anchor" id="pcm_plugins_multi"></a>
Plugin: Multiple streams to One</h1>
<p>This plugin converts multiple streams to one.</p>
<div class="fragment"><div class="line">pcm.name {</div>
<div class="line">        type multi              # Multiple streams conversion PCM</div>
<div class="line">        slaves {        # Slaves definition</div>
<div class="line">        ID STR      # Slave PCM name</div>
<div class="line"><span class="preprocessor">        # or</span></div>
<div class="line">        ID {</div>
<div class="line">            pcm STR     # Slave PCM name</div>
<div class="line"><span class="preprocessor">            # or</span></div>
<div class="line">            pcm { }     # Slave PCM definition</div>
<div class="line">            channels INT    # Slave channels</div>
<div class="line">        }</div>
<div class="line">        }</div>
<div class="line">    bindings {      # Bindings table</div>
<div class="line">        N {</div>
<div class="line">            slave STR   # Slave key</div>
<div class="line">            channel INT # Slave channel</div>
<div class="line">        }</div>
<div class="line">    }</div>
<div class="line">    [master INT]        # Define the master slave</div>
<div class="line">}</div>
</div><!-- fragment --><p>For example, to bind two PCM streams with two-channel stereo (hw:0,0 and hw:0,1) as one 4-channel stereo PCM stream, define like this: </p><div class="fragment"><div class="line">pcm.quad {</div>
<div class="line">    type multi</div>
<div class="line"></div>
<div class="line">    slaves.a.pcm <span class="stringliteral">&quot;hw:0,0&quot;</span></div>
<div class="line">    slaves.a.channels 2</div>
<div class="line">    slaves.b.pcm <span class="stringliteral">&quot;hw:0,1&quot;</span></div>
<div class="line">    slaves.b.channels 2</div>
<div class="line"></div>
<div class="line">    bindings.0.slave a</div>
<div class="line">    bindings.0.channel 0</div>
<div class="line">    bindings.1.slave a</div>
<div class="line">    bindings.1.channel 1</div>
<div class="line">    bindings.2.slave b</div>
<div class="line">    bindings.2.channel 0</div>
<div class="line">    bindings.3.slave b</div>
<div class="line">    bindings.3.channel 1</div>
<div class="line">}</div>
</div><!-- fragment --><p> Note that the resultant pcm "quad" is not in the interleaved format but in the "complex" format. Hence, it's not accessible by applications which can handle only the interleaved (or the non-interleaved) format. In such a case, wrap this PCM with <a class="el" href="pcm_plugins.html#pcm_plugins_route">route</a> or <a class="el" href="pcm_plugins.html#pcm_plugins_plug">plug</a> plugin. </p><div class="fragment"><div class="line">pcm.quad2 {</div>
<div class="line">    type route</div>
<div class="line">    slave.pcm <span class="stringliteral">&quot;quad&quot;</span></div>
<div class="line">    ttable.0.0 1</div>
<div class="line">    ttable.1.1 1</div>
<div class="line">    ttable.2.2 1</div>
<div class="line">    ttable.3.3 1</div>
<div class="line">}</div>
</div><!-- fragment --><h2><a class="anchor" id="pcm_plugins_multi_funcref"></a>
Function reference</h2>
<ul>
<li>
<a class="el" href="pcm__multi_8c.html#a9cd9738f81265d5255a9c28bbccb8bb4" title="Creates a new Multi PCM. ">snd_pcm_multi_open()</a> </li>
<li>
<a class="el" href="pcm__multi_8c.html#aeb0fcef35d9f9bf598384cfe46e163a5" title="Creates a new Multi PCM. ">_snd_pcm_multi_open()</a> </li>
</ul>
<h1><a class="anchor" id="pcm_plugins_share"></a>
Plugin: Share</h1>
<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 <a class="el" href="pcm_plugins.html#pcm_plugins_dmix">dmix plugin</a>.</p>
<p>The difference from <a class="el" href="pcm_plugins.html#pcm_plugins_dshare">dshare plugin</a> is that share plugin requires the server program "aserver", while dshare plugin doesn't need the explicit server but access to the shared buffer.</p>
<div class="fragment"><div class="line">pcm.name {</div>
<div class="line">        type share              # Share PCM</div>
<div class="line">        slave STR               # Slave name</div>
<div class="line"><span class="preprocessor">        # or</span></div>
<div class="line">        slave {                 # Slave definition</div>
<div class="line">                pcm STR         # Slave PCM name</div>
<div class="line">                [format STR]    # Slave format</div>
<div class="line">                [channels INT]  # Slave channels</div>
<div class="line">                [rate INT]      # Slave rate</div>
<div class="line">                [period_time INT] # Slave period time in us</div>
<div class="line">                [buffer_time INT] # Slave buffer time in us</div>
<div class="line">        }</div>
<div class="line">    bindings {</div>
<div class="line">        N INT       # Slave channel INT <span class="keywordflow">for</span> client channel N</div>
<div class="line">    }</div>
<div class="line">}</div>
</div><!-- fragment --><h2><a class="anchor" id="pcm_plugins_share_funcref"></a>
Function reference</h2>
<ul>
<li>
<a class="el" href="pcm__share_8c.html#ab7c7e88e681d727250e67b6fbd11e245" title="Creates a new Share PCM. ">snd_pcm_share_open()</a> </li>
<li>
<a class="el" href="pcm__share_8c.html#a201ff59d8aad291bfd324fef114bf2d9" title="Creates a new Share PCM. ">_snd_pcm_share_open()</a> </li>
</ul>
<h1><a class="anchor" id="pcm_plugins_hooks"></a>
Plugin: hooks</h1>
<p>This plugin is used to call some 'hook' function when this plugin is opened, modified or closed. Typically, it is used to change control values for a certain state specially for the PCM (see the example below).</p>
<div class="fragment"><div class="line"><span class="preprocessor"># Hook arguments definition</span></div>
<div class="line">hook_args.NAME {</div>
<div class="line">    ...         # Arbitrary arguments</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="preprocessor"># PCM hook type</span></div>
<div class="line">pcm_hook_type.NAME {</div>
<div class="line">    [lib STR]       # Library file (<span class="keywordflow">default</span> libasound.so)</div>
<div class="line">    [install STR]       # Install <span class="keyword">function</span> (<span class="keywordflow">default</span> _snd_pcm_hook_NAME_install)</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"># PCM hook definition</div>
<div class="line">pcm_hook.NAME {</div>
<div class="line">    type STR        # PCM Hook type (see pcm_hook_type)</div>
<div class="line">    [args STR]      # Arguments <span class="keywordflow">for</span> install <span class="keyword">function</span> (see hook_args)</div>
<div class="line">    # or</div>
<div class="line">    [args { }]      # Arguments <span class="keywordflow">for</span> install <span class="keyword">function</span></div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="preprocessor"># PCM hook plugin</span></div>
<div class="line">pcm.NAME {</div>
<div class="line">    type hooks      # PCM with hooks</div>
<div class="line">    slave STR       # Slave name</div>
<div class="line"><span class="preprocessor">    # or</span></div>
<div class="line">    slave {         # Slave definition</div>
<div class="line">        pcm STR     # Slave PCM name</div>
<div class="line"><span class="preprocessor">        # or</span></div>
<div class="line">        pcm { }     # Slave PCM definition</div>
<div class="line">    }</div>
<div class="line">    hooks {</div>
<div class="line">        ID STR      # Hook name (see pcm_hook)</div>
<div class="line">        <span class="preprocessor"># or</span></div>
<div class="line">        ID { }      # Hook definition (see pcm_hook)</div>
<div class="line">    }</div>
<div class="line">}</div>
</div><!-- fragment --><p>Example:</p>
<div class="fragment"><div class="line">hooks.0 {</div>
<div class="line">    type ctl_elems</div>
<div class="line">    hook_args [</div>
<div class="line">        {</div>
<div class="line">            name <span class="stringliteral">&quot;Wave Surround Playback Volume&quot;</span></div>
<div class="line">            preserve <span class="keyword">true</span></div>
<div class="line">            lock <span class="keyword">true</span></div>
<div class="line">            optional <span class="keyword">true</span></div>
<div class="line">            value [ 0 0 ]</div>
<div class="line">        }</div>
<div class="line">        {</div>
<div class="line">            name <span class="stringliteral">&quot;EMU10K1 PCM Send Volume&quot;</span></div>
<div class="line">            index { @func private_pcm_subdevice }</div>
<div class="line">            lock <span class="keyword">true</span></div>
<div class="line">            value [ 0 0 0 0 0 0 255 0 0 0 0 255 ]</div>
<div class="line">        }</div>
<div class="line">    ]</div>
<div class="line">}</div>
</div><!-- fragment --><p> Here, the controls "Wave Surround Playback Volume" and "EMU10K1 PCM Send Volume" are set to the given values when this pcm is accessed. Since these controls take multi-dimensional values, the <code>value</code> field is written as an array. When <code>preserve</code> is true, the old values are saved and restored when the pcm is closed. The <code>lock</code> means that the control is locked during this pcm is opened, and cannot be changed by others. When <code>optional</code> is set, no error is returned but ignored even if the specified control doesn't exist.</p>
<h2><a class="anchor" id="pcm_plugins_hooks_funcref"></a>
Function reference</h2>
<ul>
<li>
The function ctl_elems - <a class="el" href="pcm__hooks_8c.html#abfd89c986184f010df8646b46e623490" title="Install CTL settings using hardware associated with PCM handle. ">_snd_pcm_hook_ctl_elems_install()</a> - installs CTL settings described by given configuration. </li>
<li>
<a class="el" href="pcm__hooks_8c.html#a0355f8ca87a7361b1c3fdd36baf05175" title="Creates a new hooks PCM. ">snd_pcm_hooks_open()</a> </li>
<li>
<a class="el" href="pcm__hooks_8c.html#a4d7e604b82a739945aefde32395bea24" title="Creates a new hooks PCM. ">_snd_pcm_hooks_open()</a> </li>
</ul>
<h1><a class="anchor" id="pcm_plugins_dmix"></a>
Plugin: dmix</h1>
<p>This plugin provides direct mixing of multiple streams. The resolution for 32-bit mixing is only 24-bit. The low significant byte is filled with zeros. The extra 8 bits are used for the saturation.</p>
<div class="fragment"><div class="line">pcm.name {</div>
<div class="line">    type dmix       # Direct mix</div>
<div class="line">    ipc_key INT     # unique IPC key</div>
<div class="line">    ipc_key_add_uid BOOL    # add current uid to unique IPC key</div>
<div class="line">    ipc_perm INT        # IPC permissions (octal, <span class="keywordflow">default</span> 0600)</div>
<div class="line">    slave STR</div>
<div class="line">    <span class="preprocessor"># or</span></div>
<div class="line">    slave {         # Slave definition</div>
<div class="line">        pcm STR     # slave PCM name</div>
<div class="line"><span class="preprocessor">        # or</span></div>
<div class="line">        pcm { }     # slave PCM definition</div>
<div class="line">        format STR  # format definition</div>
<div class="line">        rate INT    # rate definition</div>
<div class="line">        channels INT</div>
<div class="line">        period_time INT # in usec</div>
<div class="line"><span class="preprocessor">        # or</span></div>
<div class="line">        period_size INT # in bytes</div>
<div class="line">        buffer_time INT # in usec</div>
<div class="line"><span class="preprocessor">        # or</span></div>
<div class="line">        buffer_size INT # in bytes</div>
<div class="line">        periods INT # when buffer_size or buffer_time is not specified</div>
<div class="line">    }</div>
<div class="line">    bindings {      # note: <span class="keyword">this</span> is client independent!!!</div>
<div class="line">        N INT       # maps slave channel to client channel N</div>
<div class="line">    }</div>
<div class="line">    slowptr BOOL        # slow but more precise pointer updates</div>
<div class="line">}</div>
</div><!-- fragment --><p><code>ipc_key</code> specfies the unique IPC key in integer. This number must be unique for each different dmix definition, since the shared memory is created with this key number. When <code>ipc_key_add_uid</code> is set true, the uid value is added to the value set in <code>ipc_key</code>. This will avoid the confliction of the same IPC key with different users concurrently.</p>
<p>Note that the dmix plugin itself supports only a single configuration. That is, it supports only the fixed rate (default 48000), format (<code>S16</code>), channels (2), and period_time (125000). For using other configuration, you have to set the value explicitly in the slave PCM definition. The rate, format and channels can be covered by an additional <a class="el" href="pcm_plugins.html#pcm_plugins_dmix">plug plugin</a>, but there is only one base configuration, anyway.</p>
<p>An example configuration for setting 44100 Hz, <code>S32_LE</code> format as the slave PCM of "hw:0" is like below: </p><div class="fragment"><div class="line">pcm.dmix_44 {</div>
<div class="line">    type dmix</div>
<div class="line">    ipc_key 321456  # any unique value</div>
<div class="line">    ipc_key_add_uid <span class="keyword">true</span></div>
<div class="line">    slave {</div>
<div class="line">        pcm <span class="stringliteral">&quot;hw:0&quot;</span></div>
<div class="line">        format S32_LE</div>
<div class="line">        rate 44100</div>
<div class="line">    }</div>
<div class="line">}</div>
</div><!-- fragment --><p> You can hear 48000 Hz samples still using this dmix pcm via plug plugin like: </p><div class="fragment"><div class="line">% aplay -Dplug:dmix_44 foo_48k.wav</div>
</div><!-- fragment --><p>For using the dmix plugin for OSS emulation device, you have to set the period and the buffer sizes in power of two. For example, </p><div class="fragment"><div class="line">pcm.dmixoss {</div>
<div class="line">    type dmix</div>
<div class="line">    ipc_key 321456  # any unique value</div>
<div class="line">    ipc_key_add_uid <span class="keyword">true</span></div>
<div class="line">    slave {</div>
<div class="line">        pcm <span class="stringliteral">&quot;hw:0&quot;</span></div>
<div class="line">        period_time 0</div>
<div class="line">        period_size 1024  # must be power of 2</div>
<div class="line">        buffer_size 8192  # ditto</div>
<div class="line">    }</div>
<div class="line">}</div>
</div><!-- fragment --><p> <code>period_time 0</code> must be set, too, for resetting the default value. In the case of soundcards with multi-channel IO, adding the bindings would help </p><div class="fragment"><div class="line">pcm.dmixoss {</div>
<div class="line">    ...</div>
<div class="line">    bindings {</div>
<div class="line">        0 0   # map from 0 to 0</div>
<div class="line">        1 1   # map from 1 to 1</div>
<div class="line">    }</div>
<div class="line">}</div>
</div><!-- fragment --><p> so that only the first two channels are used by dmix. Also, note that ICE1712 have the limited buffer size, 5513 frames (corresponding to 640 kB). In this case, reduce the buffer_size to 4096.</p>
<h2><a class="anchor" id="pcm_plugins_dmix_funcref"></a>
Function reference</h2>
<ul>
<li>
<a class="el" href="pcm__dmix_8c.html#ae31120062bceb47f24d18e672f728b4f" title="Creates a new dmix PCM. ">snd_pcm_dmix_open()</a> </li>
<li>
<a class="el" href="pcm__dmix_8c.html#a98332eee00abd086c486bc63ade4484e" title="Creates a new dmix PCM. ">_snd_pcm_dmix_open()</a> </li>
</ul>
<h1><a class="anchor" id="pcm_plugins_dshare"></a>
Plugin: dshare</h1>
<p>This plugin provides sharing channels. Unlike <a class="el" href="pcm_plugins.html#pcm_plugins_share">share plugin</a>, this plugin doesn't need the explicit server program but accesses the shared buffer concurrently from each client as well as <a class="el" href="pcm_plugins.html#pcm_plugins_dmix">dmix</a> and <a class="el" href="pcm_plugins.html#pcm_plugins_dsnoop">dsnoop</a> plugins do. The parameters below are almost identical with these plugins.</p>
<div class="fragment"><div class="line">pcm.name {</div>
<div class="line">    type dshare     # Direct sharing</div>
<div class="line">    ipc_key INT     # unique IPC key</div>
<div class="line">    ipc_key_add_uid BOOL    # add current uid to unique IPC key</div>
<div class="line">    ipc_perm INT        # IPC permissions (octal, <span class="keywordflow">default</span> 0600)</div>
<div class="line">    slave STR</div>
<div class="line">    <span class="preprocessor"># or</span></div>
<div class="line">    slave {         # Slave definition</div>
<div class="line">        pcm STR     # slave PCM name</div>
<div class="line"><span class="preprocessor">        # or</span></div>
<div class="line">        pcm { }     # slave PCM definition</div>
<div class="line">        format STR  # format definition</div>
<div class="line">        rate INT    # rate definition</div>
<div class="line">        channels INT</div>
<div class="line">        period_time INT # in usec</div>
<div class="line"><span class="preprocessor">        # or</span></div>
<div class="line">        period_size INT # in bytes</div>
<div class="line">        buffer_time INT # in usec</div>
<div class="line"><span class="preprocessor">        # or</span></div>
<div class="line">        buffer_size INT # in bytes</div>
<div class="line">        periods INT # when buffer_size or buffer_time is not specified</div>
<div class="line">    }</div>
<div class="line">    bindings {      # note: <span class="keyword">this</span> is client independent!!!</div>
<div class="line">        N INT       # maps slave channel to client channel N</div>
<div class="line">    }</div>
<div class="line">    slowptr BOOL        # slow but more precise pointer updates</div>
<div class="line">}</div>
</div><!-- fragment --><h2><a class="anchor" id="pcm_plugins_dshare_funcref"></a>
Function reference</h2>
<ul>
<li>
<a class="el" href="pcm__dshare_8c.html#a88bec432614f2a75100c33ed8dfd97b6" title="Creates a new dshare PCM. ">snd_pcm_dshare_open()</a> </li>
<li>
<a class="el" href="pcm__dshare_8c.html#ae837c9fab4f6e2e0b08aa7864c19901b" title="Creates a new dshare PCM. ">_snd_pcm_dshare_open()</a> </li>
</ul>
<h1><a class="anchor" id="pcm_plugins_dsnoop"></a>
Plugin: dsnoop</h1>
<p>This plugin splits one capture stream to more. It works the reverse way of <a class="el" href="pcm_plugins.html#pcm_plugins_dmix">dmix plugin</a>, reading the shared capture buffer from many clients concurrently. The meaning of parameters below are almost identical with dmix plugin.</p>
<div class="fragment"><div class="line">pcm.name {</div>
<div class="line">    type dsnoop     # Direct snoop</div>
<div class="line">    ipc_key INT     # unique IPC key</div>
<div class="line">    ipc_key_add_uid BOOL    # add current uid to unique IPC key</div>
<div class="line">    ipc_perm INT        # IPC permissions (octal, <span class="keywordflow">default</span> 0600)</div>
<div class="line">    slave STR</div>
<div class="line">    <span class="preprocessor"># or</span></div>
<div class="line">    slave {         # Slave definition</div>
<div class="line">        pcm STR     # slave PCM name</div>
<div class="line"><span class="preprocessor">        # or</span></div>
<div class="line">        pcm { }     # slave PCM definition</div>
<div class="line">        format STR  # format definition</div>
<div class="line">        rate INT    # rate definition</div>
<div class="line">        channels INT</div>
<div class="line">        period_time INT # in usec</div>
<div class="line"><span class="preprocessor">        # or</span></div>
<div class="line">        period_size INT # in bytes</div>
<div class="line">        buffer_time INT # in usec</div>
<div class="line"><span class="preprocessor">        # or</span></div>
<div class="line">        buffer_size INT # in bytes</div>
<div class="line">        periods INT # when buffer_size or buffer_time is not specified</div>
<div class="line">    }</div>
<div class="line">    bindings {      # note: <span class="keyword">this</span> is client independent!!!</div>
<div class="line">        N INT       # maps slave channel to client channel N</div>
<div class="line">    }</div>
<div class="line">    slowptr BOOL        # slow but more precise pointer updates</div>
<div class="line">}</div>
</div><!-- fragment --><h2><a class="anchor" id="pcm_plugins_dsnoop_funcref"></a>
Function reference</h2>
<ul>
<li>
<a class="el" href="pcm__dsnoop_8c.html#a8cb7e3979f25d99e74e7a1e6d016436e" title="Creates a new dsnoop PCM. ">snd_pcm_dsnoop_open()</a> </li>
<li>
<a class="el" href="pcm__dsnoop_8c.html#a6f504effb6bc99326e94e3450602cd37" title="Creates a new dsnoop PCM. ">_snd_pcm_dsnoop_open()</a> </li>
</ul>
<h1><a class="anchor" id="pcm_plugins_ladpsa"></a>
Plugin: LADSPA &lt;-&gt; ALSA</h1>
<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#ggaa14b7f26877a812acbb39811364177f8a7d9fd83c6ff5be7a9cde4b0673b64bf0">SND_PCM_FORMAT_FLOAT</a> (note: this type can be either little or big-endian depending on architecture).</p>
<p>The policy duplicate means that there must be only one binding definition for channel zero. This definition is automatically duplicated for all channels. If the LADSPA plugin has multiple audio inputs or outputs the policy duplicate is automatically switched to policy none.</p>
<p>The plugin serialization works as expected. You can eventually use more channels (inputs / outputs) inside the LADPSA plugin chain than processed in the ALSA plugin chain. If ALSA channel does not exist for given LADSPA input audio port, zero samples are given to this LADSPA port. On the output side (ALSA next plugin input), the valid channels are checked, too. If specific ALSA channel does not exist, the LADSPA output port is connected to a dummy sample area.</p>
<p>Instances of LADSPA plugins are created dynamically.</p>
<div class="fragment"><div class="line">pcm.name {</div>
<div class="line">        type ladspa             # ALSA&lt;-&gt;LADSPA PCM</div>
<div class="line">        slave STR               # Slave name</div>
<div class="line"><span class="preprocessor">        # or</span></div>
<div class="line">        slave {                 # Slave definition</div>
<div class="line">                pcm STR         # Slave PCM name</div>
<div class="line"><span class="preprocessor">                # or</span></div>
<div class="line">                pcm { }         # Slave PCM definition</div>
<div class="line">        }</div>
<div class="line">        [channels INT]      # count input channels (input to LADSPA plugin chain)</div>
<div class="line">    [path STR]      # Path (directory) with LADSPA plugins</div>
<div class="line">    plugins |       <span class="preprocessor"># Definition for both directions</span></div>
<div class="line">        playback_plugins |  # Definition <span class="keywordflow">for</span> playback direction</div>
<div class="line">    capture_plugins {   # Definition <span class="keywordflow">for</span> capture direction</div>
<div class="line">        N {     # Configuration <span class="keywordflow">for</span> LADPSA plugin N</div>
<div class="line">            [<span class="keywordtype">id</span> INT]    # LADSPA plugin ID (<span class="keywordflow">for</span> example 1043)</div>
<div class="line">            [label STR] # LADSPA plugin label (<span class="keywordflow">for</span> example <span class="stringliteral">&#39;delay_5s&#39;</span>)</div>
<div class="line">            [filename STR]  # Full filename of .so library with LADSPA plugin code</div>
<div class="line">            [policy STR]    # Policy can be <span class="stringliteral">&#39;none&#39;</span> or <span class="stringliteral">&#39;duplicate&#39;</span></div>
<div class="line">            input | output {</div>
<div class="line">                bindings {</div>
<div class="line">                    C INT or STR    # C - channel, INT - audio port index, STR - audio port name</div>
<div class="line">                }</div>
<div class="line">                controls {</div>
<div class="line"><span class="preprocessor">                        # valid only in the input block</span></div>
<div class="line">                    I INT or REAL   # I - control port index, INT or REAL - control value</div>
<div class="line"><span class="preprocessor">                    # or</span></div>
<div class="line">                    STR INT or REAL # STR - control port name, INT or REAL - control value</div>
<div class="line">                }</div>
<div class="line">            }</div>
<div class="line">        }</div>
<div class="line">    }</div>
<div class="line">}</div>
</div><!-- fragment --><h2><a class="anchor" id="pcm_plugins_ladspa_funcref"></a>
Function reference</h2>
<ul>
<li>
<a class="el" href="pcm__ladspa_8c.html#adcc43e9aeb068d3f8e1cd17d7f8a92cc" title="Creates a new LADSPA<->ALSA Plugin. ">snd_pcm_ladspa_open()</a> </li>
<li>
<a class="el" href="pcm__ladspa_8c.html#af310f491d26253256cdf8589334a64d2" title="Creates a new LADSPA<->ALSA PCM. ">_snd_pcm_ladspa_open()</a> </li>
</ul>
<h1><a class="anchor" id="pcm_plugins_asym"></a>
Plugin: asym</h1>
<p>This plugin is a combination of playback and capture PCM streams. Slave PCMs can be defined asymmetrically for both directions.</p>
<div class="fragment"><div class="line">pcm.name {</div>
<div class="line">        type asym               # Asym PCM</div>
<div class="line">        playback STR            # Playback slave name</div>
<div class="line"><span class="preprocessor">        # or</span></div>
<div class="line">        playback {              # Playback slave definition</div>
<div class="line">                pcm STR         # Slave PCM name</div>
<div class="line"><span class="preprocessor">                # or</span></div>
<div class="line">                pcm { }         # Slave PCM definition</div>
<div class="line">        }</div>
<div class="line">        capture STR             # Capture slave name</div>
<div class="line"><span class="preprocessor">        # or</span></div>
<div class="line">        capture {               # Capture slave definition</div>
<div class="line">                pcm STR         # Slave PCM name</div>
<div class="line"><span class="preprocessor">                # or</span></div>
<div class="line">                pcm { }         # Slave PCM definition</div>
<div class="line">        }</div>
<div class="line">}</div>
</div><!-- fragment --><p>For example, you can combine a dmix plugin and a dsnoop plugin as as a single PCM for playback and capture directions, respectively. </p><div class="fragment"><div class="line">pcm.duplex {</div>
<div class="line">    type asym</div>
<div class="line">    playback.pcm <span class="stringliteral">&quot;dmix&quot;</span></div>
<div class="line">    capture.pcm <span class="stringliteral">&quot;dsnoop&quot;</span></div>
<div class="line">}</div>
</div><!-- fragment --><p>By defining only a single direction, the resultant PCM becomes half-duplex.</p>
<h2><a class="anchor" id="pcm_plugins_asym_funcref"></a>
Function reference</h2>
<ul>
<li>
<a class="el" href="pcm__asym_8c.html#a39d690db97257936622f800f1d81d306" title="Creates a new asym stream PCM. ">_snd_pcm_asym_open()</a> </li>
</ul>
<h1><a class="anchor" id="pcm_plugins_iec958"></a>
Plugin: IEC958</h1>
<p>This plugin converts 32bit IEC958 subframe samples to linear, or linear to 32bit IEC958 subframe samples.</p>
<div class="fragment"><div class="line">pcm.name {</div>
<div class="line">        type iec958             # IEC958 subframe conversion PCM</div>
<div class="line">        slave STR               # Slave name</div>
<div class="line"><span class="preprocessor">        # or</span></div>
<div class="line">        slave {                 # Slave definition</div>
<div class="line">                pcm STR         # Slave PCM name</div>
<div class="line"><span class="preprocessor">                # or</span></div>
<div class="line">                pcm { }         # Slave PCM definition</div>
<div class="line">        }</div>
<div class="line">    [status status-bytes]   # IEC958 status bits (given in byte array)</div>
<div class="line">    <span class="preprocessor"># IEC958 preamble bits definitions</span></div>
<div class="line"><span class="preprocessor">    # B/M/W or Z/X/Y, B = block start, M = even subframe, W = odd subframe</span></div>
<div class="line"><span class="preprocessor">    # As default, Z = 0x08, Y = 0x04, X = 0x02</span></div>
<div class="line">    [preamble.z or preamble.b val]</div>
<div class="line">    [preamble.x or preamble.m val]</div>
<div class="line">    [preamble.y or preamble.w val]</div>
<div class="line">}</div>
</div><!-- fragment --><h2><a class="anchor" id="pcm_plugins_iec958_funcref"></a>
Function reference</h2>
<ul>
<li>
<a class="el" href="pcm__iec958_8c.html#a5838de1fbcdbbc2debfd3995aa8f402b" title="Creates a new IEC958 subframe conversion PCM. ">snd_pcm_iec958_open()</a> </li>
<li>
<a class="el" href="pcm__iec958_8c.html#aa2e0ac89b0b3190b5cf4c31c97e77620" title="Creates a new IEC958 subframe conversion PCM. ">_snd_pcm_iec958_open()</a> </li>
</ul>
<h1><a class="anchor" id="pcm_plugins_softvol"></a>
Plugin: Soft Volume</h1>
<p>This plugin applies the software volume attenuation. The format, rate and channels must match for both of source and destination.</p>
<p>When the control is stereo (count=2), the channels are assumed to be either mono, 2.0, 2.1, 4.0, 4.1, 5.1 or 7.1.</p>
<p>If the control already exists and it's a system control (i.e. no user-defined control), the plugin simply passes its slave without any changes.</p>
<div class="fragment"><div class="line">pcm.name {</div>
<div class="line">        type softvol            # Soft Volume conversion PCM</div>
<div class="line">        slave STR               # Slave name</div>
<div class="line"><span class="preprocessor">        # or</span></div>
<div class="line">        slave {                 # Slave definition</div>
<div class="line">                pcm STR         # Slave PCM name</div>
<div class="line"><span class="preprocessor">                # or</span></div>
<div class="line">                pcm { }         # Slave PCM definition</div>
<div class="line">                [format STR]    # Slave format</div>
<div class="line">        }</div>
<div class="line">        control {</div>
<div class="line">            name STR        # control element <span class="keywordtype">id</span> <span class="keywordtype">string</span></div>
<div class="line">        [card STR]      # control card index</div>
<div class="line">        [iface STR]     # <span class="keyword">interface </span>of the element</div>
<div class="line">        [index INT]     # index of the element</div>
<div class="line">        [device INT]    # device number of the element</div>
<div class="line">        [subdevice INT] # subdevice number of the element</div>
<div class="line">        [count INT]     # control channels 1 or 2 (default: 2)</div>
<div class="line">    }</div>
<div class="line">    [min_dB REAL]           # minimal dB value (default: -51.0)</div>
<div class="line">    [max_dB REAL]           # maximal dB value (default:   0.0)</div>
<div class="line">    [resolution INT]        # resolution (default: 256)</div>
<div class="line"><span class="preprocessor">                # resolution = 2 means a mute switch</span></div>
<div class="line"><span class="preprocessor">}</span></div>
</div><!-- fragment --><h2><a class="anchor" id="pcm_plugins_softvol_funcref"></a>
Function reference</h2>
<ul>
<li>
<a class="el" href="pcm__softvol_8c.html#ad569db39824bb0a31c73dd9d4948a4b7" title="Creates a new SoftVolume PCM. ">snd_pcm_softvol_open()</a> </li>
<li>
<a class="el" href="pcm__softvol_8c.html#a4347460ac616c9a323681021c6498d0d" title="Creates a new Soft Volume PCM. ">_snd_pcm_softvol_open()</a> </li>
</ul>
<h1><a class="anchor" id="pcm_plugins_null"></a>
Plugin: Null</h1>
<p>This plugin discards contents of a PCM stream or creates a stream with zero samples.</p>
<p>Note: This implementation uses devices /dev/null (playback, must be writable) and /dev/full (capture, must be readable).</p>
<div class="fragment"><div class="line">pcm.name {</div>
<div class="line">        type null               # Null PCM</div>
<div class="line">}</div>
</div><!-- fragment --><h2><a class="anchor" id="pcm_plugins_null_funcref"></a>
Function reference</h2>
<ul>
<li>
<a class="el" href="pcm__empty_8c.html#a55df6f9b1b71d37ea91557cc26e8ab3a" title="Creates a new Empty PCM. ">_snd_pcm_empty_open()</a> </li>
</ul>
</div></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jun 18 2014 05:47:49 for ALSA project - the C library reference by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.7
</small></address>
</body>
</html>