Skip to content
This repository has been archived by the owner on Jan 27, 2025. It is now read-only.

No incoming audio in phone calls [Razer Phone/cheryl/potentially all CAF devices] #12

Closed
linuxct opened this issue Apr 1, 2018 · 9 comments

Comments

@linuxct
Copy link
Contributor

linuxct commented Apr 1, 2018

Logcat and dmesg seem okay.
Tried changing the Dialer app to Google's stock one, didn't fix the issue.
Also tried re-routing the audio from the earspeaker to the actual speakers, and to Bluetooth headset, but didn't solve the issue. Only sound that comes from them is a loud 'beep' when the call ends.
3rd party VoIP apps like Telegram or WhatsApp have no issues at all with in-call audio.

May need custom audio re-routing inside the mixer_paths?

@linuxct
Copy link
Contributor Author

linuxct commented Apr 1, 2018

Manually extracting the following files from the razer DP1 image (injecting their respective vdex's)
framework/qcrilhook.jar
framework/qti-telephony-common.jar
framework/QtiTelephonyServicelibrary.jar
and placing them inside the system partition along with their respectives permission xml's DIDN'T SOLVE the issue.

This means MSM8996 fixes don't help in the MSM8998.

@ghost
Copy link

ghost commented Apr 2, 2018

Getting my Razer phone tomorrow, let's see then, subscribed to issue.

@linuxct
Copy link
Contributor Author

linuxct commented Apr 2, 2018

As a follow up to last night's comment, trying to inject the Apks corresponding to Qcomm RIL QtiTelephonyService, QtiSystemService, Qcrilmsgtunnel from the stock rom into the GSI didn't work either.
Just adding as much info as I can so that no one needs to mess around with already tested stuff.

@linuxct
Copy link
Contributor Author

linuxct commented Apr 5, 2018

As an update, @TheCrazyLex and I have tried by adding the flag "AUDIO_OUTPUT_FLAG_FAST" to the primary output mixport inside vendor's audio_policy_configuration, still with the same results

@linuxct
Copy link
Contributor Author

linuxct commented Apr 7, 2018

New update. I've delete the Razer signature from the files QtiTelephonyService, QtiSystemService, Qcrilmsgtunnel, and resigned them with the system signing key. Now files are installable and services run like normal. For the specific case of Qcrilmsgtunnel, I've faced the issue that it was missing a library from HIDL, but that file is indeed present in the system after comparing the tree output between GSI image and Razer image.

photo_2018-04-07_22-30-01

Concerned, I decompiled the apk in question and changed <uses-library android:name="android.hidl.manager@1.0-java" /> to <uses-library android:name="android.hidl.manager@1.0-java" android:required="false" />. Now the file loads up properly and is running in the system as a background task.

photo_2018-04-07_22-32-51

Now, I moved the missing libs back to the system to check if audio worked, and this is what happened:
log.txt. System becomes unstable, Android phone crashes constantly at boot, and all apps begin to crash due to mismatch in time service.

From the log, we can extract the following 2 errors:
04-02 16:07:57.408 3945 3945 I zygote64: Caused by: java.lang.ClassNotFoundException: Didn't find class "org.codeaurora.internal.IExtTelephony$Stub" on path: DexPathList[[zip file "/system/framework/qti-telephony-common.jar"],nativeLibraryDirectories=[/system/lib64, /vendor/lib64]]
and
04-02 16:07:57.412 3945 3945 I zygote64: Rejecting re-init on previously-failed class java.lang.Class<com.qualcomm.qti.internal.telephony.QtiRIL>: java.lang.IncompatibleClassChangeError: Superclass com.android.internal.telephony.RIL of com.qualcomm.qti.internal.telephony.QtiRIL is declared final (declaration of 'com.qualcomm.qti.internal.telephony.QtiRIL' appears in /system/framework/qti-telephony-common.jar)

Final thought: I'm done :)

@linuxct linuxct changed the title No incoming audio in phone calls [Razer Phone/cheryl] No incoming audio in phone calls [Razer Phone/cheryl/potentially all CAF devices] Apr 7, 2018
@linuxct
Copy link
Contributor Author

linuxct commented Apr 7, 2018

I've fixed it. I'll write up one last comment with everything needed to reproduce the fix on any device.

@linuxct
Copy link
Contributor Author

linuxct commented Apr 7, 2018

Check out this thread I've made to bloat this issue less: https://forum.xda-developers.com/project-treble/trebleenabled-device-development/treble-qualcomm-device-call-audio-check-t3774818
For the specific case of the Razer Phone, I published this: https://forum.xda-developers.com/razer-phone/how-to/treble-install-generic-image-gsi-razer-t3770684/page5#post76159165
This isn't a permanent fix however, and can be addressed directly from compilation time in GSIs.

@linuxct linuxct closed this as completed Apr 7, 2018
@phhusson
Copy link
Owner

Some investigations about the always-on-speaker mode:
Editing audio_policy_configuration.xml to include Earpiece as attachedDevices, and change devicePort Earpiece from AUDIO_CHANNEL_IN_MONO to AUDIO_CHANNEL_OUT_MONO makes earpiece working!
Going to speaker mode works as well.
Going back from speaker doesn't though.

@phhusson
Copy link
Owner

The same change without actually changing audio_policy_configuration.xml:
phhusson/platform_frameworks_av@3f7e564

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants