snd_pcm_plugin_set_disable()
Disable PCM plugins
Synopsis:
#include <sys/asoundlib.h>
unsigned int snd_pcm_plugin_set_disable(
snd_pcm_t *pcm,
unsigned int plugins );
Arguments:
- pcm
- The handle for the PCM device, which you must have opened by calling snd_pcm_open_name(), snd_pcm_open(), or snd_pcm_open_preferred().
- plugins
- A bitmap of the plugins that you want to disable; a bitwise OR of zero or more of the following
(which are the plugins that are currently enabled by default):
- PLUGIN_BUFFER_PARTIAL_BLOCKS —
prevent the read and write routines from using partial blocks of data.
The plugin-aware versions of the PCM read and write calls don't require that you work with multiples of fragment-size blocks (the nonplugin-aware versions do). This is because one of the plugins in the lib sub-buffers the data for you. You can disable this plugin by setting the PLUGIN_BUFFER_PARTIAL_BLOCKS bit with this function, in which case the plugin-aware versions also fail on reads and writes that aren't multiples of the fragment size.
Either way, interleaved stereo data has to be aligned by the sample size times the number of channels (i.e., each write must have the same number of samples for the left and right channels).
- PLUGIN_CONVERSION — disable the automatic conversion
of audio to match hardware capabilities (for example, voice
conversion, rate conversion, type conversion, etc.).
This conversion impacts the functions
snd_pcm_channel_params(),
snd_pcm_channel_setup(),
and
snd_pcm_channel_status().
These now behave as
snd_pcm_plugin_params(),
snd_pcm_plugin_setup(),
and
snd_pcm_plugin_status(),
unless you've disabled the conversion by calling:
snd_pcm_plugin_set_disable(handle, PLUGIN_CONVERSION); - PLUGIN_MMAP — disable the mmap plugins.
Note:If mmap plugins are used, some of the members of the snd_pcm_channel_status_t structure aren't used.
- PLUGIN_BUFFER_PARTIAL_BLOCKS —
prevent the read and write routines from using partial blocks of data.
Library:
libasound.so
Use the -l asound option with qcc to link against this library.
Description:
You can use snd_pcm_plugin_set_disable() to disable plugins that are ordinarily used in the plugin chain. You need to do this before calling snd_pcm_plugin_params().
Returns:
The updated bitmap of disabled plugins.
Examples:
See the wave.c example in the appendix.
Classification:
QNX Neutrino
| Safety: | |
|---|---|
| Cancellation point | No |
| Interrupt handler | No |
| Signal handler | Yes |
| Thread | Read the Caveats |
Caveats:
This function isn't thread safe if pcm (snd_pcm_t) is used across multiple threads.
