snd_pcm_plugin_set_src_method()

Updated: April 19, 2023

Set the system's source filter method (plugin-aware)

Synopsis:

#include <sys/asoundlib.h>

unsigned int snd_pcm_plugin_set_src_method (
                snd_pcm_t *handle,
                unsigned int method );

Arguments:

handle
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().
method
The filter that you want to use:
  • 0 — basic linear interpolated SRC (the default)
  • 1 — basic anti-aliased SRC filter (7-point Kaiser windowed)
  • 2 — 20-point band pass

Library:

libasound.so

Description:

The snd_pcm_plugin_set_src_method() function sets the source filter method. If you want to set this method, do so before you call snd_pcm_plugin_params(), so that the plugin can be properly initialized (including the filters).

Because the polyphase SRC plugin converter provides the best quality rate conversion with the least amount of CPU usage, QSA always tries to use it as the source filter method, regardless of the filter set using snd_pcm_plugin_set_src_method(). For more information, see “Polyphase SRC plugin converter”.

Returns:

The current method.

Classification:

QNX Neutrino

Safety:  
Cancellation point No
Interrupt handler No
Signal handler Yes
Thread Read the Caveats

Caveats:

This function is not thread safe if handle (snd_pcm_t) is used across multiple threads.

Make sure that you don't mix and match plugin- and nonplugin-aware functions in your application, or you may get undefined behavior and misleading results.