ALSA: pcm: Preprocess PAUSED or SUSPENDED stream before PREPARE
authorTakashi Iwai <tiwai@suse.de>
Tue, 24 May 2016 13:40:03 +0000 (15:40 +0200)
committerTakashi Iwai <tiwai@suse.de>
Wed, 14 Jun 2017 05:44:00 +0000 (07:44 +0200)
commit1b745cd97425f7b0b9d0c87c1b9766c31b7d0a7e
tree98c15796187add768fa5c9d2f30c1b4cb41f41fd
parent4b95ff781e30c50298257d22a2c3743b2e5739be
ALSA: pcm: Preprocess PAUSED or SUSPENDED stream before PREPARE

Calling PREPARE ioctl to the stream in either PAUSED or SUSPENDED
state may confuse some drivers that don't handle the state properly.
Instead of fixing each driver, PCM core should take care of the proper
state change before actually trying to (re-)prepare the stream.
Namely, when the stream is in PAUSED state, it triggers PAUSE_RELEASE,
and when in SUSPENDED state, it triggers STOP, before calling prepare
callbacks.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/pcm_native.c