pal: start input bt devices before creating mmap buffer
Full GKV is needed during create mmap buffer. However, device KV
will only be populated during stream start for BT device. As a
result, create_mmap_buffer() will run into failure.
Start input bt device prior to create mmap buffer.
Change-Id: Ibe5952633b3bb62cd3b864a5f4b16c99947e11ff
diff --git a/stream/src/StreamPCM.cpp b/stream/src/StreamPCM.cpp
index e001253..5f2c5a3 100644
--- a/stream/src/StreamPCM.cpp
+++ b/stream/src/StreamPCM.cpp
@@ -1656,8 +1656,10 @@
rm->lockGraph();
for (int32_t i=0; i < mDevices.size(); i++) {
if ((mDevices[i]->getSndDeviceId() == PAL_DEVICE_OUT_BLUETOOTH_A2DP) ||
- (mDevices[i]->getSndDeviceId() == PAL_DEVICE_OUT_BLUETOOTH_BLE)) {
- PAL_DBG(LOG_TAG, "start BT A2DP/BLE device as to populate the full GKVs");
+ (mDevices[i]->getSndDeviceId() == PAL_DEVICE_OUT_BLUETOOTH_BLE) ||
+ (mDevices[i]->getSndDeviceId() == PAL_DEVICE_IN_BLUETOOTH_BLE) ||
+ (mDevices[i]->getSndDeviceId() == PAL_DEVICE_IN_BLUETOOTH_SCO_HEADSET)) {
+ PAL_DBG(LOG_TAG, "start BT devices as to populate the full GKVs");
status = mDevices[i]->start();
if ((0 != status) && mDevices.size() == 1) {
PAL_ERR(LOG_TAG, "device start failed: %d", status);