[alsa-devel] [PATCH alsa-lib 04/12] pcm: hw: use helper function to query status/control data after HW_PARAMS call

Takashi Sakamoto o-takashi at sakamocchi.jp
Fri Jun 30 01:58:20 CEST 2017


When executing ioctl(2) with SNDRV_PCM_IOCTL_HW_PARAMS, applications
request ALSA PCM core to decide configurations of runtime of PCM
substream. This operation shifts state of the runtime after the decision.
Additionally, avail_min of the runtime is reset to the size of one period
of PCM buffer.

When alsa-lib applications run with fallback mode from failure of page
mapping of status/control data, the data in user space should be updated.
On the other hand, they don't need to change/update control data. Current
implementation of alsa-lib satisfies this principle with sub-effect to
the control data. For this purpose, an added helper function can be
available.

This commit replaces with the function.

Signed-off-by: Takashi Sakamoto <o-takashi at sakamocchi.jp>
---
 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 50619fe9..aa548529 100644
--- a/src/pcm/pcm_hw.c
+++ b/src/pcm/pcm_hw.c
@@ -349,7 +349,7 @@ static int snd_pcm_hw_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params)
 	params->info &= ~0xf0000000;
 	if (pcm->tstamp_type != SND_PCM_TSTAMP_TYPE_GETTIMEOFDAY)
 		params->info |= SND_PCM_INFO_MONOTONIC;
-	return sync_ptr(hw, 0);
+	return query_state(hw);
 }
 
 static void snd_pcm_hw_close_timer(snd_pcm_hw_t *hw)
-- 
2.11.0



More information about the Alsa-devel mailing list