From: Takashi Iwai Subject: Re: [PATCH - JACK PCM plugin] jack: Use boundary as hw_ptr wrap around Date: Tue, 13 Feb 2018 06:40:26 +0100 Message-ID: References: <1516794545-9868-1-git-send-email-twischer@de.adit-jv.com> 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 mx2.suse.de (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id CFF5D2676EC for ; Tue, 13 Feb 2018 06:40:28 +0100 (CET) In-Reply-To: <1516794545-9868-1-git-send-email-twischer@de.adit-jv.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: twischer@de.adit-jv.com Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org On Wed, 24 Jan 2018 12:49:05 +0100, wrote: > > From: Timo Wischer > > instead of using buffer_size as wrap around. No, the ioplug backend has to report the position from 0 to buffer_size. > This is required to detect Xruns. The XRUN can be reported back from the backend just by returning an error from pointer callback. > It is also required to allow the JACK thread > to processes the whole ALSA audio buffer at once > without calling snd_pcm_avail_update() in between. > > For example when the hw_ptr will be updated with > hw_ptr += buffer_size > and it is using the buffer_size as wrap around > hw_ptr %= buffer_size > would result in the same value as before the add operation. > > Due to that the user application would not recognize > that the complete audio buffer was copied. This has nothing to do with the reported position. If this happens, it simply means an XRUN. You should report the error instead. thanks, Takashi