Sophie

Sophie

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

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>Direct Access (MMAP) Functions</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>Direct Access (MMAP) Functions<br>
<small>
[<a class="el" href="group___p_c_m.html">PCM Interface</a>]</small>
</h1><table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Functions</h2></td></tr>
<tr><td nowrap align=right valign=top>int&nbsp;</td><td valign=bottom><a class="el" href="group___p_c_m___direct.html#a0">snd_pcm_mmap_begin</a> (<a class="el" href="group___p_c_m.html#a20">snd_pcm_t</a> *pcm, const <a class="el" href="group___p_c_m.html#a22">snd_pcm_channel_area_t</a> **areas, <a class="el" href="group___p_c_m.html#a17">snd_pcm_uframes_t</a> *offset, <a class="el" href="group___p_c_m.html#a17">snd_pcm_uframes_t</a> *frames)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Application request to access a portion of direct (mmap) area.</em> <a href="#a0"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top><a class="el" href="group___p_c_m.html#a18">snd_pcm_sframes_t</a>&nbsp;</td><td valign=bottom><a class="el" href="group___p_c_m___direct.html#a1">snd_pcm_mmap_commit</a> (<a class="el" href="group___p_c_m.html#a20">snd_pcm_t</a> *pcm, <a class="el" href="group___p_c_m.html#a17">snd_pcm_uframes_t</a> offset, <a class="el" href="group___p_c_m.html#a17">snd_pcm_uframes_t</a> frames)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Application has completed the access to area requested with <a class="el" href="pcm_8c.html#a281">snd_pcm_mmap_begin</a>.</em> <a href="#a1"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top><a class="el" href="group___p_c_m.html#a18">snd_pcm_sframes_t</a>&nbsp;</td><td valign=bottom><a class="el" href="group___p_c_m___direct.html#a2">snd_pcm_mmap_writei</a> (<a class="el" href="group___p_c_m.html#a20">snd_pcm_t</a> *pcm, const void *buffer, <a class="el" href="group___p_c_m.html#a17">snd_pcm_uframes_t</a> size)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Write interleaved frames to a PCM using direct buffer (mmap).</em> <a href="#a2"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top><a class="el" href="group___p_c_m.html#a18">snd_pcm_sframes_t</a>&nbsp;</td><td valign=bottom><a class="el" href="group___p_c_m___direct.html#a3">snd_pcm_mmap_readi</a> (<a class="el" href="group___p_c_m.html#a20">snd_pcm_t</a> *pcm, void *buffer, <a class="el" href="group___p_c_m.html#a17">snd_pcm_uframes_t</a> size)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Read interleaved frames from a PCM using direct buffer (mmap).</em> <a href="#a3"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top><a class="el" href="group___p_c_m.html#a18">snd_pcm_sframes_t</a>&nbsp;</td><td valign=bottom><a class="el" href="group___p_c_m___direct.html#a4">snd_pcm_mmap_writen</a> (<a class="el" href="group___p_c_m.html#a20">snd_pcm_t</a> *pcm, void **bufs, <a class="el" href="group___p_c_m.html#a17">snd_pcm_uframes_t</a> size)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Write non interleaved frames to a PCM using direct buffer (mmap).</em> <a href="#a4"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top><a class="el" href="group___p_c_m.html#a18">snd_pcm_sframes_t</a>&nbsp;</td><td valign=bottom><a class="el" href="group___p_c_m___direct.html#a5">snd_pcm_mmap_readn</a> (<a class="el" href="group___p_c_m.html#a20">snd_pcm_t</a> *pcm, void **bufs, <a class="el" href="group___p_c_m.html#a17">snd_pcm_uframes_t</a> size)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Read non interleaved frames to a PCM using direct buffer (mmap).</em> <a href="#a5"></a><em></em></font><br><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
See the <a href="pcm.html#pcm">PCM (digital audio) interface</a> page for more details. <hr><h2>Function Documentation</h2>
<a name="a0" doxytag="pcm.h::snd_pcm_mmap_begin"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> int snd_pcm_mmap_begin </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="group___p_c_m.html#a20">snd_pcm_t</a> *&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>pcm</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap>const <a class="el" href="group___p_c_m.html#a22">snd_pcm_channel_area_t</a> **&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>areas</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="group___p_c_m.html#a17">snd_pcm_uframes_t</a> *&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>offset</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="group___p_c_m.html#a17">snd_pcm_uframes_t</a> *&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>frames</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Application request to access a portion of direct (mmap) area.
<p>
<dl compact><dt><b>Parameters: </b></dt><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>pcm</em>&nbsp;</td><td>
PCM handle  </td></tr>
<tr><td valign=top><em>areas</em>&nbsp;</td><td>
Returned mmap channel areas </td></tr>
<tr><td valign=top><em>offset</em>&nbsp;</td><td>
Returned mmap area offset in area steps (== frames) </td></tr>
<tr><td valign=top><em>frames</em>&nbsp;</td><td>
mmap area portion size in frames (wanted on entry, contiguous available on exit) </td></tr>
</table>
</dl><dl compact><dt><b>Returns: </b></dt><dd>
0 on success otherwise a negative error code</dl>It is necessary to call the <a class="el" href="group___p_c_m.html#a54">snd_pcm_avail_update()</a> function directly before this call. Otherwise, this function can return a wrong count of available frames.
<p>
The function should be called before a sample-direct area can be accessed. The resulting size parameter is always less or equal to the input count of frames and can be zero, if no frames can be processed (the ring buffer is full).
<p>
See the <a class="el" href="group___p_c_m___direct.html#a1">snd_pcm_mmap_commit()</a> function to finish the frame processing in the direct areas. <dl compact><dt><b>Examples: </b></dt><dd>
<a class="el" href="_2test_2pcm_8c-example.html#a33">/test/pcm.c</a>.</dl>    </td>
  </tr>
</table>
<a name="a1" doxytag="pcm.h::snd_pcm_mmap_commit"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="group___p_c_m.html#a18">snd_pcm_sframes_t</a> snd_pcm_mmap_commit </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="group___p_c_m.html#a20">snd_pcm_t</a> *&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>pcm</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="group___p_c_m.html#a17">snd_pcm_uframes_t</a>&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>offset</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="group___p_c_m.html#a17">snd_pcm_uframes_t</a>&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>frames</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Application has completed the access to area requested with <a class="el" href="group___p_c_m___direct.html#a0">snd_pcm_mmap_begin</a>.
<p>
<dl compact><dt><b>Parameters: </b></dt><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>pcm</em>&nbsp;</td><td>
PCM handle </td></tr>
<tr><td valign=top><em>offset</em>&nbsp;</td><td>
area offset in area steps (== frames) </td></tr>
<tr><td valign=top><em>size</em>&nbsp;</td><td>
area portion size in frames </td></tr>
</table>
</dl><dl compact><dt><b>Returns: </b></dt><dd>
count of transferred frames otherwise a negative error code</dl>You should pass this function the offset value that <a class="el" href="group___p_c_m___direct.html#a0">snd_pcm_mmap_begin()</a> returned. The frames parameter should hold the number of frames you have written or read to/from the audio buffer. The frames parameter must never exceed the contiguous frames count that <a class="el" href="group___p_c_m___direct.html#a0">snd_pcm_mmap_begin()</a> returned. Each call to <a class="el" href="group___p_c_m___direct.html#a0">snd_pcm_mmap_begin()</a> must be followed by a call to <a class="el" href="group___p_c_m___direct.html#a1">snd_pcm_mmap_commit()</a>.
<p>
Example: <div class="fragment"><pre>  <span class="keywordtype">double</span> phase = 0;
  <span class="keyword">const</span> snd_pcm_area_t *areas;
  <a class="code" href="group___p_c_m.html#a18">snd_pcm_sframes_t</a> avail, size, commitres;
  <a class="code" href="group___p_c_m.html#a17">snd_pcm_uframes_t</a> offset, frames;
  <span class="keywordtype">int</span> err;

  avail = <a class="code" href="group___p_c_m.html#a54">snd_pcm_avail_update</a>(pcm);
  <span class="keywordflow">if</span> (avail &lt; 0)
    error(avail);
  <span class="comment">// at this point, we can transfer at least 'avail' frames</span>
  
  <span class="comment">// we want to process frames in chunks (period_size)</span>
  <span class="keywordflow">if</span> (avail &lt; period_size)
    <span class="keywordflow">goto</span> _skip;
  size = period_size;
  <span class="comment">// it is possible that contiguous areas are smaller, thus we use a loop</span>
  <span class="keywordflow">while</span> (size &gt; 0) {
    frames = size;

    err = <a class="code" href="group___p_c_m___direct.html#a0">snd_pcm_mmap_begin</a>(pcm_handle, &amp;areas, &amp;offset, &amp;frames);
    <span class="keywordflow">if</span> (err &lt; 0)
      error(err);
    <span class="comment">// this function fills the areas from offset with count of frames</span>
    generate_sine(areas, offset, frames, &amp;phase);
    commitres = <a class="code" href="group___p_c_m___direct.html#a1">snd_pcm_mmap_commit</a>(pcm_handle, offset, frames);
    <span class="keywordflow">if</span> (commitres &lt; 0 || commitres != frames)
      error(commitres &gt;= 0 ? -EPIPE : commitres);
      
    size -= frames;
  }
 _skip:
</pre></div>
<p>
Look to the <a class="el" href="_2test_2pcm_8c-example.html#example_test_pcm">Sine-wave generator</a> example for more details about the generate_sine function. <dl compact><dt><b>Examples: </b></dt><dd>
<a class="el" href="_2test_2pcm_8c-example.html#a34">/test/pcm.c</a>.</dl>    </td>
  </tr>
</table>
<a name="a3" doxytag="pcm.h::snd_pcm_mmap_readi"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="group___p_c_m.html#a18">snd_pcm_sframes_t</a> snd_pcm_mmap_readi </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="group___p_c_m.html#a20">snd_pcm_t</a> *&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>pcm</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap>void *&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>buffer</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="group___p_c_m.html#a17">snd_pcm_uframes_t</a>&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>size</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Read interleaved frames from a PCM using direct buffer (mmap).
<p>
<dl compact><dt><b>Parameters: </b></dt><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>pcm</em>&nbsp;</td><td>
PCM handle </td></tr>
<tr><td valign=top><em>buffer</em>&nbsp;</td><td>
frames containing buffer </td></tr>
<tr><td valign=top><em>size</em>&nbsp;</td><td>
frames to be written </td></tr>
</table>
</dl><dl compact><dt><b>Returns: </b></dt><dd>
a positive number of frames actually read otherwise a negative error code </dl><dl compact><dt><b>Return values: </b></dt><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>-EBADFD</em>&nbsp;</td><td>
PCM is not in the right state (<a class="el" href="group___p_c_m.html#a72a109">SND_PCM_STATE_PREPARED</a> or <a class="el" href="group___p_c_m.html#a72a110">SND_PCM_STATE_RUNNING</a>) </td></tr>
<tr><td valign=top><em>-EPIPE</em>&nbsp;</td><td>
an overrun occurred </td></tr>
<tr><td valign=top><em>-ESTRPIPE</em>&nbsp;</td><td>
a suspend event occurred (stream is suspended and waiting for an application recovery)</td></tr>
</table>
</dl>If the blocking behaviour was selected, then routine waits until all requested bytes are filled. The count of bytes can be less only if a signal or underrun occurred.
<p>
If the non-blocking behaviour is selected, then routine doesn't wait at all.     </td>
  </tr>
</table>
<a name="a5" doxytag="pcm.h::snd_pcm_mmap_readn"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="group___p_c_m.html#a18">snd_pcm_sframes_t</a> snd_pcm_mmap_readn </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="group___p_c_m.html#a20">snd_pcm_t</a> *&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>pcm</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap>void **&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>bufs</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="group___p_c_m.html#a17">snd_pcm_uframes_t</a>&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>size</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Read non interleaved frames to a PCM using direct buffer (mmap).
<p>
<dl compact><dt><b>Parameters: </b></dt><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>pcm</em>&nbsp;</td><td>
PCM handle </td></tr>
<tr><td valign=top><em>bufs</em>&nbsp;</td><td>
frames containing buffers (one for each channel) </td></tr>
<tr><td valign=top><em>size</em>&nbsp;</td><td>
frames to be written </td></tr>
</table>
</dl><dl compact><dt><b>Returns: </b></dt><dd>
a positive number of frames actually read otherwise a negative error code </dl><dl compact><dt><b>Return values: </b></dt><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>-EBADFD</em>&nbsp;</td><td>
PCM is not in the right state (<a class="el" href="group___p_c_m.html#a72a109">SND_PCM_STATE_PREPARED</a> or <a class="el" href="group___p_c_m.html#a72a110">SND_PCM_STATE_RUNNING</a>) </td></tr>
<tr><td valign=top><em>-EPIPE</em>&nbsp;</td><td>
an overrun occurred </td></tr>
<tr><td valign=top><em>-ESTRPIPE</em>&nbsp;</td><td>
a suspend event occurred (stream is suspended and waiting for an application recovery)</td></tr>
</table>
</dl>If the blocking behaviour was selected, then routine waits until all requested bytes are filled. The count of bytes can be less only if a signal or underrun occurred.
<p>
If the non-blocking behaviour is selected, then routine doesn't wait at all.     </td>
  </tr>
