yashsingh1/xdaforums huggingface dataset:
[Huawei Mate 9 Questions & Answers] cr2:
OK, this is the code blob that needs to be modified (absolute addresses are from the glgps4774 binary with the f2* MD5 hash, the S8+ and Oreo binaries have the same code but at a shifted location):

454924: f946d268 ldr x8, [x19,#3488]
454928: 52a00029 mov w9, #0x10000 // #65536
45492c: 728b6309 movk w9, #0x5b18
454930: 5280014b mov w11, #0xa // #10
454934: b8696908 ldr w8, [x8,x9]
454938: f946ca69 ldr x9, [x19,#3472]
45493c: 528002ca mov w10, #0x16 // #22
454940: 9103a3e0 add x0, sp, #0xe8
454944: 7100051f cmp w8, #0x1
454948: 3943b929 ldrb w9, [x9,#238]
45494c: 321f0fe8 orr w8, wzr, #0x1e
454950: 1a880176 csel w22, w11, w8, eq
454954: 321e03e8 orr w8, wzr, #0x4
454958: 1a8a016a csel w10, w11, w10, eq
45495c: 1a8803f9 csel w25, wzr, w8, eq
454960: 7100013f cmp w9, #0x0
454964: 1a9f1155 csel w21, w10, wzr, ne

There are 2 external values that control channel allocation

(the areas pointed by ldr x9, [x19,#3472] and ldr x8, [x19,#3488]).

"orr w8, wzr, #0x1e" sets 30 channels for GPS and "mov w10, #0x16"

sets 22 channels for GLNS, if the first configuration parameter is not set.

Otherwise both get 10 channels from "mov w11, #0xa"

My first idea was that this is controlled by the <gll->BestGnssMix="true",

but it is a false assumption ;)

GAL gets the same amount of channels as GLNS, if the second parameter is not zero

"ldrb w9, [x9,#238] -> cmp w9, #0x0"

I have no idea who and how sets these parameters (for that i need a kernel with /dev/mem compiled in, gdb and other goodies), so in the "default" configuration

GPS=30, GLNS=22 and GAL=0.

I suggest to replace "mov w10, #0x16" with "mov w10, #0x0"

to zero the number of GLNS channels (seems to be a pretty trivial change).

As a second incremental step we can try to replace "csel w21, w10, wzr, ne"

with "mov w21, #0x16", so GAL gets 22 search channels instead of GLNS.
[Huawei Mate 9 Questions & Answers] palatkik:
Please help a novice like me understand? How does recording the Rinex data in a moving car benefit anymore than just saving the nmea log, gpx or kml track as most other GPS applications for android do?
[Huawei Mate 9 Questions & Answers] cr2:
I have a problem running modified glgps4774 on my Mate 9, related to the selinux context. What is the security mechanism of checking its integrity ?

Is there any stored hash value, which fails the verification ???

---------- Post added at 12:00 PM ---------- Previous post was at 11:50 AM ----------

The built-in positioning algorithm which produces your NMEA log has limited amount of information about the atmospheric conditions (electron density in the ionosphere, temperature and water content in the troposphere) and not very accurate position information for the satellites. Using external data sources to correct these errors

( and therefore improve the model algorithm) allows huge improvements in the positioning accuracy.
[Huawei Mate 9 Questions & Answers] palatkik:
Thanks for your helpful information. I personally have an interest in the point positioning usefulness of the Geo++ Rinex Android app on a Mate-9 as sometimes I need to check things in the field and results I get with the Mate-9 fulfill this it seems.

I have tested this on a point collecting 20 minutes of data or 1 hour of data then processing on an ITRF network website. I am getting repeated results within 1.5m position with the 1 hour data and within 2m using 20 minutes of data. This I find very reasonable for a mobile phone.

** However the height above ellipsoid results are only within about 10 meters of each other, do you think this about right - should heights be like this when position is so good? Can you help explain why elevations might be 5 times worse in the results please?
[Huawei Mate 9 Questions & Answers] palatkik:
Thanks for feedback. I have checked out all my readings on a point, and if I average them all out to minimize the outliers or take out the outliers altogether I would tend to agree with you that my ellipsoid heights are about twice the uncertainty (4m) of the horizontal results (2m). I can live with this on a mobile phone :).
[Huawei Mate 9 Questions & Answers] cr2:
If you think that S8+ has a better GPS receiver than Mate 9,

have a look at my screenshot:
[Huawei Mate 9 Questions & Answers] cr2:
And also a fixup in the .rela.dyn section, then the new hardcoded almanac is fully accepted by glgps4774
[Huawei Mate 9 Questions & Answers] hanskie:
[MENTION=234719]cr2[/MENTION]

This screenshot is from S8?

Why only 18 satellites? No glonas, Chinese or Japanese satellites? Where are you? :)

I have got 20 satellites in my room at home.
[Huawei Mate 9 Questions & Answers] cr2:
This was my Mate 9, but it has exactly the same Broadcom GPS receiver

(BCM4753 inside BCM4774) as S8*

and other Huawei phones like P9, P10, Honor 9, etc.

glonas is disabled via RTI, Beidou through gpsconfig.xml and QZSS is below the horison at that time. I have clean GPS+GAL config with 7 visible Galileo satellites.

When the next 4 Galileo satellites will be activated, i'll try to test the Galileo-only setup (just for fun).

The coordinates are on the screenshot, this is the parking lot at Galileo Control Center in Oberpfaffenhofen, Germany.
[Huawei Mate 9 Questions & Answers] cr2:
Wanted to share the Galileo-only screenshot (using stock GPS Test.apk) and make some comments. Galileo reception works properly only if you use the V5 for the LTO. The standard setting in gps.conf is to download LTO V4 from http://gllto.glpals.com/7day/v4/latest/lto2.dat

On the rooted phone i have downloaded lto2.dat from http://gllto.glpals.com/4day/v5/latest/lto2.dat (note the "4day", there is no "7day" for v5),

put it into /data/gps/lto2.dat and run 'date +%s > /data/gps/ltoStatus.txt

You can also try to edit gps.conf and see if it helps,

because i don't use internet on Mate9.

There are still two big questions remaining for Broadcom:

1. How to disable duty cycling (there is a parameter called "MinMaxBlock" which is set to 2,5 on Mate9 and to 2,3 on S8*, and it is not known what it means)

2. Why there is no output of Galileo Navigation subframes ? Such function exists in glgps4744 code, but for some reason it is never called, and the actual data is internally available. This is a clear software bug, but i guess only Broadcom can fix it.
[Huawei Mate 9 Questions & Answers] cr2:
7day is available now also for V5.
[Huawei Mate 9 Questions & Answers] @Vortex:
Awesome,I'm troubled with the Broadcom GPS system locking for pretty long time,can you give some extra detail guide to do the full modification for the Broadcom GPS?thanks,I think this method will be availiable for most broadcom chips even some legacy ones:)

---------- Post added at 21:06 ---------- Previous post was at 20:28 ----------

1.Is the gllto.glpals.com:80/rtistatus.dat ?What's the encypt key for this file?:)

2.Any other modification need to disable GLONASS?
[Huawei Mate 9 Questions & Answers] kmichalak2:
Are there any keys that are required to view/edit rtistatus and rto files?
[Huawei Mate 9 Questions & Answers] hanskie:
when i drivig a car there is no problem. Problem is when i do some sports like skiing. When i drive a cable car (ski lift) the track is stright. When i'm skiing track is crazy as a EKG.

You could check my track from osmand.

https://www.dropbox.com/s/0qg9vgd6jq19e9e/2017-01-18_13-37_Wed.gpx?dl=0
[Huawei Mate 9 Questions & Answers] palatkik:
I've switched the Location Mode from "Use GPS only" to "Use GPS, Wifi and mobile networks" and the problem like this seems to be greatly reduced.

What location mode are you using?
[Huawei Mate 9 Questions & Answers] hanskie:
[MENTION=591659]palatkik[/MENTION]

I use it with WiFi and GSM too. Energy saving is turned off. Set to normal mode.

Wysłane z telefonu Mate 9
[Huawei Mate 9 Questions & Answers] hanskie:
Another test behind me after setting on my phone factory default. Finally result is the same. This phone is not usable for any sport activity.

Wysłane z telefonu Mate 9
[Huawei Mate 9 Questions & Answers] gm007:
This application is rated 3.8 maybe try another one.
[Huawei Mate 9 Questions & Answers] hanskie:
It doesn't matter. I have tried also osmand and there is the same issue.

At the same time I had a second phone with iski tracker too and recording was great. It was old Samsung S4 mini.

Wysłane z telefonu Mate 9
[Huawei Mate 9 Questions & Answers] RR-99:
How frequently is your app updating the GPS position?

It looks like there are not enough samples for the speed you are travelling.
[Huawei Mate 9 Questions & Answers] hanskie:
Every 3 seconds (I think). It's not important how often it is. It should be precisely not like in the picture. This frequency is default and the same as in any other phone on which this track looks good.

Wysłane z telefonu Mate 9
[Huawei Mate 9 Questions & Answers] RR-99:
Well I can't explain the difference from your other phones, but 3 seconds might be too long depending how fast you are travelling.

If you are in a car or on a bike, you will have travelled a long way in 3 seconds and the app has to use every point. With more plots, the app has enough data to smooth out the path.

I use Geo Tracker and set it to record positions every 1 second. It gives very good tracks on my Mate 9 even at speed.
[Huawei Mate 9 Questions & Answers] hanskie:
So tell me why on any other phones everythink lokks great? I have noticed this issue only on my Mate 9. Speed is not important, frequency of position reading too. My phone shows that I'm jumping up the ski slope - thats not true.
[Huawei Mate 9 Questions & Answers] gauravxda:
Works like a Charm ,

Recently did a 4000 km New Zealand road trip . Used Google Maps GPS for approx 10 hours a day for 10 days . Heard GPS signal lost for just once . It worked beautifully . And the best part is this is first phone which can do all day long GPS tracking without charging in . My previous Note 4 would die in 4-5 hours .

Even without internet connection in mountains it worked really well . I am thrilled ! .
[Huawei Mate 9 Questions & Answers] forrestcate:
No problems here
[Huawei Mate 9 Questions & Answers] palatkik:
Yes, I thought that fixed it, but it seems with mine also if I use GPS Wifi and GSM the fix jumps all over. Yesterday I did a 22km route and the Sports fitness app measured it as 28km, so useless like you say. Never had this issue with my old Samsung. Hope it gets fixed because rest of phone is great.
[Huawei Mate 9 Questions & Answers] RR-99:
The Mate 9 is the best phone GPS I've ever used - and I've used lots.

I always use GPS only, with WiFi and GSM turned off. Those methods are far less accurate than GPS and are only really useful when GPS signals are screened - indoors or in city canyons.

In almost all outdoor situations you'll get better results with GPS only, particularly with the new Galileo system coming on stream and used by the Mate 9.

Try it that way.
[Huawei Mate 9 Questions & Answers] hanskie:
[MENTION=4947133]RR-99[/MENTION]

Have you tried to use it for sports? For example skiing?

I use for many years on different phones (Samsung galaxy note II, Sony Xperia P, Samsung galaxy s4 mini, IPhone 6) and I have never seen such a bad recording as on Mate 9.
[Huawei Mate 9 Questions & Answers] RR-99:
Not for skiing but I have used it on a pedal cycle and in the car of course.

It gives a very good plot, using only GPS. It is better than my Note 4.
[Huawei Mate 9 Questions & Answers] palatkik:
Are you using it in open or built up areas? Until now I have tried it in built up areas whilst cycling and I find the Mate-9 mostly useless for GPS tracking. I have chosen both of the location modes with GPS and prefer to use GPS only but the fixes are all over the place causing spiking in position and on a typical track an over accumulated distance of 10-30% higher than distance actually traveled due to jumps in GPS location fixes. This in my 4th smart phone over past 10 years and I've never seen such rubbish results.

I contacted Huawei about it and below is their useless reply to me:

Regarding your issue, we would advise that you check weather (sic) you have selected the location mode with high accuracy, in order to do this you will need to go to Settings > Location access > Location mode and select 'High accuracy'.

Moreover, we do not have any type of information or configuration of this application because we do not support third party applications and we can not guarantee the compatibility between our models and third party applications.

For further assistance we will advise you to verify with the application developers in order to know if a particular fitness application is compatible with our phones.
[Huawei Mate 9 Questions & Answers] RR-99:
Hi palatkik,

You will see there is another thread running about GPS at the moment. There seems to be some doubt as to which GPS systems the Mate is actually using.

Could you load the GPS Test Plus app? It shows which satellites the phone can see. I'd be interested to know what your phone is using.
[Huawei Mate 9 Questions & Answers] hanskie:
I have got a brand new mate 9. It's a second piece of this phone because of gps issue. I have made a test yesterday and there is a result :

Every print screens and recordings was made at the same time!

Mate 9

Huawei P9

Samsung Galaxy Note 2

View attachment 1

Wysłane z telefonu Mate 9
[Huawei Mate 9 Questions & Answers] RR-99:
So the Mate 9 is less accurate than the P9. That can't be right surely.

Can you check which satellites it is seeing, with one of the test apps?
[Huawei Mate 9 Questions & Answers] hanskie:
No that's impossible. There is no option to check.

Wysłane z telefonu Mate 9
[Huawei Mate 9 Questions & Answers] RR-99:
You can check what satellites you are receiving, with another app: GPS Test, or GPS Status, or AndroiTS GPS Test.
[Huawei Mate 9 Questions & Answers] hanskie:
Where are this galileo satellites?

Wysłane z telefonu Mate 9
[Huawei Mate 9 Questions & Answers] RR-99:
I think Galileo are the ones marked with a "?"

But if the phone is not identifying the Galileo satellites, how can we be sure that it is using them or ignoring them?

There is something strange happening with the Mate 9 GPS. I hope that Huawei is looking into this. If it is a software problem it can be fixed with a firmware update. If is something firmware related then we are *****d with Galileo.
[Huawei Mate 9 Questions & Answers] hanskie:
I think mate 9 do not recognise galileo satellites. It should be shown in GPS Test app as on attached picture. View attachment 4038082

I don't understand this situation.

Wysłane z telefonu Mate 9
[Huawei Mate 9 Questions & Answers] Hielko:
L29

One Galileo satelite visible by GPS test. The triangle with number 26.
[Huawei Mate 9 Questions & Answers] hanskie:
Please give us an information about your firmware version.

Wysłane z telefonu Mate 9
[Huawei Mate 9 Questions & Answers] Hielko:
See screenshot.
[Huawei Mate 9 Questions & Answers] palatkik:
I am not sure which other GPS thread you mean? So far I have only found this one and a much smaller thread on GPS for the Mate9? I have GPS Test but but not the paid Plus version. I also have another similarly named free app called GPS Test that I find more quickly id's the satellite constellation by flag as attached. So on my Mate 9 today I currently see satellites from 5 different organizations US, Russian, Chinese, Japanese and Europe. I can only assume that all are being used by all apps at any time as there is no way of filtering them in/out in any apps I have.

I generally don't have a problem with GPS navigation apps such as turn by turn navigation, but the sports tracking apps that record continuous tracks like the Ski app mentioned on this thread and the apps I use SportyPal and Sports Tracker apps for cycling - both produce jumps in position as large errors in accumulated distances exercised over, much worse than I have ever seen.
[Huawei Mate 9 Questions & Answers] Benji1983:
Hi

Here also no problems at all

Greetz benji
[Huawei Mate 9 Questions & Answers] RR-99:
Strange that different users are getting different reception.

I'm not complaining about operation myself, it seems to track OK. But some satellites are not correctly labelled.

Benji1983, you have the '?' labels like me.

Here's the other thread:

https://xdaforums.com/mate-9/help/gps-mate-9-t3552780
[Huawei Mate 9 Questions & Answers] RR-99:
Hi palatkik. I have loaded the same app as you (I think later version?) and it shows very different. Only GPS, none of the others. I would like to know why.

Which Mate 9 version is yours? I have L29C432B138. Have you made any firmware changes?
[Huawei Mate 9 Questions & Answers] gm007:
He is using this app,and here are my test.c185b138
[Huawei Mate 9 Questions & Answers] RR-99:
Thank you very much gm007!

I have that app now. On my phone it is showing GPS and Glonass. Just by a window indoors I haven't seen any Beidou or Galileo yet but I will take it out for a walk.

---------- Post added at 04:25 PM ---------- Previous post was at 03:37 PM ----------

Have been standing in a very open area for five minutes.

Still only GPS and Glonass. Something isn't right - I wonder if this is a Mate 9 version issue. No reason why it should be but what else could it be.?
[Huawei Mate 9 Questions & Answers] hanskie:
I have asked Huawei about that and they told me that the mate 9 doesn't use a galileo satelites. I don't know that's true.

I see only GPS Glonass Beidou.

Wysłane z telefonu Mate 9
[Huawei Mate 9 Questions & Answers] RR-99:
The specification here says it does get Galileo

http://consumer.huawei.com/en/mobile-phones/tech-specs/mate9-en.htm

But I have not seen it yet.
[Huawei Mate 9 Questions & Answers] hanskie:
Yes, our phone is ready to use galileo but as said Huawei they don't use this satelites. Maybe they will later?

Wysłane z telefonu Mate 9
[Huawei Mate 9 Questions & Answers] RR-99:
If someone has a good contact with Huawei they should send them a link to this thread. Perhaps they could explain what is actually happening and if it is going to change.
[Huawei Mate 9 Questions & Answers] gm007:
Just did a test on my Mi5 phone at the same place,and there is lot of difference,mate 9 is much better.
[Huawei Mate 9 Questions & Answers] RR-99:
Yes. I found the Mate 9 was more accurate than my Note 4. But your screen shot confirms that it is only receiving GPS and Glonass. No Galileo or Beidou.

Galileo should be the most accurate of all. Why are we not using it.?
[Huawei Mate 9 Questions & Answers] gm007:
I'm finding beidou wih mate 9 but not galileo.

I think need a software update.
[Huawei Mate 9 Questions & Answers] RR-99:
If you are receiving Beidou sats, there should be as many as GPS and Glonass.

Yes let's hope that 156 will fix it.
[Huawei Mate 9 Questions & Answers] hanskie:
The should better correct gps stability during sport activity.

Bellow Beidou satelite.

Wysłane z telefonu Mate 9
[Huawei Mate 9 Questions & Answers] RR-99:
Just one Beidou? That will not help.
[Huawei Mate 9 Questions & Answers] gm007:
I can find maximum 3 beidou.
[Huawei Mate 9 Questions & Answers] RR-99:
3 is not enough for a fix.
[Huawei Mate 9 Questions & Answers] hanskie:
I'm in Europe. Not in Asia :) I don't need Beidou satelites

Wysłane z telefonu Mate 9
[Huawei Mate 9 Questions & Answers] RR-99:
Beidou is not only for Asia. It is being extended to cover the whole world, with 35 satellites.
[Huawei Mate 9 Questions & Answers] palatkik:
I am in Asia and mostly see US and Russian satellites on the Mate9 with a European, Chinese and Japanese in few amounts. Yes 3 is not enough but combined I have over 20 to use so if one or two of those is Chinese shouldn't they combine with other constellations to give a suitable fix?

I have just completed another unsuccessful Mate-9 cycling exercise. Attached is a plot of the gpx output showing part the exact same route mapped by a Samsung Note 2 vs my newer Mate 9. Whereas both devices stray from the true line due to line of sight obstructions the Mate-9 is spiking all over the place using GPS/Wifi/GSM most accurate mode. The Samsung Note 2 was Kitkat and had one location mode only. The Mate-9 added an extra 7km to the total distance making it next to useless imho.
[Huawei Mate 9 Questions & Answers] hanskie:
[MENTION=591659]palatkik[/MENTION]

Great job. No one believed me that Mate 9 has got that issue.

Which application you used for this test?

Could you tell us something about the terrain specification where you had this track deviations?

Wysłane z telefonu Mate 9
[Huawei Mate 9 Questions & Answers] RR-99:
No, you can't add one satellite to another constellation because they are not synchronised together. If your receiver is working correctly it will get separate position fixes from each system and make a decision how to combine them for the best result. With only one or two satellites from one system it will ignore them.

But if you are in Asia you should be receiving many Beidou satellites, not just one or two!

If that is what you are getting with the Mate 9 you should report it to Huawei technical support.

By the way, "GPS/Wifi/GSM most accurate mode" will not help at all if you are out cycling. It is only more accurate if you are in a difficult place where you cannot get a good GPS fix. Otherwise the phone should only be using GPS because it is very much more accurate.
[Huawei Mate 9 Questions & Answers] palatkik:
OK. I have last week sent the image of Samsung Note 2 track and Huawei Mate 9 track to Huawei support - until no answer. I have only until now found a contact in London UK for support and haven't explained to them yet I am in Asia where I bought the international model. Will follow up with this thread if it proves helpful. The area I have done my track comparison was in a heavily built up area so I do expect errors, I notice when I pass a high rise building the track can veers 10-20 m away from it with both Samsung and Huawei which is OK but the Huawei spikes remain unexplained? I used GPS/wifi/GSM before as that is what the Tech Support guy told me to use so I sent them that map of it. Later this coming week I will try exact same route with "GPS only" on the Huawei Vs Samsung, but I have tried it before on other routes and it was worse.

OK, so the different nations constellations don't work in sync with each other. Can anyone or yourself suggest a technical link for this explaining why the satellite constellations are not compatible with each other please? I can believe it but would like it clear for my understanding? Perhaps this is reason for spikes in position if the device is jumping between constellations that are not in sync themselves? I have 100-150m spikes in position on the sample map I attached earlier.

In my previous GPS Test I only had one Chinese satellite, but my location was obscured. I was on the 15th floor of an apartment building! I have since tried it outside in open area where I picked up a lot more satellites of course and 5 Chinese came up and there were more US and Russian. The screen capture does not show all as they scroll off bottom.
[Huawei Mate 9 Questions & Answers] palatkik:
Thanks! I have been using a fitness app called free SportyPal Pro for many years, since the days of Windows Mobile Phone! It allows free upload of track data to their web site and from there one can download a GPX file of the track. I have made the GPX plot I posted using standard mapping software, in this case I used Global Mapper on Windows PC but any will do.

I have compared other fitness apps and they all show these spikes in track position with Mate-9 but I have only noticed SportyPal as a free app that allows GPX export.