Lines Matching refs:usecase
392 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) in register_out_stream()
649 struct audio_usecase *usecase) in enable_audio_route() argument
654 if (usecase == NULL) in enable_audio_route()
657 ALOGV("%s: enter: usecase(%d)", __func__, usecase->id); in enable_audio_route()
659 audio_extn_sound_trigger_update_stream_status(usecase, ST_EVENT_STREAM_BUSY); in enable_audio_route()
661 if (usecase->type == PCM_CAPTURE) { in enable_audio_route()
662 struct stream_in *in = usecase->stream.in; in enable_audio_route()
664 snd_device = usecase->in_snd_device; in enable_audio_route()
691 snd_device = usecase->out_snd_device; in enable_audio_route()
692 audio_extn_utils_send_app_type_cfg(adev, usecase); in enable_audio_route()
693 audio_extn_ma_set_device(usecase); in enable_audio_route()
694 audio_extn_utils_send_audio_calibration(adev, usecase); in enable_audio_route()
697 ALOGW_IF(strlcpy(mixer_path, use_case_table[usecase->id], sizeof(mixer_path)) in enable_audio_route()
702 ALOGD("%s: usecase(%d) apply and update mixer path: %s", __func__, usecase->id, mixer_path); in enable_audio_route()
710 struct audio_usecase *usecase) in disable_audio_route() argument
715 if (usecase == NULL) in disable_audio_route()
718 ALOGV("%s: enter: usecase(%d)", __func__, usecase->id); in disable_audio_route()
719 if (usecase->type == PCM_CAPTURE) in disable_audio_route()
720 snd_device = usecase->in_snd_device; in disable_audio_route()
722 snd_device = usecase->out_snd_device; in disable_audio_route()
725 ALOGW_IF(strlcpy(mixer_path, use_case_table[usecase->id], sizeof(mixer_path)) in disable_audio_route()
729 ALOGD("%s: usecase(%d) reset and update mixer path: %s", __func__, usecase->id, mixer_path); in disable_audio_route()
732 if (usecase->type == PCM_CAPTURE) { in disable_audio_route()
733 struct stream_in *in = usecase->stream.in; in disable_audio_route()
739 audio_extn_sound_trigger_update_stream_status(usecase, ST_EVENT_STREAM_FREE); in disable_audio_route()
909 static int update_effect_param_ecns(struct audio_usecase *usecase, in update_effect_param_ecns() argument
917 if (!usecase) in update_effect_param_ecns()
920 in = usecase->stream.in; in update_effect_param_ecns()
923 ret = platform_get_effect_config_data(usecase->in_snd_device, in update_effect_param_ecns()
945 struct audio_usecase *usecase = NULL; in enable_disable_effect() local
956 usecase = get_usecase_from_list(adev, in->usecase); in enable_disable_effect()
958 ret = platform_get_effect_config_data(usecase->in_snd_device, in enable_disable_effect()
966 usecase->id, usecase->in_snd_device); in enable_disable_effect()
975 ret = update_effect_param_ecns(usecase, effect_config.module_id, in enable_disable_effect()
996 struct audio_usecase *usecase = node_to_item(node, struct audio_usecase, list); in check_and_enable_effect() local
997 if (usecase->type == PCM_CAPTURE && usecase->stream.in != NULL) { in check_and_enable_effect()
998 in = usecase->stream.in; in check_and_enable_effect()
1134 struct audio_usecase *usecase; in check_and_route_playback_usecases() local
1168 usecase = node_to_item(node, struct audio_usecase, list); in check_and_route_playback_usecases()
1169 if (usecase->type == PCM_CAPTURE || usecase == uc_info) in check_and_route_playback_usecases()
1173 (usecase->out_snd_device != snd_device && in check_and_route_playback_usecases()
1174 (usecase->devices & AUDIO_DEVICE_OUT_ALL_CODEC_BACKEND || in check_and_route_playback_usecases()
1175 usecase->devices & (AUDIO_DEVICE_OUT_USB_DEVICE|AUDIO_DEVICE_OUT_USB_HEADSET)) && in check_and_route_playback_usecases()
1176 platform_check_backends_match(snd_device, usecase->out_snd_device))) { in check_and_route_playback_usecases()
1178 __func__, use_case_table[usecase->id], in check_and_route_playback_usecases()
1179 platform_get_snd_device_name(usecase->out_snd_device)); in check_and_route_playback_usecases()
1180 disable_audio_route(adev, usecase); in check_and_route_playback_usecases()
1181 switch_device[usecase->id] = true; in check_and_route_playback_usecases()
1188 usecase = node_to_item(node, struct audio_usecase, list); in check_and_route_playback_usecases()
1189 if (switch_device[usecase->id]) { in check_and_route_playback_usecases()
1190 disable_snd_device(adev, usecase->out_snd_device); in check_and_route_playback_usecases()
1196 usecase = node_to_item(node, struct audio_usecase, list); in check_and_route_playback_usecases()
1197 if (switch_device[usecase->id]) { in check_and_route_playback_usecases()
1198 d_device = derive_playback_snd_device(usecase, uc_info, in check_and_route_playback_usecases()
1202 usecase->out_snd_device = d_device; in check_and_route_playback_usecases()
1209 usecase = node_to_item(node, struct audio_usecase, list); in check_and_route_playback_usecases()
1210 if (switch_device[usecase->id] ) { in check_and_route_playback_usecases()
1211 enable_audio_route(adev, usecase); in check_and_route_playback_usecases()
1222 struct audio_usecase *usecase; in check_and_route_capture_usecases() local
1242 usecase = node_to_item(node, struct audio_usecase, list); in check_and_route_capture_usecases()
1243 if (usecase->type != PCM_PLAYBACK && in check_and_route_capture_usecases()
1244 usecase != uc_info && in check_and_route_capture_usecases()
1245 usecase->in_snd_device != snd_device && in check_and_route_capture_usecases()
1247 usecase->devices == AUDIO_DEVICE_IN_VOICE_CALL) || in check_and_route_capture_usecases()
1249 usecase->in_snd_device)) && in check_and_route_capture_usecases()
1250 (usecase->id != USECASE_AUDIO_SPKR_CALIB_TX)) { in check_and_route_capture_usecases()
1252 __func__, use_case_table[usecase->id], in check_and_route_capture_usecases()
1253 platform_get_snd_device_name(usecase->in_snd_device)); in check_and_route_capture_usecases()
1254 disable_audio_route(adev, usecase); in check_and_route_capture_usecases()
1255 switch_device[usecase->id] = true; in check_and_route_capture_usecases()
1262 usecase = node_to_item(node, struct audio_usecase, list); in check_and_route_capture_usecases()
1263 if (switch_device[usecase->id]) { in check_and_route_capture_usecases()
1264 disable_snd_device(adev, usecase->in_snd_device); in check_and_route_capture_usecases()
1269 usecase = node_to_item(node, struct audio_usecase, list); in check_and_route_capture_usecases()
1270 if (switch_device[usecase->id]) { in check_and_route_capture_usecases()
1278 usecase = node_to_item(node, struct audio_usecase, list); in check_and_route_capture_usecases()
1280 if (switch_device[usecase->id] ) { in check_and_route_capture_usecases()
1281 usecase->in_snd_device = snd_device; in check_and_route_capture_usecases()
1282 enable_audio_route(adev, usecase); in check_and_route_capture_usecases()
1457 struct audio_usecase *usecase; in get_voice_usecase_id_from_list() local
1461 usecase = node_to_item(node, struct audio_usecase, list); in get_voice_usecase_id_from_list()
1462 if (usecase->type == VOICE_CALL) { in get_voice_usecase_id_from_list()
1463 ALOGV("%s: usecase id %d", __func__, usecase->id); in get_voice_usecase_id_from_list()
1464 return usecase->id; in get_voice_usecase_id_from_list()
1473 struct audio_usecase *usecase; in get_usecase_from_list() local
1477 usecase = node_to_item(node, struct audio_usecase, list); in get_usecase_from_list()
1478 if (usecase->id == uc_id) in get_usecase_from_list()
1479 return usecase; in get_usecase_from_list()
1484 static bool force_device_switch(struct audio_usecase *usecase) in force_device_switch() argument
1486 if (usecase->type == PCM_CAPTURE || usecase->stream.out == NULL) { in force_device_switch()
1493 if ((usecase->stream.out->devices & AUDIO_DEVICE_OUT_ALL_A2DP) && in force_device_switch()
1511 struct audio_usecase *usecase = node_to_item(node, struct audio_usecase, list); in adev_get_active_input() local
1512 if (usecase->type == PCM_CAPTURE && usecase->stream.in != NULL) { in adev_get_active_input()
1513 last_active_in = usecase->stream.in; in adev_get_active_input()
1528 struct audio_usecase *usecase = node_to_item(node, struct audio_usecase, list); in get_voice_communication_input() local
1529 if (usecase->type == PCM_CAPTURE && usecase->stream.in != NULL && in get_voice_communication_input()
1530 usecase->stream.in->source == AUDIO_SOURCE_VOICE_COMMUNICATION) { in get_voice_communication_input()
1531 return usecase->stream.in; in get_voice_communication_input()
1573 struct audio_usecase *usecase; in get_priority_input() local
1579 usecase = node_to_item(node, struct audio_usecase, list); in get_priority_input()
1580 if (usecase->type == PCM_CAPTURE) { in get_priority_input()
1581 in = usecase->stream.in; in get_priority_input()
1601 struct audio_usecase *usecase = NULL; in select_devices_with_force_switch() local
1610 usecase = get_usecase_from_list(adev, uc_id); in select_devices_with_force_switch()
1611 if (usecase == NULL) { in select_devices_with_force_switch()
1616 if ((usecase->type == VOICE_CALL) || in select_devices_with_force_switch()
1617 (usecase->type == PCM_HFP_CALL)) { in select_devices_with_force_switch()
1619 usecase->stream.out->devices); in select_devices_with_force_switch()
1622 usecase->stream.out->devices); in select_devices_with_force_switch()
1623 usecase->devices = usecase->stream.out->devices; in select_devices_with_force_switch()
1638 (usecase->devices == AUDIO_DEVICE_IN_VOICE_CALL))) { in select_devices_with_force_switch()
1650 if (usecase->type == PCM_PLAYBACK) { in select_devices_with_force_switch()
1651 usecase->devices = usecase->stream.out->devices; in select_devices_with_force_switch()
1658 usecase->stream.out->devices); in select_devices_with_force_switch()
1663 if (usecase->stream.out == voip_out && voip_in != NULL) { in select_devices_with_force_switch()
1664 select_devices(adev, voip_in->usecase); in select_devices_with_force_switch()
1667 } else if (usecase->type == PCM_CAPTURE) { in select_devices_with_force_switch()
1668 usecase->devices = usecase->stream.in->device; in select_devices_with_force_switch()
1679 usecase->stream.in->enable_ec_port = false; in select_devices_with_force_switch()
1681 if (usecase->id == USECASE_AUDIO_RECORD_AFE_PROXY) { in select_devices_with_force_switch()
1699 priority_in = usecase->stream.in; in select_devices_with_force_switch()
1709 if (out_snd_device == usecase->out_snd_device && in select_devices_with_force_switch()
1710 in_snd_device == usecase->in_snd_device) { in select_devices_with_force_switch()
1711 if (!force_device_switch(usecase) && !force_switch) in select_devices_with_force_switch()
1730 if (usecase->id == USECASE_INCALL_MUSIC_UPLINK || in select_devices_with_force_switch()
1731 usecase->id == USECASE_INCALL_MUSIC_UPLINK2) { in select_devices_with_force_switch()
1771 if ((usecase->type == VOICE_CALL) && in select_devices_with_force_switch()
1772 (usecase->in_snd_device != SND_DEVICE_NONE) && in select_devices_with_force_switch()
1773 (usecase->out_snd_device != SND_DEVICE_NONE)) { in select_devices_with_force_switch()
1777 voice_set_sidetone(adev, usecase->out_snd_device, false); in select_devices_with_force_switch()
1781 if (usecase->out_snd_device != SND_DEVICE_NONE) { in select_devices_with_force_switch()
1782 disable_audio_route(adev, usecase); in select_devices_with_force_switch()
1783 disable_snd_device(adev, usecase->out_snd_device); in select_devices_with_force_switch()
1786 if (usecase->in_snd_device != SND_DEVICE_NONE) { in select_devices_with_force_switch()
1787 disable_audio_route(adev, usecase); in select_devices_with_force_switch()
1788 disable_snd_device(adev, usecase->in_snd_device); in select_devices_with_force_switch()
1795 if ((usecase->type == VOICE_CALL) && in select_devices_with_force_switch()
1796 (usecase->in_snd_device != SND_DEVICE_NONE) && in select_devices_with_force_switch()
1797 (usecase->out_snd_device != SND_DEVICE_NONE)) { in select_devices_with_force_switch()
1805 if ((usecase->devices & AUDIO_DEVICE_OUT_ALL_CODEC_BACKEND) || in select_devices_with_force_switch()
1806 (usecase->devices & (AUDIO_DEVICE_OUT_USB_DEVICE|AUDIO_DEVICE_OUT_USB_HEADSET)) || in select_devices_with_force_switch()
1807 (usecase->devices & AUDIO_DEVICE_OUT_ALL_A2DP)) in select_devices_with_force_switch()
1808 check_and_route_playback_usecases(adev, usecase, out_snd_device); in select_devices_with_force_switch()
1813 check_and_route_capture_usecases(adev, usecase, in_snd_device); in select_devices_with_force_switch()
1817 if (usecase->type == VOICE_CALL) in select_devices_with_force_switch()
1822 usecase->in_snd_device = in_snd_device; in select_devices_with_force_switch()
1823 usecase->out_snd_device = out_snd_device; in select_devices_with_force_switch()
1827 enable_audio_route(adev, usecase); in select_devices_with_force_switch()
1838 if (usecase->type == VOICE_CALL) { in select_devices_with_force_switch()
1847 if (usecase->type != PCM_CAPTURE && voip_usecase) { in select_devices_with_force_switch()
1870 in->usecase, use_case_table[in->usecase]); in stop_input_stream()
1872 uc_info = get_usecase_from_list(adev, in->usecase); in stop_input_stream()
1875 __func__, in->usecase); in stop_input_stream()
1896 select_devices(adev, priority_in->usecase); in stop_input_stream()
1910 ALOGV("%s: enter: usecase(%d)", __func__, in->usecase); in start_input_stream()
1927 ALOGV("%s: usecase(%d)", __func__, in->usecase); in start_input_stream()
1929 in->pcm_device_id = platform_get_pcm_device_id(in->usecase, PCM_CAPTURE); in start_input_stream()
1932 __func__, in->usecase); in start_input_stream()
1938 uc_info->id = in->usecase; in start_input_stream()
1950 select_devices(adev, in->usecase); in start_input_stream()
1952 if (in->usecase == USECASE_AUDIO_RECORD_MMAP) { in start_input_stream()
1966 if (in->usecase == USECASE_AUDIO_RECORD_AFE_PROXY) { in start_input_stream()
2197 struct audio_usecase *usecase; in allow_hdmi_channel_config() local
2201 usecase = node_to_item(node, struct audio_usecase, list); in allow_hdmi_channel_config()
2202 if (usecase->devices & AUDIO_DEVICE_OUT_AUX_DIGITAL) { in allow_hdmi_channel_config()
2209 if (usecase->id == USECASE_VOICE_CALL) { in allow_hdmi_channel_config()
2214 } else if (usecase->id == USECASE_AUDIO_PLAYBACK_HIFI) { in allow_hdmi_channel_config()
2229 struct audio_usecase *usecase; in check_and_set_hdmi_channels() local
2249 usecase = node_to_item(node, struct audio_usecase, list); in check_and_set_hdmi_channels()
2250 if (usecase->type == PCM_PLAYBACK && in check_and_set_hdmi_channels()
2251 usecase->devices & AUDIO_DEVICE_OUT_AUX_DIGITAL) { in check_and_set_hdmi_channels()
2252 disable_audio_route(adev, usecase); in check_and_set_hdmi_channels()
2261 usecase = node_to_item(node, struct audio_usecase, list); in check_and_set_hdmi_channels()
2262 if (usecase->type == PCM_PLAYBACK && in check_and_set_hdmi_channels()
2263 usecase->devices & AUDIO_DEVICE_OUT_AUX_DIGITAL) { in check_and_set_hdmi_channels()
2264 enable_audio_route(adev, usecase); in check_and_set_hdmi_channels()
2276 struct audio_usecase *usecase; in check_and_set_usb_service_interval() local
2286 usecase = node_to_item(node, struct audio_usecase, list); in check_and_set_usb_service_interval()
2287 if (usecase->type == PCM_PLAYBACK && in check_and_set_usb_service_interval()
2288 (audio_is_usb_out_device(usecase->devices & AUDIO_DEVICE_OUT_ALL_USB))) { in check_and_set_usb_service_interval()
2289 switch (usecase->id) { in check_and_set_usb_service_interval()
2326 out->usecase, use_case_table[out->usecase]); in stop_output_stream()
2327 uc_info = get_usecase_from_list(adev, out->usecase); in stop_output_stream()
2330 __func__, out->usecase); in stop_output_stream()
2334 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) { in stop_output_stream()
2339 } else if (out->usecase == USECASE_AUDIO_PLAYBACK_ULL || in stop_output_stream()
2340 out->usecase == USECASE_AUDIO_PLAYBACK_MMAP) { in stop_output_stream()
2344 if (out->usecase == USECASE_INCALL_MUSIC_UPLINK || in stop_output_stream()
2345 out->usecase == USECASE_INCALL_MUSIC_UPLINK2) { in stop_output_stream()
2375 if (out->usecase == USECASE_AUDIO_PLAYBACK_VOIP || in stop_output_stream()
2378 struct audio_usecase *usecase; in stop_output_stream() local
2380 usecase = node_to_item(node, struct audio_usecase, list); in stop_output_stream()
2381 if ((usecase->type == PCM_CAPTURE && in stop_output_stream()
2382 usecase->id != USECASE_AUDIO_RECORD_VOIP) in stop_output_stream()
2383 || usecase == uc_info) in stop_output_stream()
2387 __func__, usecase->id, use_case_table[usecase->id], in stop_output_stream()
2388 out->usecase, use_case_table[out->usecase]); in stop_output_stream()
2389 select_devices(adev, usecase->id); in stop_output_stream()
2441 __func__, out->usecase, use_case_table[out->usecase], in start_output_stream()
2442 out->usecase == USECASE_AUDIO_PLAYBACK_WITH_HAPTICS ? "(with haptics)" : "", in start_output_stream()
2475 out->pcm_device_id = platform_get_pcm_device_id(out->usecase, PCM_PLAYBACK); in start_output_stream()
2478 __func__, out->pcm_device_id, out->usecase); in start_output_stream()
2484 uc_info->id = out->usecase; in start_output_stream()
2515 select_devices(adev, out->usecase); in start_output_stream()
2519 select_devices(adev, out->usecase); in start_output_stream()
2524 if (out->usecase == USECASE_INCALL_MUSIC_UPLINK || in start_output_stream()
2525 out->usecase == USECASE_INCALL_MUSIC_UPLINK2) { in start_output_stream()
2531 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) { in start_output_stream()
2554 } else if (out->usecase == USECASE_AUDIO_PLAYBACK_MMAP) { in start_output_stream()
2568 if (out->usecase == USECASE_AUDIO_PLAYBACK_AFE_PROXY) { in start_output_stream()
2583 if (out->usecase == USECASE_AUDIO_PLAYBACK_WITH_HAPTICS) { in start_output_stream()
2612 if (out->usecase == USECASE_AUDIO_PLAYBACK_ULL || in start_output_stream()
2613 out->usecase == USECASE_AUDIO_PLAYBACK_MMAP) { in start_output_stream()
2762 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) { in out_get_buffer_size()
2800 if (out->usecase != USECASE_AUDIO_PLAYBACK_OFFLOAD) { in out_standby_l()
2805 if (out->usecase == USECASE_AUDIO_PLAYBACK_WITH_HAPTICS) { in out_standby_l()
2818 if (out->usecase == USECASE_AUDIO_PLAYBACK_MMAP) { in out_standby_l()
2852 out->usecase, use_case_table[out->usecase]); in out_standby()
2869 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) { in out_on_error()
2964 struct audio_usecase *usecase; in out_set_parameters() local
2974 __func__, out->usecase, use_case_table[out->usecase], kvpairs); in out_set_parameters()
2988 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) { in out_set_parameters()
3106 select_devices(adev, out->usecase); in out_set_parameters()
3112 select_devices(adev, out->usecase); in out_set_parameters()
3143 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) { in out_set_parameters()
3281 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) in out_get_latency()
3284 (out->usecase == USECASE_AUDIO_PLAYBACK_MMAP)) { in out_get_latency()
3289 hw_delay = platform_render_latency(out->usecase)/1000; in out_get_latency()
3310 int pcm_device_id = platform_get_pcm_device_id(out->usecase, in set_compr_volume()
3336 if (out->usecase == USECASE_AUDIO_PLAYBACK_HIFI) { in out_set_volume()
3340 } else if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) { in out_set_volume()
3349 } else if (out->usecase == USECASE_AUDIO_PLAYBACK_VOIP) { in out_set_volume()
3392 use_case_table[out->usecase], in out_snd_mon_cb()
3432 if (out->usecase == USECASE_AUDIO_PLAYBACK_MMAP) { in out_write()
3474 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) { in out_write()
3530 if (out->usecase == USECASE_AUDIO_PLAYBACK_VOIP || in out_write()
3531 out->usecase == USECASE_INCALL_MUSIC_UPLINK || in out_write()
3532 out->usecase == USECASE_INCALL_MUSIC_UPLINK2) { in out_write()
3573 bool use_mmap = is_mmap_usecase(out->usecase) || out->realtime; in out_write()
3577 if (out->usecase == USECASE_AUDIO_PLAYBACK_WITH_HAPTICS) { in out_write()
3653 if (out->usecase != USECASE_AUDIO_PLAYBACK_OFFLOAD) { in out_write()
3660 if (out->usecase != USECASE_AUDIO_PLAYBACK_OFFLOAD) { in out_write()
3683 if ((out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) && (dsp_frames != NULL)) { in out_get_render_position()
3726 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) { in out_get_presentation_position()
3773 (platform_render_latency(out->usecase) * out->sample_rate / 1000000LL); in out_get_presentation_position()
3814 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) { in out_pause()
3831 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) { in out_resume()
3848 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) { in out_drain()
3863 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) { in out_flush()
3880 if (out->usecase == USECASE_AUDIO_PLAYBACK_MMAP && !out->standby && in out_stop()
3898 if (out->usecase == USECASE_AUDIO_PLAYBACK_MMAP && !out->standby && in out_start()
3962 if (out->usecase != USECASE_AUDIO_PLAYBACK_MMAP || !out->standby) { in out_create_mmap_buffer()
3963 ALOGE("%s: usecase = %d, standby = %d", __func__, out->usecase, out->standby); in out_create_mmap_buffer()
3967 out->pcm_device_id = platform_get_pcm_device_id(out->usecase, PCM_PLAYBACK); in out_create_mmap_buffer()
3970 __func__, out->pcm_device_id, out->usecase); in out_create_mmap_buffer()
4053 if (out->usecase != USECASE_AUDIO_PLAYBACK_MMAP || in out_get_mmap_position()
4135 if (in->usecase == USECASE_AUDIO_RECORD_MMAP) { in in_standby()
4245 select_devices(adev, in->usecase); in in_set_parameters()
4299 if (in->usecase != USECASE_AUDIO_RECORD_MMAP) in in_set_gain()
4347 use_case_table[in->usecase], in in_snd_mon_cb()
4379 if (in->usecase == USECASE_AUDIO_RECORD_MMAP) { in in_read()
4408 bool use_mmap = is_mmap_usecase(in->usecase) || in->realtime; in in_read()
4443 in->usecase != USECASE_AUDIO_RECORD_AFE_PROXY) { in in_read()
4580 struct audio_usecase *usecase; in add_remove_audio_effect() local
4583 usecase = node_to_item(node, struct audio_usecase, list); in add_remove_audio_effect()
4584 if (usecase->type == PCM_PLAYBACK) in add_remove_audio_effect()
4585 select_devices(adev, usecase->id); in add_remove_audio_effect()
4590 select_devices(in->dev, in->usecase); in add_remove_audio_effect()
4604 select_devices(in->dev, in->usecase); in add_remove_audio_effect()
4636 if (in->usecase == USECASE_AUDIO_RECORD_MMAP && !in->standby && in in_stop()
4654 if (in->usecase == USECASE_AUDIO_RECORD_MMAP && !in->standby && in in_start()
4700 if (in->usecase != USECASE_AUDIO_RECORD_MMAP || !in->standby) { in in_create_mmap_buffer()
4701 ALOGE("%s: usecase = %d, standby = %d", __func__, in->usecase, in->standby); in in_create_mmap_buffer()
4706 in->pcm_device_id = platform_get_pcm_device_id(in->usecase, PCM_CAPTURE); in in_create_mmap_buffer()
4709 __func__, in->pcm_device_id, in->usecase); in in_create_mmap_buffer()
4794 if (in->usecase != USECASE_AUDIO_RECORD_MMAP || in in_get_mmap_position()
4824 in->usecase, mic_array, mic_count); in in_get_active_microphones()
4893 ALOGV("%s: in->usecase: %d, device: %x", __func__, in->usecase, device); in in_update_sink_metadata()
4895 if (in->usecase == USECASE_AUDIO_RECORD_AFE_PROXY in in_update_sink_metadata()
5008 out->usecase = USECASE_AUDIO_PLAYBACK_HIFI; in adev_open_output_stream()
5011 out->usecase = USECASE_AUDIO_PLAYBACK_MMAP; in adev_open_output_stream()
5018 out->usecase = USECASE_AUDIO_PLAYBACK_HIFI; in adev_open_output_stream()
5065 out->usecase = USECASE_AUDIO_PLAYBACK_OFFLOAD; in adev_open_output_stream()
5185 out->usecase = USECASE_AUDIO_PLAYBACK_AFE_PROXY; in adev_open_output_stream()
5243 out->usecase = USECASE_AUDIO_PLAYBACK_VOIP; in adev_open_output_stream()
5258 out->usecase = USECASE_AUDIO_PLAYBACK_DEEP_BUFFER; in adev_open_output_stream()
5261 out->usecase = USECASE_AUDIO_PLAYBACK_TTS; in adev_open_output_stream()
5264 out->usecase = USECASE_AUDIO_PLAYBACK_ULL; in adev_open_output_stream()
5268 out->usecase = USECASE_AUDIO_PLAYBACK_MMAP; in adev_open_output_stream()
5276 out->usecase = USECASE_AUDIO_PLAYBACK_WITH_HAPTICS; in adev_open_output_stream()
5280 __func__, adev->haptic_pcm_device_id, out->usecase); in adev_open_output_stream()
5290 out->usecase = USECASE_AUDIO_PLAYBACK_LOW_LATENCY; in adev_open_output_stream()
5355 __func__, use_case_table[out->usecase], config->format, out->config.format); in adev_open_output_stream()
5369 if (get_usecase_from_list(adev, out->usecase) != NULL) { in adev_open_output_stream()
5370 ALOGE("%s: Usecase (%d) is already present", __func__, out->usecase); in adev_open_output_stream()
5465 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) { in adev_close_output_stream()
5614 struct audio_usecase *usecase; in adev_set_parameters() local
5617 usecase = node_to_item(node, struct audio_usecase, list); in adev_set_parameters()
5618 if ((usecase->type == PCM_PLAYBACK) && in adev_set_parameters()
5619 (usecase->devices & AUDIO_DEVICE_OUT_ALL_A2DP)) { in adev_set_parameters()
5623 lock_output_stream(usecase->stream.out); in adev_set_parameters()
5627 select_devices(adev, usecase->id); in adev_set_parameters()
5629 pthread_mutex_unlock(&usecase->stream.out->lock); in adev_set_parameters()
5649 struct audio_usecase *usecase; in adev_set_parameters() local
5652 usecase = node_to_item(node, struct audio_usecase, list); in adev_set_parameters()
5653 struct stream_in *in = usecase->stream.in; in adev_set_parameters()
5654 if (usecase->type == PCM_CAPTURE && in != NULL && in adev_set_parameters()
5656 select_devices(adev, in->usecase); in adev_set_parameters()
5747 struct audio_usecase *usecase; in adev_set_mode() local
5750 usecase = node_to_item(node, struct audio_usecase, list); in adev_set_mode()
5751 if (usecase->type == PCM_CAPTURE && usecase->stream.in != NULL) { in adev_set_mode()
5752 select_devices_with_force_switch(adev, usecase->id, true); in adev_set_mode()
6004 in->usecase = USECASE_AUDIO_RECORD_AFE_PROXY; in adev_open_input_stream()
6008 in->usecase = USECASE_AUDIO_RECORD_HIFI; in adev_open_input_stream()
6021 in->usecase = USECASE_AUDIO_RECORD; in adev_open_input_stream()
6026 in->usecase = USECASE_AUDIO_RECORD_LOW_LATENCY; in adev_open_input_stream()
6028 in->realtime = may_use_noirq_mode(adev, in->usecase, in->flags); in adev_open_input_stream()
6048 in->usecase = USECASE_AUDIO_RECORD_MMAP; in adev_open_input_stream()
6063 in->usecase = USECASE_AUDIO_RECORD_VOIP; in adev_open_input_stream()
6369 uc_info = get_usecase_from_list(adev, out->usecase); in check_a2dp_restore_l()
6372 __func__, out->usecase); in check_a2dp_restore_l()
6377 out->usecase, use_case_table[out->usecase]); in check_a2dp_restore_l()
6408 select_devices(adev, out->usecase); in check_a2dp_restore_l()