</table>
<a name="a2" doxytag="pcm.h::snd_pcm_mmap_writei"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="group___p_c_m.html#a18">snd_pcm_sframes_t</a> snd_pcm_mmap_writei </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="group___p_c_m.html#a20">snd_pcm_t</a> *&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>pcm</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap>const void *&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>buffer</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="group___p_c_m.html#a17">snd_pcm_uframes_t</a>&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>size</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Write interleaved frames to a PCM using direct buffer (mmap).
<p>
<dl compact><dt><b>Parameters: </b></dt><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>pcm</em>&nbsp;</td><td>
PCM handle </td></tr>
<tr><td valign=top><em>buffer</em>&nbsp;</td><td>
frames containing buffer </td></tr>
<tr><td valign=top><em>size</em>&nbsp;</td><td>
frames to be written </td></tr>
</table>
</dl><dl compact><dt><b>Returns: </b></dt><dd>
a positive number of frames actually written otherwise a negative error code </dl><dl compact><dt><b>Return values: </b></dt><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>-EBADFD</em>&nbsp;</td><td>
PCM is not in the right state (<a class="el" href="group___p_c_m.html#a72a109">SND_PCM_STATE_PREPARED</a> or <a class="el" href="group___p_c_m.html#a72a110">SND_PCM_STATE_RUNNING</a>) </td></tr>
<tr><td valign=top><em>-EPIPE</em>&nbsp;</td><td>
an underrun occurred </td></tr>
<tr><td valign=top><em>-ESTRPIPE</em>&nbsp;</td><td>
a suspend event occurred (stream is suspended and waiting for an application recovery)</td></tr>
</table>
</dl>If the blocking behaviour is selected, then routine waits until all requested bytes are played or put to the playback ring buffer. The count of bytes can be less only if a signal or underrun occurred.
<p>
If the non-blocking behaviour is selected, then routine doesn't wait at all. <dl compact><dt><b>Examples: </b></dt><dd>
<a class="el" href="_2test_2pcm_8c-example.html#a35">/test/pcm.c</a>.</dl>    </td>
  </tr>
</table>
<a name="a4" doxytag="pcm.h::snd_pcm_mmap_writen"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="group___p_c_m.html#a18">snd_pcm_sframes_t</a> snd_pcm_mmap_writen </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="group___p_c_m.html#a20">snd_pcm_t</a> *&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>pcm</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap>void **&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>bufs</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="group___p_c_m.html#a17">snd_pcm_uframes_t</a>&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>size</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Write non interleaved frames to a PCM using direct buffer (mmap).
<p>
<dl compact><dt><b>Parameters: </b></dt><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>pcm</em>&nbsp;</td><td>
PCM handle </td></tr>
<tr><td valign=top><em>bufs</em>&nbsp;</td><td>
frames containing buffers (one for each channel) </td></tr>
<tr><td valign=top><em>size</em>&nbsp;</td><td>
frames to be written </td></tr>
</table>
</dl><dl compact><dt><b>Returns: </b></dt><dd>
a positive number of frames actually written otherwise a negative error code </dl><dl compact><dt><b>Return values: </b></dt><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>-EBADFD</em>&nbsp;</td><td>
PCM is not in the right state (<a class="el" href="group___p_c_m.html#a72a109">SND_PCM_STATE_PREPARED</a> or <a class="el" href="group___p_c_m.html#a72a110">SND_PCM_STATE_RUNNING</a>) </td></tr>
<tr><td valign=top><em>-EPIPE</em>&nbsp;</td><td>
an underrun occurred </td></tr>
<tr><td valign=top><em>-ESTRPIPE</em>&nbsp;</td><td>
a suspend event occurred (stream is suspended and waiting for an application recovery)</td></tr>
</table>
</dl>If the blocking behaviour is selected, then routine waits until all requested bytes are played or put to the playback ring buffer. The count of bytes can be less only if a signal or underrun occurred.
<p>
If the non-blocking behaviour is selected, then routine doesn't wait at all.     </td>
  </tr>
</table>
<hr><address style="align: right;"><small>Generated on Wed Apr 2 16:06:38 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>