Lines Matching refs:usecase
312 struct mixer_card *uc_get_mixer_for_card(struct audio_usecase *usecase, int card)
317 list_for_each(node, &usecase->mixer_list) {
318 mixer_card = node_to_item(node, struct mixer_card, uc_list_node[usecase->id]);
428 struct audio_usecase *usecase;
432 usecase = node_to_item(node, struct audio_usecase, adev_list_node);
433 if (usecase->id == uc_id)
434 return usecase;
442 struct audio_usecase *usecase;
446 usecase = node_to_item(node, struct audio_usecase, adev_list_node);
447 if (usecase->type & type)
448 return usecase;
548 struct audio_usecase *usecase;
550 usecase = get_usecase_from_type(adev, PCM_CAPTURE|VOICE_CALL);
551 if (usecase != NULL) {
552 active_input = (struct stream_in *)usecase->stream;
709 int64_t render_latency(audio_usecase_t usecase)
711 (void)usecase;
783 struct audio_usecase *usecase = NULL;
790 ALOGV("%s: usecase(%d)", __func__, uc_id);
795 usecase = get_usecase_from_type(adev, PCM_CAPTURE|VOICE_CALL);
796 if (usecase != NULL) {
797 active_input = (struct stream_in *)usecase->stream;
800 usecase = get_usecase_from_id(adev, uc_id);
801 if (usecase == NULL) {
802 ALOGE("%s: Could not find the usecase(%d)", __func__, uc_id);
805 active_out = (struct stream_out *)usecase->stream;
807 if (usecase->type == VOICE_CALL) {
810 usecase->devices = active_out->devices;
813 * If the voice call is active, use the sound devices of voice call usecase
816 * usecase.
820 if (usecase == NULL) {
821 ALOGE("%s: Could not find the voice call usecase", __func__);
827 if (usecase->type == PCM_PLAYBACK) {
828 usecase->devices = active_out->devices;
835 select_devices(adev, active_input->usecase);
838 } else if (usecase->type == PCM_CAPTURE) {
839 usecase->devices = ((struct stream_in *)usecase->stream)->devices;
852 if (out_snd_device == usecase->out_snd_device &&
853 in_snd_device == usecase->in_snd_device) {
863 if (usecase->out_snd_device != SND_DEVICE_NONE) {
865 disable_snd_device(adev, usecase, usecase->out_snd_device, false);
869 if (usecase->in_snd_device != SND_DEVICE_NONE) {
870 disable_snd_device(adev, usecase, usecase->in_snd_device, false);
875 enable_snd_device(adev, usecase, out_snd_device, false);
879 enable_snd_device(adev, usecase, in_snd_device, false);
882 list_for_each(node, &usecase->mixer_list) {
883 mixer_card = node_to_item(node, struct mixer_card, uc_list_node[usecase->id]);
887 usecase->in_snd_device = in_snd_device;
888 usecase->out_snd_device = out_snd_device;
891 if (usecase->devices & (AUDIO_DEVICE_OUT_WIRED_HEADSET | AUDIO_DEVICE_OUT_WIRED_HEADPHONE))
893 adev->htc_acoustic_set_rt5506_amp(adev->mode, usecase->devices);
1122 if (out != NULL && out->usecase == USECASE_AUDIO_PLAYBACK) {
1145 if (adev->primary_output!= NULL && adev->primary_output->usecase == USECASE_AUDIO_PLAYBACK &&
1176 adev->primary_output->usecase == USECASE_AUDIO_PLAYBACK &&
1182 ALOGE("%s: Could not find PCM device id for the usecase(%d)",
1893 ALOGV("%s: enter: usecase(%d: %s)", __func__,
1894 in->usecase, use_case_table[in->usecase]);
1895 uc_info = get_usecase_from_id(adev, in->usecase);
1897 ALOGE("%s: Could not find the usecase (%d) in the list",
1898 __func__, in->usecase);
1937 ALOGV("%s: enter: usecase(%d)", __func__, in->usecase);
1939 pcm_profile = get_pcm_device(in->usecase == USECASE_AUDIO_CAPTURE_HOTWORD
1942 ALOGE("%s: Could not find PCM device id for the usecase(%d)",
1943 __func__, in->usecase);
1955 uc_info->id = in->usecase;
1974 select_devices(adev, in->usecase);
2230 static int uc_release_pcm_devices(struct audio_usecase *usecase)
2232 struct stream_out *out = (struct stream_out *)usecase->stream;
2242 list_init(&usecase->mixer_list);
2247 static int uc_select_pcm_devices(struct audio_usecase *usecase)
2250 struct stream_out *out = (struct stream_out *)usecase->stream;
2254 audio_devices_t devices = usecase->devices;
2256 list_init(&usecase->mixer_list);
2259 while ((pcm_profile = get_pcm_device(usecase->type, devices)) != NULL) {
2263 mixer_card = uc_get_mixer_for_card(usecase, pcm_profile->card);
2266 list_add_tail(&usecase->mixer_list, &mixer_card->uc_list_node[usecase->id]);
2354 uc_info = get_usecase_from_id(adev, out->usecase);
2356 ALOGE("%s: Could not find the usecase (%d) in the list",
2357 __func__, out->usecase);
2374 uc_info->id = out->usecase;
2384 select_devices(adev, out->usecase);
2393 ALOGV("%s: enter: usecase(%d: %s)", __func__,
2394 out->usecase, use_case_table[out->usecase]);
2396 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD &&
2417 ALOGV("%s: enter: usecase(%d: %s) devices(%#x) channels(%d)",
2418 __func__, out->usecase, use_case_table[out->usecase], out->devices, out->config.channels);
2422 if (out->usecase != USECASE_AUDIO_PLAYBACK_OFFLOAD) {
2468 ALOGE("%s: Could not find the usecase (%d) in the list",
2587 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) {
2622 if (out->usecase != USECASE_AUDIO_PLAYBACK_OFFLOAD) {
2655 ALOGV("%s: enter: usecase(%d: %s)", __func__,
2656 out->usecase, use_case_table[out->usecase]);
2713 struct audio_usecase *usecase;
2726 ALOGD("%s: enter: usecase
2727 __func__, out->usecase, use_case_table[out->usecase], kvpairs, out->devices, adev->mode);
2737 (out->usecase == USECASE_AUDIO_PLAYBACK)) {
2751 uc_info = get_usecase_from_id(adev, out->usecase);
2753 ALOGE("%s: Could not find the usecase (%d) in the list",
2754 __func__, out->usecase);
2768 select_devices(adev, out->usecase);
2800 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) {
2852 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD)
2866 if (out->usecase == USECASE_AUDIO_PLAYBACK_MULTI_CH) {
2870 } else if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) {
2979 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) {
3185 if ((out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) && (dsp_frames != NULL)) {
3230 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) {
3254 (render_latency(out->usecase) * out->sample_rate / 1000000LL);
3288 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) {
3307 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) {
3327 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) {
3342 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) {
3541 uc_info = get_usecase_from_id(adev, in->usecase);
3543 ALOGE("%s: Could not find the usecase (%d) in the list",
3544 __func__, in->usecase);
3559 ret = select_devices(adev, in->usecase);
3636 if (in->usecase == USECASE_AUDIO_CAPTURE_HOTWORD) {
3705 select_devices(in->dev, in->usecase);
3758 select_devices(in->dev, in->usecase);
3842 out->usecase = USECASE_AUDIO_PLAYBACK_OFFLOAD;
3878 out->usecase = USECASE_AUDIO_PLAYBACK_DEEP_BUFFER;
3883 out->usecase = USECASE_AUDIO_PLAYBACK;
3897 /* Check if this usecase is already existing */
3899 if (get_usecase_from_id(adev, out->usecase) != NULL) {
3900 ALOGE("%s: Usecase (%d) is already present", __func__, out->usecase);
3957 if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) {
4045 struct audio_usecase *usecase;
4048 usecase = node_to_item(node, struct audio_usecase, adev_list_node);
4049 if (usecase->type == PCM_PLAYBACK) {
4050 select_devices(adev, usecase->id);
4242 in->usecase = USECASE_AUDIO_CAPTURE_HOTWORD;
4244 in->usecase = USECASE_AUDIO_CAPTURE;