Stopping the capture
If your application wishes to stop capturing, it can simply stop reading data and let the subchannel overrun as described above, but there's a better way.
If you want your application to stop capturing immediately and delete any unread data from the hardware buffer, call one the drop functions:
- snd_pcm_plugin_drop() if you're using the plugins
- snd_pcm_channel_drop() if you aren't
If you want your application to stop capturing immediately without discarding the buffered data so the client can read out the remaining data, call one the drain functions:
- snd_pcm_plugin_drain() if you're using the plugins
- snd_pcm_channel_drain() if you aren't
Page updated:
