mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-01 22:58:49 -04:00
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).
This commit is contained in:
parent
504a2e34a4
commit
18a6132a66
2 changed files with 5 additions and 1 deletions
|
|
@ -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);
|
snd_pcm_mmap_appl_forward(pcm, size);
|
||||||
|
sync_ptr(hw, 0);
|
||||||
#ifdef DEBUG_MMAP
|
#ifdef DEBUG_MMAP
|
||||||
fprintf(stderr, "appl_forward: hw_ptr = %li, appl_ptr = %li, size = %li\n", *pcm->hw.ptr, *pcm->appl.ptr, size);
|
fprintf(stderr, "appl_forward: hw_ptr = %li, appl_ptr = %li, size = %li\n", *pcm->hw.ptr, *pcm->appl.ptr, size);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -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);
|
snd_atomic_read_init(&ratom, &plugin->watom);
|
||||||
_again:
|
_again:
|
||||||
snd_atomic_read_begin(&ratom);
|
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);
|
err = snd_pcm_status(plugin->gen.slave, status);
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
snd_atomic_read_ok(&ratom);
|
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 = {
|
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,
|
.state = snd_pcm_generic_state,
|
||||||
.hwsync = snd_pcm_generic_hwsync,
|
.hwsync = snd_pcm_generic_hwsync,
|
||||||
.delay = snd_pcm_plugin_delay,
|
.delay = snd_pcm_plugin_delay,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue