mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-10 14:19:09 -04:00
asoc: fix prepare error in pulseaudio loopback cases
In pulseaudio, prepare comes just after open for every substream in loopback cases, but the 'audio_client' is not allocated for the first substream in every pcm. And the returned error causes the failure of pulseaudio initialization for all loopback cases. Change-Id: I7fb6c1f23b9cf2660e4dd519a731c7e13a809a4a Signed-off-by: Guodong Hu <guodhu@codeaurora.org>
This commit is contained in:
parent
74a0ee0121
commit
b36d8ca714
1 changed files with 6 additions and 6 deletions
|
|
@ -448,12 +448,6 @@ static int msm_pcm_prepare(struct snd_pcm_substream *substream)
|
|||
dev_dbg(component->dev, "%s: ASM loopback stream:%d\n",
|
||||
__func__, substream->stream);
|
||||
|
||||
if (!pcm || !pcm->audio_client) {
|
||||
mutex_unlock(&pcm->lock);
|
||||
pr_err("%s: private data null or audio client freed\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (pcm->playback_start && pcm->capture_start) {
|
||||
mutex_unlock(&pcm->lock);
|
||||
return ret;
|
||||
|
|
@ -474,6 +468,12 @@ static int msm_pcm_prepare(struct snd_pcm_substream *substream)
|
|||
pcm->capture_substream->private_data;
|
||||
event.event_func = msm_pcm_route_event_handler;
|
||||
event.priv_data = (void *) pcm;
|
||||
|
||||
if (!pcm->audio_client) {
|
||||
mutex_unlock(&pcm->lock);
|
||||
pr_err("%s: audio client freed\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
msm_pcm_routing_reg_phy_stream(soc_pcm_tx->dai_link->id,
|
||||
pcm->audio_client->perf_mode,
|
||||
pcm->session_id, pcm->capture_substream->stream);
|
||||
|
|
|
|||
Loading…
Reference in a new issue