pa_assert(u);
if (load && u->loopback_args.sink && u->loopback_args.source) {
- if (!u->loopback_args.latency_msec || !u->loopback_args.latency_msec) {
+ if (!u->loopback_args.latency_msec)
u->loopback_args.latency_msec = LOOPBACK_DEFAULT_LATENCY_MSEC;
+ if (!u->loopback_args.adjust_sec)
u->loopback_args.adjust_sec = LOOPBACK_DEFAULT_ADJUST_SEC;
- }
+
args = pa_sprintf_malloc("sink=%s source=%s latency_msec=%d adjust_time=%d",
u->loopback_args.sink->name, u->loopback_args.source->name,
u->loopback_args.latency_msec, u->loopback_args.adjust_sec);
if (!data->idx_avail_devices) {
pa_log_error("[SELECT] available devices is NULL, set it to null sink/source");
- if (data->stream_type == STREAM_SINK_INPUT)
- *(data->proper_sink) = null_sink;
- else
- *(data->proper_source) = null_source;
- return PA_HOOK_OK;
+ goto not_found;
+ }
+
+ if (IS_MANUAL_ROUTE_TYPE_SERIES(data->route_type) && !data->idx_manual_devices) {
+ pa_log_error("[SELECT] manual devices is NULL, set it to null sink/source");
+ goto not_found;
}
if (IS_AUTO_ROUTE_TYPE_SERIES(data->route_type)) {
}
}
- } else if (data->route_type == STREAM_ROUTE_TYPE_MANUAL && data->idx_manual_devices) {
+ } else if (data->route_type == STREAM_ROUTE_TYPE_MANUAL) {
PA_IDXSET_FOREACH(device_type, data->idx_avail_devices, idx) {
pa_log_info("[SELECT][MANUAL] avail_device[%u] for this role[%-16s]: type[%-16s]", idx, data->stream_role, device_type);
if (!is_cached_device_connected(device_type, data->stream_type))
}
}
- } else if (data->route_type == STREAM_ROUTE_TYPE_MANUAL_EXT && data->idx_manual_devices) {
+ } else if (data->route_type == STREAM_ROUTE_TYPE_MANUAL_EXT) {
PA_IDXSET_FOREACH(device_type, data->idx_avail_devices, idx) {
pa_log_info("[SELECT][MANUAL_EXT] avail_device[%u] for this role[%-16s]: type[%-16s]", idx, data->stream_role, device_type);
if (!is_cached_device_connected(device_type, data->stream_type))
else {
if (((pa_sink_input*)(data->stream))->sink != sink)
pa_sink_input_move_to(data->stream, sink, false);
- }
+ }
} else if (data->stream_type == STREAM_SOURCE_OUTPUT) {
if ((source = pa_tz_device_get_source(device, DEVICE_ROLE_NORMAL))) {
}
}
+not_found:
if ((data->stream_type == STREAM_SINK_INPUT) ? !(*(data->proper_sink)) : !(*(data->proper_source))) {
pa_log_warn("[SELECT] could not find a proper sink/source, set it to null sink/source");
if (data->stream_type == STREAM_SINK_INPUT)
}
}
- } else if (data->route_type == STREAM_ROUTE_TYPE_MANUAL && data->idx_manual_devices) {
+ } else if (data->route_type == STREAM_ROUTE_TYPE_MANUAL) {
uint32_t d_idx = 0;
PA_IDXSET_FOREACH(device_type, data->idx_avail_devices, idx) {
pa_log_debug(" -- manual_device[%u] for this role[%-16s]: device_id(%u)", idx, data->stream_role, *device_id);
if (!(device = pa_device_manager_get_device_by_id(u->device_manager, *device_id)))
continue;
- /* FIXME : This is temparary code, until App could give
- * proper BT-SCO device for call-voice */
- if (IS_ROLE_COMMUNICATION(route_info.role) && pa_streq(device->type, DEVICE_TYPE_BT_SCO)) {
- pa_tz_device *sco_device;
- if ((sco_device = _get_sco_connected_device(u->device_manager)) == NULL) {
- pa_log_error(" ** could not find BT SCO");
- continue;
- }
- if (sco_device->id != *device_id) {
- pa_log_info("Redirecting this manual routing for call-voice to SCO device(%u)", sco_device->id);
- device = sco_device;
- }
- }
dm_device_type = pa_tz_device_get_type(device);
if (!pa_streq(device_type, dm_device_type))
continue;