Lines Matching refs:usecase
213 struct audio_usecase *usecase) in enable_audio_route() argument
218 if (usecase == NULL) in enable_audio_route()
221 ALOGV("%s: enter: usecase(%d)", __func__, usecase->id); in enable_audio_route()
223 if (usecase->type == PCM_CAPTURE) in enable_audio_route()
224 snd_device = usecase->in_snd_device; in enable_audio_route()
226 snd_device = usecase->out_snd_device; in enable_audio_route()
228 strcpy(mixer_path, use_case_table[usecase->id]); in enable_audio_route()
238 struct audio_usecase *usecase) in disable_audio_route() argument
243 if (usecase == NULL) in disable_audio_route()
246 ALOGV("%s: enter: usecase(%d)", __func__, usecase->id); in disable_audio_route()
247 if (usecase->type == PCM_CAPTURE) in disable_audio_route()
248 snd_device = usecase->in_snd_device; in disable_audio_route()
250 snd_device = usecase->out_snd_device; in disable_audio_route()
251 strcpy(mixer_path, use_case_table[usecase->id]); in disable_audio_route()
314 struct audio_usecase *usecase; in check_usecases_codec_backend() local
334 usecase = node_to_item(node, struct audio_usecase, list); in check_usecases_codec_backend()
335 if (usecase->type != PCM_CAPTURE && in check_usecases_codec_backend()
336 usecase != uc_info && in check_usecases_codec_backend()
337 usecase->out_snd_device != snd_device && in check_usecases_codec_backend()
338 usecase->devices & AUDIO_DEVICE_OUT_ALL_CODEC_BACKEND) { in check_usecases_codec_backend()
340 __func__, use_case_table[usecase->id], in check_usecases_codec_backend()
341 platform_get_snd_device_name(usecase->out_snd_device)); in check_usecases_codec_backend()
342 disable_audio_route(adev, usecase); in check_usecases_codec_backend()
343 switch_device[usecase->id] = true; in check_usecases_codec_backend()
350 usecase = node_to_item(node, struct audio_usecase, list); in check_usecases_codec_backend()
351 if (switch_device[usecase->id]) { in check_usecases_codec_backend()
352 disable_snd_device(adev, usecase->out_snd_device); in check_usecases_codec_backend()
357 usecase = node_to_item(node, struct audio_usecase, list); in check_usecases_codec_backend()
358 if (switch_device[usecase->id]) { in check_usecases_codec_backend()
366 usecase = node_to_item(node, struct audio_usecase, list); in check_usecases_codec_backend()
368 if (switch_device[usecase->id] ) { in check_usecases_codec_backend()
369 usecase->out_snd_device = snd_device; in check_usecases_codec_backend()
370 enable_audio_route(adev, usecase); in check_usecases_codec_backend()
381 struct audio_usecase *usecase; in check_and_route_capture_usecases() local
399 usecase = node_to_item(node, struct audio_usecase, list); in check_and_route_capture_usecases()
400 if (usecase->type != PCM_PLAYBACK && in check_and_route_capture_usecases()
401 usecase != uc_info && in check_and_route_capture_usecases()
402 usecase->in_snd_device != snd_device) { in check_and_route_capture_usecases()
404 __func__, use_case_table[usecase->id], in check_and_route_capture_usecases()
405 platform_get_snd_device_name(usecase->in_snd_device)); in check_and_route_capture_usecases()
406 disable_audio_route(adev, usecase); in check_and_route_capture_usecases()
407 switch_device[usecase->id] = true; in check_and_route_capture_usecases()
414 usecase = node_to_item(node, struct audio_usecase, list); in check_and_route_capture_usecases()
415 if (switch_device[usecase->id]) { in check_and_route_capture_usecases()
416 disable_snd_device(adev, usecase->in_snd_device); in check_and_route_capture_usecases()
421 usecase = node_to_item(node, struct audio_usecase, list); in check_and_route_capture_usecases()
422 if (switch_device[usecase->id]) { in check_and_route_capture_usecases()
430 usecase = node_to_item(node, struct audio_usecase, list); in check_and_route_capture_usecases()
432 if (switch_device[usecase->id] ) { in check_and_route_capture_usecases()
433 usecase->in_snd_device = snd_device; in check_and_route_capture_usecases()
434 enable_audio_route(adev, usecase); in check_and_route_capture_usecases()
470 struct audio_usecase *usecase; in get_voice_usecase_id_from_list() local
474 usecase = node_to_item(node, struct audio_usecase, list); in get_voice_usecase_id_from_list()
475 if (usecase->type == VOICE_CALL) { in get_voice_usecase_id_from_list()
476 ALOGV("%s: usecase id %d", __func__, usecase->id); in get_voice_usecase_id_from_list()
477 return usecase->id; in get_voice_usecase_id_from_list()
486 struct audio_usecase *usecase; in get_usecase_from_list() local
490 usecase = node_to_item(node, struct audio_usecase, list); in get_usecase_from_list()
491 if (usecase->id == uc_id) in get_usecase_from_list()
492 return usecase; in get_usecase_from_list()
502 struct audio_usecase *usecase = NULL; in select_devices() local
509 usecase = get_usecase_from_list(adev, uc_id); in select_devices()
510 if (usecase == NULL) { in select_devices()
515 if ((usecase->type == VOICE_CALL) || in select_devices()
516 (usecase->type == PCM_HFP_CALL)) { in select_devices()
518 usecase->stream.out->devices); in select_devices()
519 in_snd_device = platform_get_input_snd_device(adev->platform, usecase->stream.out->devices); in select_devices()
520 usecase->devices = usecase->stream.out->devices; in select_devices()
534 (usecase->devices == AUDIO_DEVICE_IN_VOICE_CALL))) { in select_devices()
546 if (usecase->type == PCM_PLAYBACK) { in select_devices()
547 usecase->devices = usecase->stream.out->devices; in select_devices()
551 usecase->stream.out->devices); in select_devices()
552 if (usecase->stream.out == adev->primary_output && in select_devices()
555 out_snd_device != usecase->out_snd_device) { in select_devices()
556 select_devices(adev, adev->active_input->usecase); in select_devices()
559 } else if (usecase->type == PCM_CAPTURE) { in select_devices()
560 usecase->devices = usecase->stream.in->device; in select_devices()
568 } else if (usecase->id == USECASE_AUDIO_RECORD_AFE_PROXY) { in select_devices()
576 if (out_snd_device == usecase->out_snd_device && in select_devices()
577 in_snd_device == usecase->in_snd_device) { in select_devices()
590 if ((usecase->type == VOICE_CALL) && in select_devices()
591 (usecase->in_snd_device != SND_DEVICE_NONE) && in select_devices()
592 (usecase->out_snd_device != SND_DEVICE_NONE)) { in select_devices()
597 if (usecase->out_snd_device != SND_DEVICE_NONE) { in select_devices()
598 disable_audio_route(adev, usecase); in select_devices()
599 disable_snd_device(adev, usecase->out_snd_device); in select_devices()
602 if (usecase->in_snd_device != SND_DEVICE_NONE) { in select_devices()
603 disable_audio_route(adev, usecase); in select_devices()
604 disable_snd_device(adev, usecase->in_snd_device); in select_devices()
611 if ((usecase->type == VOICE_CALL) && in select_devices()
612 (usecase->in_snd_device != SND_DEVICE_NONE) && in select_devices()
613 (usecase->out_snd_device != SND_DEVICE_NONE)) { in select_devices()
621 if (usecase->devices & AUDIO_DEVICE_OUT_ALL_CODEC_BACKEND) in select_devices()
622 check_usecases_codec_backend(adev, usecase, out_snd_device); in select_devices()
627 check_and_route_capture_usecases(adev, usecase, in_snd_device); in select_devices()
631 if (usecase->type == VOICE_CALL) in select_devices()
636 usecase->in_snd_device = in_snd_device; in select_devices()
637 usecase->out_snd_device = out_snd_device; in select_devices()
639 enable_audio_route(adev, usecase); in select_devices()
645 if (usecase->type == VOICE_CALL) in select_devices()
662 in->usecase, use_case_table[in->usecase]); in stop_input_stream()
663 uc_info = get_usecase_from_list(adev, in->usecase); in stop_input_stream()
666 __func__, in->usecase); in stop_input_stream()
690 ALOGV("%s: enter: usecase(%d)", __func__, in->usecase); in start_input_stream()
691 in->pcm_device_id = platform_get_pcm_device_id(in->usecase, PCM_CAPTURE); in start_input_stream()
694 __func__, in->usecase); in start_input_stream()
701 uc_info->id = in->usecase; in start_input_stream()
709 select_devices(adev, in->usecase); in start_input_stream()
717 if (in->usecase == USECASE_AUDIO_RECORD_AFE_PROXY) { in start_input_stream()
899 struct audio_usecase *usecase; in allow_hdmi_channel_config() local
903 usecase = node_to_item(node, struct audio_usecase, list); in allow_hdmi_channel_config()
904 if (usecase->devices & AUDIO_DEVICE_OUT_AUX_DIGITAL) { in allow_hdmi_channel_config()
911 if (usecase->id == USECASE_VOICE_CALL) { in allow_hdmi_channel_config()
916 } else if (usecase->id == USECASE_AUDIO_PLAYBACK_MULTI_CH) { in allow_hdmi_channel_config()
931 struct audio_usecase *usecase; in check_and_set_hdmi_channels() local
951 usecase = node_to_item(node, struct audio_usecase, list); in check_and_set_hdmi_channels()
952 if (usecase->type == PCM_PLAYBACK && in check_and_set_hdmi_channels()
953 usecase->devices & AUDIO_DEVICE_OUT_AUX_DIGITAL) { in check_and_set_hdmi_channels()
954 disable_audio_route(adev, usecase); in check_and_set_hdmi_channels()
963 usecase = node_to_item(node, struct audio_usecase, list); in check_and_set_hdmi_channels()
964 if (usecase->type == PCM_PLAYBACK && in check_and_set_hdmi_channels()
965 usecase->devices & AUDIO_DEVICE_OUT_AUX_DIGITAL) { in check_and_set_hdmi_channels()
966 enable_audio_route(adev, usecase); in check_and_set_hdmi_channels()
980 out->usecase, use_case_table[out->usecase]); in stop_output_stream()
981 uc_info = get_usecase_from_list(adev, out->usecase); in stop_output_stream()
984 __func__, out->usecase); in stop_output_stream()
988 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) { in stop_output_stream()
1021 __func__, out->usecase, use_case_table[out->usecase], out->devices); in start_output_stream()
1022 out->pcm_device_id = platform_get_pcm_device_id(out->usecase, PCM_PLAYBACK); in start_output_stream()
1025 __func__, out->pcm_device_id, out->usecase); in start_output_stream()
1031 uc_info->id = out->usecase; in start_output_stream()
1044 select_devices(adev, out->usecase); in start_output_stream()
1050 if (out->usecase != USECASE_AUDIO_PLAYBACK_OFFLOAD) { in start_output_stream()
1053 if (out->usecase == USECASE_AUDIO_PLAYBACK_AFE_PROXY) { in start_output_stream()
1174 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) { in out_get_buffer_size()
1206 out->usecase, use_case_table[out->usecase]); in out_standby()
1212 if (out->usecase != USECASE_AUDIO_PLAYBACK_OFFLOAD) { in out_standby()
1280 struct audio_usecase *usecase; in out_set_parameters() local
1289 __func__, out->usecase, use_case_table[out->usecase], kvpairs); in out_set_parameters()
1331 select_devices(adev, out->usecase); in out_set_parameters()
1353 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) { in out_set_parameters()
1405 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) in out_get_latency()
1418 if (out->usecase == USECASE_AUDIO_PLAYBACK_MULTI_CH) { in out_set_volume()
1422 } else if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) { in out_set_volume()
1429 int pcm_device_id = platform_get_pcm_device_id(out->usecase, in out_set_volume()
1469 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) { in out_write()
1494 if (out->usecase == USECASE_AUDIO_PLAYBACK_AFE_PROXY) { in out_write()
1522 if ((out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) && (dsp_frames != NULL)) { in out_get_render_position()
1563 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) { in out_get_presentation_position()
1583 (platform_render_latency(out->usecase) * out->sample_rate / 1000000LL); in out_get_presentation_position()
1617 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) { in out_pause()
1633 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) { in out_resume()
1650 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) { in out_drain()
1665 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) { in out_flush()
1774 status = select_devices(adev, in->usecase); in in_set_parameters()
1816 if (in->usecase == USECASE_AUDIO_RECORD_AFE_PROXY) { in in_read()
1827 if (ret == 0 && adev->mic_muted && in->usecase != USECASE_AUDIO_RECORD_AFE_PROXY) in in_read()
1869 struct audio_usecase *usecase; in add_remove_audio_effect() local
1872 usecase = node_to_item(node, struct audio_usecase, list); in add_remove_audio_effect()
1873 if (usecase->type == PCM_PLAYBACK) { in add_remove_audio_effect()
1874 select_devices(adev, usecase->id); in add_remove_audio_effect()
1879 select_devices(in->dev, in->usecase); in add_remove_audio_effect()
1885 select_devices(in->dev, in->usecase); in add_remove_audio_effect()
1953 out->usecase = USECASE_AUDIO_PLAYBACK_MULTI_CH; in adev_open_output_stream()
1974 out->usecase = USECASE_AUDIO_PLAYBACK_OFFLOAD; in adev_open_output_stream()
2026 out->usecase = USECASE_AUDIO_PLAYBACK_AFE_PROXY; in adev_open_output_stream()
2031 out->usecase = USECASE_AUDIO_PLAYBACK_DEEP_BUFFER; in adev_open_output_stream()
2034 out->usecase = USECASE_AUDIO_PLAYBACK_LOW_LATENCY; in adev_open_output_stream()
2039 && pcm_params_format_test(adev->use_case_table[out->usecase], in adev_open_output_stream()
2055 __func__, use_case_table[out->usecase], config->format, out->config.format); in adev_open_output_stream()
2069 if (get_usecase_from_list(adev, out->usecase) != NULL) { in adev_open_output_stream()
2070 ALOGE("%s: Usecase (%d) is already present", __func__, out->usecase); in adev_open_output_stream()
2126 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) { in adev_close_output_stream()
2203 struct audio_usecase *usecase; in adev_set_parameters() local
2206 usecase = node_to_item(node, struct audio_usecase, list); in adev_set_parameters()
2207 if (usecase->type == PCM_PLAYBACK) { in adev_set_parameters()
2208 select_devices(adev, usecase->id); in adev_set_parameters()
2403 in->usecase = USECASE_AUDIO_RECORD_AFE_PROXY; in adev_open_input_stream()
2406 in->usecase = USECASE_AUDIO_RECORD; in adev_open_input_stream()
2411 in->usecase = USECASE_AUDIO_RECORD_LOW_LATENCY; in adev_open_input_stream()