From: Takashi Iwai Subject: Re: [PATCH] ALSA: compress: Fix stop handling on compressed capture streams Date: Tue, 05 Feb 2019 22:02:28 +0100 Message-ID: References: <20190205162940.1028-1-ckeepax@opensource.cirrus.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 mx1.suse.de (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 22CD5267418 for ; Tue, 5 Feb 2019 22:02:29 +0100 (CET) In-Reply-To: <20190205162940.1028-1-ckeepax@opensource.cirrus.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: Charles Keepax Cc: patches@opensource.cirrus.com, vkoul@kernel.org, broonie@kernel.org, alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org On Tue, 05 Feb 2019 17:29:40 +0100, Charles Keepax wrote: > > It is normal user behaviour to start, stop, then start a stream > again without closing it. Currently this works for compressed > playback streams but not capture ones. > > The states on a compressed capture stream go directly from OPEN to > PREPARED, unlike a playback stream which moves to SETUP and waits > for a write of data before moving to PREPARED. Currently however, > when a stop is sent the state is set to SETUP for both types of > streams. This leaves a capture stream in the situation where a new > start can't be sent as that requires the state to be PREPARED and > a new set_params can't be sent as that requires the state to be > OPEN. The only option being to close the stream, and then reopen. > > Correct this issues by allowing snd_compr_drain_notify to set the > state depending on the stream direction, as we already do in > set_params. > > Fixes: 49bb6402f1aa ("ALSA: compress_core: Add support for capture streams") > Signed-off-by: Charles Keepax Applied now (with Cc to stable). Thanks. Takashi