The Advanced Linux Sound Architecture (ALSA) - utilities
Find a file
Takashi Sakamoto 5ee9e8dfd7 axfer: add support for timer-based scheduling model with MMAP operation
In 2010, ALSA PCM interface got an flag of hardware parameters to suppress
periodical interrupts, according to a request from PulseAudio developer.

In typical PCM operation for usual hardware, PCM drivers configure the
hardware to generate the periodical interrupts to notify that the same
amount of data frames as a period of PCM buffer is actually transferred
via serial sound interface. The flag can suppress this if the driver
support it.

There's some merits of this configuration:
 - No interrupt context run for PCM substream. The PCM substream is
   handled in any process context only. No need to care of race
   conditions between interrupt/process contexts. This is good for
   developers of drivers and applications.
 - CPU time is not used for handlers on the interrupt context. The CPU
   time can be dedicated for the other tasks. This is good in a point
   of Time Sharing System.
 - Hardware is not configured to generate interrupts. This is good in a
   point of reduction of overall power consumption.

Disabling period interrupt is used for 'Timer-based scheduling' to
consume data frames on PCM buffer independently of interrupt context. As
noted, no interrupt context runs for PCM substream, thus any blocking
operation is not released. Furthermore, system calls for multiplexed I/O
is not also released without timeout.

In this scheduling model, applications need to care of available space on
PCM buffer by lapse of time, typically by yielding CPU and wait for
rescheduling. For the yielding, timeout is calculated for preferable
amount of PCM frames to process. This is an additional merit for
applications, like sound servers. when an I/O thread of the server wait
for the timeout, the other threads can process data frames for server
clients. Furthermore, with usage of rewinding/forwarding, applications
can achieve low latency between transmission position and handling
position even if they uses large size of PCM buffers.

But the timeout should be calculated with enough care of hardware
capabilities. To disable period interrupt, used hardware should satisfy
some requirements for data transmission:
1. Even if drivers don't handle interrupts to queue next data transmission,
   hardware voluntarily perform the data transmission when needed
   (typically by requesting DMA automatically).
2. hardware has a capability to report current position of data
   transmission with enough accuracy against the data transmission.
   developers refer this as 'granularity'. If hardware can always
   reports updated position after the data transmission finishes, the
   granularity equals to the size of period of PCM buffer.
3. a fine size of data transmission in one time. This size is decided
   depending on configuration of hardware or DMA controller, but for
   efficiency it may not be one byte. Thus some amount of data frame is
   transferred by one data transmission. Developers refer this as
   'burst-ness'.

The timeout should be calculated according to the item 2 and 3, however
in current ALSA PCM interface supplemental information is not delivered
from drivers to applications. Although at present userspace applications
should be written by a speculative way for this point, there's few
problems because there're a few hardware which satisfy the above items.
However, when more drivers supports this feature, the problem may largely
be exposed and bothers application developers.

This commit adds an option to use 'timer-based scheduling' for data
transmission. This commit adds '--sched-model' option, and the scheduling
mode is enabled when 'timer' is assigned to the option by equal sign.

Although there's some TODOs, you can see the scheduling mode in this
simple program, like:

$ axfer transfer --sched-model=timer -P -d 2 -D hw:0,3 /dev/urandom -f dat -vvv
$ axfer transfer --sched-model=timer -C -d 2 -D hw:1,0 /dev/null -r 48000 -vvv

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-11-13 12:04:51 +01:00
alsa-info alsa-info: add ACPI device status 2017-01-10 09:09:57 +01:00
alsaconf alsaconf: update gentoo to use modprobe.d method as everyone else 2013-11-14 08:51:55 +01:00
alsactl alsactl: lock - fix the array size (gcc warning) 2018-10-14 17:01:38 +02:00
alsaloop alsaloop: more avail_min cleanups 2018-10-24 16:01:06 +02:00
alsamixer alsamixer: fix gcc warnings 2018-10-14 17:05:22 +02:00
alsaucm alsatplg: add man file 2018-10-09 10:53:32 +02:00
amidi Change FSF address (Franklin Street) 2017-11-14 14:28:53 +01:00
amixer Change FSF address (Franklin Street) 2017-11-14 14:28:53 +01:00
aplay aplay: improve available conditions for '--samples' and '--duration' options 2018-11-08 16:03:32 +01:00
axfer axfer: add support for timer-based scheduling model with MMAP operation 2018-11-13 12:04:51 +01:00
bat alsabat: Allow custom sample format for round trip latency test 2018-08-05 18:45:28 +02:00
iecset Change FSF address (Franklin Street) 2017-11-14 14:28:53 +01:00
include configure.in -> configure.ac rename 2014-05-07 10:55:59 +02:00
m4 Fix autoreconf 2005-08-19 13:07:45 +00:00
po fix gettextize 2018-10-24 20:46:25 +02:00
seq Change FSF address (Franklin Street) 2017-11-14 14:28:53 +01:00
speaker-test speaker-test: Allow sampling rates up to 768000 2018-06-07 12:15:46 +02:00
topology topology/topology.c: drop unneeded <dlfcn.h> include 2018-11-02 15:04:34 +01:00
utils Changed Jaroslav Kysela's e-mail from perex@suse.cz to perex@perex.cz 2007-10-15 10:25:17 +02:00
.gitignore initial version of .travis.yml 2018-10-24 22:30:59 +02:00
.travis.yml initial version of .travis.yml 2018-10-24 22:30:59 +02:00
acinclude.m4 fixed for the recent autoconf. 2004-01-26 15:57:37 +00:00
ChangeLog update build tools. 2005-08-13 16:27:59 +00:00
configure.ac axfer: add unit test for container interface 2018-11-13 12:04:25 +01:00
COPYING Updated COPYING with the recent FSF address 2011-06-03 14:24:30 +02:00
gitcompile configure.in -> configure.ac rename 2014-05-07 10:55:59 +02:00
INSTALL alsactl: Move systemd unit start-up from basic.target to sound.target 2017-10-06 14:32:16 +02:00
Makefile.am axfer: add an entry point for this command 2018-11-13 12:04:19 +01:00
README.md rename and update README.md 2018-10-24 17:41:16 +02:00
TODO aplay/arecord 2000-12-27 21:24:57 +00:00

alsa-utils

Advanced Linux Sound Architecture - Utilities

This package contains the command line utilities for the ALSA project. The package can be compiled only with the installed ALSA driver and the ALSA C library (alsa-lib).

Utility Description
alsaconf the ALSA driver configurator script
alsa-info a script to gather information about ALSA subsystem
alsactl an utility for soundcard settings management
aplay/arecord an utility for the playback / capture of .wav,.voc,.au files
amixer a command line mixer
alsamixer a ncurses mixer
amidi a utility to send/receive sysex dumps or other MIDI data
iecset a utility to show/set the IEC958 status bits
speaker-test a speaker test utility
alsaloop a software loopback for PCM devices
alsaucm Use Case Manager utility
alsabat a sound tester for ALSA sound card driver
alsatplg ALSA topology compiler

You may give a look for more information about the ALSA project to URL http://www.alsa-project.org.