Commit graph

6 commits

Author SHA1 Message Date
Jaroslav Kysela
ea8972c83b include: prefer alsa/asoundlib.h for apps, dependency cleanups
Fixes several issues with header files:

- prefer alsa/asoundlib.h file for the alsa-lib core functionalities
  (use #warning to inform current and future developers, do the job)
- include alsa/asoundlib.h in headers for external plugins by default
- pcm_external.h: dependencies cleanup
- as benefit, the parsers in IDEs should get all information for individial
  header files (see PR#435)

This change was mainly tergetted to fix errors caused by wrong include order
(like for endianness detection, missing typedefs etc.).

Closes: https://github.com/alsa-project/alsa-lib/issues/431
Link: https://github.com/alsa-project/alsa-lib/pull/435
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-02-02 18:56:47 +01:00
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
Jaroslav Kysela
5b9041bced Change FSF address (Franklin Street)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2017-11-14 14:29:26 +01:00
Alan Young
97be19cf6f pcm: rate: Add capability to pass configuration node to plugins
If a rate plugin uses a node (compound) instead of a plain string for
its "converter", and that compound is not a simple string array, then
the compound will be passed as an additional parameter to the new plugin
open() function (SND_PCM_RATE_PLUGIN_CONF_ENTRY(XXX)). The previous
open() function (SND_PCM_RATE_PLUGIN_ENTRY(XXX)) will be called if the
CONF version is not found. It is up to the plugin to determine whether
the presence of the conf parameter is mandatory.

Signed-off-by: Alan Young <consult.awy@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-21 22:29:44 +01:00
Takashi Iwai
1929c55d2e Query the supported rate ranges from rate plugins
Extend the PCM-rate plugin protocol to allow the host to query the
supported sample rates.  The protocol version is bumped to 0x010002,
and the version number negotiaion is slightly changed.
Now the plugin is supposed to fill the version it supports in return.

The old versioned plugins are still supported, but they may spew
version-mismatch warning prints.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-06-02 16:26:03 +02:00
Takashi Iwai
33d69ef33b Create rate converter plugin SDK
Created a new rate converter plugin SDK.
A rate converter can be replaced as an extra plugin now.
The default rate converter is a built-in linear converter.

You can find a sample external converter in alsa-plugins package.
2006-04-06 18:37:55 +02:00