yashsingh1/xdaforums huggingface dataset:
[OnePlus 3 & 3T Cross Device Development] BillGoss:
After mucking around all day with doing GPS tests here's my current view:

0. [N]Los 16 leaves Los 17.1 for dead with respect to GPS performance.

1. There's no difference on Los 17.1 between using the stock gps.conf versus one that includes the "missing" XTRA_* settings. After clearing AGPS my phone takes 4-5 minutes (I never waited that long in my previous tests) to get a successful fix (locked on satellites) irrespective of the gps.conf used. The subsequent use (exit GPS app, open app again) takes between 20s-1m30 to get a lock on satellites.

2. Different apps behave differently. With GPS Test, if I clear and update AGPS I lose all satellites immediately and have to wait ~5 min to get most of them back. On the other hand, with GPS Status I can open the app and reset AGPS a few times without totally losing all satellites but eventually I'll lose all of them and have to wait for ~5 min to get them back.

3. GPS on Los 17.1 sucks! (See point 0)
[OnePlus 3 & 3T Cross Device Development] Eric_Lev:
FYI, GPS on LOS 17 works seamlessly with others devices such as A3 (2016 - official), A5 (2016 - official) and OP5T (unofficial) ... Tests performed with SatStat (FDroid).
[OnePlus 3 & 3T Cross Device Development] :
Do you see the ims apn? (If not, check permissions and selinux context.)

What about comparing the resourves of CarrierConfig and Phone apks? (Systematic next step, only if ims apn is present.)

---------- Post added at 09:23 ---------- Previous post was at 09:05 ----------

@BillGoss:

Would you please get verbose logs?

Set DEBUG_LEVEL in gps.conf to 5; set IZAT_DEBUG_LEVEL to 5; set log buffer in dev opts to 4 Mio.; delete agps data and immidiatly reboot (without waiting for sat lock); after the reboot wait until sat lock and get the logcat, please.
[OnePlus 3 & 3T Cross Device Development] BillGoss:
Yes, but this is a OP 3/3T thread.
[OnePlus 3 & 3T Cross Device Development] Dirk:
So why is it different on the 3/T than the aforementioned devices running the same software? (Which i'm sure is the point Eric is making). Is there anything diagnostically helpful to learn here?
[OnePlus 3 & 3T Cross Device Development] lokeshjt:
Yes, I can see the IMS apn. i will try comparing the apk resources.
[OnePlus 3 & 3T Cross Device Development] helderfp:
Using latest lineage and had zero problems driving with sygic gps
[OnePlus 3 & 3T Cross Device Development] knpk13:
https://xdaforums.com/oneplus-3/one...ageos-17-0-oneplus-3-3t-t3990061/post82878227
[OnePlus 3 & 3T Cross Device Development] Darkestnoir:
Tested your new gps.conf and it works great, cleared and updated agps and waited few minutes. Got a GPS lock with 5m accuracy. After a restart, GPS lock was there after few seconds :good:
[OnePlus 3 & 3T Cross Device Development] :
Do you use "gps" in the meaning of location service or in the meaning of "satellite only based positioning"? How long does satellite only based positing take to get a lock on statellites after agps data is deleted? How long for subsequent locks?

Do you say you can update agps data from a userspace app without error message? If so: don't ise that app for testing. Since it's not possible by design to externally update the agps data in the qcom gps stack (explained some postings back), all apps reporting sucessfull agps injection are erroneous - at least on op3/t.

Did you have issues with sat locks before and it's solved now, or did you always expirience accepteble sat lock times? Hpw long does it take from sucessfully deleting agps data (always check for app messages) to the first lock? How long does it take for subsequent locks? Do these vary from the same test with shipped gps.conf?
[OnePlus 3 & 3T Cross Device Development] Darkestnoir:
Hey,

i used GPS Test to check my gps status and also deleted and updated agps data with it. With the original gps.conf i had no gps lock at all most of the time, only sometimes it worked somehow. With the new one i got a lock after ~3 minutes after a agps reset and update (lose all sats hat are shown when i do this). After a device restart the lock was there after few seconds with high accuracy. Atm i don't need much GPS because of home office, but in few months (i hope) i will need it daily and can test it better.

Where i can see the error you are talking about?
[OnePlus 3 & 3T Cross Device Development] H. K. ROY:
this is a follow up of my previous post. anybody can help me out in this situation???

after 0622 update (i have wiped everything and completely reinstalled from scratch) device is heating up in standby and battery drain is still there (>4%/h). I have attached screenshots and kernel logs in attachments.
[OnePlus 3 & 3T Cross Device Development] :
Ah, ok. The status message is bogus. Obviously the data is only deleted but never updated (otherwise the time to lock would be the same). If you delete the data and update as single steps (on debugging tasks it's always usefull to do things step by step - as proofed by this example ;) ) you get the correct status "AGPS request failed".

The article on fixing gps on op3/t linked in this thread (https://www.itechify.com/2016/08/04/how-to-fix-gps-oneplus-3-guide/) suggest to clear agps followed by update AGPS, which produces the error "AGPS request failed"; the author failed to read the error and claims in his article it's possible to inject agps data externaly.

Since this is just impossible by design, I'm always alerted when I read some user thinks he has sucessfully updated the agps data, to avoid being traped by the wromg information injecting aps is possible on op3/t.
[OnePlus 3 & 3T Cross Device Development] :
Completely different question about cutoff voltage used for OP3T.

I noticed the following setting in build.prop of LOS17.1:

#ifdef VENDOR_EDIT
#yangfb 20160919 ,modify to set cutoff voltage to 3250mv
ro.cutoff_voltage_mv=3250
#endif

As I am using an OP3T, shouldn't this be 3400 to fully use the capacity of our battery?
[OnePlus 3 & 3T Cross Device Development] :
From an unpacked OOS 9.0.6 op3t full zip:

ingo@adler /usr/local/src/oxygenos $ grep ro.cutoff_voltage_mv system/build.prop
ro.cutoff_voltage_mv=3250
ingo@adler /usr/local/src/oxygenos $

Honestly I can't recall the voltage specs for our devices, nor do I know when and where the mV cutoff is used, but the capacity of a bat is measured in mAh not in mV.

BTW (for op3):

ingo@adler /usr/local/src/oxygenos $ git checkout op3
Zu Branch 'op3' gewechselt
ingo@adler /usr/local/src/oxygenos $ grep ro.cutoff_voltage_mv system/build.prop
ro.cutoff_voltage_mv=3250
ingo@adler /usr/local/src/oxygenos $
[OnePlus 3 & 3T Cross Device Development] :
That was my misunderstanding indeed, I read mAh but it was mV ofcourse. Though, found a proposal for changing the line in build.prop of Cyanogenmod where they actually are talking it to 3400mV: https://xdaforums.com/oneplus-3t/help/cyanogenmod-provide-official-device-t3500766

With the risk of blowing up the battery of my phone :p I just tried changing it to 3400mV, though no change; 100% is still 100% and no further charging.

So advice to other people reading this:

Do not try this at home, leave the 3250mV as it is not giving you extra battery capacity and you take the risk of killing your battery.
[OnePlus 3 & 3T Cross Device Development] chtitlou:
Hey guys.

Some more testing on the GPS. I tried the new gps.conf given by [MENTION=10511117]Johan2020[/MENTION] (the updated one) and did not manage to fix any of the sats. Actually I didn't notice that my GPS didn't work first, I had the surprise yesturday while driving. I did a clean install no long before, few weeks ago. No way to get a GPS position, I tried resetting, redownloading, resetting without downloading, using different GPS test apps along recommendations from previous posts.... Didn't make it.

And surprisingly, by simply dirty flashing the latest rom (20200622), I got a fix in few minutes, and now can relock it easily in few seconds.

I absolutely don't know what happened, but I'm the second one to experience this . I hope this would help in any way.
[OnePlus 3 & 3T Cross Device Development] BillGoss:
Ok, here are the logs.

Some explanations:

All tests done using Los 17.1 200608.

I started off by flashing Nlos 16 0607 and getting a solid satellite lock. Then I restored Los 17 and opened GPS Test and checked the time to get a lock and took a logcat.

I then cleared and updated (cu) AGPS and rebooted the phone.

After the phone had rebooted I opened GPS Test and checked the time to get a solid lock and took a logcat.

I did this whole process using the stock gps.conf with level 5 debug (od) repeated by one using the config including the XTRA entries and level 5 debug (xd) The debug level in izat.conf was also set to 5 in all tests.

Results:

od initial: 15s to fix

od cu: stopped after 9 minutes without a fix

xd initial: 9s to fix

xd cu: 6:30 to fix

Happy hunting!
[OnePlus 3 & 3T Cross Device Development] hkkp:
Sorry for a bit off-topic, just want to say that 'the same software' isn't 100% the same, though. For different phone there's different device tree, different vendor blobs. That's why there are different installation zip for each different devices.

Or, if you want to try, download a zip for those aforementioned devices and flash it on 3/T......
[OnePlus 3 & 3T Cross Device Development] Dirk:
By same software i meant LOS. Did you really not understand that, or do you think that somebody who has been an active XDA member for over a decade doesn't know that ROMs are device specific? Or was it just your intention to call me a ****ing idiot?

Let me reword my question in a way that you might understand:

What is different in Lineageos 17.1 on the Oneplus 3 or Oneplus 3T with regards to GPS specific software or settings, that is different to Lineageos 17.1 on several other devices?
[OnePlus 3 & 3T Cross Device Development] BillGoss:
I think a more interesting question is why is GPS on Los 17 so much worse than on Los 16 on our phone.

Edit: I was thinking along the same lines as [MENTION=3880407]hkkp[/MENTION] so I'm glad I didn't reply to your previous question or you would have bitten my head off! ? :laugh:
[OnePlus 3 & 3T Cross Device Development] hkkp:
Sorry if you feel offended, that wasn't my intention.

I'm trying to explain is, in the past few pages all those GPS related files that people mentioned, 'gps.conf', 'proprietary-files.txt', and a bunch of 'config.xml' etc, they are all under directory .../device/oneplus/oneplus3/ in LOS source code, under the oneplus3 device tree. These files could be same with other devices, could be different due to different hardware used, and they are part of the LOS.

Might not be a good example here, for Microsoft Windows, the Windows system included all sort of generic drivers for existing hardware, so you can install the same software to many different spec PCs. But Android is different, the installation zip only included specific device files.

Correct me if I'm wrong.
[OnePlus 3 & 3T Cross Device Development] :
I've answered the first question implicitly and the second explicitly when pointing out the different blobs for op3/t 17.1 and 16.0.

[MENTION=2911853]BillGoss[/MENTION]: I need some time to evaluate your logs - but the most important point is, that the new gps.conf fixed the issue for you. Some more testing from other useres would be great.
[OnePlus 3 & 3T Cross Device Development] :
I've compared/checked "od cu" against "xd cu":

It wasn't surprising to me that "od cu" doesn't has any XTRA_SERVER, but :

grep XTRA_SERVER /mnt/export/data/Downloads/incoming/200624-12*
/mnt/export/data/Downloads/incoming/200624-124825-xd-cu-6m30s.logcat:06-24 12:40:56.905 562 635 D LocSvc_utils_cfg: loc_set_config_entry: PARAM XTRA_SERVER_1 = http://xtrapath1.izatcloud.net/xtra3grcej.bin
/mnt/export/data/Downloads/incoming/200624-124825-xd-cu-6m30s.logcat:06-24 12:40:56.905 562 635 D LocSvc_utils_cfg: loc_set_config_entry: PARAM XTRA_SERVER_2 = http://xtrapath2.izatcloud.net/xtra3grcej.bin
/mnt/export/data/Downloads/incoming/200624-124825-xd-cu-6m30s.logcat:06-24 12:40:56.905 562 635 D LocSvc_utils_cfg: loc_set_config_entry: PARAM XTRA_SERVER_3 = http://xtrapath3.izatcloud.net/xtra3grcej.bin

But that doesn't seem to be the only issue fixed by correctly configuring the qcom gps stack. The capability negotiation looks very different:

for i in /mnt/export/data/Downloads/incoming/200624-12*; do grep getCarrierCapabilities $i /dev/null|head -n1; done
/mnt/export/data/Downloads/incoming/200624-122335-od-cu-x9min.logcat:06-24 12:12:02.918 563 645 V LocSvc_CtxBase: getCarrierCapabilities: CAPABILITIES 17, SUPL_MODE 1, carrier capabilities 13
/mnt/export/data/Downloads/incoming/200624-124825-xd-cu-6m30s.logcat:06-24 12:40:56.923 562 635 V LocSvc_CtxBase: getCarrierCapabilities: CAPABILITIES 37, SUPL_MODE 3, carrier capabilities 37

Accoring to the comments in gps.conf (from 16.0; geofence is missing in tje comments of 17.1) "od cu" negotiation is missing msa and geofence. The missing MSA capability could explain the feedback from the user reporting one sim makes gps work, but another carroer breaks gps.

I think we should test the xd gps.conf more. Also users having no issues with gps should check if the xd gps.conf doesn't break anything. If it works for all use cases we can push a commit to gerrit.
[OnePlus 3 & 3T Cross Device Development] :
Those are exactly the things I changed in my GPS.conf. Had to travel today, GPS working fine without any issues. Lock within seconds...

Even https seems to work...
[OnePlus 3 & 3T Cross Device Development] :
Yep, https for XTRA_SERVERs works since 13.1. It's just not wanted by los.

In 15.1 -> 16.0 some gps configuration has been moved from gps.conf to fw/b:

https://github.com/LineageOS/androi...3fdc920#diff-b95972a09ea19f5e627e357f184e76c4

From 16.0 to 17.1 fw/b doesn't honor gps configs anymore:

ingo@adler /usr/local/src/los16/frameworks/base $ git checkout los/lineage-16.0
HEAD ist jetzt bei 5df8608656b Merge tag 'android-9.0.0_r56' of https://android.googlesource.com/platform/frameworks/base into staging/lineage-16.0_merge-android-9.0.0_r56
ingo@adler /usr/local/src/los16/frameworks/base $ grep -r "config_gpsParameters" services/core/java/com/android/server/location/
services/core/java/com/android/server/location/GnssLocationProvider.java: com.android.internal.R.array.config_gpsParameters);
ingo@adler /usr/local/src/los16/frameworks/base $ git checkout los/lineage-17.1
Aktualisiere Dateien: 100% (16147/16147), Fertig.
Vorherige Position von HEAD war 5df8608656b Merge tag 'android-9.0.0_r56' of https://android.googlesource.com/platform/frameworks/base into staging/lineage-16.0_merge-android-9.0.0_r56
HEAD ist jetzt bei d6c4b239872 SystemUI: QS Details: Fix layout issues
ingo@adler /usr/local/src/los16/frameworks/base $ grep -r "config_gpsParameters" services/core/java/com/android/server/location/
ingo@adler /usr/local/src/los16/frameworks/base $

This means all gps config has to be done in gps.conf in 17.1.

EDIT:

The SUPL_HOST in your gps.conf is not portable to all carriers. For a gps.conf for all users it should be supl.google.com instead.
[OnePlus 3 & 3T Cross Device Development] Hellera:
Hello friends, I just installed the latest build, no problem, it works fine. I found somewhere on the web something about a theme engine integrated in Lineage 17.1. So, I would want to know if is any tweak, trick to activate it... is it?! Or it's available only for some other devices?!

And something else... I tried the LOS twrp recovery but I'm not so familiary with it... so, I installed the ROM with the official twrp without any problem, I even made a backup. So do i really need to use the new twrp? Thank you.
[OnePlus 3 & 3T Cross Device Development] :
This has been discussed and answerd. Always search before posting, please. Thanx.
[OnePlus 3 & 3T Cross Device Development] knpk13:
Display settings should have basic theming options like an accent picker and icon customizer.

If you want something more powerful, install substratum or substratum lite from the play store and your preferred theme. You'll need magisk for it to work.
[OnePlus 3 & 3T Cross Device Development] BillGoss:
More interesting - well, I think it's interesting - stuff on GPS...

I had a look at the OOS gps.conf and was surprised to see that it has no XTRA_SERVER entries. Yet OOS is just as good as Nlos 16 at getting a quick fix on satellites. So that made we wonder what purpose the XTRA settings have.

I also noticed that [MENTION=10511117]Johan2020[/MENTION] was using ntp.org instead of izatcloud.net for the ntp server. So I did a ping on the different servers and discovered that the izatcloud.net one doesn't reply. That's not good. But does it really make any difference?

So I decided to try a simple test: use a dummy gps.conf and see how things work. To my total surprise I found that the time to get a fix after clearing and updating AGPS in GPS Test was between 1:30 and 2:30! That was better than any of my tests done yesterday. Also, after getting the first fix, if I close the GPS app and open it again I get a fix in about 10s.

I also tested again the Los 17 gps.conf with added XTRA lines and also [MENTION=10511117]Johan2020[/MENTION]'s latest file and got similar results for all of them as I got for the dummy file! So today I can't reproduce yesterday's results - I'm getting far better times and the contents of the gps.conf file seem to be irrelevant. Go figure!

So, based on today's tests, Los 17 takes about 2 minutes to get a lock after clearing and updating AGPS irrespective of gps.conf contents. This is nothing like the 10s for the same action in [N]Los 16 or OOS 9.0.6 so I stand by my comment that GPS in Los 17 sucks (ok, sucks on my OnePlus 3T) .

One last comment. I have noticed that clearing/updating AGPS using GPS Test (https://play.google.com/store/apps/details?id=com.chartcross.gpstest) works consistently and actually clears the viewed satellites. Whereas resetting AGPS in GPS Status (https://play.google.com/store/apps/details?id=com.eclipsim.gpsstatus2) doesn't clear the viewed satellites so it's not doing a true clean in my books. I've used GPS Status for many, many years but I'm now considering switching to GPS Test (paid version).
[OnePlus 3 & 3T Cross Device Development] lokeshjt:
Is it intentional that quick settings is always black even if pure black is disabled in dark mode ? I think in LOS 16 it was dark grey in dark theme and black only if pure black mode was enabled.
[OnePlus 3 & 3T Cross Device Development] Johannes1098:
So till yesterday, I used my own gps.conf (https://xdaforums.com/showpost.php?p=82897967&postcount=1612) and I thought it is better - but also not that that good as in LOS16

But yesterday I switched no the "new" gps.conf - and since then the gps is as worse as with stock os 17

So either we are on the wrong path with the "gps.conf" file, or there are really a few settings that are VERY important for gps.conf and that are set wrong (maybe also depending on carrier)

I also wonder what are thedifferences between los16 and los17?

So could we try the blobs from LOS16 or isn't this possible?

Where else are config files?

Is there anybody with dirty flash from LOS16, who says "Yes my gps works fine everyday since day 1 with los17" - then it could be a settings file in /data. (I didn't find one yet and I don't know even if there is ANY sort of gps config in /data).

Questions over questions.. And no answers. Damn it

Never had such an interesting and strange bug yet in LOS..
[OnePlus 3 & 3T Cross Device Development] :
[MENTION=2911853]BillGoss[/MENTION] & [MENTION=8423339]Johannes1098[/MENTION]:

I'm not building 17.1, but I've explained in this posting https://xdaforums.com/oneplus-3/one...eplus-3-3t-t3990061/post82895993#post82895993 that some (most propably 7 commits to the device specific gps implementation) commits need to be reverted to try to use the old blobs (the old blons can be found at themuppets; a list can be generated from proprietary-files.txt [all pinned files in the gps block]).

To check if the 16.0 blobs work at all and work better then the 17.1 blobs, you need a test build.

For ntp servers: a ntp server runs on tcp port 123 and udp port 123, neither rfc 958 (ntp) nor rfc 1305 (ntp v3) nor rfc 5905 (ntp v4) require reachability by ping. To check the availibility of a ntp server you need some kind of ntp client. For linux (I'm sure there are tools for android, windows and darwin, too) this is e.g. ntpdate:

ingo@adler /usr/local/src/los16/device/oneplus/oneplus3 $ ntpdate -q pool.ntp.org
server 46.243.26.34, stratum 1, offset -0.000489, delay 0.05463
server 80.127.152.30, stratum 2, offset -0.000557, delay 0.05602
server 45.159.204.28, stratum 2, offset +0.000637, delay 0.05969
server 162.159.200.1, stratum 3, offset +0.002338, delay 0.05399
25 Jun 09:39:38 ntpdate[31424]: adjust time server 46.243.26.34 offset -0.000489 sec
ingo@adler /usr/local/src/los16/device/oneplus/oneplus3 $ ntpdate -q time.izatcloud.net
server 52.42.72.58, stratum 4, offset +0.001600, delay 0.21803
server 34.223.228.170, stratum 4, offset +0.004764, delay 0.20186
server 34.220.201.22, stratum 4, offset -0.003060, delay 0.21829
server 54.185.46.30, stratum 4, offset -0.002746, delay 0.21649
25 Jun 09:39:58 ntpdate[31442]: adjust time server 34.223.228.170 offset +0.004764 sec
ingo@adler /usr/local/src/los16/device/oneplus/oneplus3 $

Everything's fine with time.izatcloud.net. Apart from that a regional ntp server may help getting faster fixes, because it may have a lower latency (this may differ from carrier to carrier; the same ntp server may have a low latency on wifi/dsl, but a high one on mobiöe data - or vice versa).

For the constantly claimed "delete and update": on the op3/t it's not possible to update agps data from outside the gps stack. The izat technologie - baked into the soc - doesn't allow the gps stack to accept injections of agps data from any external app, no matter what menu items an app offers and no matter what the app reports: IT'S NOT POSSIBLE BY DESIGN! If you don't belive me, register at qualcomm and check the documentation.

EDIT: I recommend https://play.google.com/store/apps/details?id=com.android.gpstest (be aware the are - at least - 4 different apps on pstore with the name "GPS Test"). This app shipps with correct (error) messages, is open source and for free.
[OnePlus 3 & 3T Cross Device Development] BillGoss:
I know you're not building Los 17 (you've mentioned this before) and I've no intention of building ROMs (I'm a user, not a builder)

Thanks for clarifying the ntp server issue and for showing how to invoke it. And, yes, local ntp servers have significantly lower latency, but that's insignificant in the actually usage.

Thanks, also, for explaining that apps can't inject AGPS. My point is more about clearing the data and GPS Test seems to do a better job of that than GPS Status.

I'm going to continue using Los 17 with a dummy config file and see how it works long term. However, it would be nice is someone found a solution for Los 17 so that it works like 16.

If GPS it's a showstopper, then we can always fall back to Los 16 or OOS.

I enjoyed doing the tests and thinking about it and trying different things. The frustrating bit is my total lack of knowledge about how GPS works in Android and what the various setting really do. But it doesn't bother me enough to start looking at code or reading standards :D
[OnePlus 3 & 3T Cross Device Development] Johannes1098:
Jup, same goes for me.

I can build builds after the instruction from the los wiki, but everything else like reverting commits, changing blobs etc. I'm just don't have the knowledge for that..
[MENTION=9708417]Eric_Lev[/MENTION] you built some builds for the clock issue. May you able to built a version with the things that [MENTION=4405529]nvertigo67[/MENTION] pointed out before (https://xdaforums.com/oneplus-3/one...ageos-17-0-oneplus-3-3t-t3990061/post82895993)

Of course only if you are able to do it and also have the time :)