Link two PCM streams together
#include <sys/asoundlib.h> int snd_pcm_link( snd_pcm_t *pcm1, snd_pcm_t *pcm2 );
When you link two PCM streams using snd_pcm_link(), they always stream at the same time. Starting one stream causes the other streams in the group to start. You can call snd_pcm_*_resume(), snd_pcm_*_pause(), and snd_pcm_*_prepare() on the grouped PCM handles to start the audio stream. This default behavior is referred to as synchronized behavior and is the default PCM link mode (SND_PCM_LINK_MODE_SYNC). You can change this behavior using the snd_pcm_link_mode() and snd_pcm_transition() functions.
Regardless of the mode you choose, audio concurrency management policies are applied to the grouped PCM streams as single audio stream.
PCM handles for playback must have the same audio type for this function to create a new link to a group; otherwise the call fails. In addition, pcm2 cannot already belong to a PCM link group. PCM handles for capture aren't required to be the same audio type.
EOK on success, or a negative error value on error.
QNX Neutrino
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | No |
Signal handler | Yes |
Thread | Read the Caveats |
This function is not thread safe if pcm1 or pcm2(snd_pcm_t) are used across multiple threads.