/*
* synchronize hardware pointer (hw_ptr) with ours
*/
-static int snd_pcm_dmix_sync_ptr(snd_pcm_t *pcm)
+static int _snd_pcm_dmix_sync_ptr(snd_pcm_t *pcm, int do_slave_sync)
{
snd_pcm_direct_t *dmix = pcm->private_data;
snd_pcm_uframes_t slave_hw_ptr, old_slave_hw_ptr, avail;
default:
break;
}
- if (dmix->slowptr)
+ if (do_slave_sync)
snd_pcm_hwsync(dmix->spcm);
old_slave_hw_ptr = dmix->slave_hw_ptr;
slave_hw_ptr = dmix->slave_hw_ptr = *dmix->spcm->hw.ptr;
return 0;
}
+static int snd_pcm_dmix_sync_ptr(snd_pcm_t *pcm)
+{
+ snd_pcm_direct_t *dmix = pcm->private_data;
+ return _snd_pcm_dmix_sync_ptr(pcm, dmix->slowptr);
+}
+
/*
* plugin implementation
*/
switch(dmix->state) {
case SNDRV_PCM_STATE_DRAINING:
case SNDRV_PCM_STATE_RUNNING:
- return snd_pcm_dmix_sync_ptr(pcm);
+ /* sync slave PCM */
+ return _snd_pcm_dmix_sync_ptr(pcm, 1);
case SNDRV_PCM_STATE_PREPARED:
case SNDRV_PCM_STATE_SUSPENDED:
case STATE_RUN_PENDING: