ngoquang2708 / android_device_samsung_vivalto3gvn

Device tree for Samsung Galaxy V SM-G313HZ
7 stars 8 forks source link

Cannot make calls with open source rild & libril #102

Closed ngoquang2708 closed 6 years ago

ngoquang2708 commented 6 years ago

USSD, service signal do work.

libreference-ril_sp.so crashed right after we make the call.

Tombstone: https://gist.github.com/ngoquang2708/d4768bb544214a6eb58b3ecc49ee31e7.

ngoquang2708 commented 6 years ago

Commits https://github.com/ngoquang2708/android_device_samsung_vivalto3gvn/commit/8eb6cbaf0be745211b270dd440127d95e8784d9e and https://github.com/ngoquang2708/android_hardware_sprd/commit/b41febe292acca5f6df6f3d7cf974912126eeec7 seem to fix this issue. @remilia15 I can make a call now. Want your confirmation.

diepquynh commented 6 years ago

I knew it. There must be a NULL in CallDetails I'll test your commit now

diepquynh commented 6 years ago

Btw how did you figure out this issue?

ngoquang2708 commented 6 years ago

Look at cm-11.0 libril, in dial function I see some log strings that I could use to search for it in IDA. In IDA, I searh for "uusUcs". Found sub_ACE4 function have reference to that string so I can assume that sub_ACE4 is the dial function in libril source. From there I just look for pacel::readInt32, where its result is assign to...

ngoquang2708 commented 6 years ago

Previously we "shim" that dial function in java. Now without BOARD_RIL_CLASS as you suggested, we have to deal with C code in libril.

ngoquang2708 commented 6 years ago

IDA is such a great tools. Why haven't I discover it earlier :)

diepquynh commented 6 years ago

Well it's a great tool for disassembling C libraries, but with my noob level, understanding those assembled codes is a problem

A nice thing is that I didn't even touch dial function in stock libril o.O Logcat just give serviceDied upon dialing and sending commands to modem, nothing else. Maybe because I use libsecril-shim with shimmed Dial function

ngoquang2708 commented 6 years ago

I have no knowledge of assembly either. Just guessing. Looking for old thing that we did in Java the make RIL work. Then re-apply it in C.

diepquynh commented 6 years ago

Confirmed working Testing with dual-SIM

Edit: Working with dual SIM, but will take a long time after booting to get dual SIM stable for calling

diepquynh commented 6 years ago

Just ditched dial function in libsecril-shim. Now calls work immediately

ngoquang2708 commented 6 years ago

Do you have to shim libsecril(-client?) to get working RIL in N?

diepquynh commented 6 years ago

I use prebuilt in N, but open-source one in O

ngoquang2708 commented 6 years ago

Why shim it while we have source?

diepquynh commented 6 years ago

Actually I use libsecril-shim for IMEI. Are your IMEIs in Settings unknown?

ngoquang2708 commented 6 years ago

Yeah. All are unknown :)

diepquynh commented 6 years ago

First is that IMEI is unknown Second, signal bars will never change Third, if you got IMEI working, current static radio impl will derp our 3G RAF (if you go to Settings -> Mobile network then Advanced), returning -1 as RAF value and throw RIL_E_GENERIC_FAILURE

These are what I've found so far

ngoquang2708 commented 6 years ago

Do you know what is the -c parameter to rild? What its value means? I have changed it to like 0 then 1 then 2 and got no signal. 1 2 3 still no signal. But left it as is as your as 0 2 3 work. Confuse me like the way old rild socket!

diepquynh commented 6 years ago

It's the same thing as we did for rild sockets -c para stands for clientId, which is renamed from rild in O

ngoquang2708 commented 6 years ago

Ok. Wonder why it behaves like old one :)