]> git.alsa-project.org Git - alsa-lib.git/commitdiff
Finer sync of dmix in delay callback
authorTakashi Iwai <tiwai@suse.de>
Thu, 6 Apr 2006 17:01:02 +0000 (19:01 +0200)
committerTakashi Iwai <tiwai@suse.de>
Thu, 6 Apr 2006 17:01:02 +0000 (19:01 +0200)
Sync pointers in delay callback in dmix.  This solves some problems
of aoss with apps that don't check poll_revents.

The rate plugin is fixed to call delay of slave appropriately, too.

src/pcm/pcm_dmix.c
src/pcm/pcm_rate.c

index d8cc8adf88d73598fee74bd84cf195b81c4d4e47..be7fe8d285d554207b48f6a1ac43bec4b09fe15f 100644 (file)
@@ -437,6 +437,7 @@ static int snd_pcm_dmix_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *delayp)
                if (err < 0)
                        return err;
                /* fallthru */
+               snd_pcm_dmix_sync_area(pcm);
        case SNDRV_PCM_STATE_PREPARED:
        case SNDRV_PCM_STATE_SUSPENDED:
        case STATE_RUN_PENDING:
index 3c65e2cae5e1a3269ae445f69e7eca232e6c0a7b..eac58ba6ed2325b715ea2ade4c85e59d2e8c8fef 100644 (file)
@@ -617,7 +617,12 @@ static int snd_pcm_rate_hwsync(snd_pcm_t *pcm)
 
 static int snd_pcm_rate_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *delayp)
 {
+       snd_pcm_rate_t *rate = pcm->private_data;
        snd_pcm_rate_hwsync(pcm);
+       /* call slave's delay callback although the value is overwritten.
+        * it's needed for a better sync of dmix on aoss.
+        */
+       snd_pcm_delay(rate->gen.slave, delayp);
        if (pcm->stream == SND_PCM_STREAM_PLAYBACK)
                *delayp = snd_pcm_mmap_playback_hw_avail(pcm);
        else