1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
3
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>ALSA project - the C library reference: Timer interface</title>
5
<link href="doxygen.css" rel="stylesheet" type="text/css">
6
<link href="tabs.css" rel="stylesheet" type="text/css"></head><body>
7
<!-- Generated by Doxygen 1.5.0 -->
10
<li><a href="index.html"><span>Main Page</span></a></li>
11
<li><a href="modules.html"><span>Modules</span></a></li>
12
<li><a href="annotated.html"><span>Data Structures</span></a></li>
13
<li><a href="files.html"><span>Files</span></a></li>
14
<li><a href="pages.html"><span>Related Pages</span></a></li>
15
<li><a href="examples.html"><span>Examples</span></a></li>
17
<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">
18
General overview</a></h2>
19
The timer implementation uses ring buffer to store information about
20
timing events. In this buffer is recorded count of ticks and current
21
tick resolution in nanoseconds.<h2><a class="anchor" name="timer_open">
23
Timer devices can be opened in two ways. When <a class="el" href="group___timer.html#g19279d167469082d1efd10f6ed4289ab">SND_TIMER_OPEN_NONBLOCK</a>
24
flag is used, then the open functions return immediately with -EBUSY
25
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">
27
Events are read via <a class="el" href="group___timer.html#g09307fbc086367b5d0dda0aca1ce38b9">snd_timer_read()</a> function.<h2><a class="anchor" name="timer_examples">
29
The full featured examples with cross-links:<p>
30
</p><dl class="user" compact="compact"><dt><b>Simple timer test program</b></dt><dd><a class="el" href="/home/alsa/tmp/cvs/alsa-lib/src/timer/timer.c.html#example_test_timer">example code</a> </dd></dl>
31
<dl class="user" compact="compact"><dt><b></b><br>
32
</dt><dd>This example shows opening a timer device and reading of timer events. </dd></dl>
33
<hr size="1"><address style=""><small>Generated on Wed Sep 9 14:37:08 2009 for ALSA project - the C library reference by
34
<a href="http://www.doxygen.org/index.html">
35
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.0 </small></address>
b'\\ No newline at end of file'