Skip to content

About

Location daemon for Linux devices (initially just with Qualcomm chips). It collects & provides positioning data from GNSS (incluing GPS), cellular beacons (using phone position), & Wifi. It also feeds to Droidloom Android apps. It leverages Geoclue, Avahi, NMEA, beaconDB, Denial Phonewave Dmail, & Qualcomm Location XTRA Service (xtracloud.net).

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

qlocationd-linux

A location daemon for Linux on Qualcomm phones. It talks to the modem's GNSS (satellite positioning) engine through Qualcomm's location service over QRTR, and passes the positions on:

  • to GeoClue, as NMEA sentences on a local socket (GeoClue's network-nmea source), so ordinary Linux apps get satellite positions;
  • to Droidloom's Android apps, through the org.dmail.Location1 D-Bus interface on the system bus.

Independent project; not made or endorsed by Qualcomm.

Status

Started 4 December 2026. The daemon, qlocationd run, is written but not yet tested on a phone; three more commands bring the modem's GNSS engine up and check it:

  • qlocationd probe finds the modem's location service (QMI service 16) and reads the engine lock (every field), the operation mode and the predicted-orbit (XTRA) data the engine holds. It changes nothing on the modem. First run on the Xperia 1 VI, 4 December 2026: service version 2 on node 0; engine lock "all"; operation mode "standalone"; XTRA data 72 h long, starting 525 h earlier (long expired).
  • qlocationd test-session [--client-type 1|3] [--xtra DIR] [MINUTES] unlocks the engine, registers for reports as client type 1 (application framework, as Qualcomm's own HAL does; the default since 4 December 2026, the only type this modem accepts; or 3, privileged) with the client string "HAL", gives the engine the time if the clock is synchronised, runs one session for up to MINUTES (default 10; Ctrl+C, or the terminal closing, ends it sooner), prints what the engine reports every 15 s (status, satellites heard per system, best signal, satellites used, accuracy, never a position), then stops the session and locks the engine again. First run, 4 December 2026, without the client string (as dmail sends it): registration refused with QMI error 0x0030 (invalid argument); Qualcomm's interface makes the string mandatory for privileged clients. The engine then read back as unlocked although the lock request succeeded; probe and test-session now print every field of the lock reading. Second run, with the string "HAL": type 3 still refused (0x0030), type 1 accepted; locking read back correctly both times. The type 1 session ran 10 minutes without XTRA and got no fix: up to 7 satellites heard (GPS and GLONASS only), strongest signal 21 to 31 dB-Hz, none used; the engine timed out at 255 s and 510 s and searched again, and asked for XTRA at the start and at 600 s. --xtra DIR now gives it XTRA data: the file kept in DIR if under a day old, else one downloaded with curl from path1-3.xtracloud.net/xtra3grcej.bin (dmail's list, from the OnePlus 12R's stock xtra-daemon) and kept in DIR. Third run, outdoors, type 1 with XTRA: the first injection, right after the session started, was refused (QMI error 0x0001, malformed message); the same file given when the engine asked for it a moment later was taken and covered 168 h. First fix after 7 s (±36 m, 8 satellites used), then ±5 m most of the time; up to 33 satellites heard (GPS, GLONASS, BeiDou, Galileo, SBAS) and 26 used. A window and no XTRA, against open air with XTRA: two changes at once, so the run does not show which mattered more.
  • qlocationd lock locks the engine, should a test session be cut off.
  • qlocationd run is the daemon (needs root for its socket for now): it serves positions as NMEA (GGA, RMC) on /run/qlocationd/nmea.sock (group geoclue, mode 0660), counts each connection as a reader, runs the engine only while there is one (unlocked, registered, given the time, session started; stopped and locked again when the last reader goes), and gives it XTRA when it asks: the kept /var/lib/qlocationd/xtra.bin if under a day old, else a fresh download. GeoClue connects to the socket only while its NMEA source is in use. Settings come from /etc/qlocationd.conf (packaging/qlocationd.conf lists every setting with its default); packaging/geoclue/91-qlocationd.conf points GeoClue at the socket.
  • qlocationd should-start answers the settings' autostart (for the service, later).

First target: Sony Xperia 1 VI (pdx245, Snapdragon 8 Gen 3, SM8650) running Arch Linux ARM, as part of https://github.com/spoorun/xperia1vi-linux-port.

Build

Rust 1.88 or later:

cargo build --release

The program is then target/release/qlocationd.

Origin and licence

The location code will be built on phonewave's dmail (https://github.com/denialwm/phonewave, services/modem/dmail), which is MIT licensed ("Copyright (c) 2026 Phonewave contributors"). Every file built from it keeps that notice and says so. So far src/qrtr.rs, src/qmi.rs, src/location.rs and src/xtra.rs are dmail's files, copied unchanged from phonewave commit f4a20ad with a header saying so; dmail's licence text is in LICENSES/MIT-phonewave.txt.

This project as a whole is licensed under the GNU General Public License, version 3 or (at your option) any later version (GPL-3.0-or-later); see LICENSE.

To do

  1. Location service client over QRTR (client type 1 since 4 December 2026, first planned as 3); the engine runs only while something asks for positions. Written; the daemon not yet tested.
  2. Time injection once the system clock is synchronised. Done.
  3. XTRA assistance data from Qualcomm's servers, once a day, with two settings on a settings page: the download address, so that a mirror can be used instead of Qualcomm's servers (the default), and a switch to turn the downloads off. A direct download shows Qualcomm the phone's IP address once a day. Downloads and the settings file done; the settings page to come (item 10).
  4. NMEA sentences (GGA, RMC) for GeoClue on a Unix socket; GeoClue's modem GPS source stays off. Written; not yet tested.
  5. org.dmail.Location1 on the system bus (name org.dmail, path /org/dmail), open to group dmail, for Droidloom.
  6. A warning at start if ModemManager lists GPS on the modem, since ModemManager and this daemon must not both drive the engine.
  7. systemd service, system user, D-Bus policy, Arch Linux package.
  8. Later: a rough starting position for the engine from beaconDB.
  9. Later: optional sharing of positions with other devices on chosen local networks (NMEA over TCP, announced through Avahi), off by default and switched on from a settings page. NMEA over TCP has no password or encryption, so anyone on that network could read the position.
  10. A settings page in the Location KCM Störm proposes for Plasma, writing /etc/qlocationd.conf: switches for the GNSS engine, XTRA (and its servers), the GeoClue feed, the Droidloom feed, the starting position from beaconDB (cell towers, Wi-Fi) and starting at boot. The file has them all now; some do nothing yet.

Authors

Störm (spoorun) assisted by Claude.

About

Location daemon for Linux devices (initially just with Qualcomm chips). It collects & provides positioning data from GNSS (incluing GPS), cellular beacons (using phone position), & Wifi. It also feeds to Droidloom Android apps. It leverages Geoclue, Avahi, NMEA, beaconDB, Denial Phonewave Dmail, & Qualcomm Location XTRA Service (xtracloud.net).

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages