]> git.alsa-project.org Git - alsa-lib.git/commitdiff
Fix PCM without control/status mmap
authorTakashi Iwai <tiwai@suse.de>
Wed, 29 Mar 2006 09:32:18 +0000 (09:32 +0000)
committerTakashi Iwai <tiwai@suse.de>
Wed, 29 Mar 2006 09:32:18 +0000 (09:32 +0000)
Fix the update of appl_ptr via mmap_commit when control/status structs
are not mmapped (e.g. 32bit compatible mode on 64bit kernel).

src/pcm/pcm_hw.c
src/pcm/pcm_plugin.c

index 2c26d95b3a304b12a339a82abb8ac568effabd0f..683ae2d1cc13b4b36be09906d200eabbe6ed688c 100644 (file)
@@ -942,6 +942,7 @@ static snd_pcm_sframes_t snd_pcm_hw_mmap_commit(snd_pcm_t *pcm,
                }
        }
        snd_pcm_mmap_appl_forward(pcm, size);
+       sync_ptr(hw, 0);
 #ifdef DEBUG_MMAP
        fprintf(stderr, "appl_forward: hw_ptr = %li, appl_ptr = %li, size = %li\n", *pcm->hw.ptr, *pcm->appl.ptr, size);
 #endif
index 583f95b7d2bc99bc5f00ddc614073b6d162c756c..6e9503621c66032c69ec20b4130c6835efa2dba6 100644 (file)
@@ -524,6 +524,9 @@ int snd_pcm_plugin_status(snd_pcm_t *pcm, snd_pcm_status_t * status)
        snd_atomic_read_init(&ratom, &plugin->watom);
  _again:
        snd_atomic_read_begin(&ratom);
+       /* sync with the latest hw and appl ptrs */
+       snd_pcm_plugin_avail_update(pcm);
+
        err = snd_pcm_status(plugin->gen.slave, status);
        if (err < 0) {
                snd_atomic_read_ok(&ratom);
@@ -545,7 +548,7 @@ int snd_pcm_plugin_status(snd_pcm_t *pcm, snd_pcm_status_t * status)
 }
 
 snd_pcm_fast_ops_t snd_pcm_plugin_fast_ops = {
-       .status = snd_pcm_generic_status,
+       .status = snd_pcm_plugin_status,
        .state = snd_pcm_generic_state,
        .hwsync = snd_pcm_generic_hwsync,
        .delay = snd_pcm_plugin_delay,