[Android Software/Hacking General [Developers Only]] Genesis3:
On to the next (and really the last ugly) problem I've got here....

Attempting to complete CM7 port, and the remaining problem is the GPS. I've tried linking with the Froyo libraries without success - the GPS never turns on at all, and it appears the problem is library based with differences in alignment between arguments (e.g. long where there would be doubles, etc) as some of the device addresses are completely hosed in the debug trace.

CM7 includes AMSS support up to 50000. /dev/oncrpc supports that this is what I should be using. And it sort of comes up.

This is what I get on boot:

D/GpsLocationProvider( 213): handleEnable
D/loc_api_rpc_glue( 213): Loc API RPC client initialized.
D/GpsLocationProvider( 213): set_capabilities_callback: 7
D/libloc ( 213): loc_read_gps_conf: using /etc/gps.conf
D/libloc ( 213): loc_eng_init created client, id = 0
D/libloc ( 213): loc_eng_ni_init: entered.
D/libloc ( 213): loc_eng_set_server, type = 1, hostname = supl.google.com, port = 7276
D/libloc ( 213): loc_eng_set_server, addr = supl.google.com:7276
D/libloc ( 213): loc_eng_ioctl called: client = 0, ioctl_type = RPC_LOC_IOCTL_SET_UMTS_SLP_SERVER_ADDR
D/libloc ( 213): loc_eng_deferred_action_thread started
D/libloc ( 213): loc_eng_set_gps_lock mode, client = 0, lock_type = 1
D/libloc ( 213): loc_eng_ioctl called: client = 0, ioctl_type = RPC_LOC_IOCTL_SET_ENGINE_LOCK
D/libloc ( 213): loc_eng_ioctl result: client = 0, ioctl_type = RPC_LOC_IOCTL_SET_UMTS_SLP_SERVER_ADDR, RPC_LOC_API_SUCCESS
D/libloc ( 213): loc_eng_ioctl result: client = 0, ioctl_type = RPC_LOC_IOCTL_SET_ENGINE_LOCK, RPC_LOC_API_SUCCESS

So far, so good; we init and set up the supplemental host pointer, and all looks ok.

But then...

D/GpsLocationProvider( 213): NTP server returned: 1316203868090 (Fri Sep 16 15:11:08 GMT+00:00 2011) reference: 39387 certainty: 250 system time offset: -14870
D/libloc ( 213): loc_eng_inject_time, uncertainty = 250, time 1316203868090
D/libloc ( 213): loc_eng_ioctl called: client = 0, ioctl_type = RPC_LOC_IOCTL_INJECT_UTC_TIME
E/loc_api_rpc_glue( 213): loc_api_sync_ioctl: IOCTL result failed, result: 1 (select id 0)
D/libloc ( 213): loc_eng_ioctl result: client = 0, ioctl_type = RPC_LOC_IOCTL_INJECT_UTC_TIME, RPC_LOC_API_GENERAL_FAILURE
E/libloc ( 213): loc_eng_inject_time failed

Not so good. I added a diagnostic to make sure the time I was sending up was in fact the same (no problems with typing) as the NTP server returned. It is.

Now here's the potential problem - this is off the boot, and we haven't set an operating mode yet. Can the system push this data without having done that

first

? I don't know.

The attempt to load the ephermis from the xtra servers fails too:

