Skip to content

omamobile-modem-sit 0.3.43: a call the modem no longer lists ends here, sitd keeps running - #754

Open
den-kloot wants to merge 2 commits into
derekross:mainfrom
den-kloot:omamobile-modem-sit-stale-call
Open

den-kloot wants to merge 2 commits into
derekross:mainfrom
den-kloot:omamobile-modem-sit-stale-call

Conversation

@den-kloot

@den-kloot den-kloot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

What and why

Part of #729, as asked for there. A call to a number that forwards straight back to this phone rings here while the outgoing call is still dialing. The outgoing call ends with cause 17, and the modem never mentions the incoming one again: it refuses AIMS_ANSWER and AIMS_HANGUP with error 2 and lists no call. sitd kept the call as ringing-in, and 12 s after the first refused request it stopped itself ("Call release was not confirmed"), so calls and SMS were gone until a reboot.

sitd now asks the modem before it gives a call up as unconfirmed (Service.reconcile). If GET_CURRENT_CALLS is empty, the calls it still shows end here (terminated, reason error), the audio route is released and sitd goes on. It asks in four places:

  • when a hang-up is refused;
  • when an answer is refused (the client gets "This call has already ended");
  • when the hangup deadline expires;
  • at the service stop, before unconfirmed_release().

The points from the issue:

  1. The path. The change is in packages/omamobile-modem-sit/lib/service.py.

  2. A pending dial is left out. While self.pending is set, or a live call has no modem ID yet, the modem isn't asked and the old path runs. A modem that still lists a call, or doesn't answer the question, also stays with unconfirmed_release().

  3. The stop path. The finally in main() reconciles before its unconfirmed_release().

  4. Tests. tools/sit-sim has two new modes:

    • --forwarded-back: a ring for a second call ID, the dialled call ended with cause 17, an empty call list, answer and hang-up refused with error 2.
    • --silent-dial: AIMS_DIAL is never answered and no call is listed.

    test_sim.py runs the forwarded call with a refused hang-up, a refused answer and a service stop: sitd keeps running past the 12 s deadline, the call ends, there is no radio-off, and the stop exits 0. It also runs the pending dial, which still ends in the unconfirmed release without a second GET_CURRENT_CALLS. test_service.py has the same cases as unit tests, plus a modem that still lists a call and a call check that fails.

  5. The version. It says 0.3.43 (rebased onto main at 0.3.41 on 2026-11-15; omamobile-modem-sit 0.3.42: a default route on a down link no longer keeps the cellular route away #759 says 0.3.42). Please set it as you need at merge.

Ending a ringing-in call that has had no status for a while is not in here. I can do that as a separate change.

Device and build

  • Phone: Pixel 9a (tegu)
  • Kernel release (uname -r): 7.3.0-rc6-omamobile-push1-gcbb1a7eb0a78
  • Packages changed, with versions: omamobile-modem-sit 0.3.43

Checks (no phone needed)

  • tools/pr-check origin/main passes
  • tests/all passes: not completely. I ran it on the phone itself (I have no other machine with the tree at hand today), and there it stops at tests/boot-method ("display-msm should log not stamping on empty tree"). That one fails the same way on unchanged main on the phone, so the tests after it didn't run. Of those I ran tests/tools-help, tests/grep-q-pipes and tests/pr-check by hand: they pass. CI will show the rest.
  • tests/packages passes for the package I touched: packages/omamobile-modem-sit/test/all, with the simulator (16 simulator tests, 30 in test_service.py)
  • Each changed package has its version bumped, and the new version is in the commit subject
  • Commits have area prefixes and bodies that say why; any AI help is a Co-Authored-By: or Assisted-by: trailer, never a Signed-off-by:

On the phone

  • I ran this on my own phone, booted into this build. How it was installed: the phone has omamobile-modem-sit 0.3.35-1 from the repository, and I copied this head's lib/service.py over the installed file (sha256 d3b87cd7d22d…, the same as in this branch), then rebooted. service.py is identical in 0.3.35 and on main, so the service code that ran is this pull request's. The rest of the package is 0.3.35, so main's nr_after_radio_on (0.3.36, off by default) was not on the phone. It is not a package built from this head.
  • Runbook steps passed, 2026-11-14, all through omamobile-mmd's ModemManager API, as the Phone app does:
    • An ordinary outgoing call (the other phone switched on), hung up 2 s into the ringing: AIMS_HANGUP error 0, the call terminated, no call check. Pass.
    • The forwarded call, the returning call hung up (the other phone switched off, forwarding to this number): pass, log below.
    • The forwarded call, the returning call answered: pass, log below. The client got "Call failed: This call has already ended".
    • After each of the two, sitd was still active 16 s later (past the 12 s deadline), stage running, IMS registered, no live call, call audio not running. The dial that followed the first one was accepted.
  • What I did not test on the phone: the service stop with a stale call, the expired deadline as the trigger (the hang-up and the answer reconcile at once, so the deadline never ran), a modem that still lists a call, and the pending dial. Those ran in the simulator and the unit tests only. One phone, one carrier, VoLTE. I didn't make an ordinary incoming call with this head; one was answered and hung up on 2026-11-13 with the first version of the patch (omamobile-sitd: a call forwarded back to this phone leaves a stale incoming call; answer/hang-up return error 2 and sitd stops itself (patch attached) #729).
  • Nothing in this change writes outside slot B and userdata, weakens the storage guard, or reads registers from userspace (AGENTS.md §1)

The returning call hung up (sitd never logs numbers; nothing is cut out):

07:18:34.050 omamobile-sitd: SIT GET_CURRENT_CALLS: error=0 length=16
07:18:34.596 omamobile-sitd: AoC tegu speakerphone prepared at conservative TAS gain
07:18:34.634 omamobile-sitd: SIT AIMS_DIAL: error=0 length=12
07:18:34.637 omamobile-mmd:  Call/1: unknown -> dialing
07:18:36.358 omamobile-sitd: Incoming call ringing
07:18:36.360 omamobile-mmd:  Call/2: incoming, ringing-in
07:18:36.718 omamobile-mmd:  Call/1: dialing -> terminated
07:18:41.784 omamobile-sitd: SIT AIMS_HANGUP: error=2 length=12
07:18:41.797 omamobile-sitd: SIT GET_CURRENT_CALLS: error=0 length=16
07:18:41.970 omamobile-sitd: AoC call routes restored
07:18:41.971 omamobile-sitd: Call check after a refused hang-up: the modem lists no call; 1 stale call(s) ended here
07:18:41.975 omamobile-mmd:  Call/2: ringing-in -> terminated

The returning call answered:

07:19:16.244 omamobile-sitd: SIT GET_CURRENT_CALLS: error=0 length=16
07:19:16.790 omamobile-sitd: AoC tegu speakerphone prepared at conservative TAS gain
07:19:16.835 omamobile-sitd: SIT AIMS_DIAL: error=0 length=12
07:19:16.839 omamobile-mmd:  Call/3: unknown -> dialing
07:19:18.712 omamobile-sitd: Incoming call ringing
07:19:18.714 omamobile-mmd:  Call/4: incoming, ringing-in
07:19:19.119 omamobile-mmd:  Call/3: dialing -> terminated
07:19:24.004 omamobile-sitd: SIT AIMS_ANSWER: error=2 length=12
07:19:24.008 omamobile-sitd: SIT GET_CURRENT_CALLS: error=0 length=16
07:19:24.202 omamobile-sitd: AoC call routes restored
07:19:24.204 omamobile-sitd: Call check after a refused answer: the modem lists no call; 1 stale call(s) ended here
07:19:24.209 omamobile-mmd:  Call/4: ringing-in -> terminated

About the phone, so the report below reads right: it runs a local kernel build and local units for the modem (from #372 before it merged), and cpif's keep_link_up=Y with a helper that polls the modem once a second (the workaround described in #672). The smoke report was taken five minutes after the boot the tests ran in. Its package list shows 0.3.35-1 for the reason given above.

tools/phone-smoke report

phone-smoke: unknown

Kernel 7.3.0-rc6-omamobile-push1-gcbb1a7eb0a78, tools at unknown, 2026-11-14T06:20Z.

Check Result Detail
boot (required) ok kernel 7.3.0-rc6-omamobile-push1-gcbb1a7eb0a78, slot b, up 331s
storage guard (required) ok 62 partitions; only userdata and slot B's boot images writable
root (required) ok ext4 on userdata, 78G free
kernel health (required) ok no oops or BUG; 0 WARN, 16 error lines in dmesg (15 known, of them cpif message for a channel nobody opened x15, 1 new)
new dmesg errors not ok maxtcpc N: Failed to get vbus regulator handle x1
systemd units ok none failed
USB gadget (required) ok bound to 11210000.usb
display ok card1-DSI-1 connected, 1080x2424
GPU ok render node on panthor
session (required) ok Hyprland and the Omarchy shell running
lock ok PAM file present, the shell can lock (passwordPam true, locked false)
touch ok Synaptics TouchComm Touchscreen
buttons ok gpio-keys
Wi-Fi ok wlp1s0 on brcmfmac, link up
Bluetooth ok hci0, powered true
battery ok 29% Discharging, 43 °C
sound cards ok googleteguaocsn
sensors ok Accelerometer AmbientLight Proximity
cameras skip no libcamera tools
thermal ok hottest zone 57 °C

Packages: hyprland 0.57.0-3.4, libcamera 0.7.2-4.23, mesa 1:26.2.4-1.4, omacam 0.3.3-1, omamessages 0.2.2-1, omamobile-apps 0.2.3-1, omamobile-audio 0.5.18-1, omamobile-device-tegu 0.2.18-1, omamobile-firstboot 0.1.5-1, omamobile-gnss 0.2.9-1, omamobile-keyring 20261026-1, omamobile-mirror 0.1.1-1, omamobile-mmd 0.1.4-1, omamobile-modem 0.1.21-1, omamobile-modem-sit 0.3.35-1, omamobile-omarchy 0.1.44-1, omamobile-owl-widgets 0.1.2-1, omamobile-sensors 0.2.1-1, omamobile-settings 0.1.2-1, omamobile-shell 0.2.127-1, omamobile-voice 0.1.0-1, omaphone 0.2.3-1, omarchy 4.5.0-3, omatel-agent 0.2.4-2, quickshell 0.3.2.r7.g2b4501a-1

🤖 Generated with Claude Code

@derekross

Copy link
Copy Markdown
Owner

Thank you for turning the issue into this so carefully: everything I asked for on #729 is here, the pending dial is kept out exactly as I hoped, and the two simulator modes make the case easy to follow. The phone logs for both the hung-up and the answered call are very clear.

One thing needs changing, and it's small:

  1. An unexpected error from the call check skips the radio-off. reconcile() catches ModemError, TimeoutError and OSError, but the transport can also raise a plain RuntimeError ("unprocessed indication limit exceeded", "invalid SIT framing", "short SIT write") or EOFError when the channel closes. Those now leave reconcile() before unconfirmed_release() gets to run. With your ServiceTests fixture, a ringing call, an expired deadline and a call-list request that raises RuntimeError('unprocessed indication limit exceeded'), main raises UnconfirmedRelease with one radio-off, and this branch raises the RuntimeError with none. Catching Exception there (anything unexpected returns False, so the old path runs) and a test with that side effect would close it.

And a few smaller things:

Before merging I'll run an ordinary call on my Pixel 7 Pro with this branch, as I said on the issue. In that run I'd also like to see what the modem answers to GET_CURRENT_CALLS while a call is connected, because the new path trusts an empty list to mean "no call" before it skips the radio-off, and so far we've only seen that list empty. If it turns out the modem doesn't list connected IMS calls, I'd ask to limit the local ending to calls that never connected (ringing-in, waiting), which covers both cases seen so far.

Thanks again, this is a nasty failure (no calls or texts until a reboot) and the fix is well thought through.

den-kloot and others added 2 commits November 15, 2026 08:20
…e, sitd keeps running

A call to a number that forwards straight back to this phone rings here
while the outgoing call is still dialing. The outgoing call then ends
with cause 17, and the modem never mentions the incoming one again: it
refuses AIMS_ANSWER and AIMS_HANGUP with error 2 and GET_CURRENT_CALLS
lists no call. sitd kept the call as ringing-in, and 12 s after the
first refused request the hangup deadline expired and it stopped itself
("Call release was not confirmed"): no calls or SMS until a reboot
(derekross#729, a Pixel 9a, twice on 2026-11-13).

Before giving a call up as unconfirmed, sitd now asks the modem
(Service.reconcile): when a hang-up or an answer is refused, when the
hangup deadline expires, and at the service stop before
unconfirmed_release(). If GET_CURRENT_CALLS is empty, the calls it still
shows end here (terminated, reason error), the audio route is released
and sitd goes on. The dial action already relies on the same answer
before it dials.

A dial whose setup is still pending is left out: while self.pending is
set, or a live call has no modem ID yet, the modem is not asked and the
old path runs. The same deadline is armed when a dial times out, the
modem may not list a late dial yet, and ending it here would drop the
status of a call that then connects. A modem that still lists a call,
or doesn't answer the question, also stays with unconfirmed_release().

tools/sit-sim: --forwarded-back (a ring for a second call ID, the
dialled call ended with cause 17, an empty call list, answer and
hang-up refused with error 2) and --silent-dial (AIMS_DIAL never
answered, no call listed).

Tests: test_sim.py runs the forwarded call with a refused hang-up, a
refused answer and a service stop (sitd keeps running past the 12 s
deadline, the call ends, no radio-off; the stop exits 0), and the
pending dial, which still ends in the unconfirmed release without a
second GET_CURRENT_CALLS. test_service.py has the same cases as unit
tests, plus a modem that still lists a call and a call check that
fails. test/all (run on the Pixel 9a itself, aarch64): passes.

On a Pixel 9a (2026-11-14, 7.3.0-rc6-omamobile-push1-gcbb1a7eb0a78):
this head's lib/service.py over the installed 0.3.35 (the file is the
same in 0.3.35 and on main), then a reboot. An ordinary outgoing call,
hung up while it rang: AIMS_HANGUP error 0, as before. The forwarded
call, twice, the returning call hung up and then answered through
omamobile-mmd: error 2 each time, "the modem lists no call; 1 stale
call(s) ended here", the call terminated, the audio routes restored,
sitd still running 16 s later and the next dial accepted. Not run on a
phone: the service stop with a stale call and the pending dial (both
in the simulator only).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…-off

reconcile() caught ModemError, TimeoutError and OSError from GET_CURRENT_CALLS, but the transport also raises a plain RuntimeError (invalid SIT framing, a short SIT write, the unprocessed indication limit) and EOFError when the channel closes. Those left reconcile() before unconfirmed_release() ran: with a ringing call and an expired deadline, main raises UnconfirmedRelease after one radio-off, and the branch raised the RuntimeError with none. Any failure of the check now returns False, so the old path runs. A test with both errors; MODEM-CLIENT.md says that sitd asks the modem first.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@den-kloot
den-kloot force-pushed the omamobile-modem-sit-stale-call branch from 2705b25 to 40194ec Compare November 15, 2026 07:40
@den-kloot den-kloot changed the title omamobile-modem-sit 0.3.38: a call the modem no longer lists ends here, sitd keeps running omamobile-modem-sit 0.3.43: a call the modem no longer lists ends here, sitd keeps running Nov 15, 2026
@den-kloot

Copy link
Copy Markdown
Contributor Author

Thanks, you're right about the transport's own errors; I had only looked at what request() raises for a refusal or a timeout.

Rebased onto main (ad58709c); the review is one commit on top, 40194ec6.

  1. An unexpected error from the call check. reconcile() now catches Exception and returns False, so the old path runs. test_call_check_that_breaks_still_ends_in_the_radio_off is your case, with RuntimeError('unprocessed indication limit exceeded') and with EOFError('SIT channel closed'): a ringing call, an expired deadline, UnconfirmedRelease, one radio-off, the call still live. With the old except line it fails for both.
  2. "Fixes omamobile-sitd: a call forwarded back to this phone leaves a stale incoming call; answer/hang-up return error 2 and sitd stops itself (patch attached) #729" is "Part of omamobile-sitd: a call forwarded back to this phone leaves a stale incoming call; answer/hang-up return error 2 and sitd stops itself (patch attached) #729" in the description now.
  3. device/cheetah/MODEM-CLIENT.md says that sitd asks the modem first, and when it still ends in the radio-off.
  4. version says 0.3.43 only so that the branch doesn't conflict; set what fits.

On GET_CURRENT_CALLS during a connected call: agreed. If your run shows that the modem doesn't list a connected IMS call, I'll limit the local ending to ringing-in and waiting.

One thing I saw on the way and left alone, since it is the same on main: after the radio-off, unconfirmed_release() asks for the radio state and catches OSError, RuntimeError and ValueError. EOFError is none of those, so on a closed channel it leaves there instead of UnconfirmedRelease. The radio-off has run by then.

derekross added a commit that referenced this pull request Nov 15, 2026
L-776: a fallback helper is checked against every exception its transport raises (#754). L-777: a DMA master running vendor firmware with its IOMMU in bypass stays disabled behind an overlay until the IOMMU is described (kernel #250, the maintainer's decision of 2026-11-15).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derekross

Copy link
Copy Markdown
Owner

Thank you, this is exactly what I asked for, and the extra test covering EOFError as well is a nice touch. I checked that the new test fails with the old except line and passes with yours. The documentation change reads well too.

Thanks also for spotting the EOFError gap in unconfirmed_release()'s radio-state read. As you say, the radio-off has already run by then, so it's a small separate fix, and I'll open an issue for it so it doesn't get lost.

There's nothing more for you to change here. What's left is mine: the ordinary call on my Pixel 7 Pro, recording what the modem answers to GET_CURRENT_CALLS while the call is connected. My phone is busy with a sleep test today, so it'll be after that. If the modem turns out not to list a connected IMS call, I'll come back to you about limiting the local ending to ringing-in and waiting, as you offered.

On the version: another change to the same package (#817, the internet bearer set up again after the modem drops it) is likely to merge first as 0.3.42, so 0.3.43 on your branch is probably right as it stands. I'll set it at merge either way. The two changes merge cleanly, and the package's tests pass with both.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants