Android RIL and GNSS driver for Android 13 on x86_64

Hello,

I’m currently working on building a custom Android image for Waydroid.
To get cellular network access as well as GPS i bought an EC25-E module (USB / UART).
Looking at the user guide i found out that i need the RIL and GPS drivers specific to android.
Would you please provide me with the driver files ?

Android version is 13 and architecture is x86_64.
If more information about my system is needed please let me know.

I will provide the RIL libs. Please check the message.

The problem is that the IRadio 1.1 might not work well on Android 13.

Hello,

thank you for the quick response.

I thought the RIL driver supports up to IRadio version 1.4 since that is what it says in the RIL driver user guide (v2.0 from 2021-04-19). Is that not correct ?

Also i need the GPS driver as well. From what i saw for that i need some file called gps.default.so to get the NMEA gps working.
Could you please provide that as well or tell me where i can download it ?

I could provide the gps.default.so on x86_64.
But for IRadio 1.4, I don’ t have the Android source code to build the libril.so.

Thank you for providing the gps driver as well.

I will give the IRadio 1.1 driver a try but if that doesn’t work then is it possible for you to get the android source code necessary to build a IRadio 1.4 version ? Since the user guide says that IRadio 1.4 is supported it would be nice to actually be able to use it… Also i do need the driver to work well. If it doesn’t its basically useless…

I will provide the libril.so for IRadio 1.5.
I have tested with IRadio 1.5 the Android 13 works well. But you have to replace the libril.so with the original one.

That would be awesome. Thanks a lot.

I can easily replace any files necessary since I’m making a custom build of android anyway so thats not an issue.

Hi, could you please provide me also with RIL drivers for IRadio 1.5?
Thanks!

Hello Bean,

have you sent the files for the RIL driver 1.5 yet ?
If so something must have gone wrong because i didn’t receive anything.

Quectel_Android_GPS_Driver_V2.2.20_beta.zip (1.0 MB)

Quectel_Android_RIL_Driver_V3.6.35_master_beta.zip (1.4 MB)

I have sent it by using the forum message.

I got those but you said that the RIL driver you sent previously is a different one. So i was waiting for the version that supports RIL 1.5

I have never sent anyone the x86_64 IRadio 1.5 Quectel libs.

Please try it and set the IRadio to 1.6
quectel_IRadio1.6_ril_libs.zip (6.6 MB)

1 Like

After a lot of try and error i managed to get some success with the driver files and their included documentation. However I’m still facing a few issues:

For RIL 1.1:
The manifest XML provided in the documentation seems to be incomplete as i needed to add some extra bits from here:

Without the extra XML bits i always got this error:

03-30 14:10:01.220  1750  1750 W HidlServiceManagement: Waited one second for android.hardware.radio@1.0::IRadio/slot1
03-30 14:10:01.220    47    47 I hwservicemanager: Since android.hardware.radio@1.0::IRadio/slot1 is not registered, trying to start it as a lazy HAL.
03-30 14:10:01.220  1750  1750 I HidlServiceManagement: getService: Trying again for android.hardware.radio@1.0::IRadio/slot1...
03-30 14:10:01.220    47  2177 W libc    : Unable to set property "ctl.interface_start" to "android.hardware.radio@1.0::IRadio/slot1": error code: 0x20
03-30 14:10:01.220    47  2177 I hwservicemanager: Tried to start android.hardware.radio@1.0::IRadio/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.
03-30 14:10:01.690     0     0 E init    : Control message: Could not find 'android.hardware.radio@1.0::IRadio/slot1' for ctl.interface_start from pid: 47 (/system/bin/hwservicemanager)

Other than that it looks like its working for the most part except for audio during voice calls.
Is there some extra configuration required to get that working as well or does that have to do with the RIL driver being incompatible with android 13 ?
GPS is working as expected too so thats something.
So far i wasn’t able to test the data connection yet. I’ll check that later.

For RIL 1.6:

It doesn’t even manage to start the rild due to some linker errors due to a missing symbol. No idea where to start debugging that as i suspect that its related the ril library you provided and not anything with the android itself.

03-30 13:59:04.024     0     0 I init    : starting service 'vendor.ril-daemon'...
03-30 13:59:03.591  1656  1656 F linker  : CANNOT LINK EXECUTABLE "/vendor/bin/hw/rild": cannot locate symbol "_ZN7android8hardware12ProcessState16initWithMmapSizeEm" referenced by "/vendor/lib64/libril.so"...
03-30 13:59:04.052     0     0 I init    : Service 'vendor.ril-daemon' (pid 1656) exited with status 1
03-30 13:59:04.052     0     0 I init    : Sending signal 9 to service 'vendor.ril-daemon' (pid 1656) process group...
03-30 13:59:04.052     0     0 I libprocessgroup: Successfully killed process cgroup uid 1001 pid 1656 in 0ms
03-30 13:59:04.238     0     0 I logd    : logdr: UID=0 GID=0 PID=1657 b tail=0 logMask=99 pid=0 start=0ns deadline=0ns
03-30 13:59:03.918   115   638 D gps_ql  : Error connecting rild-nmea (Connection refused)
03-30 13:59:03.918   115   638 D gps_ql  : fail to open GPS channel <rild-nmea>!
03-30 13:59:04.177   816   816 W HidlServiceManagement: Waited one second for android.hardware.radio@1.6::IRadio/slot1
03-30 13:59:04.177    47    47 I hwservicemanager: Since android.hardware.radio@1.6::IRadio/slot1 is not registered, trying to start it as a lazy HAL.
03-30 13:59:04.177   816   816 I HidlServiceManagement: getService: Trying again for android.hardware.radio@1.6::IRadio/slot1...
03-30 13:59:04.177    47  1659 W libc    : Unable to set property "ctl.interface_start" to "android.hardware.radio@1.6::IRadio/slot1": error code: 0x20
03-30 13:59:04.177    47  1659 I hwservicemanager: Tried to start android.hardware.radio@1.6::IRadio/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.
03-30 13:59:04.639     0     0 E init    : Control message: Could not find 'android.hardware.radio@1.6::IRadio/slot1' for ctl.interface_start from pid: 47 (/system/bin/hwservicemanager)
03-30 13:59:04.918   115   638 D gps_ql  : Error connecting rild-nmea (Connection refused)
03-30 13:59:04.918   115   638 D gps_ql  : fail to open GPS channel <rild-nmea>!
03-30 13:59:05.177   816   816 W HidlServiceManagement: Waited one second for android.hardware.radio@1.6::IRadio/slot1

It cannot judge just by the description.
Please check:

Whether RIL service is running.

getprop | grep ril
ps -elf | grep ril

Whether the phone is running

getprop | grep phone

for IRadio 1.6.

So have you put the libril.so into vendor/lib64/.
If so I am afaid I need to pull the whole Android source code.

Here is the configuration, command output and the log files from testing the RIL 1.6:

rild.rc
service vendor.ril-daemon /vendor/bin/hw/rild -l /vendor/lib64/hw/libreference-ril.so
    class main
    user radio
    group radio cache inet misc audio log readproc wakelock sdcard_rw
    capabilities BLOCK_SUSPEND NET_ADMIN NET_RAW

manifest.xml
<hal format="hidl">
    <name>android.hardware.radio</name>
    <transport>hwbinder</transport>
    <fqname>@1.6::IRadio/slot1</fqname>
    <fqname>@1.2::ISap/slot1</fqname>
</hal>

:/ # getprop | grep ril
[init.svc.vendor.ril-daemon]: [restarting]
[init.svc_debug_pid.vendor.ril-daemon]: [1956]
[ril.function.dataonly]: [0]
[ril.subscription.types]: [SIM]
[ro.boot.noril]: [no]
[ro.boottime.vendor.ril-daemon]: [5336849923685]
[ro.radio.noril]: [no]
[ro.ril.enable.amr.wideband]: [1]
[ro.telephony.ril.config]: [simactivation]
[vendor.rild.libpath]: [/vendor/lib64/hw/libreference-ril.so]

:/ # ps -elf | grep ril   
root            1991     356 0 16:01:03 pts/0 00:00:00 grep ril

:/ # getprop | grep phone    
[hw.nophone]: [no]

:/ # ls -la /vendor/lib64/*radio*
-rw-r--r-- 1 root root  190336 2024-04-01 15:57 /vendor/lib64/android.hardware.radio.config@1.0.so
-rw-r--r-- 1 root root  230712 2024-04-01 15:57 /vendor/lib64/android.hardware.radio.config@1.1.so
-rw-r--r-- 1 root root  170496 2024-04-01 15:57 /vendor/lib64/android.hardware.radio.config@1.2.so
-rw-r--r-- 1 root root 2049088 2024-04-01 15:57 /vendor/lib64/android.hardware.radio@1.0.so
-rw-r--r-- 1 root root 1348920 2024-04-01 15:57 /vendor/lib64/android.hardware.radio@1.1.so
-rw-r--r-- 1 root root 1487936 2024-04-01 15:57 /vendor/lib64/android.hardware.radio@1.2.so
-rw-r--r-- 1 root root 1398664 2024-04-01 15:57 /vendor/lib64/android.hardware.radio@1.3.so
-rw-r--r-- 1 root root 1609288 2024-04-01 15:57 /vendor/lib64/android.hardware.radio@1.4.so
-rw-r--r-- 1 root root 1866672 2024-04-01 15:57 /vendor/lib64/android.hardware.radio@1.5.so
-rw-r--r-- 1 root root 2192080 2024-04-01 15:57 /vendor/lib64/android.hardware.radio@1.6.so

:/ # ls -la /vendor/lib64/*ril*
-rw-r--r-- 1 root root   51424 2024-04-01 15:57 /vendor/lib64/libreference-ril.so
-rw-r--r-- 1 root root 1826912 2024-04-01 15:57 /vendor/lib64/libril.so
-rw-r--r-- 1 root root    7640 2024-04-01 15:57 /vendor/lib64/librilutils.so

|:/ # ls -la /vendor/lib64/hw/*ril*
-rw-r--r-- 1 root root 601000 2024-04-01 15:57 /vendor/lib64/hw/libreference-ril.so

:/ # logcat -b radio -v time
--------- beginning of radio
04-01 15:58:29.549 D/TelephonyRegistry(  328): listen oscl: mHasNotifySubscriptionInfoChangedOccurred==false no callback
04-01 15:58:29.817 D/TelephonyRegistry(  328): listen oscl: mHasNotifySubscriptionInfoChangedOccurred==false no callback
04-01 15:58:30.041 D/TelephonyRegistry(  328): listen oscl: mHasNotifySubscriptionInfoChangedOccurred==false no callback
04-01 15:58:30.068 D/TelephonyRegistry(  328): listen oscl: mHasNotifySubscriptionInfoChangedOccurred==false no callback
04-01 15:58:30.071 D/TelephonyRegistry(  328): listen oscl: mHasNotifySubscriptionInfoChangedOccurred==false no callback
04-01 15:58:30.072 W/CarrierConfigManager(  328): Error getting config for subId -1 ICarrierConfigLoader is null
04-01 15:58:30.073 D/TelephonyRegistry(  328): listen oscl: mHasNotifySubscriptionInfoChangedOccurred==false no callback
04-01 15:58:30.076 D/TelephonyRegistry(  328): systemRunning register for intents
04-01 15:58:30.159 D/TelephonyRegistry(  328): notifyCellLocationForSubscriber: subId=2147483647 cellIdentity=null
04-01 15:58:30.249 W/CarrierConfigManager(  672): Error getting config for subId -1 ICarrierConfigLoader is null
04-01 15:58:30.275 D/TelephonyRegistry(  328): listen oscl: mHasNotifySubscriptionInfoChangedOccurred==false no callback
04-01 15:58:30.279 D/TelephonyComponentFactory(  677): validated paths: null
04-01 15:58:30.279 D/TelephonyComponentFactory(  677): Total components injected: 0
04-01 15:58:30.280 D/TDC     (  677): updateOrInsert: inserting: Modem { uuid=modem, state=0, rilModel=0, rat={}, maxActiveVoiceCall=1, maxActiveDataCall=1, maxStandby=1 }
04-01 15:58:30.280 D/TDC     (  677): updateOrInsert: inserting: Sim { uuid=sim, modemUuid=modem, state=0 }
04-01 15:58:30.280 D/MetricsCollector(  677): registered
04-01 15:58:30.281 D/CdmaSSM (  677): subscriptionSource from settings: 0
04-01 15:58:30.281 I/PhoneFactory(  677): Cdma Subscription set to 0
04-01 15:58:30.281 I/PhoneFactory(  677): Network Mode set to 10
04-01 15:58:30.281 D/RILJ    (  677): RIL: init allowedNetworkTypes=326655 cdmaSubscription=0) [PHONEnull]
04-01 15:58:30.318 D/TelephonyRegistry(  328): listen oscl: mHasNotifySubscriptionInfoChangedOccurred==false no callback
04-01 15:58:30.354 W/CarrierConfigManager(  567): Error getting config for subId -1 ICarrierConfigLoader is null
04-01 15:58:30.356 D/TelephonyRegistry(  328): listen oscl: mHasNotifySubscriptionInfoChangedOccurred==false no callback
04-01 15:58:30.437 W/CarrierConfigManager(  567): Error getting config for subId -1 ICarrierConfigLoader is null
04-01 15:58:30.437 W/CarrierConfigManager(  567): Error getting config for subId -1 ICarrierConfigLoader is null
04-01 15:58:30.438 D/TelephonyRegistry(  328): listen oscl: mHasNotifySubscriptionInfoChangedOccurred==false no callback
04-01 15:58:30.459 W/CarrierConfigManager(  672): Error getting config for subId -1 ICarrierConfigLoader is null
04-01 15:58:30.465 W/CarrierConfigManager(  672): Error getting config for subId -1 ICarrierConfigLoader is null
04-01 15:58:30.603 W/CarrierConfigManager(  672): Error getting config for subId -1 ICarrierConfigLoader is null
04-01 15:58:31.656 D/TelephonyRegistry(  328): listen oscl: mHasNotifySubscriptionInfoChangedOccurred==false no callback
04-01 15:58:36.813 W/CarrierConfigManager(  672): Error getting config for subId -1 ICarrierConfigLoader is null
04-01 15:58:36.827 W/CarrierConfigManager(  672): Error getting config for subId -1 ICarrierConfigLoader is null

