From 18a6132a6650c11e9aa9782ea363bd8b322f45a1 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Wed, 29 Mar 2006 09:32:18 +0000 Subject: [PATCH] Fix PCM without control/status mmap 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 | 1 + src/pcm/pcm_plugin.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/pcm/pcm_hw.c b/src/pcm/pcm_hw.c index 2c26d95b..683ae2d1 100644 --- a/src/pcm/pcm_hw.c +++ b/src/pcm/pcm_hw.c @@ -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 diff --git a/src/pcm/pcm_plugin.c b/src/pcm/pcm_plugin.c index 583f95b7..6e950362 100644 --- a/src/pcm/pcm_plugin.c +++ b/src/pcm/pcm_plugin.c @@ -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, -- 2.47.1