From: Takashi Iwai Subject: Re: [PATCH - JACK 1/1] jack: Use internal snd_pcm_state to reduce amount of additional variables Date: Thu, 15 Mar 2018 14:14:06 +0100 Message-ID: References: <1521118587-6319-1-git-send-email-twischer@de.adit-jv.com> <1521118587-6319-2-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 768E3267252 for ; Thu, 15 Mar 2018 14:14:07 +0100 (CET) In-Reply-To: <1521118587-6319-2-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 Thu, 15 Mar 2018 13:56:27 +0100, wrote: > > From: Timo Wischer > > This variable will be used to exchange the status of the stream between > the ALSA and JACK thread. In future commits it will also be used to signal > DRAINING state from the ALSA to JACK thread and to signal XRUN state form > the JACK to ALSA thread. > > Therefore this internal state variable is not always in sync with > io->state. In addition the internal state variable will be updated after > the corresponding callback function was processed and not before the > callback function was called (e.g. PREPARE and RUNNING). Well, the fact that the state change is done for PREPARE before the plugin callback can be seen as a generic bug of ioplug. The best would be to fix in ioplug side. And, the rest is RUNNING state. Is there anything else? For RUNNING, instead of keeping an internal shadow state, a saner way would be to have a jack->running bool flag indicating whether it's really running. thanks, Takashi