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:
parent
4618e01aa4
commit
e1dc8749e3
|
@ -171,6 +171,7 @@ bool is_supported_sink_device(audio_devices_t sink_device_mask)
|
|||
if((sink_device_mask & AUDIO_DEVICE_OUT_SPEAKER) ||
|
||||
(sink_device_mask & AUDIO_DEVICE_OUT_WIRED_HEADSET) ||
|
||||
(sink_device_mask & AUDIO_DEVICE_OUT_WIRED_HEADPHONE) ||
|
||||
(sink_device_mask & AUDIO_DEVICE_OUT_BLUETOOTH_A2DP) ||
|
||||
(sink_device_mask & AUDIO_DEVICE_OUT_LINE)) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -2366,6 +2366,8 @@ int select_devices(struct audio_device *adev, audio_usecase_t uc_id)
|
|||
}
|
||||
} else if ((usecase->stream.out != NULL) &&
|
||||
!(usecase->stream.out->flags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD) &&
|
||||
(usecase->type != TRANSCODE_LOOPBACK_TX) &&
|
||||
(usecase->type != TRANSCODE_LOOPBACK_RX) &&
|
||||
usecase->stream.out->started) {
|
||||
if (is_bt_soc_on(adev) == false) {
|
||||
ALOGD("BT SCO/A2dp disconnected while in connection");
|
||||
|
|
|
@ -579,6 +579,7 @@ int main(int argc, char *argv[]) {
|
|||
log_file = stdout;
|
||||
transcode_loopback_config_t *transcode_loopback_config = NULL;
|
||||
transcode_loopback_config_t *temp = NULL;
|
||||
char param[100] = {0};
|
||||
|
||||
struct option long_options[] = {
|
||||
/* These options set a flag. */
|
||||
|
@ -654,6 +655,12 @@ int main(int argc, char *argv[]) {
|
|||
exit_process_thread = true;
|
||||
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;
|
||||
fprintf(log_file,"\nLoading HAL for loopback usecase done\n");
|
||||
|
||||
|
|
Loading…
Reference in New Issue