audio: add linein to BT headset loopback support

- Add AUDIO_DEVICE_OUT_BLUETOOTH_A2DP as the sink
  device to support linein to BT headset loopback.
- set device_connect parameter in transcode loopback
  test app to load A2DP source IPC library.

Change-Id: Ib52fdf9aa966f50834ffa34884f5fa76053df15e
This commit is contained in:
Surendar Karka 2018-11-19 16:23:14 +05:30
parent bbb3c820ae
commit 25b584c1b7
3 changed files with 10 additions and 0 deletions

View File

@ -171,6 +171,7 @@ bool is_supported_sink_device(audio_devices_t sink_device_mask)
if((sink_device_mask & AUDIO_DEVICE_OUT_SPEAKER) || if((sink_device_mask & AUDIO_DEVICE_OUT_SPEAKER) ||
(sink_device_mask & AUDIO_DEVICE_OUT_WIRED_HEADSET) || (sink_device_mask & AUDIO_DEVICE_OUT_WIRED_HEADSET) ||
(sink_device_mask & AUDIO_DEVICE_OUT_WIRED_HEADPHONE) || (sink_device_mask & AUDIO_DEVICE_OUT_WIRED_HEADPHONE) ||
(sink_device_mask & AUDIO_DEVICE_OUT_BLUETOOTH_A2DP) ||
(sink_device_mask & AUDIO_DEVICE_OUT_LINE)) { (sink_device_mask & AUDIO_DEVICE_OUT_LINE)) {
return true; return true;
} }

View File

@ -2345,6 +2345,8 @@ int select_devices(struct audio_device *adev, audio_usecase_t uc_id)
} }
} else if ((usecase->stream.out != NULL) && } else if ((usecase->stream.out != NULL) &&
!(usecase->stream.out->flags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD) && !(usecase->stream.out->flags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD) &&
(usecase->type != TRANSCODE_LOOPBACK_TX) &&
(usecase->type != TRANSCODE_LOOPBACK_RX) &&
usecase->stream.out->started) { usecase->stream.out->started) {
if (is_bt_soc_on(adev) == false) { if (is_bt_soc_on(adev) == false) {
ALOGD("BT SCO/A2dp disconnected while in connection"); ALOGD("BT SCO/A2dp disconnected while in connection");

View File

@ -579,6 +579,7 @@ int main(int argc, char *argv[]) {
log_file = stdout; log_file = stdout;
transcode_loopback_config_t *transcode_loopback_config = NULL; transcode_loopback_config_t *transcode_loopback_config = NULL;
transcode_loopback_config_t *temp = NULL; transcode_loopback_config_t *temp = NULL;
char param[100] = {0};
struct option long_options[] = { struct option long_options[] = {
/* These options set a flag. */ /* These options set a flag. */
@ -654,6 +655,12 @@ int main(int argc, char *argv[]) {
exit_process_thread = true; exit_process_thread = true;
goto exit_transcode_loopback_test; goto exit_transcode_loopback_test;
} }
if (sink_device == AUDIO_DEVICE_OUT_BLUETOOTH_A2DP) {
snprintf(param, sizeof(param), "%s=%d", "connect", sink_device);
qahw_set_parameters(primary_hal_handle, param);
}
transcode_loopback_config->hal_handle = primary_hal_handle; transcode_loopback_config->hal_handle = primary_hal_handle;
fprintf(log_file,"\nLoading HAL for loopback usecase done\n"); fprintf(log_file,"\nLoading HAL for loopback usecase done\n");