MOON
Server: Apache/2.2.31 (Unix) mod_ssl/2.2.31 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4
System: Linux csr818.wilogic.com 2.6.18-419.el5xen #1 SMP Fri Feb 24 22:50:37 UTC 2017 x86_64
User: digitals (531)
PHP: 5.4.45
Disabled: NONE
Upload Files
File: //usr/share/doc/alsa-lib-devel-1.0.17/lib64/html/timer.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>ALSA project - the C library reference: Timer interface</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.4.7 -->
<div class="tabs">
  <ul>
    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
    <li><a href="modules.html"><span>Modules</span></a></li>
    <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
    <li><a href="files.html"><span>Files</span></a></li>
    <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
    <li><a href="examples.html"><span>Examples</span></a></li>
  </ul></div>
<h1><a class="anchor" name="timer">Timer interface</a></h1>Timer interface is designed to use internal timers in sound hardware, but it can be driven with any timer.<h2><a class="anchor" name="timer_general_overview">
General overview</a></h2>
The timer implementation uses ring buffer to store information about timing events. In this buffer is recorded count of ticks and current tick resolution in nanoseconds.<h2><a class="anchor" name="timer_open">
Opening</a></h2>
Timer devices can be opened in two ways. When <a class="el" href="group___timer.html#g19279d167469082d1efd10f6ed4289ab">SND_TIMER_OPEN_NONBLOCK</a> flag is used, then the open functions return immediately with -EBUSY error code when resources are occupied with another application. When <a class="el" href="group___timer.html#g19279d167469082d1efd10f6ed4289ab">SND_TIMER_OPEN_NONBLOCK</a> is not used (by default) the open functions block the application requesting device until resources are not free.<h2><a class="anchor" name="timer_events">
Events</a></h2>
Events are read via <a class="el" href="group___timer.html#g09307fbc086367b5d0dda0aca1ce38b9">snd_timer_read()</a> function.<h2><a class="anchor" name="timer_examples">
Examples</a></h2>
The full featured examples with cross-links:<p>
<dl compact><dt><b>Simple timer test program</b></dt><dd><a class="el" href="/builddir/build/BUILD/alsa-lib-1.0.17a/src/timer/timer.c.html#example_test_timer">example code</a> </dd></dl>
<dl compact><dt><b></b></dt><dd>This example shows opening a timer device and reading of timer events. </dd></dl>
<hr size="1"><address style="align: right;"><small>Generated on Tue Jan 20 22:42:10 2009 for ALSA project - the C library reference by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
</body>
</html>