Home | History | Annotate | Download | only in hal

Lines Matching refs:usecase

347     if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD)
551 struct audio_usecase *usecase)
556 if (usecase == NULL)
559 ALOGV("%s: enter: usecase(%d)", __func__, usecase->id);
561 if (usecase->type == PCM_CAPTURE)
562 snd_device = usecase->in_snd_device;
564 snd_device = usecase->out_snd_device;
566 audio_extn_utils_send_app_type_cfg(adev, usecase);
567 audio_extn_utils_send_audio_calibration(adev, usecase);
568 strcpy(mixer_path, use_case_table[usecase->id]);
570 ALOGD("%s: usecase(%d) apply and update mixer path: %s", __func__, usecase->id, mixer_path);
578 struct audio_usecase *usecase)
583 if (usecase == NULL)
586 ALOGV("%s: enter: usecase(%d)", __func__, usecase->id);
587 if (usecase->type == PCM_CAPTURE)
588 snd_device = usecase->in_snd_device;
590 snd_device = usecase->out_snd_device;
591 strcpy(mixer_path, use_case_table[usecase->id]);
593 ALOGD("%s: usecase(%d) reset and update mixer path: %s", __func__, usecase->id, mixer_path);
694 // will be renabled on usecase start
723 uc - existing usecase
724 new_uc - new usecase
807 // NB: case 7 is hypothetical and isn't a practical usecase yet.
809 // the combo devices active on the existing usecase share a backend.
810 // This is because we cannot have a usecase active on a combo device
811 // and a new usecase requests one device in this combo pair.
834 struct audio_usecase *usecase;
853 specified usecase */
858 usecase = node_to_item(node, struct audio_usecase, list);
859 if (usecase->type == PCM_CAPTURE || usecase == uc_info)
863 (usecase->out_snd_device != snd_device &&
864 (usecase->devices & AUDIO_DEVICE_OUT_ALL_CODEC_BACKEND ||
865 usecase->devices & (AUDIO_DEVICE_OUT_USB_DEVICE|AUDIO_DEVICE_OUT_USB_HEADSET)) &&
866 platform_check_backends_match(snd_device, usecase->out_snd_device))) {
867 ALOGV("%s: Usecase (%s) is active on (%s) - disabling ..",
868 __func__, use_case_table[usecase->id],
869 platform_get_snd_device_name(usecase->out_snd_device));
870 disable_audio_route(adev, usecase);
871 switch_device[usecase->id] = true;
878 usecase = node_to_item(node, struct audio_usecase, list);
879 if (switch_device[usecase->id]) {
880 disable_snd_device(adev, usecase->out_snd_device);
886 usecase = node_to_item(node, struct audio_usecase, list);
887 if (switch_device[usecase->id]) {
888 d_device = derive_playback_snd_device(usecase, uc_info,
892 usecase->out_snd_device = d_device;
897 specified usecase to new snd devices */
899 usecase = node_to_item(node, struct audio_usecase, list);
900 if (switch_device[usecase->id] ) {
901 enable_audio_route(adev, usecase);
912 struct audio_usecase *usecase;
924 * usecase is also switched to earpiece i.e. voice-dmic-ef,
932 usecase = node_to_item(node, struct audio_usecase, list);
933 if (usecase->type != PCM_PLAYBACK &&
934 usecase != uc_info &&
935 usecase->in_snd_device != snd_device &&
936 (usecase->id != USECASE_AUDIO_SPKR_CALIB_TX)) {
937 ALOGV("%s: Usecase (%s) is active on (%s) - disabling ..",
938 __func__, use_case_table[usecase->id],
939 platform_get_snd_device_name(usecase->in_snd_device));
940 disable_audio_route(adev, usecase);
941 switch_device[usecase->id] = true;
948 usecase = node_to_item(node, struct audio_usecase, list);
949 if (switch_device[usecase->id]) {
950 disable_snd_device(adev, usecase->in_snd_device);
955 usecase = node_to_item(node, struct audio_usecase, list);
956 if (switch_device[usecase->id]) {
962 specified usecase to new snd devices */
964 usecase = node_to_item(node, struct audio_usecase, list);
966 if (switch_device[usecase->id] ) {
967 usecase->in_snd_device = snd_device;
968 enable_audio_route(adev, usecase);
1132 struct audio_usecase *usecase;
1136 usecase = node_to_item(node, struct audio_usecase, list);
1137 if (usecase->type == VOICE_CALL) {
1138 ALOGV("%s: usecase id %d", __func__, usecase->id);
1139 return usecase->id;
1148 struct audio_usecase *usecase;
1152 usecase = node_to_item(node, struct audio_usecase, list);
1153 if (usecase->id == uc_id)
1154 return usecase;
1164 struct audio_usecase *usecase = NULL;
1173 usecase = get_usecase_from_list(adev, uc_id);
1174 if (usecase == NULL) {
1175 ALOGE("%s: Could not find the usecase(%d)", __func__, uc_id);
1179 if ((usecase->type == VOICE_CALL) ||
1180 (usecase->type == PCM_HFP_CALL)) {
1182 usecase->stream.out->devices);
1183 in_snd_device = platform_get_input_snd_device(adev->platform, usecase->stream.out->devices);
1184 usecase->devices = usecase->stream.out->devices;
1187 * If the voice call is active, use the sound devices of voice call usecase
1190 * usecase. This is to avoid switching devices for voice call when
1198 (usecase->devices == AUDIO_DEVICE_IN_VOICE_CALL))) {
1210 if (usecase->type == PCM_PLAYBACK) {
1211 usecase->devices = usecase->stream.out->devices;
1217 usecase->stream.out->devices);
1222 if (usecase->stream.out == voip_out &&
1226 select_devices(adev, adev->active_input->usecase);
1229 } else if (usecase->type == PCM_CAPTURE) {
1230 usecase->devices = usecase->stream.in->device;
1242 if (usecase->id == USECASE_AUDIO_RECORD_AFE_PROXY) {
1255 if (out_snd_device == usecase->out_snd_device &&
1256 in_snd_device == usecase->in_snd_device) {
1296 if ((usecase->type == VOICE_CALL) &&
1297 (usecase->in_snd_device != SND_DEVICE_NONE) &&
1298 (usecase->out_snd_device != SND_DEVICE_NONE)) {
1302 voice_set_sidetone(adev, usecase->out_snd_device, false);
1306 if (usecase->out_snd_device != SND_DEVICE_NONE) {
1307 disable_audio_route(adev, usecase);
1308 disable_snd_device(adev, usecase->out_snd_device);
1311 if (usecase->in_snd_device != SND_DEVICE_NONE) {
1312 disable_audio_route(adev, usecase);
1313 disable_snd_device(adev, usecase->in_snd_device);
1320 if ((usecase->type == VOICE_CALL) &&
1321 (usecase->in_snd_device != SND_DEVICE_NONE) &&
1322 (usecase->out_snd_device != SND_DEVICE_NONE)) {
1330 if ((usecase->devices & AUDIO_DEVICE_OUT_ALL_CODEC_BACKEND) ||
1331 (usecase->devices & (AUDIO_DEVICE_OUT_USB_DEVICE|AUDIO_DEVICE_OUT_USB_HEADSET)))
1332 check_and_route_playback_usecases(adev, usecase, out_snd_device);
1337 check_and_route_capture_usecases(adev, usecase, in_snd_device);
1341 if (usecase->type == VOICE_CALL)
1346 usecase->in_snd_device = in_snd_device;
1347 usecase->out_snd_device = out_snd_device;
1351 enable_audio_route(adev, usecase);
1357 if (usecase->type == VOICE_CALL) {
1366 if (usecase == voip_usecase) {
1381 ALOGV("%s: enter: usecase(%d: %s)", __func__,
1382 in->usecase, use_case_table[in->usecase]);
1385 if (adev->active_input->usecase == in->usecase) {
1388 ALOGW("%s adev->active_input->usecase %s, v/s in->usecase %s",
1390 use_case_table[adev->active_input->usecase],
1391 use_case_table[in->usecase]);
1395 uc_info = get_usecase_from_list(adev, in->usecase);
1397 ALOGE("%s: Could not find the usecase (%d) in the list",
1398 __func__, in->usecase);
1425 ALOGV("%s: enter: usecase(%d)", __func__, in->usecase);
1437 /* Check if source matches incall recording usecase criteria */
1442 ALOGV("%s: usecase(%d)", __func__, in->usecase);
1444 in->pcm_device_id = platform_get_pcm_device_id(in->usecase, PCM_CAPTURE);
1446 ALOGE("%s: Could not find PCM device id for the usecase(%d)",
1447 __func__, in->usecase);
1454 uc_info->id = in->usecase;
1465 select_devices(adev, in->usecase);
1467 if (in->usecase == USECASE_AUDIO_RECORD_MMAP) {
1481 if (in->usecase == USECASE_AUDIO_RECORD_AFE_PROXY) {
1708 struct audio_usecase *usecase;
1712 usecase = node_to_item(node, struct audio_usecase, list);
1713 if (usecase->devices & AUDIO_DEVICE_OUT_AUX_DIGITAL) {
1720 if (usecase->id == USECASE_VOICE_CALL) {
1725 } else if (usecase->id == USECASE_AUDIO_PLAYBACK_HIFI) {
1740 struct audio_usecase *usecase;
1760 usecase = node_to_item(node, struct audio_usecase, list);
1761 if (usecase->type == PCM_PLAYBACK &&
1762 usecase->devices & AUDIO_DEVICE_OUT_AUX_DIGITAL) {
1763 disable_audio_route(adev, usecase);
1772 usecase = node_to_item(node, struct audio_usecase, list);
1773 if (usecase->type == PCM_PLAYBACK &&
1774 usecase->devices & AUDIO_DEVICE_OUT_AUX_DIGITAL) {
1775 enable_audio_route(adev, usecase);
1788 ALOGV("%s: enter: usecase(%d: %s)", __func__,
1789 out->usecase, use_case_table[out->usecase]);
1790 uc_info = get_usecase_from_list(adev, out->usecase);
1792 ALOGE("%s: Could not find the usecase (%d) in the list",
1793 __func__, out->usecase);
1797 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) {
1815 /* Must be called after removing the usecase from list */
1820 struct audio_usecase *usecase;
1822 usecase = node_to_item(node, struct audio_usecase, list);
1823 if (usecase->devices & AUDIO_DEVICE_OUT_SPEAKER)
1824 select_devices(adev, usecase->id);
1838 ALOGV("%s: enter: usecase(%d: %s) devices(%#x)",
1839 __func__, out->usecase, use_case_table[out->usecase], out->devices);
1848 out->pcm_device_id = platform_get_pcm_device_id(out->usecase, PCM_PLAYBACK);
1850 ALOGE("%s: Invalid PCM device id(%d) for the usecase(%d)",
1851 __func__, out->pcm_device_id, out->usecase);
1857 uc_info->id = out->usecase;
1864 /* This must be called before adding this usecase to the list */
1872 select_devices(adev, out->usecase);
1878 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) {
1896 } else if (out->usecase == USECASE_AUDIO_PLAYBACK_MMAP) {
1910 if (out->usecase == USECASE_AUDIO_PLAYBACK_AFE_PROXY) {
2055 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) {
2093 if (out->usecase != USECASE_AUDIO_PLAYBACK_OFFLOAD) {
2098 if (out->usecase == USECASE_AUDIO_PLAYBACK_MMAP) {
2123 ALOGV("%s: enter: usecase(%d: %s)", __func__,
2124 out->usecase, use_case_table[out->usecase]);
2141 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) {
2227 struct audio_usecase *usecase;
2235 ALOGD("%s: enter: usecase(%d: %s) kvpairs: %s",
2236 __func__, out->usecase, use_case_table[out->usecase], kvpairs);
2248 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD && val == AUDIO_DEVICE_NONE &&
2288 * For example, music playback is active on headset (deep-buffer usecase)
2289 * and if we go to ringtones and select a ringtone, low-latency usecase
2292 * playback to headset+speaker while starting low-lateny usecase for ringtone.
2326 select_devices(adev, out->usecase);
2346 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) {
2483 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD)
2486 (out->usecase == USECASE_AUDIO_PLAYBACK_MMAP)) {
2491 hw_delay = platform_render_latency(out->usecase)/1000;
2505 if (out->usecase == USECASE_AUDIO_PLAYBACK_HIFI) {
2509 } else if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) {
2516 int pcm_device_id = platform_get_pcm_device_id(out->usecase,
2531 } else if (out->usecase == USECASE_AUDIO_PLAYBACK_VOIP) {
2573 ALOGW("out_snd_mon_cb for card %d usecase %s, status %s", card,
2574 use_case_table[out->usecase],
2614 if (out->usecase == USECASE_AUDIO_PLAYBACK_MMAP) {
2637 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) {
2686 if (out->usecase == USECASE_AUDIO_PLAYBACK_VOIP) {
2705 bool use_mmap = is_mmap_usecase(out->usecase) || out->realtime;
2719 if (out->usecase != USECASE_AUDIO_PLAYBACK_OFFLOAD) {
2726 if (out->usecase != USECASE_AUDIO_PLAYBACK_OFFLOAD) {
2749 if ((out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) && (dsp_frames != NULL)) {
2792 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) {
2813 (platform_render_latency(out->usecase) * out->sample_rate / 1000000LL);
2847 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) {
2863 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) {
2880 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) {
2895 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) {
2912 if (out->usecase == USECASE_AUDIO_PLAYBACK_MMAP && !out->standby &&
2930 if (out->usecase == USECASE_AUDIO_PLAYBACK_MMAP && !out->standby &&
2982 if (out->usecase != USECASE_AUDIO_PLAYBACK_MMAP || !out->standby) {
2983 ALOGE("%s: usecase = %d, standby = %d", __func__, out->usecase, out->standby);
2987 out->pcm_device_id = platform_get_pcm_device_id(out->usecase, PCM_PLAYBACK);
2989 ALOGE("%s: Invalid PCM device id(%d) for the usecase(%d)",
2990 __func__, out->pcm_device_id, out->usecase);
3065 if (out->usecase != USECASE_AUDIO_PLAYBACK_MMAP) {
3144 if (in->usecase == USECASE_AUDIO_RECORD_MMAP) {
3237 select_devices(adev, in->usecase);
3308 ALOGW("in_snd_mon_cb for card %d usecase %s, status %s", card,
3309 use_case_table[in->usecase],
3341 if (in->usecase == USECASE_AUDIO_RECORD_MMAP) {
3364 bool use_mmap = is_mmap_usecase(in->usecase) || in->realtime;
3397 if (ret == 0 && adev->mic_muted && in->usecase != USECASE_AUDIO_RECORD_AFE_PROXY) {
3473 struct audio_usecase *usecase;
3476 usecase = node_to_item(node, struct audio_usecase, list);
3477 if (usecase->type == PCM_PLAYBACK)
3478 select_devices(adev, usecase->id);
3482 select_devices(in->dev, in->usecase);
3488 select_devices(in->dev, in->usecase);
3518 if (in->usecase == USECASE_AUDIO_RECORD_MMAP && !in->standby &&
3536 if (in->usecase == USECASE_AUDIO_RECORD_MMAP && !in->standby &&
3570 if (in->usecase != USECASE_AUDIO_RECORD_MMAP || !in->standby) {
3571 ALOGE("%s: usecase = %d, standby = %d", __func__, in->usecase, in->standby);
3576 in->pcm_device_id = platform_get_pcm_device_id(in->usecase, PCM_CAPTURE);
3578 ALOGE("%s: Invalid PCM device id(%d) for the usecase(%d)",
3579 __func__, in->pcm_device_id, in->usecase);
3656 if (in->usecase != USECASE_AUDIO_RECORD_MMAP) {
3745 out->usecase = USECASE_AUDIO_PLAYBACK_HIFI;
3780 out->usecase = USECASE_AUDIO_PLAYBACK_OFFLOAD;
3824 out->usecase = USECASE_AUDIO_PLAYBACK_AFE_PROXY;
3830 out->usecase = USECASE_AUDIO_PLAYBACK_VOIP;
3845 out->usecase = USECASE_AUDIO_PLAYBACK_DEEP_BUFFER;
3848 out->usecase = USECASE_AUDIO_PLAYBACK_TTS;
3851 out->usecase = USECASE_AUDIO_PLAYBACK_ULL;
3855 out->usecase = USECASE_AUDIO_PLAYBACK_MMAP;
3862 out->usecase = USECASE_AUDIO_PLAYBACK_LOW_LATENCY;
3883 ALOGV("%s: Usecase(%s) config->format %#x out->config.format %#x\n",
3884 __func__, use_case_table[out->usecase], config->format, out->config.format);
3896 /* Check if this usecase is already existing */
3898 if (get_usecase_from_list(adev, out->usecase) != NULL) {
3899 ALOGE("%s: Usecase (%d) is already present", __func__, out->usecase);
3988 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) {
4417 in->usecase = USECASE_AUDIO_RECORD_AFE_PROXY;
4421 in->usecase = USECASE_AUDIO_RECORD_HIFI;
4434 in->usecase = USECASE_AUDIO_RECORD;
4439 in->usecase = USECASE_AUDIO_RECORD_LOW_LATENCY;
4441 in->realtime = may_use_noirq_mode(adev, in->usecase, in->flags);
4461 in->usecase = USECASE_AUDIO_RECORD_MMAP;
4476 in->usecase = USECASE_AUDIO_RECORD_VOIP;