From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: emu10k1 bug and patch (0.9.0rc7) Date: Fri, 14 Feb 2003 10:21:15 +0100 Sender: alsa-devel-admin@lists.sourceforge.net Message-ID: References: <20030210172112.GA12226@via.ecp.fr> Mime-Version: 1.0 (generated by SEMI 1.14.4 - "Hosorogi") Content-Type: text/plain; charset=US-ASCII Return-path: In-Reply-To: Errors-To: alsa-devel-admin@lists.sourceforge.net List-Help: List-Post: List-Subscribe: , List-Unsubscribe: , List-Archive: To: Jaroslav Kysela Cc: Arnaud de Bossoreille de Ribou , "alsa-devel@lists.sourceforge.net" , bozo@via.ecp.fr List-Id: alsa-devel@alsa-project.org At Thu, 13 Feb 2003 21:30:17 +0100 (CET), Jaroslav wrote: > > On Mon, 10 Feb 2003, Arnaud de Bossoreille de Ribou wrote: > > > So the bug looks like a signedness problem since sw_ready is unsigned > > and there is a while(sw_ready > 0), which explain the constant delay, > > next in the "snd_emu10k1_fx8010_playback_transfer" function. > > > > So the emu10k1.patch file attached fixes the problem and seems not to > > introduce new ones. > > Please, could you try this patch, if it also fixes your problem? Thanks. i don't think the patch fixes the original problem. if there are only two periods, the diff will be either period_size or -period_size, i.e. (buffer_size/2) or -(buffer_size/2). assume the buffer size = 200 appl_ptr 0 100 diff = 100 - 0 = 100 0 diff = 0 - 100 = -100 100 > if (diff) { > if (diff < -(snd_pcm_sframes_t) (runtime->boundary / 2)) > diff += runtime->boundary; > - pcm->sw_ready += diff; > + frames += diff; > } and since boundary = buffer_size as default, the above condition will be not satisfied (i.e. diff is equal with -(runtime->boundary/2) and it is never smaller). as i wrote, the condition should be <= . btw, can the rewound length be over -(boundary/2) ? Takashi ------------------------------------------------------- This SF.NET email is sponsored by: FREE SSL Guide from Thawte are you planning your Web Server Security? Click here to get a FREE Thawte SSL guide and find the answers to all your SSL security issues. http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0026en