hal: set default sample rate during voice/voip call

During voip call, backend sample rate is changed from
48Khz to 44.1Khz when starting 44.1Khz playback. This
is due to voip call using audio path is failed to check
to cause backend sample rate is changed.

Add voip call using audio path usecase condition check to
ensure default sample rate is set.

CRs-Fixed: 2405457
Change-Id: I9001abc059b554be6dda132a3a6b2c54227effd2
This commit is contained in:
kunleiz 2019-02-28 16:53:25 +08:00
parent d3b6813171
commit 83c0b4f0bc
2 changed files with 8 additions and 2 deletions

View File

@ -5848,7 +5848,10 @@ static int platform_get_voice_call_backend(struct audio_device* adev)
if (voice_is_in_call(adev) || adev->mode == AUDIO_MODE_IN_COMMUNICATION) {
list_for_each(node, &adev->usecase_list) {
uc = node_to_item(node, struct audio_usecase, list);
if (uc && (uc->type == VOICE_CALL || uc->type == VOIP_CALL) && uc->stream.out) {
if (uc && uc->stream.out &&
(uc->type == VOICE_CALL ||
uc->type == VOIP_CALL ||
uc->id == USECASE_AUDIO_PLAYBACK_VOIP)) {
out_snd_device = platform_get_output_snd_device(adev->platform, uc->stream.out);
backend_idx = platform_get_backend_index(out_snd_device);
break;

View File

@ -6816,7 +6816,10 @@ static int platform_get_voice_call_backend(struct audio_device* adev)
if (voice_is_in_call(adev) || adev->mode == AUDIO_MODE_IN_COMMUNICATION) {
list_for_each(node, &adev->usecase_list) {
uc = node_to_item(node, struct audio_usecase, list);
if (uc && (uc->type == VOICE_CALL || uc->type == VOIP_CALL) && uc->stream.out) {
if (uc && uc->stream.out &&
(uc->type == VOICE_CALL ||
uc->type == VOIP_CALL ||
uc->id == USECASE_AUDIO_PLAYBACK_VOIP)) {
out_snd_device = platform_get_output_snd_device(adev->platform, uc->stream.out);
backend_idx = platform_get_backend_index(out_snd_device);
break;