:/ # logcat
04-01 15:58:57.078   115   642 D gps_ql  : Error connecting rild-nmea (Connection refused)
04-01 15:58:57.078   115   642 D gps_ql  : fail to open GPS channel <rild-nmea>!
04-01 15:58:57.296   677   677 W HidlServiceManagement: Waited one second for android.hardware.radio@1.6::IRadio/slot1
04-01 15:58:57.296    47    47 I hwservicemanager: Since android.hardware.radio@1.6::IRadio/slot1 is not registered, trying to start it as a lazy HAL.
04-01 15:58:57.296   677   677 I HidlServiceManagement: getService: Trying again for android.hardware.radio@1.6::IRadio/slot1...
04-01 15:58:57.296    47  1677 W libc    : Unable to set property "ctl.interface_start" to "android.hardware.radio@1.6::IRadio/slot1": error code: 0x20
04-01 15:58:57.297    47  1677 I hwservicemanager: Tried to start android.hardware.radio@1.6::IRadio/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.
04-01 15:58:56.988     0     0 E init    : Control message: Could not find 'android.hardware.radio@1.6::IRadio/slot1' for ctl.interface_start from pid: 47 (/system/bin/hwservicemanager)
04-01 15:58:57.434     0     0 I init    : starting service 'vendor.ril-daemon'...
04-01 15:58:57.764  1679  1679 F linker  : CANNOT LINK EXECUTABLE "/vendor/bin/hw/rild": cannot locate symbol "_ZN7android8hardware12ProcessState16initWithMmapSizeEm" referenced by "/vendor/lib64/libril.so"...
04-01 15:58:57.456     0     0 I init    : Service 'vendor.ril-daemon' (pid 1679) exited with status 1
04-01 15:58:57.456     0     0 I init    : Sending signal 9 to service 'vendor.ril-daemon' (pid 1679) process group...
04-01 15:58:57.456     0     0 I libprocessgroup: Successfully killed process cgroup uid 1001 pid 1679 in 0ms
04-01 15:58:57.918   917   949 W System  : A resource failed to call release. 
04-01 15:58:58.078   115   642 D gps_ql  : Error connecting rild-nmea (Connection refused)
04-01 15:58:58.078   115   642 D gps_ql  : fail to open GPS channel <rild-nmea>!

As for the RIL 1.1 (V3_6_35_beta) that you provided:
I was able to get LTE working as well now.
While doing some more testing i noticed that sometimes i get network timeouts while running USSD codes. So far i wasn’t able to find anything in the logs though.
Also it seems like audio using UAC is somewhat working now as well.
However enabling audio output through the UAC device is not persistent so i need some way of always executing AT+QPCMV=1,2 before or once the RIL deamon is running.
Is there any way to accomplish that with the RIL driver or is this not the way to do it ?

Here is also the output of the command you said to try as comparison:

:/ # getprop | grep ril
[gsm.version.ril-impl]: [Quectel_Android_RIL_Driver_V3.6.35]
[init.svc.vendor.ril-daemon]: [running]
[init.svc_debug_pid.vendor.ril-daemon]: [196]
[ril.function.dataonly]: [0]
[ril.subscription.types]: [SIM]
[ro.boot.noril]: [no]
[ro.boottime.vendor.ril-daemon]: [2062303004608]
[ro.radio.noril]: [no]
[ro.ril.enable.amr.wideband]: [1]
[ro.telephony.ril.config]: [simactivation]
[vendor.rild.libpath]: [/vendor/lib64/hw/libreference-ril.so]

:/ # ps -elf | grep ril                                                                                                                                                                                          
radio            196       1 0 15:03:52 ?     00:00:00 rild -l /vendor/lib64/hw/libreference-ril.so
root            2211    1135 0 15:11:26 pts/0 00:00:00 grep ril

:/ # getprop | grep phone                                                                                                                                                                                        
[cache_key.telephony.phone_account_to_subid]: [-7921242441362823577]
[debug.tracing.battery_stats.phone_scanning]: [0]
[debug.tracing.battery_stats.phone_signal_strength]: [4]
[debug.tracing.battery_stats.phone_state]: [0]
[gsm.current.phone-type]: [1]
[hw.nophone]: [no]

:/ # logcat -b radio -v time
--------- beginning of radio
04-01 16:20:10.851 D/RILD    (  202): **RIL Daemon Started**
04-01 16:20:10.851 D/RILD    (  202): **RILd param count=3**
04-01 16:20:10.855 D/RILD    (  202): RIL_Init argc = 3 clientId = 0
04-01 16:20:10.855 D/RILC    (  202): Quectel RIL Version: Quectel_Android_RIL_Driver_V3.6.35
04-01 16:20:10.855 D/RILC    (  202): Compiled date: Mar 11 2024 time: 14:11:19
04-01 16:20:10.855 D/NDK     (  202): Default libnetutils.so path:/system/lib64/libnetutils.so
04-01 16:20:10.855 D/NDK     (  202): ql_find_libpath:/apex/com.android.vndk.v33/lib64/libnetutils.so
04-01 16:20:10.856 D/NDK     (  202): Default libcutils.so path:/system/lib64/libcutils.so
04-01 16:20:10.856 D/NDK     (  202): Found libcutils.so path:/apex/com.android.vndk.v33/lib64/libcutils.so
04-01 16:20:10.856 D/RILC    (  202): [ro.build.version.release]: [13]
04-01 16:20:10.856 D/RILC    (  202): Android Version: 130, RIL_VERSION: 12 / 12
04-01 16:20:10.856 D/RILC    (  202): 1.1</version>
04-01 16:20:10.856 D/RILC    (  202): __getIRadioVersion:674 IRadioVersion:1
04-01 16:20:10.856 D/RILC    (  202): [ro.build.description]: [lineage_waydroid_x86_64-userdebug 13 TQ3A.230901.001 eng.lukas.20240303.153256 test-keys]
04-01 16:20:10.856 D/RILC    (  202): [ro.hardware]: [unknown]
04-01 16:20:10.856 I/RILC    (  202): clientID = 0
04-01 16:20:10.856 D/RILD    (  202): RIL_Init rilInit completed
04-01 16:20:10.856 I/RILC    (  202): SIM_COUNT: 1
04-01 16:20:10.856 E/RILC    (  202): RIL_register: RIL version 12
04-01 16:20:10.856 I/RILC    (  202): s_registerCalled flag set, 1
04-01 16:20:10.856 I/RILC    (  202): mainLoop Start

To enable the UAC is possible, but I don’t think it is possible to use the UAC feature for voice call.

You need set it just once
echo -ne “at+qcfg="usbcfg",0x2C7C,0x0125,1,1,1,1,1,0,1\r\n” > /dev/ttyUSB2

need set it every time, it cannot save
echo -ne “AT+QPCMV=1,2\r\n” > /dev/ttyUSB2