From: Takashi Iwai Subject: Re: [PATCH] Reduce interrupt latency in sound/pci/via82xx.c Date: Mon, 12 Sep 2005 15:09:36 +0200 Message-ID: References: <200509121418.05184.annabellesgarden@yahoo.de> <200509121509.27712.annabellesgarden@yahoo.de> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Return-path: In-Reply-To: <200509121509.27712.annabellesgarden@yahoo.de> Sender: alsa-devel-admin@lists.sourceforge.net Errors-To: alsa-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: Karsten Wiese Cc: alsa-devel@lists.sourceforge.net List-Id: alsa-devel@alsa-project.org At Mon, 12 Sep 2005 15:09:27 +0200, Karsten Wiese wrote: > > Am Montag, 12. September 2005 14:35 schrieb Takashi Iwai: > > > > I don't like that the behavior depends on the period size. > > If it's bad to loop too much, we should fix this behavior. > > > > The question is how to handle the value 0 of CUR_COUNT register. > > Usually this occurs in a boundary, i.e. very likely only in > > snd_pcm_period_elapsed(). > > > > So, for example, add a flag indicating that the position callback is > > being called in the irq handler. And the position callback assumes > > the exact next period if CUR_COUNT is 0 and this flag is set. If the > > flag isn't set, the driver loops probing to get an accurate position. > > This doesn't help in the worst case: > An application requests position when CUR_COUNT is already 0 immediately > before the interrupt callback runs. Thus it disables interrupt > (or blocks the callback by spinlock) until it reads != 0 resulting in > the same interrupt latency. Hmm, then let's fix the handling of 0 read in all cases. We can simply assume the next period in this case as an exception. > How about a bool module_parameter to choose the pointer calculation > method then? > Do you know any application benefitting from the sub period position > precision? dmix/dsnoop/dshare. Takashi ------------------------------------------------------- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf