Charles Keepax bbc0621ff3 ALSA: compress: Fix stop handling on compressed capture streams
commit 4f2ab5e1d13d6aa77c55f4914659784efd776eb4 upstream.

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 <ckeepax@opensource.cirrus.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-12 19:46:11 +01:00
..
2015-11-18 18:08:54 +00:00
2017-08-30 20:44:29 +02:00
2014-05-05 18:20:22 -07:00
2015-11-30 12:24:12 +00:00
2015-02-02 14:42:42 +01:00
2014-07-04 18:50:51 +01:00
2015-07-09 12:00:11 +01:00
2017-06-28 18:33:31 +01:00
2014-04-18 18:52:18 +01:00
2015-11-18 12:55:25 +00:00
2016-09-24 19:51:57 +01:00
2015-03-11 12:08:20 +00:00
2014-09-15 15:52:03 +02:00