]> git.alsa-project.org Git - alsa-utils.git/commit
axfer: add options for buffer arrangement
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Tue, 13 Nov 2018 06:41:37 +0000 (15:41 +0900)
committerTakashi Iwai <tiwai@suse.de>
Tue, 13 Nov 2018 11:04:47 +0000 (12:04 +0100)
commitd28f9def9714e45fee88ed126e8792bdf20d8ee4
tree32b89ba8d9641137b33b9734ff31959c98ff9da3
parent0e3a1d9e0b692307aa8ae483b3df3c9a53d4256e
axfer: add options for buffer arrangement

In ALSA PCM interface, two parameters are used for size of intermediate
buffer for data frames; period size and buffer size. Actual effects of
these sizes differs depending on hardware, but basically the size of
period is used for intervals of hardware interrupts and the size of buffer
is used to maintain the intermediate buffer as ring buffer. These
parameters can be configured as a part of hardware parameters by
data frame unit or micro second. PCM API in alsa-lib also includes
helper functions to configure them by the two units.

This commit adds support for options to the parameters by both units. When
no options are given, default values are applied according to current
aplay; available maximum size of buffer up to 500msec, a quarter of the
size of buffer for period size. However, these calculation should be
reconsidered somehow.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
axfer/xfer-libasound.c
axfer/xfer-libasound.h
axfer/xfer-options.c