D/GpsLocationProvider( 213): calling native_inject_xtra_data
D/libloc ( 213): loc_eng_deferred_action_thread signalled
D/libloc ( 213): qct_loc_eng_inject_xtra_data, xtra size = 38521, data ptr = 0x5fd078
D/libloc ( 213): qct_loc_eng_inject_xtra_data, part 1/38, len = 1024, total = 0
D/libloc ( 213): Inject coarse position Lat=30.399703, Lon=-86.501947, Acc=2926.00
D/libloc ( 213): loc_eng_ioctl called: client = 0, ioctl_type = RPC_LOC_IOCTL_INJECT_POSITION
D/libloc ( 213): loc_ioctl XTRA injected length: 1024
D/libloc ( 213): qct_loc_eng_inject_xtra_data, part 2/38, len = 1024, total = 1024
D/libloc ( 213): loc_ioctl XTRA injected length: 2048
D/libloc ( 213): qct_loc_eng_inject_xtra_data, part 3/38, len = 1024, total = 2048
D/libloc ( 213): loc_ioctl XTRA injected length: 3072
D/libloc ( 213): qct_loc_eng_inject_xtra_data, part 4/38, len = 1024, total = 3072
D/libloc ( 213): loc_ioctl XTRA injected length: 4096
D/libloc ( 213): qct_loc_eng_inject_xtra_data, part 5/38, len = 1024, total = 4096
D/libloc ( 213): loc_ioctl XTRA injected length: 5120
D/libloc ( 213): qct_loc_eng_inject_xtra_data, part 6/38, len = 1024, total = 5120
D/libloc ( 213): loc_ioctl XTRA injected length: 6144
D/libloc ( 213): qct_loc_eng_inject_xtra_data, part 7/38, len = 1024, total = 6144
D/libloc ( 213): loc_ioctl XTRA injected length: 7168
D/libloc ( 213): qct_loc_eng_inject_xtra_data, part 8/38, len = 1024, total = 7168
D/libloc ( 213): loc_ioctl XTRA injected length: 8192
D/libloc ( 213): qct_loc_eng_inject_xtra_data, part 9/38, len = 1024, total = 8192
D/libloc ( 213): loc_ioctl XTRA injected length: 9216
D/libloc ( 213): qct_loc_eng_inject_xtra_data, part 10/38, len = 1024, total = 9216
D/libloc ( 213): loc_ioctl XTRA injected length: 10240
D/libloc ( 213): qct_loc_eng_inject_xtra_data, part 11/38, len = 1024, total = 10240
D/libloc ( 213): loc_ioctl XTRA injected length: 11264
D/libloc ( 213): qct_loc_eng_inject_xtra_data, part 12/38, len = 1024, total = 11264
D/libloc ( 213): loc_ioctl XTRA injected length: 12288
D/libloc ( 213): qct_loc_eng_inject_xtra_data, part 13/38, len = 1024, total = 12288
D/libloc ( 213): loc_ioctl XTRA injected length: 13312
D/libloc ( 213): qct_loc_eng_inject_xtra_data, part 14/38, len = 1024, total = 13312
D/libloc ( 213): loc_ioctl XTRA injected length: 14336
D/libloc ( 213): qct_loc_eng_inject_xtra_data, part 15/38, len = 1024, total = 14336
D/libloc ( 213): loc_ioctl XTRA injected length: 15360
D/libloc ( 213): qct_loc_eng_inject_xtra_data, part 16/38, len = 1024, total = 15360
D/libloc ( 213): loc_ioctl XTRA injected length: 16384
D/libloc ( 213): qct_loc_eng_inject_xtra_data, part 17/38, len = 1024, total = 16384
D/libloc ( 213): loc_ioctl XTRA injected length: 17408
D/libloc ( 213): qct_loc_eng_inject_xtra_data, part 18/38, len = 1024, total = 17408
D/libloc ( 213): loc_ioctl XTRA injected length: 18432
D/libloc ( 213): qct_loc_eng_inject_xtra_data, part 19/38, len = 1024, total = 18432
D/libloc ( 213): loc_ioctl XTRA injected length: 19456
D/libloc ( 213): qct_loc_eng_inject_xtra_data, part 20/38, len = 1024, total = 19456
D/libloc ( 213): loc_ioctl XTRA injected length: 20480
D/libloc ( 213): qct_loc_eng_inject_xtra_data, part 21/38, len = 1024, total = 20480
D/libloc ( 213): loc_ioctl XTRA injected length: 21504
D/libloc ( 213): qct_loc_eng_inject_xtra_data, part 22/38, len = 1024, total = 21504
D/libloc ( 213): loc_ioctl XTRA injected length: 22528
D/libloc ( 213): qct_loc_eng_inject_xtra_data, part 23/38, len = 1024, total = 22528
D/libloc ( 213): loc_ioctl XTRA injected length: 23552
D/libloc ( 213): qct_loc_eng_inject_xtra_data, part 24/38, len = 1024, total = 23552
D/libloc ( 213): loc_ioctl XTRA injected length: 24576
D/libloc ( 213): qct_loc_eng_inject_xtra_data, part 25/38, len = 1024, total = 24576
D/libloc ( 213): loc_ioctl XTRA injected length: 25600
D/libloc ( 213): qct_loc_eng_inject_xtra_data, part 26/38, len = 1024, total = 25600
D/libloc ( 213): loc_ioctl XTRA injected length: 26624
D/libloc ( 213): qct_loc_eng_inject_xtra_data, part 27/38, len = 1024, total = 26624
D/libloc ( 213): loc_ioctl XTRA injected length: 27648
D/libloc ( 213): qct_loc_eng_inject_xtra_data, part 28/38, len = 1024, total = 27648
D/libloc ( 213): loc_ioctl XTRA injected length: 28672
D/libloc ( 213): qct_loc_eng_inject_xtra_data, part 29/38, len = 1024, total = 28672
D/libloc ( 213): loc_ioctl XTRA injected length: 29696
D/libloc ( 213): qct_loc_eng_inject_xtra_data, part 30/38, len = 1024, total = 29696
D/libloc ( 213): loc_ioctl XTRA injected length: 30720
D/libloc ( 213): qct_loc_eng_inject_xtra_data, part 31/38, len = 1024, total = 30720
D/libloc ( 213): loc_ioctl XTRA injected length: 31744
D/libloc ( 213): qct_loc_eng_inject_xtra_data, part 32/38, len = 1024, total = 31744
D/libloc ( 213): loc_ioctl XTRA injected length: 32768
D/libloc ( 213): qct_loc_eng_inject_xtra_data, part 33/38, len = 1024, total = 32768
D/libloc ( 213): loc_ioctl XTRA injected length: 33792
D/libloc ( 213): qct_loc_eng_inject_xtra_data, part 34/38, len = 1024, total = 33792
D/libloc ( 213): loc_ioctl XTRA injected length: 34816
D/libloc ( 213): qct_loc_eng_inject_xtra_data, part 35/38, len = 1024, total = 34816
D/libloc ( 213): loc_ioctl XTRA injected length: 35840
D/libloc ( 213): qct_loc_eng_inject_xtra_data, part 36/38, len = 1024, total = 35840
D/libloc ( 213): loc_ioctl XTRA injected length: 36864
D/libloc ( 213): qct_loc_eng_inject_xtra_data, part 37/38, len = 1024, total = 36864
D/libloc ( 213): loc_ioctl XTRA injected length: 37888
D/libloc ( 213): qct_loc_eng_inject_xtra_data, part 38/38, len = 633, total = 37888
D/libloc ( 213): loc_eng_ioctl called: client = 0, ioctl_type = RPC_LOC_IOCTL_INJECT_PREDICTED_ORBITS_DATA
D/libloc ( 213): loc_eng_ioctl result: client = 0, ioctl_type = RPC_LOC_IOCTL_INJECT_POSITION, RPC_LOC_API_SUCCESS
E/loc_api_rpc_glue( 213): loc_api_sync_ioctl: IOCTL result failed, result: 1 (select id 1)
D/libloc ( 213): loc_eng_ioctl result: client = 0, ioctl_type = RPC_LOC_IOCTL_INJECT_PREDICTED_ORBITS_DATA, RPC_LOC_API_GENERAL_FAILURE
E/libloc ( 213): loc_eng_ioctl for xtra error

Note that the injection of network position (from the cell system) SUCCEEDS but the ephermis download FAILS.

From here if I start the GPS I get position reports but (obviously) the aGPS data isn't used as it never got loaded, and the GPS is unable to get a lock - even after a half-hour or more outdoors. It does show intermittent locks on up to three satellites, but never gets the ephermis and almanac (which can require ~15 minutes or more on a cold start) to give me a fix.

To fix this I have to through one form or another get the network assistance working. The question is.... why ISN'T it working when it appears the format of the data being sent down is fine, and more importantly most of the RPC calls are claiming success!