From: Takashi Iwai Subject: Re: underruns and strange code in pcm_rate.c Date: Thu, 08 Nov 2007 07:17:23 +0100 Message-ID: References: <472E5A64.6010705@aknet.ru> <473091F4.80105@aknet.ru> <4731F2F4.2080704@aknet.ru> <4732097E.3040401@aknet.ru> <4732C455.7040503@aknet.ru> <4732D151.20109@aknet.ru> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx1.suse.de (ns1.suse.de [195.135.220.2]) by alsa0.perex.cz (Postfix) with ESMTP id 23A9B2483A for ; Thu, 8 Nov 2007 10:28:33 +0100 (CET) In-Reply-To: <4732D151.20109@aknet.ru> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Stas Sergeev Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Thu, 08 Nov 2007 12:05:21 +0300, Stas Sergeev wrote: > > Hello. > > Takashi Iwai wrote: > > Yeah I've seen the problem, > Grrr... so you reproduced the > problem already, right? But still not exactly sure whether it's the same as you've got. It's no good testcase after all, you see? > > but as I wrote, it's basically because you > > use periods=2 and unaligned sample rates. > I do not - maybe libao does, but in > fact I am sure also the sound servers > have the same problem. You didn't set the slave period_size and periods properly in your configuration. This defines periods=2 eventually. > > So, of course, it doesn't work. > It does - have you tried my patch? It works casually until a certain point. But XRUN shall happen, as I explained. So, the patch helps well but not cures completely as long as you use that configuration. > > slave.periods 3 > > slave.period_size 4096 > > then you'll hear the improvement, I guess. > So you already tried everything - then > why asking me for the test-case? Because ogg123 is not the good way to understand the bug. It has a middle layer, threading, and so on. A testcase is the standard way to debug. I don't like XP particularly but some of its concept is benifitable for normal programming, too... > Anyway. There is a bug. And not the > only one. You knew the workaround > while I was searching for the fix. > Now you decide what is better - fix > it or apply to workarounds. Sigh. A bug is a bug. I know. But, the problem is that the configuration still doesn't work. I'll likely apply your patch soon later, but I need a better way to check. > Btw, I can still reproduce the underrun > by rapidly switching the consoles, even > though now it is harder to reproduce. This is utterly another problem, rather than the real-time response issue. Because the realtime responsiveness is important for two period case, slight difference of period/buffer size or its wakeup condition influences greatly on the behavior. Takashi