<p><br>
> > ><br>
> > it seem that the alsa sink is more complicated than your figure.<br>
><br>
> The fact that there's a region in the beginning of the sink buffer that<br>
> shouldn't be rewound is an implementation detail of alsa sink, and does<br>
> not need to be taken into account in the general rewind handling. The<br>
> alsa sink is able to take care of it internally.<br>
><br>
> > Refer to figure 14 HD Audio DMA and buffering , section 4.6 Energy<br>
> > Efficient HA audio mechanism<br>
> ><br>
> > most sound cards have fixed size FIFO buffer instead of dynamic FIFO and<br>
> > minimum transfer size(brust) similar to hda controller which snd_pcm_rewind<br>
> > cannot rewind any audio data in those first in first out buffer.<br>
> ><br>
> > <a href="http://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/src/modules/alsa?id=4df443bbe682055a41e7c2248877dcc7682a69b8">http://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/src/modules/alsa?id=4df443bbe682055a41e7c2248877dcc7682a69b8</a><br>
><br>
> Thanks for bringing that commit into attention, because it seems to<br>
> introduce a new bug (although judging from the commit message, Pierre<br>
> was aware of it and considered it a feature): the code doesn't take<br>
> tsched_watermark into account anymore when doing rewinds. The point of<br>
> tsched_watermark is to ensure that pulseaudio has enough time to fill<br>
> the sink buffer. If it's ignored when rewinding, it's likely that there<br>
> will be an underrun when refilling the sink buffer, if tsched_watermark<br>
> is greater than rewind_safeguard.</p>
<p>how about those sound cards which minimum latency is much higher than that of pulse plugin</p>
<p><a href="http://thread.gmane.org/gmane.linux.alsa.devel/89157/focus=89167">http://thread.gmane.org/gmane.linux.alsa.devel/89157/focus=89167</a></p>
<p>snd-ymfpci update the hwptr at 5.33 ms interval while pulse plugin claim to support as low as 1ms</p>
<p>does the driver need to add another constraints which restrict the period bytes to be multiple of 1024 at 48000Hz in addition to forcing the driver to run at 48000Hz since hwptr only change at period boundary ?</p>
<p>with minimum period of 3 , the minimum buffer time of snd-ymfpci is 16ms</p>
<p>can pa server reject the pulse client when it request latency lower than 16ms (minimum period * minimum period time of the sound driver)?</p>
<p>><br>
> > 1) do the server really need to rewind when there is only one pulse client ?<br>
><br>
> Yes. The sink buffer may have up to 2 seconds of audio from the one<br>
> pulse client, and if you then change the software volume of the sink (or<br>
> sink input, doesn't matter), you will have to rewrite the sink buffer<br>
> contents unless you want to wait 2 seconds until the volume change<br>
> becomes audible.</p>
<p>when module-suspend-on-idle is loaded pa server close the sink after 5 seconds of no activity for power saving and reopen the sink when another appllication connect to play audio, does it mean that rewind is not necessary in this situation ?<br>
</p>