]> git.alsa-project.org Git - alsa-lib.git/commit
pcm: rate: fix the hw_ptr update until the boundary available
authormahendran.k <mahendran.kuppusamy@in.bosch.com>
Fri, 30 Dec 2016 06:29:27 +0000 (11:59 +0530)
committerTakashi Iwai <tiwai@suse.de>
Mon, 2 Jan 2017 13:50:35 +0000 (14:50 +0100)
commit7570e5d77514d8d8af387da04a010fa2ccaf543c
treeba6632c2d1b9888b43ff46af6e371cb68a4bdd61
parent8eeee1ab7d7db3110b7b3bb31cfb989304dced94
pcm: rate: fix the hw_ptr update until the boundary available

For long time test case, the slave_hw_ptr will exceed the boundary
and wraparound the slave_hw_ptr. This slave boundary wraparound will
cause the rate->hw_ptr to wraparound irrespective of the
rate->boundary availability and due to that the available size goes
wrong.

Hence, to get the correct available size,
- Its necessary to increment the rate->hw_ptr upto the rate->boundary
and then wraparound the rate->hw_ptr.
- While handling fraction part of slave period, rounded value will be
introduced by input_frames(). To eliminate rounding issue on
rate->hw_ptr, subtract last rounded value from rate->hw_ptr and add
new rounded value of present slave_hw_ptr fraction part to
rate->hw_ptr.

Signed-off-by: mahendran.k <mahendran.kuppusamy@in.bosch.com>
Signed-off-by: Mounesh Sutar <mounesh_sutar@mentor.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
src/pcm/pcm_rate.c