The Advanced Linux Sound Architecture (ALSA) - library
Find a file
Takashi Iwai 119d9c1678 pcm: rate: Improve the support multiple formats
This patch extends the PCM rate plugin for allowing its converter
plugin to deal with multiple formats.  Currently, the converter plugin
is allowed to take different formats only when convert callback is
defined.  And for this way (so far only the standard linear rate
plugin does), all linear formats have to be handled, and it's
cumbersome.

OTOH, most other rate plugins are implemented with convert_s16
callback, which accepts only S16 format.  This is often not ideal
because many converter engines can handle 32bit formats.  Also, the
target format is often 32bit format, hence this would require
additional conversion even if the converter engine can output 32bit
natively.

In this patch, for addressing the problems above, the rate plugin API
is extended in the following way:

- The new get_supported_formats callback is added; this stores the bit
  masks of the supported input and output formats, as well as the
  behavior flags.  Currently only linear formats are allowed.
- When the plugin accepts only the interleaved stream, set
  SND_PCM_RATE_FLAG_INTERLEAVED flag bit.  Otherwise the code has to
  handle snd_pcm_channel_area at each call.
- When both input and output formats have to be identical, pass
  SND_PCM_RATE_FLAG_SYNC_FORMATS flag bit.
- When the converter wants to process different formats, use convert
  callback instead of convert_s16.  You can put both in the ops for
  compatibility, too.
  The input and output formats are found in the info argument of init
  callback.
- Now the PCM rate plugin core will skip the temporary buffer
  allocation and conversions for pre- and post-process if not needed
  (i.e. matching with the requested input or output format).

The rate plugin API version is bumped to 0x010003.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-06-17 11:40:38 +02:00
.github/workflows github actions: ubuntu - fix the non-interactive build 2020-06-02 13:16:55 +02:00
alsalisp Change FSF address (Franklin Street) 2017-11-14 14:29:26 +01:00
aserver Use __func__ instead of __FUNCTION__ 2019-06-12 08:52:07 +02:00
doc control: doc - create controls plugin page 2021-04-07 16:24:05 +02:00
include pcm: rate: Improve the support multiple formats 2021-06-17 11:40:38 +02:00
m4 Update the attributes.m4 macro file from xine 2020-01-03 19:13:13 +01:00
modules snd_dlopen: implement the relocatable version for glibc 2020-06-04 19:09:58 +02:00
src pcm: rate: Improve the support multiple formats 2021-06-17 11:40:38 +02:00
test test: audio_time - fix timestamp2ns() and usage() 2021-04-13 19:49:48 +02:00
utils utils/alsa.m4: another quick fix for the brackets 2021-04-14 08:08:43 +02:00
.gitignore initial version of .travis.yml file 2018-10-24 16:07:58 +02:00
.travis.yml initial version of .travis.yml file 2018-10-24 16:07:58 +02:00
acinclude.m4 fixed for the recent autoconf. 2004-01-26 15:52:17 +00:00
ChangeLog * update to libtool 1.3.3 1999-07-22 12:18:42 +00:00
configure.ac configure: check if eaccess() is available 2021-06-14 10:10:58 +02:00
COPYING Change FSF address (Franklin Street) 2017-11-14 14:29:26 +01:00
gitcompile add support for GCC's LTO 2019-04-09 12:44:14 +02:00
INSTALL pcm: Add thread-safety to PCM API 2016-07-11 15:25:30 +02:00
Makefile.am Makefile: Add README.md to EXTRA_DIST 2020-12-10 10:37:13 +01:00
MEMORY-LEAK Initial version 2003-02-04 14:56:07 +00:00
NOTES Change assert condition in error message handler 2007-10-24 12:53:08 +02:00
README.md README: add patch submission instructions 2020-08-16 09:36:01 +02:00
TODO Added snd_config_load_override(). 2002-01-09 21:28:15 +00:00

alsa-lib

Advanced Linux Sound Architecture (ALSA) project

Build alsa-lib

The alsa-lib is a library to interface with ALSA in the Linux kernel and virtual devices using a plugin system.

The up-to-date reference generated from sources can be accessed here:

http://www.alsa-project.org/alsa-doc/alsa-lib/

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

Submitting patches

The preferred way to submit patches is by sending them by email to the alsa-devel mailing list. Sending mail to the list requires subscription, subscribe here: https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

Add Takashi Iwai <tiwai@suse.de> and/or Jaroslav Kysela <perex@perex.cz> to Cc so that your patch won't be missed.

Patches are also accepted as GitHub pull requests.