universal5433 / android_device_samsung_trelte-common

Samsung Galaxy Note 4 - common device tree
5 stars 9 forks source link

[BUG] GPS 10-bit week rollover bug / Weak / No GPS #32

Closed Git-tara closed 1 year ago

Git-tara commented 1 year ago

Describe the bug GPS not available. Does not track current location

To Reproduce Steps to reproduce the behavior:

Install and use any apps that uses GPS location.

Expected behavior

Should be able to locate current position

Screenshots

Not needed.

Smartphone model (please complete the following information):

Additional context

Thank you and more power!

ananjaser1211 commented 1 year ago

Hello, Thank you for the report, Apologies for the late reply ive been very occupied.

if possible could you check these two apps for what they report while being outdoors.

https://play.google.com/store/apps/details?id=com.chartcross.gpstest&hl=en_IN (check if it detects any satellites, if so how many, and if it gets GNSS Fix or just stays orange)

Download and check this app https://github.com/barbeau/gpstest/releases, it will show you how many satellites are visible, and if your GPS time is correct or not, at some point in 2019~2022 many devices were affected by a GPS 10-BIT rollout bug that broke GPS time, samsung did push updates to fix it for the note 5 and newer, i am not sure if the note 4 ever received that update, but it uses the same GPS chip as the note 5 and galaxy S7, both of which needed a patch on my other ROMs, other devices such as the note 8 , S9 also required an update.

it may be possible that our note 4 needed an update too.

Now that i check samsungs OTA notice page, i do see this, in august 2022 the device had an OTA update (with newer bootloader and modem too it seems)

image

The note 5 got a similar notice, and i know for a fact that the note 5 needed this update to bring back GPS support

image

Now here is the kicker, i have downloaded all the note 4 firmwares hosted on samfirm last year to update my bootloader and modem repo, however it seems that they no longer update the note 4 listings as this particular firmware (N910CXXU2DVG1) is missing

I am having issues downloading it from samfirm so i need to check for alternative way, i wonder if this is an OTA only update ?

image

i will see how i can get it, and with any luck it has newer GPS blobs inside

https://github.com/ananjaser1211/FloydQ_Reports/issues/296 for more information about this rollout bug, you can read this bug report on my other ROM

ananjaser1211 commented 1 year ago

Alright, i have confirmed that indeed it is a 10BIT rollover bug, and the new firmware N910CXXU2DVG1 is only available by OTA, it also updates the ~bootloader~ and modem, so i will try to extract it and put it on the WiKi,

Update

the update file does contain a patch to the gps HAL, so hopefully ill be able to test it on lineage OS and see if it fixes the BUG, to confirm i ran a test before flashing the OTA, While it does provide GNSS Fix, you can see that the number of satellites are very little, which means it is unable to connect to other satalites, possibly due to the rollover bug. in theory the update should fix this and it should be able to use more GPS satellites improving accuracy, as apps also do check GPS time and fail if its too old

Screenshot_2023-08-09-23-13-26 Screenshot_2023-08-09-23-13-21 Screenshot_2023-08-09-23-13-36

ananjaser1211 commented 1 year ago

Indeed after the patch, the satellites in view reached as high as 20, and averaged around 16~18 in use, i.e its now using more satellites for location, the accuracy was also consistent at 16/8 while previously it reached as high as 64. further more the GPS reported time is now accurate. i will add the new libraries to the next builds of lineage as soon as possible.

Screenshot_2023-08-09-23-59-35

Screenshot_2023-08-10-00-00-21

ananjaser1211 commented 1 year ago

I have applied the new blobs to lineage OS and the GPS time issue is fixed, attached is before and after the patch.

Note : the first time it runs it will take a minute or so until it syncs up with GPS time, then the rest of the satalites will appear, the same behavior's happened on stock after the update, after that gps ran without a hitch regardless of a reboot / toggling location etc, Thanks again for the report, the fix will be in the next set of lineage builds.

Before : pre

After : post

Git-tara commented 1 year ago

I can't imagine the effort you put onto this project keeping this phone alive. I look forward on the next update. Thanks!!

johnwalked commented 1 year ago

@Git-tara test

johnwalked commented 1 year ago

@Git-tara Thats just pure fix great work anan as always!