Repository navigation
Conversation
…r it on the Pixel 9a The 9a's gnssd starts some 20 s after the modem is ONLINE (OMAMOBILE_MODEM_GNSS_DELAY). A location request in that window found no @GNSSND, and omamobile-gnss-start exited at once with "nothing to do". GeoClue reconnected at once, so the unit started five times in a second; systemd's start limit then failed it, and omamobile-gnss-nmea.socket with it, for the rest of the boot. GeoClue answered "Connection refused" every 5 s and Location stayed dead until it was switched off and on (derekross#864, the first request after a boot). Now, when the modem unit is up or starting with OMAMOBILE_MODEM_GNSS=1, the start waits for gnssd, 90 s at most, and goes on as soon as it listens. Where gnssd won't come (the modem off, or started without GNSS), the start still says "nothing to do", but holds the client's connection 5 s first, so a client that reconnects at once can't run the unit into the start limit. Tested: test/all gains four cases with a stand-in systemctl: no gnssd and none coming gives up after the hold; a modem without GNSS doesn't wait; a modem bringing gnssd that never comes gives up after the wait; gnssd appearing during the wait starts gnss-slsi. On a Pixel 9a after a clean reboot, a where-am-i request at 5 s of uptime, before the modem unit had started: the start logged the wait at 14 s, went on at 37 s as gnssd listened, and the first position came at 63 s, with no off and on and nothing at the start limit.
…eaves GNSS off on the Pixel 9a
At a reboot, and at the bridge's idle exit, the NMEA bridge stops before the GNSS stack it is ordered after. The 9a's client then wrote NMEA into a FIFO with no reader, SIGPIPE killed it, and the profile stopped itself before systemd's stop came: an unexpected exit, so the hang marker stayed, and every later boot skipped GNSS ("the last bring-up ... never finished") until --retry, leaving apps only GeoClue's IP positions. The skip also exited at once, so GeoClue's reconnects hit the socket's trigger limit and failed it for the rest of the boot, and a request after --retry found nothing listening.
Now the profile spawns the client with SIGPIPE ignored, so it stays until the stack is stopped; the stack is ordered after the 9a's modem unit, so at shutdown it also stops before gnssd goes; and the skip holds the connection 5 s, as "nothing to do" does.
Tested: test/all checks the client's SIGPIPE disposition around its spawn, the ordering and the hold on a leftover marker. On a Pixel 9a on the published kernel, with the bridge stopped first during a session, the stack stopped cleanly and the marker went; then 8 reboots, each with a session running at the reboot, left no marker, where before the fix 4 of 8 boots skipped GNSS after the first such reboot.
W4HO-ham
added a commit
to W4HO-ham/omarchy-mobile
that referenced
this pull request
Nov 19, 2026
…pt-in), with the runs on the published branch Location now works whenever the modem is up, and the modem's start at boot is opt-in for the reason the Modem cell names, so the cell takes the same form as the Modem and Suspend cells. The record has the runs on the published omamobile at 26867fc4e with derekross#864 and derekross#921: a GNSS fix in 25 of 28 boots from a request made before gnssd was up, each reboot made during a session, none skipping GNSS; GeoClue's own start stalled in the other 3, cause open; and five switch-offs and -ons with a fix 7.5 to 9.4 s after each request.
…tion session ends The client stops positioning through the HAL (stopNmea, then stop) when it gets TERM, but the runner's stop signals every daemon of the profile at once, and the HAL went before the client's stop reached it. gnssd then kept the receiver running, with the GNSS core streaming over SPI, until the next boot: after any location request, gnssd used about 10 % of a core and the kernel's SPI driver on a bring-up kernel logged over 100 lines a second. Now the gnss-slsi profile has a graceful stop (profile_stop, which the runner calls from the host before systemd signals the daemons): it signals the client alone, while the HAL is still there, and waits up to 3 s. A stop-requested file in the profile's run directory, written first, tells the runner that this exit is part of the stop, so it stops the rest cleanly instead of reporting "a service exited", and the hang marker's clean-stop rule still holds. A new start removes an old file. Tested: test/all runs profile_stop with a stand-in client and checks the file, the signal and the runner's clean-stop line. On a Pixel 9a after a session: before the change, gnss_spi logged 171 lines a second and gnssd used 86 ms of CPU a second after the stack had stopped, and the drain with the screen off was 408 mA against 309 mA after a fresh boot; with it, both fell to 0 when the stack stopped, the marker cleared, and the drain read 296 mA.
W4HO-ham
force-pushed
the
gnss-wait-for-gnssd
branch
from
November 19, 2026 09:49
d12c26a to
5e92a41
Compare
…nhibitor, and the hold watches for the modem Reading my own three commits again: with the modem off, the 5 s hold made the unit start every 5 s for as long as a client asked, each time under the unit's sleep inhibitor, so a 9a with no modem was kept awake by a position it couldn't have. The unit now starts the script itself and the script takes the inhibitor: at once on the 7 Pro, as its unit always did, and on the 9a only around a session. The hold is 60 s and looks every 5 s whether the modem's unit has started, then waits for its gnssd; a client that keeps asking with the modem off starts the unit once a minute, not kept awake. The wait reads /proc/net/unix with a builtin. The stop finds the client with pgrep -o (procps-ng is now a dependency), and the unit's comment says which unit stops first. Tests: the "doesn't wait" cases have upper bounds, a give-up is checked to leave no marker, session or inhibitor, the stop-requested file is checked to exist when the client gets its signal, and the runner's own stop and supervision lines are run with and without the file. Seventeen mutations of the new code each fail the suite with a FAIL line. Not yet run on a phone.
W4HO-ham
marked this pull request as draft
November 19, 2026 20:58
W4HO-ham
marked this pull request as ready for review
November 20, 2026 00:52
W4HO-ham
added a commit
to W4HO-ham/omarchy-mobile
that referenced
this pull request
Nov 20, 2026
…s#921's final head, and the GeoClue stall's cause Eight more boots on the published kernel with derekross#921's final head had a GNSS fix in seven; the eighth was GeoClue's start stall again, and this time its backtrace was taken. It is a lock-order deadlock between GLib's VFS and proxy resolver setups, reproduced without a boot (7 of 80 cold starts) and gone with GLib's built-in resolver (derekross#942). The record no longer calls the cause open, and says which overlay isn't in the tree.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three faults in the Pixel 9a's location sessions, found in the same boot runs: two ways a reboot left Location without GNSS, and a receiver that kept running after every session. The first three commits are one fix each; the fourth is from reviewing them again.
1. A request before gnssd is up. gnssd starts some 20 s after the modem is ONLINE (
OMAMOBILE_MODEM_GNSS_DELAY). A location request in that window found no@GNSSND, andomamobile-gnss-startexited at once with "nothing to do". GeoClue reconnects at once, so the unit started five times in a second, systemd's start limit failed it, andomamobile-gnss-nmea.socketwith it, for the rest of the boot: GeoClue answered "Connection refused" every 5 s and Location stayed dead until it was switched off and on. This is the first request after a boot in my runs on #864.Now the start waits before it writes the marker, so a give-up leaves nothing behind:
OMAMOBILE_MODEM_GNSS=1, it waits for gnssd, 90 s at most, and goes on as soon as it listens.2. A reboot during a session. At a reboot, and at the bridge's idle exit, the NMEA bridge stops before the GNSS stack it is ordered after. The 9a's client then wrote NMEA into a FIFO with no reader, SIGPIPE killed it, and the profile stopped itself ("a service exited") before systemd's stop came. With the main process gone,
--stopasked for no marker cleanup, so the hang marker stayed and every later boot skipped GNSS ("the last bring-up ... never finished") until--retry: apps got only GeoClue's IP positions, 25 km out. The skip also exited at once, so GeoClue's reconnects hit the socket's trigger limit and failed it for the rest of the boot.Now the profile spawns the client with SIGPIPE ignored (inherited across the exec; its
sedprefixer gets it too, the HAL and the rest don't), so it stays until systemd stops the stack. The stack is ordered afteromamobile-tegu-modem.service(ordering only), so at shutdown it stops before gnssd goes. The skip on a leftover marker holds the connection as "nothing to do" does. The marker's rule is unchanged: only a stop systemd asked for clears it.3. The receiver after a session. The client stops positioning through the HAL (
stopNmea, thenstop) when it gets TERM, but the runner's stop signals every daemon of the profile at once, and the HAL went before the client's stop reached it. gnssd then kept the receiver running, with the GNSS core streaming over SPI, until the next boot. Found looking for why the palmtop runs warm in a pocket with the screen off.Now the
gnss-slsiprofile has a graceful stop (profile_stop, which the runner already calls from the host before systemd signals the daemons, as the 7 Pro's profile has): it signals the client alone, while the HAL is still there, and waits up to 3 s.That touches the shared runner (
lib/omamobile-vendor-chroot, which the modem profile uses too) in one place:profile_stopwrites a stop-requested file in the profile's run directory first, and when a daemon's exit wakes the runner with that file there, it stops the rest with 0 and without the line "a service exited". This keeps the log and the exit code right. It is not what clears the marker: undersystemd-inhibitthe main process ends by the runner's group TERM, which systemd counts as success whether the runner exits 0 or 1, and the marker follows--stophaving found the main process alive. A profile that never writes the file behaves as before, and every start removes an old file before it enters its namespaces. If you'd rather no shared code moved for a log line, I'll drop that hunk.4. The sleep inhibitor (from my own review). The unit ran the whole start under
systemd-inhibit, so with the hold of the first commit a 9a with its modem off would have been kept awake by any client that kept asking: a start every 5 s, each under a block inhibitor. The unit now starts the script itself, and the script takes the same inhibitor: at once on the 7 Pro (it re-executes itself undersystemd-inhibit, so the 7 Pro's start is under it from the same point as before), and on the 9a only around the session.On my palmtop
Pixel 9a, Location on, indoors at the same spot, Wi-Fi up. Each boot run: a clean
systemctl reboot, thenwhere-am-i -t 240as the session user as soon as SSH answered, reporting each position's accuracy and GeoClue's description of its source, never a position.7.3.0-rc6-omamobile-tegu-s2mpg15-m1-g991042e2eff3-dirty)7.3.0-rc6-omamobile-push1-g26867fc4e826, overlayspublic-ramoops, which only adds the pstore region, andmodem-cpif)The final head (f326aef), 2026-11-20, daily kernel, modem up at boot:
gnss_spilines 156 a second during, 0 after the stack stopped and 0 again 90 s later; gnssd's CPU 137 ms a second during, 0 after--retrya GNSS fix in 14 sIn the two runs with a client that kept asking, the unit started once in 130 s and once in 150 s, not once a minute: after the give-up GeoClue did not ask the socket again in that time. No failed unit, no UFS error and no oops line in any of these boots.
All of these ran with omamobile-gnss 0.2.11-1 from #864 installed and this branch's files copied over it (for the runner: #864's file with this branch's change).
The 3 boots without a fix in the 28 are not this pull request: where-am-i's own call to start GeoClue timed out after 25 s, each time with the request about 16 s into the boot, and GeoClue's log stops after its start. Cause open; it hasn't recurred in the 36 boots since.
After a session ended and its stack had stopped (three 60 s means for the drain):
gnss_spilines in the logA fresh boot with gnssd idle read 317, 301, 309 mA, and the modem without gnssd 304, 327, 304 mA: gnssd costs nothing until a session.
Tests
test/allruns the start with stand-ins forsystemctl,systemd-inhibitand the runner:profile_stopwrites the stop-requested file before the client gets its signal; the runner's own stop and supervision lines, run undersetsid, end with 0 and no "a service exited" with the file and as before without it.Seventeen mutations of the new code (the three you'd expect of
gnssd_coming, the hold and the wait removed, the inhibitor moved, the marker written early, the file written after the signal, the runner's check made a no-op or unconditional, the SIGPIPE lines moved or removed, the ordering removed) each fail the suite with a FAIL line.tests/allandtools/pr-check origin/mainpass.Not run
systemd-inhibit. I have no 7 Pro; the path is covered by the tests only.Only omamobile-gnss changes. The version is 0.2.12 and assumes #864's 0.2.11 lands first; only
versionconflicts with #864, and I'll rebase when it lands.