<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">2013/12/6 Tanu Kaskinen <span dir="ltr"><<a href="mailto:tanu.kaskinen@linux.intel.com" target="_blank">tanu.kaskinen@linux.intel.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class=""><div class="h5">On Sat, 2013-11-30 at 18:07 +0100, Lars-Peter Clausen wrote:<br>
> PCM Devices which have the BATCH flag set update the PCM pointer only with<br>
> period size granularity. Using timer based scheduling does not have any<br>
> advantage in this mode. For one devices which have that flag set usually update<br>
> the position pointer in software after getting the period interrupt. So<br>
> disabling the period interrupt is not possible for this kind of devices.<br>
> Furthermore writing to or reading from the buffer slice for the current period<br>
> is not possible since the position inside the buffer is not known. On the other<br>
> hand the tsched algorithm seems to get easily confused for this kind of<br>
> hardware, which results in garbled audio output. This typically means that timer<br>
> based scheduling needs to be manually disabled on systems with such devices.<br>
> Auto disabling tsched in this case allows these systems to run with the default<br>
> configuration.<br>
><br>
> Signed-off-by: Lars-Peter Clausen <<a href="mailto:lars@metafoo.de">lars@metafoo.de</a>><br>
> ---<br>
> src/modules/alsa/alsa-util.c | 4 ++++<br>
> 1 file changed, 4 insertions(+)<br>
><br>
> diff --git a/src/modules/alsa/alsa-util.c b/src/modules/alsa/alsa-util.c<br>
> index 75f5858..4b24e47 100644<br>
> --- a/src/modules/alsa/alsa-util.c<br>
> +++ b/src/modules/alsa/alsa-util.c<br>
> @@ -245,6 +245,10 @@ int pa_alsa_set_hw_params(<br>
> if (!pa_alsa_pcm_is_hw(pcm_handle))<br>
> _use_tsched = false;<br>
><br>
> + /* The PCM pointer is only updated with period granularity */<br>
> + if (snd_pcm_hw_params_is_batch(hwparams))<br>
> + _use_tsched = false;<br>
> +<br>
> #if (SND_LIB_VERSION >= ((1<<16)|(0<<8)|24)) /* API additions in 1.0.24 */<br>
> if (_use_tsched) {<br>
><br>
<br>
</div></div>Thanks! I applied the patch.<br>
<span class=""><font color="#888888"><br>
--</font></span><br></blockquote></div><br></div><div class="">Are you patch sufficient ? <br><br></div><div class="gmail_extra"><div class="">In alsa-lib , snd_pcm_sw_params_set_avail_min always return zero <br><br>int snd_pcm_sw_params_set_avail_min(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val)<br>
{<br> assert(pcm && params);<br> /* Fix avail_min if it's below period size. The period_size<br> * defines the minimal wake-up timing accuracy, so it doesn't<br> * make sense to set below that.<br>
*/<br> if (val < pcm->period_size)<br> val = pcm->period_size;<br> params->avail_min = val;<br> return 0;<br>}<br><br><br><a href="http://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/src/modules/alsa/alsa-sink.c?id=26a270a934f0f174f7bd7eb89e85301963721deb">http://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/src/modules/alsa/alsa-sink.c?id=26a270a934f0f174f7bd7eb89e85301963721deb</a><br>
<br><div class=""> /* We need at last one frame in the used part of the buffer */</div><div class="">- avail_min = (snd_pcm_uframes_t) u->hwbuf_unused_frames + 1;</div><div class="">+ avail_min = (snd_pcm_uframes_t) u->hwbuf_unused / u->frame_size + 1;<br>
<br></div>do pulseaudio need to keep at least one periods instead of more than 1 frames for those driver which update hwptr in periods ?<br><br> <br></div><div class=""><br><br><br></div></div><div class="gmail_extra"><br>
<br></div></div>