sonyxperiadev / bug_tracker

Empty repository that is used as a bugtracker for Open Devices project
52 stars 13 forks source link

[Yoshino][Lilac] Calls via Telegram/Whatsapp: The caller can't hear me #619

Closed stefanhh0 closed 4 years ago

stefanhh0 commented 4 years ago

Platform: Yoshino Device: Lilac Kernel version: 4.14.188-24329-gbc26a81e6516¹ Android version: android-10.0.0_r40 Software binaries version: SW_binaries_for_Xperia_Android_10.0.7.1_r1_v9c_yoshino.img Version baseband: 1307-7511_47.2.A.11.228 Build: aosp_g8441-userdebug 10 QQ3A.200705.002 eng.stefan.20200707.220459²

Previously working on It was working before the switch to the caf audio hal and all the other changes done for audio.

Description When doing phonecalls via telegram or whatsapp the other person can't hear me. The calls being done with the phone internal mic. Normal phone calls are working though. Also calling the other person via telegram from my linux notebook works fine. Also sending voice messages using the microphone via telegram or whatsapp works.

I have seen the following PR, is it a candidate that may fix the problem? Is it fixed with https://github.com/sonyxperiadev/device-sony-common/pull/772?

Symptoms I talk, the other person does not hear me via telegram or whatsapp.

How to reproduce Do a phone call via telegram or whatsapp using built in microphone.

Additional context I couldn't grab a log since I don't have a setup to reproduce the problem myself but would require to someone to help me with it.


¹) The kernel commit can't be found on github:

²) SELinux: enforcing

MarijnS95 commented 4 years ago

I couldn't grab a log since I don't have a setup to reproduce the problem myself but would require to someone to help me with it.

Meaning the above report is from another user? Can you get them to take logs? These are necessary to identify what audiopath and usecase is selected, then work from there. Perhaps audio_platform_info requires an update like the other platforms, akin to the changes we've made before: https://github.com/MarijnS95/device-sony-yoshino/commits/lilac-dump-audio

sonyxperiadev/device-sony-common#772 allows platforms to override compress_in.enable to true, which is only supported on Kumano.

stefanhh0 commented 4 years ago

The report is from me, unfortunately I didn't think of saving the log after it occurred. I will repeat it doing a test call after my holidays and then going to provide a log.

MarijnS95 commented 4 years ago

No hurry, enjoy your holidays!

(Except if you really need to make such calls, and assuming you have root access to the device with verity disabled: perhaps I can whip up a quick patch after seeing the logs)

stefanhh0 commented 4 years ago

Here the log: default_kern.log

07-29 09:03:36.173   674 15807 E audio_route: unable to find path 'echo-reference-voip'
07-29 09:03:36.173   674 15807 E audio_route: unable to find path 'echo-reference-voip handset'

Is the missing audio route, the root cause?

MarijnS95 commented 4 years ago

It has echo-reference but lacks echo-reference-voip, which is is optional:

https://github.com/sonyxperiadev/vendor-qcom-opensource-audio-hal-primary-hal/blob/b89559e74345ae6d30c4077e86d4661dcaff83f8/hal/msm8974/platform.c#L1832-L1835

vendor.audio.feature.compr_voip.enable is set to false in common-prop, but it looks like we need to enable it for Yoshino (and everything that doesn't have -voip paths). CAF enables it for sdm660 and 89{37,98}, I guess we should too.

kholk commented 4 years ago

I went for a conservative approach when I did the initial migration: I've tried to keep "unnecessary" things disabled to avoid issues as much as possible, with a plan to get new features enabled slowly after validation.

By the way, enabling that feature looks like being THE way now, as we would have to lose the same amount of time in fixing the feat-disabled path, so, why not.

MarijnS95 commented 4 years ago

@kholk Just in case I edited the message because the linked code is an inversion. Stefan and me will enable the feature on aforementioned platforms, validate this fixes the issue and send some PRs :smile:

(So yeah, the initial question whether we should apply this to some other platforms is not relevant anymore. It's not a "nice to have", it is supposed to fix something that's broken right now).

stefanhh0 commented 4 years ago

Problem is fixed after having cherry-picked the following:

https://github.com/MarijnS95/device-sony-yoshino/commits/enable-compr-voip https://github.com/MarijnS95/device-sony-common/commits/allow-audio-feature-compr-voip

Marijn will prepare PRs.

kholk commented 4 years ago

@MarijnS95 This is going to give us some small audio latency on VoIP but it's unnoticeable, in favor of some also unnoticeable battery improvement... But you should know that already.

Btw, I approve!

MarijnS95 commented 4 years ago

Yup... Rather stick with stock/qcom configuration than trying to hack up our own echo-reference-voip nodes; I won't be surprised if the underlying ctl (AUDIO_REF_EC_UL10 MUX on supported platforms) doesn't exist on Yoshino + NinGes, or is otherwise not functioning because they don't declare this hardware support.

stefanhh0 commented 4 years ago

Thanks for fixing the problem :-)