<p><br>
2012-10-3 上午4:16 於 "Samuele Carcagno" <<a href="mailto:sam.carcagno@gmail.com">sam.carcagno@gmail.com</a>> 寫道:<br>
><br>
> Hi,<br>
><br>
> I have the same issue that is described in this post (not mine)<br>
><br>
> <a href="http://unix.stackexchange.com/questions/7067/do-the-play-utility-in-linux-really-have-a-delay-to-stop-its-process-with-r">http://unix.stackexchange.com/questions/7067/do-the-play-utility-in-linux-really-have-a-delay-to-stop-its-process-with-r</a><br>

><br>
> basically, when I play a sound with aplay or other command line utilities, when the sound ends there is a long delay (about 3 seconds)<br>
> before the program returns. This is an issue for me because I play two or more sounds in sequence from a python program for<br>
> psychoacoustics research, and the silent interval between two sounds needs to be roughly controlled. I could make wav files<br>
> with the sounds in sequence and silence between them, but the sounds need to be synchronized with lights, and this is not<br>
> so easy to achieve with a single long wav file.<br>
><br>
> I was wondering whether there are any settings in pulseaudio that can be tweaked to reduce this sound offset lag to negligible levels.<br>
> I should add that with alsa (that is when I remove pulseaudio from my system) there is not such problem, aplay starts and returns<br>
> without noticeable delays. For this reason I have been living without pulseaudio so far, but some programs start not running well<br>
> without it (skype on Kubuntu Precise), so it would be great if I could solve the issue.<br>
></p>
<p>you can reduce the maximum buffer size if you are using hda</p>
<p>echo 64 > /proc/asound/card0/pcm0p/sub0/prealloc</p>
<p>now.the.maximum buffer time of onboard hda become less than 0.4 second instead of over 20 seconds</p>