Audio: fix voip calls over bluetooth for Wolfson Microelectronics codecs.
authorstenkinevgeniy <stenkinevgeniy@gmail.com>
Mon, 9 Jul 2018 14:48:19 +0000 (14:48 +0000)
committerJan Altensen <info@stricted.net>
Tue, 5 Feb 2019 18:55:08 +0000 (19:55 +0100)
Some devices, that using wm* codecs like i9500, t805, p601 and others
need open CP pcm's when using BT SCO in IN_COMMUNICATION mode.

Change-Id: I64935aabf1c52e66409e727f02752cd325f8ef58
Signed-off-by: stenkinevgeniy <stenkinevgeniy@gmail.com>
audio/voice.c

index 2219d9a4ef892bb554687563067aef51782e4204..6d5e613037d00cabbf19320f913c8b3260335cff 100644 (file)
@@ -153,6 +153,10 @@ void stop_voice_session_bt_sco(struct audio_device *adev) {
         pcm_close(adev->pcm_sco_tx);
         adev->pcm_sco_tx = NULL;
     }
+
+    /* audio codecs like wm5201 need open modem pcm while using bt sco */
+    if (adev->mode != AUDIO_MODE_IN_CALL)
+        stop_voice_session(adev->voice.session);
 }
 
 /* must be called with the hw device mutex locked, OK to hold other mutexes */
@@ -198,6 +202,10 @@ void start_voice_session_bt_sco(struct audio_device *adev)
     pcm_start(adev->pcm_sco_rx);
     pcm_start(adev->pcm_sco_tx);
 
+    /* audio codecs like wm5201 need open modem pcm while using bt sco */
+    if (adev->mode != AUDIO_MODE_IN_CALL)
+        start_voice_session(adev->voice.session);
+
     return;
 
 err_sco_tx: