RIL Integration Android 14

Hi All,

I am trying to integrate libril from Quectel into my AOSP code Android 14 but having some issues. I got a libril.so file from Quectel but its dependent on things which are no longer part of AOSP code and Im stuggling to find the correct RIL integration libraries for Android 14. Notice Quectel libril is dependent on ndk so file which are never buillt with Android 14. I need to either get some documentation to generate them or get the correct ones which will work with AOSP code for Android 14. readelf -d libril-quectel.so | grep NEEDED
0x0000000000000001 (NEEDED) Shared library: [liblog.so]
0x0000000000000001 (NEEDED) Shared library: [libutils.so]
0x0000000000000001 (NEEDED) Shared library: [libcutils.so]
0x0000000000000001 (NEEDED) Shared library: [libhardware_legacy.so]
0x0000000000000001 (NEEDED) Shared library: [librilutils.so]
0x0000000000000001 (NEEDED) Shared library: [android.hardware.radio.config-V1-ndk.so]
0x0000000000000001 (NEEDED) Shared library: [android.hardware.radio.data-V1-ndk.so]
0x0000000000000001 (NEEDED) Shared library: [android.hardware.radio.messaging-V1-ndk.so]
0x0000000000000001 (NEEDED) Shared library: [android.hardware.radio.modem-V1-ndk.so]
0x0000000000000001 (NEEDED) Shared library: [android.hardware.radio.network-V1-ndk.so]
0x0000000000000001 (NEEDED) Shared library: [android.hardware.radio.sim-V1-ndk.so]
0x0000000000000001 (NEEDED) Shared library: [android.hardware.radio.voice-V1-ndk.so]
0x0000000000000001 (NEEDED) Shared library: [libbase.so]
0x0000000000000001 (NEEDED) Shared library: [libbinder_ndk.so]
0x0000000000000001 (NEEDED) Shared library: [libc++.so]
0x0000000000000001 (NEEDED) Shared library: [libc.so]
0x0000000000000001 (NEEDED) Shared library: [libm.so]
0x0000000000000001 (NEEDED) Shared library: [libdl.so]

OK, seems like all the ndk’s are put into system/lib64 directory and we need them in vendor/lib64 not sure if I can make libreference-ril and libril copy into the correct directory here. I have tried PRODUCT_COPY_FILES and Android.bp and on both im getting error about duplicate entries.Also if i rename it and copy it libril.so keeps reporting errors. Even though the so file exists in system/lib64 directory.

08-26 09:00:37.880 1241 1306 W CarrierConfigManager: Error getting config for subId -1 ICarrierConfigLoader is null
08-26 09:00:42.235 1712 1712 D RILD : RIL Daemon Started
08-26 09:00:42.235 1712 1712 D RILD : RILd param count=6
08-26 09:00:42.237 1712 1712 E RILD : dlopen failed: dlopen failed: library “android.hardware.radio.config-V1-ndk.so” not found: needed by /vendor/lib64/libril-quectel.so in namespace

mmm hardware/interfaces/radio/aidl
And then if you search the android.hardware.radio.config-V1-ndk.so in the out folder.

Hi,

Thanks for the reply. Yes thats there but the issue remains. Let me rephrase all the issues.
I got the libreference-ril.so and libril.so files from quectel. I am currently on Android 14 using Variscite’s IMX8MP SOM. Arch arm4. I was not able to replace libril.so and libreference-ril.so on Android 14 due to the changes in build setup for Android 14. So I created my own Android.bp file and copied the provided files with unique names in vendor/lib4 (libreference-ril-quectel.so and libril-quectel.so) I adjust the rild.rc to call this libreference-ril-quectel.so. Then I added the Android 14 manifest changes into the xml and added product_packages in my device.mk file. I can see all the packages being built and present. The issue is that lib’s from quectel do not start some services and i might have to manuallly start them. The AT commands work. I’ll just share the logs. AT commands work, but no modem and services run.

Some logs show this message.
08-26 10:41:36.300 15899 [ 6149.845780][ T200] servicemanager: Found android.hardware.radio.data.IRadioData/slot1 in device VINTF manifest.
15899 D TDC : updateOrInsert:[ 6149.858906][ T200] servicemanager: Found android.hardware.radio.messaging.IRadioMessaging/slot1 in device VINTF manifest.
inserting: Sim { uuid=sim, modem[ 6149.872714][ T200] servicemanager: Found android.hardware.radio.modem.IRadioModem/slot1 in device VINTF manifest.
Uuid=modem, state=0 }
08-26 10:4[ 6149.886190][ T200] servicemanager: Found android.hardware.radio.network.IRadioNetwork/slot1 in device VINTF manifest.
1:36.302 15899 15899 D PersistAto[ 6149.900145][ T200] servicemanager: Found android.hardware.radio.sim.IRadioSim/slot1 in device VINTF manifest.
msStorage: PersistAtoms file not [ 6149.913390][ T200] servicemanager: Found android.hardware.radio.voice.IRadioVoice/slot1 in device VINTF manifest.
found
08-26 10:41:36.303 15899 1[ 6149.926601][ T200] servicemanager: Could not find android.hardware.radio.ims.IRadioIms/slot1 in the VINTF manifest.
5899 D PersistAtomsStorage: created new PersistAtoms
08-26 10:4[ 6149.942827][ T200] servicemanager: Found android.hardware.radio.modem.IRadioModem/slot1 in device VINTF manifest.
1:36.314 15899 15899 D MetricsCol[ 6149.956514][ T200] servicemanager: Since ‘android.hardware.radio.modem.IRadioModem/slot1’ could not be found, trying to start it as a lazy AIDL service. (if it’s not configured to be a lazy service, it may be stuck starting or still starting).
lector: registered
08-26 10:41:3[ 6149.981678][ T1] init: Control message: Could not find ‘aidl/android.hardware.radio.modem.IRadioModem/slot1’ for ctl.interface_start from pid: 200 (/system/bin/servicemanager)
6.316 15899 15899 D CdmaSSM : sub[ 6149.999793][T15921] servicemanager: Tried to start aidl service android.hardware.radio.modem.IRadioModem/slot1 as a lazy service, but was unable to. Usually this happens when a service is not installed, but if the service is intended to be used as a lazy service, then it may be configured incorrectly.

The services are on the device but not being able to start.

Also the libraries i have got from quectel for Android 14 dont seem to be AIDL or HIDL as readelf shows they use legacy methods and does not self register AIDL methods.

We just care about
dlopen failed: dlopen failed: library “android.hardware.radio.config-V1-ndk.so” not found: needed by /vendor/lib64/libril-quectel.so in namespace
Make sure all the dependancies are loaded.

Please try the Quectel_Android_RIL_Driver_AIDL1_V4.1.zip.
Just make sure the rild is running and then let’s check the other problem.

Thanks for the zip file these are the ones im already using and im getting the error logs I shared earlier.

I have as I said defined the manifest.xml entries and got the libreference-ril.so (renamed to libreference-ril-quectel.so) and libril.so (renamed to libril-quectel.so) and placed them in vendor/lib4/. Did the patchelf to remove dependency on libril.so and added libril-quectel.so to libreference-ril-quectel.so. Then I did patchelf to change the SONAME of libril-quectel.so from libril to libril-quectel. Modified my rild.rc file to call with correct parameters and I can get AT command sworking but no services are running for which I shared the logs.

Please let me know if you need any more logs or if im missing anything.

This is my run through.

Added to manifest.xml

android.hardware.radio.config
2
IRadioConfig/default


android.hardware.radio.data
2
IRadioData/slot1


android.hardware.radio.messaging
2
IRadioMessaging/slot1


android.hardware.radio.modem
2
IRadioModem/slot1


android.hardware.radio.network
2
IRadioNetwork/slot1


android.hardware.radio.sim
2
IRadioSim/slot1


android.hardware.radio.voice
2
IRadioVoice/slot1

Added to PRODUCT_PACKAGES

PRODUCT_PACKAGES +=
libreference-ril-quectel
ql-ril-conf
libril-quectel
Telecom
TelephonyProvider
telephony-common
TeleService
messaging
Dialer
rild
chat
ip-up
ip-down
android.hardware.radio.config-V2-ndk
android.hardware.radio.data-V2-ndk
android.hardware.radio.messaging-V2-ndk
android.hardware.radio.modem-V2-ndk
android.hardware.radio.network-V2-ndk
android.hardware.radio.sim-V2-ndk
android.hardware.radio.voice-V2-ndk
android.hardware.radio.ims-V2-ndk
android.hardware.radio.config-V1-ndk
android.hardware.radio.data-V1-ndk
android.hardware.radio.messaging-V1-ndk
android.hardware.radio.modem-V1-ndk
android.hardware.radio.network-V1-ndk
android.hardware.radio.sim-V1-ndk
android.hardware.radio.voice-V1-ndk
android.hardware.radio.ims-V1-ndk

Did the build and got

Some part of logs not all.

AT commands work and i can see sim registeration.
08-26 09:00:07.189 739 741 D ATC : AT> AT+CPIN?
08-26 09:00:07.194 739 745 D ATC : AT< +CPIN: READY
08-26 09:00:07.194 739 745 D ATC : AT< OK
08-26 09:00:07.194 739 741 D ATC : AT> AT+CFUN?
08-26 09:00:07.196 739 745 D ATC : AT< +CFUN: 1
08-26 09:00:07.196 739 745 D ATC : AT< OK
08-26 09:00:07.256 739 741 E RILC : newSmsOnSimInd: radioService[0]->mRadioIndication == NULL
08-26 09:00:07.256 739 741 D SETUP_DATA_CALL: data_call_ops_detect:906 netcard is wwan0
08-26 09:00:07.257 739 741 D ATC : AT> AT+QCFG=“speed”
08-26 09:00:07.258 739 745 D ATC : AT< ERROR
08-26 09:00:07.260 739 741 D ATC : AT> AT+QIMSCFG=“ims_status”
08-26 09:00:07.265 739 745 D ATC : AT< ERROR
08-26 09:00:07.265 739 741 D ATC : AT> AT+QENG=“servingcell”
08-26 09:00:07.271 739 745 D ATC : AT< +QENG: “servingcell”,“NOCONN”,“LTE”,“FDD”,234,30,354305,387,1761,3,3,3,523B,-122,-18,-87,-8,5
08-26 09:00:07.271 739 745 D ATC : AT< OK
08-26 09:00:07.271 739 741 D ATC : AT> AT+COPS=3,0;+COPS?;+COPS=3,1;+COPS?
08-26 09:00:07.277 739 745 D ATC : AT< +COPS: 0,0,“EE KPN”,7
08-26 09:00:07.277 739 745 D ATC : AT< +COPS: 0,1,“EE KPN”,7
08-26 09:00:07.277 739 745 D ATC : AT< OK
08-26 09:00:07.277 739 741 D ATC : AT> AT+QENDC
08-26 09:00:07.279 739 745 D ATC : AT< ERROR
Line 4203: [ 83.692805][ T199] servicemanager: Found android.hardware.radio.data.IRadioData/slot1 in device VINTF manifest.
Line 4204: [ 83.705848][ T199] servicemanager: Found android.hardware.radio.messaging.IRadioMessaging/slot1 in device VINTF manifest.
Line 4205: [ 83.722035][ T199] servicemanager: Found android.hardware.radio.modem.IRadioModem/slot1 in device VINTF manifest.
Line 4206: [ 83.733697][ T199] servicemanager: Found android.hardware.radio.network.IRadioNetwork/slot1 in device VINTF manifest.
Line 4207: [ 83.746553][ T199] servicemanager: Found android.hardware.radio.sim.IRadioSim/slot1 in device VINTF manifest.
Line 4208: [ 83.757781][ T199] servicemanager: Found android.hardware.radio.voice.IRadioVoice/slot1 in device VINTF manifest.
Line 4209: [ 83.769282][ T199] servicemanager: Could not find android.hardware.radio.ims.IRadioIms/slot1 in the VINTF manifest.
Line 4210: [ 83.784259][ T199] servicemanager: Found android.hardware.radio.modem.IRadioModem/slot1 in device VINTF manifest.
Line 4211: [ 83.796187][ T199] servicemanager: Since ‘android.hardware.radio.modem.IRadioModem/slot1’ could not be found, trying to start it as a lazy AIDL service. (if it’s not configured to be a lazy service, it may be stuck starting or still starting).
Line 4212: [ 83.823621][ T1] init: Control message: Could not find ‘aidl/android.hardware.radio.modem.IRadioModem/slot1’ for ctl.interface_start from pid: 199 (/system/bin/servicemanager)
Line 4213: [ 83.841363][ T1401] servicemanager: Tried to start aidl service android.hardware.radio.modem.IRadioModem/slot1 as a lazy service, but was unable to. Usually this happens when a service is not installed, but if the service is intended to be used as a lazy service, then it may be configured incorrectly.
Line 4214:

The device does not show Call & SMS and no SIM. All options graded out

Regards

It seems the rild is running successfully now and not exit.
I need the android log.
logcat -b all

I have just emailed the logs.

I didn’t see the email.
You can see me with the message.
Except the private message, we will still discuss in public here.

OK, Please find ligs. It also contains kernel logs I have tried to remove properiority ones
teraterm.rar (236.1 KB)

registerService: starting android::hardware::radio::V1_1::IRadio slot1
You didn’t using the Quectel libril. It is still the native libril.so.

Can you confirm the md5sum as i used the one you shared earlier.

Just check it on the device
strings /vendor/lib64/libril.so | grep Quectel
Can you see the Quectel?

I am not able to replace libril.so file in Android 14 so what i have is vendor version (libril-quectel.so) in /vendor/lib64/libril-quectel.so on the device do i need to add sometime like
PRODUCT_PROPERTY_OVERRIDES +=
vendor.rild.libpath=/vendor/lib64/libril-quectel.so
in my device.mk file to tel libreference-ril-quectel.so to use it.

This is on the device, but I am not sure why its still using libril.so and not libril-quectel.so
From device
strings /vendor/lib64/libril-quectel.so | grep Quectel
Quectel_Android_Libril_v4.0.5
This is device.mk file
PRODUCT_OVERRIDES +=
libril
libreference-ril

PRODUCT_PROPERTY_OVERRIDES +=
vendor.rild.libpath=/vendor/lib64/libril-quectel.so

PRODUCT_PACKAGES +=
libreference-ril-quectel
ql-ril-conf
libril-quectel
Telecom
TelephonyProvider
telephony-common
TeleService
messaging
Dialer
rild
chat
ip-up
ip-down
android.hardware.radio.config-V2-ndk
android.hardware.radio.data-V2-ndk
android.hardware.radio.messaging-V2-ndk
android.hardware.radio.modem-V2-ndk
android.hardware.radio.network-V2-ndk
android.hardware.radio.sim-V2-ndk
android.hardware.radio.voice-V2-ndk
android.hardware.radio.ims-V2-ndk
android.hardware.radio.config-V1-ndk
android.hardware.radio.data-V1-ndk
android.hardware.radio.messaging-V1-ndk
android.hardware.radio.modem-V1-ndk
android.hardware.radio.network-V1-ndk
android.hardware.radio.sim-V1-ndk
android.hardware.radio.voice-V1-ndk
android.hardware.radio.ims-V1-ndk

PRODUCT_PROPERTY_OVERRIDES +=
ro.telephony.default_network=9
persist.radio.multisim.config=ss
ro.telephony.sim.count=1

This is rild.rc file
service vendor.ril-daemon /vendor/bin/hw/rild -l /vendor/lib64/libreference-ril-quectel.so – -c /vendor/etc/radio/ql-ril.conf.
manifest entries I have already shared with you.

Does anyone know how to replace AOSP libreference-ril.so and libril.so with quectels one’s in Android 14.

libril.so and libreference-ril.so is not the same one.
libreference-ril.so is the vendor ril that implement the function and use the Quectel AT command.
But the libril.so that support aidl should be provided by Google. But actually Google just implement the IRadio 1.1 in the hardware/ril/libril. Quectel try to implement the AIDL and so that the customer need to replace the /vendor/libril/libril.so also.

OK, I know I have to replace libril.so with libril-quectel.so one but when i use product_copy_files it complains and can not override referring to duplicate entry error