From: Takashi Iwai Subject: Re: [PATCH - JACK plugin] jack: Do not Xrun the ALSA buffer Date: Tue, 13 Mar 2018 22:20:17 +0100 Message-ID: References: <1520007674-14618-4-git-send-email-twischer@de.adit-jv.com> <1520930084-17449-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 393E0266F68 for ; Tue, 13 Mar 2018 22:20:20 +0100 (CET) In-Reply-To: <1520930084-17449-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 Tue, 13 Mar 2018 09:34:41 +0100, wrote: > > > Hello Takashi, > > Now I have compiled and tested the patchies successfully. > Some minor adaption where required. > I have incorporated all your findings. > > > > Please try to format the text a bit nicer. These line breaks appear > > like you're writing a poem :)i > > Done. > > > > You don't need to put inline unless it's really mandatory. > > Done. > > > > Hm, this whole stuff would fit better in ioplug code itself instead of > > open-coding in each plugin. Maybe providing a new helper function? > > I am providing a new helper function called snd_pcm_ioplug_hw_avail() > and I am reusing internally already existing functions. > > > > Ditto. Basically the whole procedure here is some common pattern, so > > it wouldn't be too bad to have it in ioplug side. > > I have provided a new area copy function which takes care about the buffer wrap around. > This function is called snd_pcm_areas_copy_wrap(). > This reduces the complexity of the JACK IO plug a lot. > I have also compared the new implementation with other ALSA IO plugins. > I could not found more simuilarities because not all plugins are creating a snd_pcm_channel_area_t for the DMA/HW buffer. > Therefore functions like snd_pcm_areas_silence() and snd_pcm_areas_copy() cannot be used. > For example the pulse IO plug is also not using snd_pcm_channel_area_t for the pulse buffer. > > I hope you are fine with these changes, now. > If not it would be great if you could give me a feedback in time. Thanks, now applied both patches to alsa-lib and the patch to jack plugin. For alsa-plugins, we'll need the update of configure.ac to check the latest alsa-lib version, but let's do it later at bumping actually the version. Takashi