Lines Matching refs:usecase
256 struct audio_usecase *usecase) in enable_audio_route() argument
261 if (usecase == NULL) in enable_audio_route()
264 ALOGV("%s: enter: usecase(%d)", __func__, usecase->id); in enable_audio_route()
266 if (usecase->type == PCM_CAPTURE) in enable_audio_route()
267 snd_device = usecase->in_snd_device; in enable_audio_route()
269 snd_device = usecase->out_snd_device; in enable_audio_route()
271 strcpy(mixer_path, use_case_table[usecase->id]); in enable_audio_route()
281 struct audio_usecase *usecase) in disable_audio_route() argument
286 if (usecase == NULL) in disable_audio_route()
289 ALOGV("%s: enter: usecase(%d)", __func__, usecase->id); in disable_audio_route()
290 if (usecase->type == PCM_CAPTURE) in disable_audio_route()
291 snd_device = usecase->in_snd_device; in disable_audio_route()
293 snd_device = usecase->out_snd_device; in disable_audio_route()
294 strcpy(mixer_path, use_case_table[usecase->id]); in disable_audio_route()
404 struct audio_usecase *usecase; in check_and_route_playback_usecases() local
424 usecase = node_to_item(node, struct audio_usecase, list); in check_and_route_playback_usecases()
425 if (usecase->type != PCM_CAPTURE && in check_and_route_playback_usecases()
426 usecase != uc_info && in check_and_route_playback_usecases()
427 usecase->out_snd_device != snd_device && in check_and_route_playback_usecases()
428 usecase->devices & AUDIO_DEVICE_OUT_ALL_CODEC_BACKEND && in check_and_route_playback_usecases()
429 platform_check_backends_match(snd_device, usecase->out_snd_device)) { in check_and_route_playback_usecases()
431 __func__, use_case_table[usecase->id], in check_and_route_playback_usecases()
432 platform_get_snd_device_name(usecase->out_snd_device)); in check_and_route_playback_usecases()
433 disable_audio_route(adev, usecase); in check_and_route_playback_usecases()
434 switch_device[usecase->id] = true; in check_and_route_playback_usecases()
441 usecase = node_to_item(node, struct audio_usecase, list); in check_and_route_playback_usecases()
442 if (switch_device[usecase->id]) { in check_and_route_playback_usecases()
443 disable_snd_device(adev, usecase->out_snd_device); in check_and_route_playback_usecases()
448 usecase = node_to_item(node, struct audio_usecase, list); in check_and_route_playback_usecases()
449 if (switch_device[usecase->id]) { in check_and_route_playback_usecases()
457 usecase = node_to_item(node, struct audio_usecase, list); in check_and_route_playback_usecases()
459 if (switch_device[usecase->id] ) { in check_and_route_playback_usecases()
460 usecase->out_snd_device = snd_device; in check_and_route_playback_usecases()
461 enable_audio_route(adev, usecase); in check_and_route_playback_usecases()
472 struct audio_usecase *usecase; in check_and_route_capture_usecases() local
490 usecase = node_to_item(node, struct audio_usecase, list); in check_and_route_capture_usecases()
491 if (usecase->type != PCM_PLAYBACK && in check_and_route_capture_usecases()
492 usecase != uc_info && in check_and_route_capture_usecases()
493 usecase->in_snd_device != snd_device && in check_and_route_capture_usecases()
494 (usecase->id != USECASE_AUDIO_SPKR_CALIB_TX)) { in check_and_route_capture_usecases()
496 __func__, use_case_table[usecase->id], in check_and_route_capture_usecases()
497 platform_get_snd_device_name(usecase->in_snd_device)); in check_and_route_capture_usecases()
498 disable_audio_route(adev, usecase); in check_and_route_capture_usecases()
499 switch_device[usecase->id] = true; in check_and_route_capture_usecases()
506 usecase = node_to_item(node, struct audio_usecase, list); in check_and_route_capture_usecases()
507 if (switch_device[usecase->id]) { in check_and_route_capture_usecases()
508 disable_snd_device(adev, usecase->in_snd_device); in check_and_route_capture_usecases()
513 usecase = node_to_item(node, struct audio_usecase, list); in check_and_route_capture_usecases()
514 if (switch_device[usecase->id]) { in check_and_route_capture_usecases()
522 usecase = node_to_item(node, struct audio_usecase, list); in check_and_route_capture_usecases()
524 if (switch_device[usecase->id] ) { in check_and_route_capture_usecases()
525 usecase->in_snd_device = snd_device; in check_and_route_capture_usecases()
526 enable_audio_route(adev, usecase); in check_and_route_capture_usecases()
562 struct audio_usecase *usecase; in get_voice_usecase_id_from_list() local
566 usecase = node_to_item(node, struct audio_usecase, list); in get_voice_usecase_id_from_list()
567 if (usecase->type == VOICE_CALL) { in get_voice_usecase_id_from_list()
568 ALOGV("%s: usecase id %d", __func__, usecase->id); in get_voice_usecase_id_from_list()
569 return usecase->id; in get_voice_usecase_id_from_list()
578 struct audio_usecase *usecase; in get_usecase_from_list() local
582 usecase = node_to_item(node, struct audio_usecase, list); in get_usecase_from_list()
583 if (usecase->id == uc_id) in get_usecase_from_list()
584 return usecase; in get_usecase_from_list()
594 struct audio_usecase *usecase = NULL; in select_devices() local
601 usecase = get_usecase_from_list(adev, uc_id); in select_devices()
602 if (usecase == NULL) { in select_devices()
607 if ((usecase->type == VOICE_CALL) || in select_devices()
608 (usecase->type == PCM_HFP_CALL)) { in select_devices()
610 usecase->stream.out->devices); in select_devices()
611 in_snd_device = platform_get_input_snd_device(adev->platform, usecase->stream.out->devices); in select_devices()
612 usecase->devices = usecase->stream.out->devices; in select_devices()
626 (usecase->devices == AUDIO_DEVICE_IN_VOICE_CALL))) { in select_devices()
638 if (usecase->type == PCM_PLAYBACK) { in select_devices()
639 usecase->devices = usecase->stream.out->devices; in select_devices()
643 usecase->stream.out->devices); in select_devices()
644 if (usecase->stream.out == adev->primary_output && in select_devices()
648 out_snd_device != usecase->out_snd_device) { in select_devices()
649 select_devices(adev, adev->active_input->usecase); in select_devices()
652 } else if (usecase->type == PCM_CAPTURE) { in select_devices()
653 usecase->devices = usecase->stream.in->device; in select_devices()
661 if (usecase->id == USECASE_AUDIO_RECORD_AFE_PROXY) { in select_devices()
672 if (out_snd_device == usecase->out_snd_device && in select_devices()
673 in_snd_device == usecase->in_snd_device) { in select_devices()
686 if ((usecase->type == VOICE_CALL) && in select_devices()
687 (usecase->in_snd_device != SND_DEVICE_NONE) && in select_devices()
688 (usecase->out_snd_device != SND_DEVICE_NONE)) { in select_devices()
692 voice_set_sidetone(adev, usecase->out_snd_device, false); in select_devices()
696 if (usecase->out_snd_device != SND_DEVICE_NONE) { in select_devices()
697 disable_audio_route(adev, usecase); in select_devices()
698 disable_snd_device(adev, usecase->out_snd_device); in select_devices()
701 if (usecase->in_snd_device != SND_DEVICE_NONE) { in select_devices()
702 disable_audio_route(adev, usecase); in select_devices()
703 disable_snd_device(adev, usecase->in_snd_device); in select_devices()
710 if ((usecase->type == VOICE_CALL) && in select_devices()
711 (usecase->in_snd_device != SND_DEVICE_NONE) && in select_devices()
712 (usecase->out_snd_device != SND_DEVICE_NONE)) { in select_devices()
720 if (usecase->devices & AUDIO_DEVICE_OUT_ALL_CODEC_BACKEND) in select_devices()
721 check_and_route_playback_usecases(adev, usecase, out_snd_device); in select_devices()
726 check_and_route_capture_usecases(adev, usecase, in_snd_device); in select_devices()
730 if (usecase->type == VOICE_CALL) in select_devices()
735 usecase->in_snd_device = in_snd_device; in select_devices()
736 usecase->out_snd_device = out_snd_device; in select_devices()
738 enable_audio_route(adev, usecase); in select_devices()
744 if (usecase->type == VOICE_CALL) { in select_devices()
765 in->usecase, use_case_table[in->usecase]); in stop_input_stream()
766 uc_info = get_usecase_from_list(adev, in->usecase); in stop_input_stream()
769 __func__, in->usecase); in stop_input_stream()
793 ALOGV("%s: enter: usecase(%d)", __func__, in->usecase); in start_input_stream()
794 in->pcm_device_id = platform_get_pcm_device_id(in->usecase, PCM_CAPTURE); in start_input_stream()
797 __func__, in->usecase); in start_input_stream()
804 uc_info->id = in->usecase; in start_input_stream()
815 select_devices(adev, in->usecase); in start_input_stream()
823 if (in->usecase == USECASE_AUDIO_RECORD_AFE_PROXY) { in start_input_stream()
1026 struct audio_usecase *usecase; in allow_hdmi_channel_config() local
1030 usecase = node_to_item(node, struct audio_usecase, list); in allow_hdmi_channel_config()
1031 if (usecase->devices & AUDIO_DEVICE_OUT_AUX_DIGITAL) { in allow_hdmi_channel_config()
1038 if (usecase->id == USECASE_VOICE_CALL) { in allow_hdmi_channel_config()
1043 } else if (usecase->id == USECASE_AUDIO_PLAYBACK_MULTI_CH) { in allow_hdmi_channel_config()
1058 struct audio_usecase *usecase; in check_and_set_hdmi_channels() local
1078 usecase = node_to_item(node, struct audio_usecase, list); in check_and_set_hdmi_channels()
1079 if (usecase->type == PCM_PLAYBACK && in check_and_set_hdmi_channels()
1080 usecase->devices & AUDIO_DEVICE_OUT_AUX_DIGITAL) { in check_and_set_hdmi_channels()
1081 disable_audio_route(adev, usecase); in check_and_set_hdmi_channels()
1090 usecase = node_to_item(node, struct audio_usecase, list); in check_and_set_hdmi_channels()
1091 if (usecase->type == PCM_PLAYBACK && in check_and_set_hdmi_channels()
1092 usecase->devices & AUDIO_DEVICE_OUT_AUX_DIGITAL) { in check_and_set_hdmi_channels()
1093 enable_audio_route(adev, usecase); in check_and_set_hdmi_channels()
1107 out->usecase, use_case_table[out->usecase]); in stop_output_stream()
1108 uc_info = get_usecase_from_list(adev, out->usecase); in stop_output_stream()
1111 __func__, out->usecase); in stop_output_stream()
1115 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) { in stop_output_stream()
1148 __func__, out->usecase, use_case_table[out->usecase], out->devices); in start_output_stream()
1149 out->pcm_device_id = platform_get_pcm_device_id(out->usecase, PCM_PLAYBACK); in start_output_stream()
1152 __func__, out->pcm_device_id, out->usecase); in start_output_stream()
1158 uc_info->id = out->usecase; in start_output_stream()
1173 select_devices(adev, out->usecase); in start_output_stream()
1179 if (out->usecase != USECASE_AUDIO_PLAYBACK_OFFLOAD) { in start_output_stream()
1182 if (out->usecase == USECASE_AUDIO_PLAYBACK_AFE_PROXY) { in start_output_stream()
1317 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) { in out_get_buffer_size()
1349 out->usecase, use_case_table[out->usecase]); in out_standby()
1358 if (out->usecase != USECASE_AUDIO_PLAYBACK_OFFLOAD) { in out_standby()
1426 struct audio_usecase *usecase; in out_set_parameters() local
1435 __func__, out->usecase, use_case_table[out->usecase], kvpairs); in out_set_parameters()
1477 select_devices(adev, out->usecase); in out_set_parameters()
1499 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) { in out_set_parameters()
1551 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) in out_get_latency()
1564 if (out->usecase == USECASE_AUDIO_PLAYBACK_MULTI_CH) { in out_set_volume()
1568 } else if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) { in out_set_volume()
1575 int pcm_device_id = platform_get_pcm_device_id(out->usecase, in out_set_volume()
1630 if (out->usecase != USECASE_AUDIO_PLAYBACK_OFFLOAD && adev->adm_register_output_stream) in out_write()
1634 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) { in out_write()
1663 if (out->usecase == USECASE_AUDIO_PLAYBACK_AFE_PROXY) { in out_write()
1695 if ((out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) && (dsp_frames != NULL)) { in out_get_render_position()
1736 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) { in out_get_presentation_position()
1756 (platform_render_latency(out->usecase) * out->sample_rate / 1000000LL); in out_get_presentation_position()
1790 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) { in out_pause()
1806 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) { in out_resume()
1823 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) { in out_drain()
1838 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) { in out_flush()
1959 status = select_devices(adev, in->usecase); in in_set_parameters()
2015 if (in->usecase == USECASE_AUDIO_RECORD_AFE_PROXY) { in in_read()
2029 if (ret == 0 && adev->mic_muted && in->usecase != USECASE_AUDIO_RECORD_AFE_PROXY) in in_read()
2072 struct audio_usecase *usecase; in add_remove_audio_effect() local
2075 usecase = node_to_item(node, struct audio_usecase, list); in add_remove_audio_effect()
2076 if (usecase->type == PCM_PLAYBACK) { in add_remove_audio_effect()
2077 select_devices(adev, usecase->id); in add_remove_audio_effect()
2082 select_devices(in->dev, in->usecase); in add_remove_audio_effect()
2088 select_devices(in->dev, in->usecase); in add_remove_audio_effect()
2156 out->usecase = USECASE_AUDIO_PLAYBACK_MULTI_CH; in adev_open_output_stream()
2177 out->usecase = USECASE_AUDIO_PLAYBACK_OFFLOAD; in adev_open_output_stream()
2229 out->usecase = USECASE_AUDIO_PLAYBACK_AFE_PROXY; in adev_open_output_stream()
2234 out->usecase = USECASE_AUDIO_PLAYBACK_DEEP_BUFFER; in adev_open_output_stream()
2237 out->usecase = USECASE_AUDIO_PLAYBACK_TTS; in adev_open_output_stream()
2240 out->usecase = USECASE_AUDIO_PLAYBACK_ULL; in adev_open_output_stream()
2243 out->usecase = USECASE_AUDIO_PLAYBACK_LOW_LATENCY; in adev_open_output_stream()
2248 && pcm_params_format_test(adev->use_case_table[out->usecase], in adev_open_output_stream()
2264 __func__, use_case_table[out->usecase], config->format, out->config.format); in adev_open_output_stream()
2278 if (get_usecase_from_list(adev, out->usecase) != NULL) { in adev_open_output_stream()
2279 ALOGE("%s: Usecase (%d) is already present", __func__, out->usecase); in adev_open_output_stream()
2340 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) { in adev_close_output_stream()
2606 in->usecase = USECASE_AUDIO_RECORD_AFE_PROXY; in adev_open_input_stream()
2609 in->usecase = USECASE_AUDIO_RECORD; in adev_open_input_stream()
2614 in->usecase = USECASE_AUDIO_RECORD_LOW_LATENCY; in adev_open_input_stream()