[PATCH alsa-lib 07/12] pcm: hw: use helper function to query status/control data for calculation of available space on PCM buffer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When calculating available space on PCM buffer, positions of hw_ptr and
appl_ptr are required. When applications map staus and control data
successfully, they can calculate the space with architecture's support
for cache coherency. When failed, they should execute ioctl(2) with
SNDRV_PCM_IOCTL_SYNC_PTR command to query these positions to kernel
space.

This commit uses an added helper function for this purpose. For this call,
no need to update appl_ptr and avail_min in kernel space.

Signed-off-by: Takashi Sakamoto <o-takashi@xxxxxxxxxxxxx>
---
 src/pcm/pcm_hw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/pcm/pcm_hw.c b/src/pcm/pcm_hw.c
index 59ba33b5..c6abf170 100644
--- a/src/pcm/pcm_hw.c
+++ b/src/pcm/pcm_hw.c
@@ -1066,7 +1066,7 @@ static snd_pcm_sframes_t snd_pcm_hw_avail_update(snd_pcm_t *pcm)
 	snd_pcm_hw_t *hw = pcm->private_data;
 	snd_pcm_uframes_t avail;
 
-	sync_ptr(hw, 0);
+	query_state(hw);
 	avail = snd_pcm_mmap_avail(pcm);
 	switch (FAST_PCM_STATE(hw)) {
 	case SNDRV_PCM_STATE_RUNNING:
-- 
2.11.0

_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux