Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Xiaomi Mi 8 doesn't show carrier frequency in Status "CF" column #167
I can not see getCarrierFrequencyHz used for getting carrier frequency in Status view "CF" column
Steps to reproduce:
I have download source code, but don't see getCarrierFrequencyHz here
i think carrier frequency should show at status fragment.
I see blank at CF column
Device and Android version:
I use Xiaomi MI8 which support dual frequencies
@benzfish Thanks for opening this issue! I had been putting off opening it hoping that this was an oversight and Xiaomi would quickly fix it with a firmware update, but given that it was released on May 31st this is looking increasingly unlikely. What firmware version is your Mi 8 on currently?
I outlined some of the background of the problem in the article I wrote on dual-frequency on Android:
...and specifically in the Xiaomi Mi 8 section:
Here's what I see:
Based on user screenshots of GnssLogger it appears that the Xiaomi Mi 8 is populating carrier frequency information for the GnssMeasurement.getCarrierFrequencyHz() method:
...but NOT for the GnssStatus.getCarrierFrequencyHz() method:
GnssStatus.getCarrierFrequencyHz() Android docs say:
It seems to me, then, as a corollary of:
...if Xiaomi is returning L5 signals in GnssStatus, getCarrierFrequencyHz() MUST be set - otherwise, it implies that the signal is on the L1 (primary) frequency, which is wrong.
I asked for clarification of this Android documentation in a few places, including:
...but so far haven't heard back. Assuming that I'm interpreting the Android docs correctly, then Xiaomi shouldn't have shipped the device in this state, especially when they are touting dual-frequency on the device. However, it looks like the Android CTS tests, which are supposed to flag any issues before devices ship, doesn't cover carrier frequency very well. I went digging into the Android CTS to see if there were any test cases for correct values in GnssStatus.getCarrierFrequencyHz(), and from GnssStatusTest it looks like there aren't:
Here's the only code related to carrier frequency:
I'm assuming that because CTS didn't flag the issue, the device shipped.
Possible workarounds for showing CF values in GPSTest on the current Mi 8 would be:
I'm following up with some contacts to see if I can get more info on the NMEA strings and carrier info. Until then, my hands are tied on this, and it's up to Xiaomi to fix the issue with a firmware update. And, even if I do get the NMEA documentation, it's a messy workaround fix for an issue that shouldn't exist.
So, in summary - IMHO this is a firmware issue with the Xiaomi Mi 8, and they need to fix it. I'll leave this issue open until the problem is resolved one way or another.
Here is a PDF from Broadcom, presumably for the BCM47755:
Reading between the lines, the phrase "GNSS Vendors are transitioning from legacy interface to the new one" seems to indicate that Broadcomm doesn't yet support the
Here's the NMEA section:
Here is a NMEA reference for
So, digesting the above - given a NMEA GSV string like:
Indexes 4, 8,12, and 16 (assuming 0-indexed) are the svids (indexes 8, 12, and 16 may be empty). If index 12 is
For example, in this NMEA string:
...index 12 is
After reviewing the Broadcom slides further, it looks like I can't extract all needed information to link the NMEA strings to the GnssStatus objects that are used in the GPSTest "Status" view.
Specifically, there is a boolean value in the GnssStatus object for whether or not a specific signal is "used" to compute the location of the device, and this same field doesn't exist in the NMEA string. So from the NMEA strings I can't see if a particular signal is used. And, without the carrier frequency info in the GnssStatus object, I can't link the NMEA string uniquely to a GnssStatus object.
So unfortunately it looks like I'm still stuck waiting for Xiaomi to add support for
Google has updated the Android CTS suite to include a new unit test for carrier frequency:
The Mi 8 is GNSS HW year 2018, so it will currently fail this CTS test, as it does not provide carrier frequency via GnssStatus. So, I hope Xiaomi will acknowledge this and fix it in an update.
Looks like Xiaomi has fixed this issue in the latest Android P update:
So that's great news! The Beidou frequency looks strange, but I'll open another issue for that.
Hey! Does anyone know why on the Xiaomi all of the C/N0, azimuth, and elevation values all end in a ".0" for the GnssStatus callback? It seems like there is some double to integer to double conversion happening somewhere.
I have worked with a Samsung too, and the C/N0 does have other decimal values than ".0"
@claudiaareneee From the devices I've seen it's fairly common to have all
All 3 data types are floats coming from the Android API:
...and they all get rounded to 1 decimal place in the formatting for GPSTest.
Also, what version of the GPSTest app are you running? It looks like an old version, as the CF value for those Beidou satellites should be shown properly in the latest version.
See also #130 regarding dropping the ".0" for elevation and azimuth.