Set the link mode for a subchannel in a group


#include <sys/asoundlib.h>

int snd_pcm_link_mode(snd_pcm_t *handle, int mode);


A handle to the subchannel in the PCM group.
he behavior of how calls to one thread impact the other subchannels in the same group. You can use one of the following modes:
  • SND_PCM_LINK_MODE_SYNC—(Default) The subchannels in the group synchronize together to respond to a call made to a subchannel in the group. For example, if you call snd_pcm_*_resume() on one subchannel in the group, the other subchannels in the group respond to the snd_pcm_*_resume() call and transition to the RUNNING state.
  • SND_PCM_LINK_MODE_ASYNC—For audio concurrency management purposes, the subchannels that are grouped together are treated as a single audio stream, but synchronization of the calls made to a subchannel in the group won't occur. For example, if you call snd_pcm_*_resume(), only the specified subchannel resumes playing.
  • SND_PCM_LINK_MODE_TRANSITION—Start playback on the PCM handles in the group that have this mode set when the current PCM handle's buffer is empty.


Use the -l asound option with qcc to link against this library.


The snd_pcm_link_mode() function sets the link mode for subchannel in a group. Within the group, you can configure different subchannels to have different modes —in other words, you can mix the modes that are set on different PCM handles belonging to the same group. For example, if you have a group of four subchannels, you could set the mode of three of them to SND_PCM_LINK_MODE_SYNC and the remaining subchannel to SND_PCM_LINK_MODE_ASYNC.


EOK on success, or an errno value if an error occurred.


Failed to change the link mode because of either an invalid handle to a PCM group or the application tried to set the link mode for a subchannel that's used to capture audio.


QNX Neutrino

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


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