From 791ee4298e1d53aa711162ec1168afeb025b5cc2 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Thu, 18 Oct 2001 19:35:56 +0000 Subject: [PATCH] Added examples (test/pcm.c and test/latency.c) --- doc/doxygen.cfg | 2 +- doc/pcm.doxygen | 36 +++++++++++++++++++++++++++++++++++- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/doc/doxygen.cfg b/doc/doxygen.cfg index f9fc1bfd..1bad25ed 100644 --- a/doc/doxygen.cfg +++ b/doc/doxygen.cfg @@ -21,7 +21,7 @@ EXCLUDE = ../src/control/control_local.h \ ../src/seq/seq_local.h RECURSIVE = YES FILE_PATTERNS = *.c *.h -#EXAMPLE_PATH = example_test.cpp +EXAMPLE_PATH = ../test/pcm.c ../test/latency.c QUIET = YES EXTRACT_ALL = NO diff --git a/doc/pcm.doxygen b/doc/pcm.doxygen index a4cfdc70..44ff1641 100644 --- a/doc/pcm.doxygen +++ b/doc/pcm.doxygen @@ -197,7 +197,8 @@ returns 24 in the case. There are two methods to transfer samples in application. The first method is the standard read / write one. The second method, uses the direct audio buffer to communicate with the device while ALSA library manages this space -itself. +itself. You can find example of all communication schemes for playback +in \ref example_test_pcm "Sine-wave generator example". \subsection alsa_pcm_rw Read / Write transfer @@ -222,4 +223,37 @@ to allow the ALSA library update the pointers to ring buffer. This sort of communication is also called "zero-copy", because the device does not require to copy the samples from application to another place in system memory. +\par + +If you like to use the compatibility functions in mmap mode, there are +read / write routines equaling to standard read / write transfers. Using +these functions discards the benefits of direct access to memory region. +See the \link ::snd_pcm_mmap_readi() \endlink, +\link ::snd_pcm_writei() \endlink, \link ::snd_pcm_readn() \endlink +and \link ::snd_pcm_writen() \endlink functions. + +\section pcm_examples Examples + +The full featured examples with cross-links: + +\par Sine-wave generator +\ref example_test_pcm "example code" +\par +This example shows various transfer methods for the playback direction. + +\par Latency measuring tool +\ref example_test_latency "example code" +\par +This example shows the measuring of minimal latency between capture and +playback devices. + */ + +/** + * \example ../test/pcm.c + * \anchor example_test_pcm + */ +/** + * \example ../test/latency.c + * \anchor example_test_latency + */ -- 2.47.1