From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: playing underruns Date: Thu, 13 Feb 2003 10:55:49 +0100 Sender: alsa-devel-admin@lists.sourceforge.net Message-ID: References: <200302122256.h1CMuJ628990@fafner.math.umass.edu> Mime-Version: 1.0 (generated by SEMI 1.14.4 - "Hosorogi") Content-Type: text/plain; charset=US-ASCII Return-path: In-Reply-To: <200302122256.h1CMuJ628990@fafner.math.umass.edu> Errors-To: alsa-devel-admin@lists.sourceforge.net List-Help: List-Post: List-Subscribe: , List-Unsubscribe: , List-Archive: To: Chris Raphael Cc: alsa-devel@lists.sourceforge.net List-Id: alsa-devel@alsa-project.org Hi, check LAD site, http://www.linuxdj.com/audio/lad/resourceslatency.php3 you'll find some good information how to get low-latency. Takashi At Wed, 12 Feb 2003 17:56:19 -0500, Chris Raphael wrote: > > > Hello List, > > This is my first post and I am new (a couple of weeks) to ALSA. > > I am working on an application that plays audio output in response > to audio input --- the relationship between input and output is > complicated and I will not describe it in any detail here --- I > am building a musical accompaniment system. I want the output to "respond" > to the input with low latency so I cannot write the output samples > very long before they are actually going to be played. Currently > I have a function that is called repeatedly (through a signal) and > writes the samples about .05 secs before they will actually be played. > I monitor the delay, in samples, (I can't remember the name of the > function (snd_delay_???) and see that the number of unplayed samples > fluctuates but there does not seem to be an increasing or decreasing > trend. So I assume that I am writing at very close to the right > rate and mostly the playback sounds fine. But every so often, > maybe once every 10 secs or so, I get a playback underrun. I > always check the system clock when my writing routine begins, > so I know the underruns are almost always *not* due to my writing > routine getting a late callback. By everything I can measure, the > samples are written on time. Can anyone tell me what I need to do > to fix this problem? Perhaps it is not reasonable of me to hope to > write samples such a short time before they need to be played? > > I would really appreciate any help I can get on this and will supply > any relevant details. I just didn't want to clutter up my question > with lots of irrelevant info. > > Thanks, > > Christopher Raphael > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Alsa-devel mailing list > Alsa-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/alsa-devel > ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf