Lines Matching refs:usecase
213 struct audio_usecase *usecase)
218 if (usecase == NULL)
221 ALOGV("%s: enter: usecase(%d)", __func__, usecase->id);
223 if (usecase->type == PCM_CAPTURE)
224 snd_device = usecase->in_snd_device;
226 snd_device = usecase->out_snd_device;
228 strcpy(mixer_path, use_case_table[usecase->id]);
238 struct audio_usecase *usecase)
243 if (usecase == NULL)
246 ALOGV("%s: enter: usecase(%d)", __func__, usecase->id);
247 if (usecase->type == PCM_CAPTURE)
248 snd_device = usecase->in_snd_device;
250 snd_device = usecase->out_snd_device;
251 strcpy(mixer_path, use_case_table[usecase->id]);
314 struct audio_usecase *usecase;
329 specified usecase */
334 usecase = node_to_item(node, struct audio_usecase, list);
335 if (usecase->type != PCM_CAPTURE &&
336 usecase != uc_info &&
337 usecase->out_snd_device != snd_device &&
338 usecase->devices & AUDIO_DEVICE_OUT_ALL_CODEC_BACKEND) {
339 ALOGV("%s: Usecase (%s) is active on (%s) - disabling ..",
340 __func__, use_case_table[usecase->id],
341 platform_get_snd_device_name(usecase->out_snd_device));
342 disable_audio_route(adev, usecase);
343 switch_device[usecase->id] = true;
350 usecase = node_to_item(node, struct audio_usecase, list);
351 if (switch_device[usecase->id]) {
352 disable_snd_device(adev, usecase->out_snd_device);
357 usecase = node_to_item(node, struct audio_usecase, list);
358 if (switch_device[usecase->id]) {
364 specified usecase to new snd devices */
366 usecase = node_to_item(node, struct audio_usecase, list);
368 if (switch_device[usecase->id] ) {
369 usecase->out_snd_device = snd_device;
370 enable_audio_route(adev, usecase);
381 struct audio_usecase *usecase;
391 * usecase is also switched to earpiece i.e. voice-dmic-ef,
399 usecase = node_to_item(node, struct audio_usecase, list);
400 if (usecase->type != PCM_PLAYBACK &&
401 usecase != uc_info &&
402 usecase->in_snd_device != snd_device) {
403 ALOGV("%s: Usecase (%s) is active on (%s) - disabling ..",
404 __func__, use_case_table[usecase->id],
405 platform_get_snd_device_name(usecase->in_snd_device));
406 disable_audio_route(adev, usecase);
407 switch_device[usecase->id] = true;
414 usecase = node_to_item(node, struct audio_usecase, list);
415 if (switch_device[usecase->id]) {
416 disable_snd_device(adev, usecase->in_snd_device);
421 usecase = node_to_item(node, struct audio_usecase, list);
422 if (switch_device[usecase->id]) {
428 specified usecase to new snd devices */
430 usecase = node_to_item(node, struct audio_usecase, list);
432 if (switch_device[usecase->id] ) {
433 usecase->in_snd_device = snd_device;
434 enable_audio_route(adev, usecase);
470 struct audio_usecase *usecase;
474 usecase = node_to_item(node, struct audio_usecase, list);
475 if (usecase->type == VOICE_CALL) {
476 ALOGV("%s: usecase id %d", __func__, usecase->id);
477 return usecase->id;
486 struct audio_usecase *usecase;
490 usecase = node_to_item(node, struct audio_usecase, list);
491 if (usecase->id == uc_id)
492 return usecase;
502 struct audio_usecase *usecase = NULL;
509 usecase = get_usecase_from_list(adev, uc_id);
510 if (usecase == NULL) {
511 ALOGE("%s: Could not find the usecase(%d)", __func__, uc_id);
515 if ((usecase->type == VOICE_CALL) ||
516 (usecase->type == PCM_HFP_CALL)) {
518 usecase->stream.out->devices);
519 in_snd_device = platform_get_input_snd_device(adev->platform, usecase->stream.out->devices);
520 usecase->devices = usecase->stream.out->devices;
523 * If the voice call is active, use the sound devices of voice call usecase
526 * usecase. This is to avoid switching devices for voice call when
534 (usecase->devices == AUDIO_DEVICE_IN_VOICE_CALL))) {
546 if (usecase->type == PCM_PLAYBACK) {
547 usecase->devices = usecase->stream.out->devices;
551 usecase->stream.out->devices);
552 if (usecase->stream.out == adev->primary_output &&
555 out_snd_device != usecase->out_snd_device) {
556 select_devices(adev, adev->active_input->usecase);
559 } else if (usecase->type == PCM_CAPTURE) {
560 usecase->devices = usecase->stream.in->device;
568 } else if (usecase->id == USECASE_AUDIO_RECORD_AFE_PROXY) {
576 if (out_snd_device == usecase->out_snd_device &&
577 in_snd_device == usecase->in_snd_device) {
590 if ((usecase->type == VOICE_CALL) &&
591 (usecase->in_snd_device != SND_DEVICE_NONE) &&
592 (usecase->out_snd_device != SND_DEVICE_NONE)) {
597 if (usecase->out_snd_device != SND_DEVICE_NONE) {
598 disable_audio_route(adev, usecase);
599 disable_snd_device(adev, usecase->out_snd_device);
602 if (usecase->in_snd_device != SND_DEVICE_NONE) {
603 disable_audio_route(adev, usecase);
604 disable_snd_device(adev, usecase->in_snd_device);
611 if ((usecase->type == VOICE_CALL) &&
612 (usecase->in_snd_device != SND_DEVICE_NONE) &&
613 (usecase->out_snd_device != SND_DEVICE_NONE)) {
621 if (usecase->devices & AUDIO_DEVICE_OUT_ALL_CODEC_BACKEND)
622 check_usecases_codec_backend(adev, usecase, out_snd_device);
627 check_and_route_capture_usecases(adev, usecase, in_snd_device);
631 if (usecase->type == VOICE_CALL)
636 usecase->in_snd_device = in_snd_device;
637 usecase->out_snd_device = out_snd_device;
639 enable_audio_route(adev, usecase);
645 if (usecase->type == VOICE_CALL)
661 ALOGV("%s: enter: usecase(%d: %s)", __func__,
662 in->usecase, use_case_table[in->usecase]);
663 uc_info = get_usecase_from_list(adev, in->usecase);
665 ALOGE("%s: Could not find the usecase (%d) in the list",
666 __func__, in->usecase);
690 ALOGV("%s: enter: usecase(%d)", __func__, in->usecase);
691 in->pcm_device_id = platform_get_pcm_device_id(in->usecase, PCM_CAPTURE);
693 ALOGE("%s: Could not find PCM device id for the usecase(%d)",
694 __func__, in->usecase);
701 uc_info->id = in->usecase;
709 select_devices(adev, in->usecase);
717 if (in->usecase == USECASE_AUDIO_RECORD_AFE_PROXY) {
899 struct audio_usecase *usecase;
903 usecase = node_to_item(node, struct audio_usecase, list);
904 if (usecase->devices & AUDIO_DEVICE_OUT_AUX_DIGITAL) {
911 if (usecase->id == USECASE_VOICE_CALL) {
916 } else if (usecase->id == USECASE_AUDIO_PLAYBACK_MULTI_CH) {
931 struct audio_usecase *usecase;
951 usecase = node_to_item(node, struct audio_usecase, list);
952 if (usecase->type == PCM_PLAYBACK &&
953 usecase->devices & AUDIO_DEVICE_OUT_AUX_DIGITAL) {
954 disable_audio_route(adev, usecase);
963 usecase = node_to_item(node, struct audio_usecase, list);
964 if (usecase->type == PCM_PLAYBACK &&
965 usecase->devices & AUDIO_DEVICE_OUT_AUX_DIGITAL) {
966 enable_audio_route(adev, usecase);
979 ALOGV("%s: enter: usecase(%d: %s)", __func__,
980 out->usecase, use_case_table[out->usecase]);
981 uc_info = get_usecase_from_list(adev, out->usecase);
983 ALOGE("%s: Could not find the usecase (%d) in the list",
984 __func__, out->usecase);
988 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) {
1006 /* Must be called after removing the usecase from list */
1020 ALOGV("%s: enter: usecase(%d: %s) devices(%#x)",
1021 __func__, out->usecase, use_case_table[out->usecase], out->devices);
1022 out->pcm_device_id = platform_get_pcm_device_id(out->usecase, PCM_PLAYBACK);
1024 ALOGE("%s: Invalid PCM device id(%d) for the usecase(%d)",
1025 __func__, out->pcm_device_id, out->usecase);
1031 uc_info->id = out->usecase;
1038 /* This must be called before adding this usecase to the list */
1044 select_devices(adev, out->usecase);
1050 if (out->usecase != USECASE_AUDIO_PLAYBACK_OFFLOAD) {
1053 if (out->usecase == USECASE_AUDIO_PLAYBACK_AFE_PROXY) {
1174 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) {
1205 ALOGV("%s: enter: usecase(%d: %s)", __func__,
1206 out->usecase, use_case_table[out->usecase]);
1212 if (out->usecase != USECASE_AUDIO_PLAYBACK_OFFLOAD) {
1280 struct audio_usecase *usecase;
1288 ALOGD("%s: enter: usecase(%d: %s) kvpairs: %s",
1289 __func__, out->usecase, use_case_table[out->usecase], kvpairs);
1314 * For example, music playback is active on headset (deep-buffer usecase)
1315 * and if we go to ringtones and select a ringtone, low-latency usecase
1318 * playback to headset+speaker while starting low-lateny usecase for ringtone.
1331 select_devices(adev, out->usecase);
1353 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) {
1405 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD)
1418 if (out->usecase == USECASE_AUDIO_PLAYBACK_MULTI_CH) {
1422 } else if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) {
1429 usecase,
1469 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) {
1494 if (out->usecase == USECASE_AUDIO_PLAYBACK_AFE_PROXY) {
1522 if ((out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) && (dsp_frames != NULL)) {
1563 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) {
1583 (platform_render_latency(out->usecase) * out->sample_rate / 1000000LL);
1617 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) {
1633 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) {
1650 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) {
1665 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) {
1774 status = select_devices(adev, in->usecase);
1816 if (in->usecase == USECASE_AUDIO_RECORD_AFE_PROXY) {
1827 if (ret == 0 && adev->mic_muted && in->usecase != USECASE_AUDIO_RECORD_AFE_PROXY)
1869 struct audio_usecase *usecase;
1872 usecase = node_to_item(node, struct audio_usecase, list);
1873 if (usecase->type == PCM_PLAYBACK) {
1874 select_devices(adev, usecase->id);
1879 select_devices(in->dev, in->usecase);
1885 select_devices(in->dev, in->usecase);
1953 out->usecase = USECASE_AUDIO_PLAYBACK_MULTI_CH;
1974 out->usecase = USECASE_AUDIO_PLAYBACK_OFFLOAD;
2026 out->usecase = USECASE_AUDIO_PLAYBACK_AFE_PROXY;
2031 out->usecase = USECASE_AUDIO_PLAYBACK_DEEP_BUFFER;
2034 out->usecase = USECASE_AUDIO_PLAYBACK_LOW_LATENCY;
2039 && pcm_params_format_test(adev->use_case_table[out->usecase],
2054 ALOGV("%s: Usecase(%s) config->format %#x out->config.format %#x\n",
2055 __func__, use_case_table[out->usecase], config->format, out->config.format);
2067 /* Check if this usecase is already existing */
2069 if (get_usecase_from_list(adev, out->usecase) != NULL) {
2070 ALOGE("%s: Usecase (%d) is already present", __func__, out->usecase);
2126 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) {
2203 struct audio_usecase *usecase;
2206 usecase = node_to_item(node, struct audio_usecase, list);
2207 if (usecase->type == PCM_PLAYBACK) {
2208 select_devices(adev, usecase->id);
2403 in->usecase = USECASE_AUDIO_RECORD_AFE_PROXY;
2406 in->usecase = USECASE_AUDIO_RECORD;
2411 in->usecase = USECASE_AUDIO_RECORD_LOW_LATENCY;