From 3089353f83cd4f551ada51eb585225f03edb724a Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Mon, 2 Nov 2026 16:58:13 -0647 Subject: [PATCH 01/31] omamobile-modem-sit 0.3.22: add opt-in tegu speakerphone audio Select the TAS2572 route only for google,tegu-aoc-snd-card. Save the controls, verify sink mute, configure the stock microphone/TDM routes, and start EP4 capture and EP5 playback as mono S16_LE at 8 kHz with 80-frame periods and two periods. Applying ALSA hardware parameters prepares each PCM once; do not prepare the modem stream twice. After PCM startup resets the amplifier profile, set both TAS digital gains to index 180 (-20 dB) and verify read-back before unmuting. A gain refusal unwinds the route and leaves call signalling available. Close PCMs before restoring controls, keep mute on cleanup failure, and retain the cheetah CS35L41 route and the default card=none configuration. Add fake-ALSA fault tests and the voice-window audit. The existing SRAM reservation is retained; no CPU mapping or phone operation is added. --- device/tegu/CALL-AUDIO-WINDOW.md | 46 +++++ .../etc/omamobile/modem-sit.conf | 6 +- packages/omamobile-modem-sit/lib/service.py | 4 +- .../omamobile-modem-sit/lib/voice_audio.py | 137 +++++++++++- .../omamobile-modem-sit/test/test_service.py | 17 ++ .../test/test_voice_audio.py | 195 ++++++++++++++++++ 6 files changed, 397 insertions(+), 8 deletions(-) create mode 100644 device/tegu/CALL-AUDIO-WINDOW.md diff --git a/device/tegu/CALL-AUDIO-WINDOW.md b/device/tegu/CALL-AUDIO-WINDOW.md new file mode 100644 index 000000000..b6a4324e7 --- /dev/null +++ b/device/tegu/CALL-AUDIO-WINDOW.md @@ -0,0 +1,46 @@ + +# Pixel 9a: AoC voice-window audit + +2026-11-02, offline. This supports TELEPHONY-PLAN section 1 (PR #360); +no call, memory access or phone operation was performed. + +**The firmware voice path has a shared SRAM window; the Linux call-audio +route does not need a new CPU mapping of it.** The checked CPIF and AoC +paths provide no evidence that adding the omitted CPIF region is required +to start a PCIe call. Whether the running firmware's path works remains +unqualified until the attended call test. + +Where it comes from: + +- MODEM-PLAN F3 records tegu's own stock DT capture: `cp_aoc_rmem` is + 12 KiB at AP physical address `0x197fd000`. The stock `cp_shmem` node's + fourth `memory-region` references it; `VSS_AOC` selects `SHMEM_VSS` + (index 1), rmem index 3, offset 0, size `0x3000`, uncached. This is AoC + SRAM, not a buffer for userspace to allocate. Google's + [GPL reservation](https://android.googlesource.com/kernel/devices/google/zuma/+/eb90f2862e78b4c409ff992e116c44e81f836e9e/dts/zuma-rmem.dtsi) + and [shared-memory description](https://android.googlesource.com/kernel/devices/google/zuma/+/b0dfdfc378dd37d7c1662bbd942240d55db83d68/dts/zuma-cp-s5300-sit.dtsi) + describe the same resource; tegu's capture is the board-specific evidence. +- Our tegu `zumapro-reserved-memory.dtsi` already reserves this range as + `cp-aoc@197fd000`, with `no-map`. Omitting the CPIF region from the + bring-up overlay does not remove that reservation. +- In the GPL CPIF port, `init_shmem_maps()` maps VSS only in the + `LINKDEV_SHMEM` case; tegu uses `LINKDEV_PCIE`. Its PCIe path does not + require `vss_base` to start. Google's + [GPL implementation](https://android.googlesource.com/kernel/google-modules/radio/samsung/s5300/+/refs/tags/android-16.0.0_r0.10/link_device.c) + preserves that distinction. Diagnostic accessors/dump support are not + the voice-stream transport. +- `aoc_alsa_voice.c` prepares the voice PCM through `prepare_phonecall()` + in `aoc_alsa_hw.c`. For playback PCM 4 it sends + `CMD_AUDIO_OUTPUT_TELEPHONY_MODEM_START_ID` (256); close sends STOP + (257). Both are header-only AoC commands, with no supplied memory + address (also confirmed in the saved GPL Zuma interface header). + The speech stays between the modem and AoC; sitd owns the PCM handles + and mixers, not the SRAM. + +Keep the reservation and leave the window CPU-unmapped. This change adds +no DT region, PCIe translation, S2MPU permission or userspace memory +access. If a later call establishes a missing firmware-side window, trace +the stock tegu firmware/translation setup separately before any kernel +change; do not substitute another board's address or map the SRAM to +inspect it. The first call still needs the plan's gain checks, log stream, +watchdog, stop conditions and attended recovery. diff --git a/packages/omamobile-modem-sit/etc/omamobile/modem-sit.conf b/packages/omamobile-modem-sit/etc/omamobile/modem-sit.conf index 669526205..e5a1d2232 100644 --- a/packages/omamobile-modem-sit/etc/omamobile/modem-sit.conf +++ b/packages/omamobile-modem-sit/etc/omamobile/modem-sit.conf @@ -138,8 +138,12 @@ group = wheel # reports that mode; with earpiece = no, refused unless the service runs at # stage media or c8 with the top amplifier at analog 6 or less and both # within the media stage's ceilings (digital 737, analog 10). +# On the Pixel 9a, call audio selects an experimental TAS2572 speakerphone +# route instead, held muted until both gains read back -20 dB after PCM +# startup. #card = none earpiece = yes # Microphone gain above stock's 130 cB during calls: 6 (default, judged -# louder and clean in calls on this phone) or 0 (stock). +# louder and clean in calls on the 7 Pro) or 0 (stock). The 9a always uses +# stock's 130 cB, with no boost. mic_boost_db = 6 diff --git a/packages/omamobile-modem-sit/lib/service.py b/packages/omamobile-modem-sit/lib/service.py index 8a92cc9c9..a7967edd1 100644 --- a/packages/omamobile-modem-sit/lib/service.py +++ b/packages/omamobile-modem-sit/lib/service.py @@ -51,7 +51,7 @@ from sit import Sit, ModemError from sms_codec import submit, received_pdu, number import carrier_manifest -from voice_audio import VoiceAudio, aoc_card +from voice_audio import AudioRefused, VoiceAudio, aoc_card STATES = {0: 'active', 1: 'held', 2: 'dialing', 3: 'ringing-out', 4: 'ringing-in', 5: 'waiting', 6: 'terminated', 7: 'held', 8: 'active'} @@ -580,7 +580,7 @@ def status(self, *, public=False): received = [r[0] for r in self.db.execute('SELECT id FROM received WHERE consumed=0 ORDER BY rowid')] return dict(modem=modem, calls=calls, sms=dict(received=['sit:' + i for i in received]), audio=dict(available=True, running=self.audio is not None, mute=self.muted, - speaker=False, speaker_available=False, error=self.audio_error)) + speaker=getattr(self.audio, 'tegu', False) is True, speaker_available=False, error=self.audio_error)) def subscribe(self, connection): """Keep an authorised connection for status events; refuse beyond diff --git a/packages/omamobile-modem-sit/lib/voice_audio.py b/packages/omamobile-modem-sit/lib/voice_audio.py index 748571e32..4b6ff2070 100644 --- a/packages/omamobile-modem-sit/lib/voice_audio.py +++ b/packages/omamobile-modem-sit/lib/voice_audio.py @@ -4,9 +4,9 @@ Uses the AoC card's voice endpoints: PCM 4 playback (EP5) and PCM 11 capture (EP4), whose numbers are the AoC entry points (AGENTS.md: the card numbers its PCMs as stock does). AoC and CP exchange audio directly; no host -recording or SRAM mapping. Amplifier protection, calibration and gain stay -with omamobile-audio: the downlink plays through TDM 0, so it needs the -amplifiers set up (stock's TDM 0 format, protection service running). +recording or SRAM mapping. On cheetah, amplifier protection, calibration +and gain stay with omamobile-audio: TDM 0 needs its amplifiers set up and +the protection service running. TDM 0 feeds both amplifiers, and the top one is the earpiece. With the protection service's earpiece mode (AOC-PLAN.md C9k) each call runs in that @@ -15,7 +15,9 @@ earpiece ceiling (top analog <= 6, AUDIO-PLAN.md section 4) and the media stage's (digital <= 737, analog <= 10, AGENTS.md). The built-in default routes no call audio; a device package whose route is verified sets -[audio] card = auto in its defaults (paths.DEVICE_DEFAULTS). +[audio] card = auto in its defaults (paths.DEVICE_DEFAULTS). Tegu instead +uses its TAS2572 speakerphone path, muted until both amplifiers read back a +conservative gain after PCM start. """ import ctypes as C import os @@ -44,6 +46,40 @@ # the watchdog stopped, muting the speakers (2026-11-03). EARPIECE_UNIT = '/usr/lib/systemd/system/omamobile-earpiece@.service' +TEGU_CARD = 'google,tegu-aoc-snd-card' +# tas2x20_dvc_table in include/sound/tas2x20-tlv.h: index 220 is unity, +# index 180 is -20 dB. Use the index, not the control's misleading dB TLV. +TEGU_GAIN = '180' +TEGU_GAINS = ('Top Speaker Digital Volume', 'Bottom Speaker Digital Volume') +TEGU_ROUTE = ( + ('Incall Sink Mute', '1'), + ('TDM_0_RX Chan', 'Four'), ('TDM_0_RX Format', 'S32_LE'), + ('TDM_0_RX Sample Rate', 'SR_48K'), + ('TDM_0_TX Chan', 'Four'), ('TDM_0_TX Format', 'S32_LE'), + ('TDM_0_TX Sample Rate', 'SR_48K'), + ('BUILDIN MIC ID CAPTURE LIST', '0,1,-1,-1'), ('MIC DC Blocker', '1'), + ('Voice Call Audio Enable', '1'), ('Voice Call Mic Source', '1'), + ('Voice Call Mic Mute', '0'), ('Incall Mic Mute', '0'), + ('AoC Modem Downlink ASRC Mode', '1'), + ('MIC HW Gain At High Power Mode (cB)', '130'), + ('MIC Record Soft Gain (dB)', '0'), + ('TDM_0_RX Mixer EP5', '1'), ('EP4 TX Mixer INTERNAL_MIC_TX', '1')) + + +class AudioRefused(RuntimeError): + """A tegu route was safely unwound; signalling may continue silently.""" + + +def is_tegu_card(card): + try: + for line in Path('/proc/asound/cards').read_text().splitlines(): + match = re.match(r'\s*(\d+)\s+\[[^]]+\]:\s*.*? - (\S+)\s*$', line) + if match and int(match[1]) == card: + return match[2] == TEGU_CARD + except OSError: + pass + return False + def aoc_card(setting='auto'): """The AoC card's index: the configured one, the card whose ALSA id or @@ -77,6 +113,11 @@ def __init__(self, *, mic_boost_db=6, card=None, earpiece=True): self.earpiece_cmd = shutil.which(EARPIECE_COMMAND) if earpiece else None if card is not None: self.card = card + self.tegu = is_tegu_card(self.card) + if self.tegu: + # The protection service's earpiece mode is the 7 Pro's CS35L41 + # route; the 9a's TAS2572 route sets its own gains. + self.earpiece_cmd = None self.saved = [] self.pcms = [] self.alsa = C.CDLL('libasound.so.2') @@ -85,6 +126,18 @@ def __init__(self, *, mic_boost_db=6, card=None, earpiece=True): C.c_uint, C.c_uint, C.c_int, C.c_uint] for name in ('snd_pcm_prepare', 'snd_pcm_start', 'snd_pcm_drop', 'snd_pcm_close', 'snd_pcm_state'): getattr(self.alsa, name).argtypes = [C.c_void_p] + if self.tegu: + self.alsa.snd_pcm_hw_params_malloc.argtypes = [C.POINTER(C.c_void_p)] + self.alsa.snd_pcm_hw_params_free.argtypes = [C.c_void_p] + for name in ('snd_pcm_hw_params_any', 'snd_pcm_hw_params'): + getattr(self.alsa, name).argtypes = [C.c_void_p, C.c_void_p] + for name in ('access', 'format', 'channels', 'rate_resample'): + getattr(self.alsa, 'snd_pcm_hw_params_set_' + name).argtypes = [ + C.c_void_p, C.c_void_p, C.c_uint] + for name in ('rate', 'periods', 'period_size'): + getattr(self.alsa, 'snd_pcm_hw_params_set_' + name).argtypes = [ + C.c_void_p, C.c_void_p, C.c_ulong if name == 'period_size' else C.c_uint, + C.c_int] def mixer(self, action, name, value=None): args = ['amixer', '-c', str(self.card), action, 'name='+name] @@ -137,6 +190,8 @@ def check_levels(self): '(the earpiece ceiling needs the top amplifier at analog 6 or less)') def __enter__(self): + if getattr(self, 'tegu', False): + return self.tegu_enter() if self.earpiece_cmd: self.earpiece(True) try: @@ -182,14 +237,86 @@ def __enter__(self): self.__exit__(None, None, None) raise + def mixer_value(self, name): + match = re.search(r'^\s*: values=([0-9,\-]+|on|off)$', self.mixer('cget', name), re.M) + if match is None: + raise RuntimeError('voice mixer state unavailable: ' + name) + return match[1] + + def tegu_params(self, pcm): + params = C.c_void_p() + self.check(self.alsa.snd_pcm_hw_params_malloc(C.byref(params)), 'params allocation') + try: + self.check(self.alsa.snd_pcm_hw_params_any(pcm, params), 'params reset') + for name, value, direction in ( + ('access', 3, None), ('format', 2, None), ('channels', 1, None), + ('rate_resample', 0, None), ('rate', 8000, 0), + ('period_size', 80, 0), ('periods', 2, 0)): + args = (pcm, params, value) + (() if direction is None else (direction,)) + self.check(getattr(self.alsa, 'snd_pcm_hw_params_set_' + name)(*args), name) + # hw_params prepares automatically. Never prepare a second time: + # preparing EP5 sends TELEPHONY_MODEM_START to the AoC. + self.check(self.alsa.snd_pcm_hw_params(pcm, params), 'params') + if self.alsa.snd_pcm_state(pcm) != 2: + raise RuntimeError('voice PCM was not prepared by hardware parameters') + finally: + self.alsa.snd_pcm_hw_params_free(params) + + def tegu_enter(self): + if self.pcms: + return self + # Read everything before changing anything. Mute is first so its + # original value is restored last, after closing the voice PCMs. + names = [name for name, _ in TEGU_ROUTE] + list(TEGU_GAINS) + saved = [(name, self.mixer_value(name)) for name in names] + self.saved = saved + try: + for name, value in TEGU_ROUTE: + self.mixer('cset', name, value) + if name == 'Incall Sink Mute' and self.mixer_value(name) not in ('1', 'on'): + raise AudioRefused('tegu call audio refused: sink mute read-back mismatch') + # Capture is ready before playback prepare starts the modem. + for device, direction in ((11, 1), (4, 0)): + pcm = C.c_void_p() + self.check(self.alsa.snd_pcm_open(C.byref(pcm), f'hw:{self.card},{device}'.encode(), + direction, 0), 'open') + self.pcms.append(pcm) + self.tegu_params(pcm) + self.check(self.alsa.snd_pcm_start(pcm), 'start') + # The codec profile resets gain at playback start. These must + # happen afterwards, while the modem downlink remains muted. + for name in TEGU_GAINS: + self.mixer('cset', name, TEGU_GAIN) + for name in TEGU_GAINS: + try: + gain = self.mixer_value(name) + except (OSError, RuntimeError, subprocess.TimeoutExpired) as error: + raise AudioRefused('tegu call audio refused: TAS gain read-back unavailable') from error + if gain != TEGU_GAIN: + raise AudioRefused('tegu call audio refused: TAS gain read-back mismatch') + self.mixer('cset', 'Incall Sink Mute', '0') + print('AoC tegu speakerphone prepared at conservative TAS gain', flush=True) + return self + except BaseException: + self.__exit__(None, None, None) + raise + def __exit__(self, *args): failures = [] + if getattr(self, 'tegu', False) and self.saved: + try: + self.mixer('cset', 'Incall Sink Mute', '1') + except (OSError, RuntimeError, subprocess.TimeoutExpired): + failures.append('Incall Sink Mute') for pcm in reversed(self.pcms): - self.alsa.snd_pcm_drop(pcm) + if self.alsa.snd_pcm_drop(pcm) < 0 and getattr(self, 'tegu', False): + failures.append('PCM drop') if self.alsa.snd_pcm_close(pcm) < 0: failures.append('PCM close') self.pcms.clear() for name, value in reversed(self.saved): + if getattr(self, 'tegu', False) and name == 'Incall Sink Mute' and failures: + continue # uncertain cleanup must leave the call sink muted try: self.mixer('cset', name, value) except (OSError, RuntimeError, subprocess.TimeoutExpired): diff --git a/packages/omamobile-modem-sit/test/test_service.py b/packages/omamobile-modem-sit/test/test_service.py index 5a8e2f5a1..5cd82e4d5 100644 --- a/packages/omamobile-modem-sit/test/test_service.py +++ b/packages/omamobile-modem-sit/test/test_service.py @@ -65,6 +65,23 @@ def test_restart_does_not_retry_pending_sms(self): other=app_service.database(self.root/'db') self.assertEqual(other.execute('SELECT state FROM outgoing').fetchone()[0],'unknown'); other.close() + def test_refused_tegu_gain_does_not_fail_call_signalling(self): + self.service.settings['audio']['card'] = 'auto' + self.client.request.side_effect = [bytes(4), b''] + with patch.object(app_service, 'aoc_card', return_value=3), \ + patch.object(app_service, 'VoiceAudio') as route: + route.return_value.__enter__.side_effect = app_service.AudioRefused('gain mismatch') + call = self.service.dispatch(dict(action='dial', number='+12025550123')) + self.assertEqual(self.service.calls[call['call']]['state'], 'dialing') + self.assertEqual([c.args[0] for c in self.client.request.call_args_list], [0x0000, 0x0d00]) + self.assertIsNone(self.service.audio) + + def test_tegu_route_is_reported_as_speakerphone(self): + self.service.audio = MagicMock(tegu=True) + self.assertTrue(self.service.status()['audio']['speaker']) + self.service.audio.tegu = False + self.assertFalse(self.service.status()['audio']['speaker']) + def test_failed_radio_off_still_requires_reboot_without_claiming_release(self): self.client.request.side_effect = TimeoutError() with patch.object(app_service, 'radio', side_effect=OSError()), \ diff --git a/packages/omamobile-modem-sit/test/test_voice_audio.py b/packages/omamobile-modem-sit/test/test_voice_audio.py index 86b2479ec..6a78e39a1 100644 --- a/packages/omamobile-modem-sit/test/test_voice_audio.py +++ b/packages/omamobile-modem-sit/test/test_voice_audio.py @@ -226,6 +226,201 @@ def test_no_aoc_card_routes_nothing(self): fake.return_value.read_text.return_value = ' 0 [Headset ]: USB-Audio - Headset\n' self.assertIsNone(voice_audio.aoc_card('auto')) + def test_tegu_detection_uses_the_selected_card_and_exact_name(self): + cards = (' 0 [Headset ]: USB-Audio - Headset\n' + ' 3 [aocsndcard ]: aoc-snd-card - google,tegu-aoc-snd-card\n') + with patch.object(voice_audio.Path, 'read_text', return_value=cards): + self.assertEqual(voice_audio.aoc_card('auto'), 3) + self.assertTrue(voice_audio.is_tegu_card(3)) + self.assertFalse(voice_audio.is_tegu_card(0)) + with patch.object(voice_audio.Path, 'read_text', return_value=cards.replace('tegu', 'cheetah')): + self.assertFalse(voice_audio.is_tegu_card(3)) + with patch.object(voice_audio.Path, 'read_text', side_effect=OSError): + self.assertFalse(voice_audio.is_tegu_card(3)) + + +class TeguAudioTests(unittest.TestCase): + def fixture(self, *, mismatch=None, unreadable=None, fail_params=False, + fail_start=False, fail_close=False, fail_mixer=None, fail_mute=False): + controls = {name: '0' for name, _ in voice_audio.TEGU_ROUTE} + controls.update({'BUILDIN MIC ID CAPTURE LIST': '0,1,-1,-1', + 'Top Speaker Digital Volume': '220', + 'Bottom Speaker Digital Volume': '210'}) + original = dict(controls) + events = [] + + class Alsa: + def __init__(self): + self.opened = 0 + self.closed = [] + self.states = {} + self.params = {} + + def snd_pcm_open(self, pointer, device, direction, mode): + self.opened += 1 + pointer._obj.value = self.opened + events.append(('open', device, direction)) + self.states[self.opened] = 0 + self.params[self.opened] = {} + return 0 + + def snd_pcm_hw_params_malloc(self, pointer): + pointer._obj.value = 100 + return 0 + + def snd_pcm_hw_params_free(self, pointer): + events.append(('free_params', pointer.value)) + + def snd_pcm_hw_params_any(self, pcm, params): + return 0 + + def __getattr__(self, name): + if not name.startswith('snd_pcm_hw_params_set_'): + raise AttributeError(name) + def setter(pcm, params, value, *direction): + self.params[pcm.value][name.removeprefix('snd_pcm_hw_params_set_')] = (value, direction) + return 0 + return setter + + def snd_pcm_hw_params(self, pcm, params): + if fail_params and pcm.value == 2: + return -5 + # ALSA prepares as part of hw_params; no explicit second + # prepare is allowed. Playback's profile resets TAS gains. + events.append(('prepare', pcm.value)) + self.states[pcm.value] = 2 + if pcm.value == 2: + for name in voice_audio.TEGU_GAINS: + controls[name] = '220' + return 0 + + def snd_pcm_prepare(self, pcm): + raise AssertionError('duplicate modem prepare') + + def snd_pcm_state(self, pcm): + return self.states[pcm.value] + + def snd_pcm_start(self, pcm): + events.append(('start', pcm.value)) + if fail_start and pcm.value == 2: + return -5 + self.states[pcm.value] = 3 + return 0 + + def snd_pcm_drop(self, pcm): + events.append(('drop', pcm.value)) + return 0 + + def snd_pcm_close(self, pcm): + events.append(('close', pcm.value)) + self.closed.append(pcm.value) + return -5 if fail_close else 0 + + audio = VoiceAudio.__new__(VoiceAudio) + audio.tegu = True + audio.card = 3 + audio.mic_boost_db = 6 # ignored on tegu: stock 130 cB only + audio.saved, audio.pcms = [], [] + audio.alsa = Alsa() + failed = False + + def mixer(action, name, value=None): + nonlocal failed + events.append((action, name, value)) + if action == 'cget': + if controls[name] == voice_audio.TEGU_GAIN: + if name == unreadable: + return ' : values=unavailable\n' + if name == mismatch: + return ' : values=220\n' + return ' : values=' + controls[name] + '\n' + if name == fail_mixer and not failed: + failed = True + raise RuntimeError('mixer failed') + if fail_mute and name == 'Incall Sink Mute' and value == '1': + return '' + controls[name] = value + return '' + + audio.mixer = mixer + return audio, events, controls, original + + def test_route_uses_exact_voice_params_and_checks_gain_before_unmuting(self): + audio, events, controls, original = self.fixture() + with audio: + self.assertIs(audio.__enter__(), audio) # no second PCM start + for name, value in voice_audio.TEGU_ROUTE: + if name != 'Incall Sink Mute': + self.assertEqual(controls[name], value) + self.assertEqual(controls['MIC HW Gain At High Power Mode (cB)'], '130') + self.assertEqual([e for e in events if e[0] == 'open'], + [('open', b'hw:3,11', 1), ('open', b'hw:3,4', 0)]) + self.assertEqual([e for e in events if e[0] == 'prepare'], [('prepare', 1), ('prepare', 2)]) + self.assertEqual([e for e in events if e[0] == 'start'], [('start', 1), ('start', 2)]) + expected = {'access': (3, ()), 'format': (2, ()), 'channels': (1, ()), + 'rate_resample': (0, ()), 'rate': (8000, (0,)), + 'period_size': (80, (0,)), 'periods': (2, (0,))} + self.assertEqual(audio.alsa.params, {1: expected, 2: expected}) + last_start = events.index(('start', 2)) + unmute = events.index(('cset', 'Incall Sink Mute', '0')) + for name in voice_audio.TEGU_GAINS: + gain = events.index(('cset', name, '180')) + read = events.index(('cget', name, None), gain) + self.assertLess(last_start, gain) + self.assertLess(gain, read) + self.assertLess(read, unmute) + self.assertEqual(audio.alsa.closed, [2, 1]) + self.assertEqual(controls, original) + self.assertEqual(events[-1], ('cset', 'Incall Sink Mute', '0')) + self.assertFalse(audio.saved or audio.pcms) + + def test_partial_pcm_or_mixer_failure_restores_saved_state(self): + for failure in ({'fail_params': True}, {'fail_start': True}, + {'fail_mixer': 'TDM_0_RX Mixer EP5'}, + {'fail_mixer': 'Bottom Speaker Digital Volume'}): + with self.subTest(failure=failure): + audio, events, controls, original = self.fixture(**failure) + with self.assertRaises(RuntimeError): + audio.__enter__() + self.assertEqual(controls, original) + self.assertEqual(len(audio.alsa.closed), audio.alsa.opened) + self.assertFalse(audio.saved or audio.pcms) + + def test_unconfirmed_sink_mute_refuses_before_opening_pcms(self): + audio, _, controls, original = self.fixture(fail_mute=True) + with self.assertRaisesRegex(voice_audio.AudioRefused, 'sink mute'): + audio.__enter__() + self.assertEqual(audio.alsa.opened, 0) + self.assertEqual(controls, original) + + def test_gain_mismatch_or_unreadable_gain_refuses_audio_and_closes_before_restore(self): + for option in ('mismatch', 'unreadable'): + for name in voice_audio.TEGU_GAINS: + with self.subTest(option=option, control=name): + audio, events, controls, original = self.fixture(**{option: name}) + with self.assertRaises(voice_audio.AudioRefused): + audio.__enter__() + # Restoring the original mute is safe only after both + # voice PCMs have closed; no failed route is audible. + unmute = events.index(('cset', 'Incall Sink Mute', '0')) + self.assertLess(events.index(('close', 1)), unmute) + self.assertEqual(controls, original) + self.assertEqual(audio.alsa.closed, [2, 1]) + + def test_body_failure_restores_state(self): + audio, _, controls, original = self.fixture() + with self.assertRaisesRegex(RuntimeError, 'call failed'): + with audio: + raise RuntimeError('call failed') + self.assertEqual(controls, original) + self.assertEqual(audio.alsa.closed, [2, 1]) + + def test_failed_close_keeps_sink_muted(self): + audio, _, controls, _ = self.fixture(fail_close=True) + audio.__enter__() + with self.assertRaisesRegex(RuntimeError, 'PCM close'): + audio.__exit__(None, None, None) + self.assertEqual(controls['Incall Sink Mute'], '1') class EarpieceUnitTests(unittest.TestCase): def test_the_mode_goes_through_the_units_when_installed(self): From d5b1f69e6f93f8869075744a59110df54fc9c717 Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Mon, 2 Nov 2026 18:08:16 -0647 Subject: [PATCH 02/31] device/tegu MODEM-PLAN, DEVICES: the 9a's first calls Outgoing and incoming speakerphone calls with audio both ways, first on the daily kernel and then on in-tree drivers from the open kernel PRs, where data and a text ran too. The Modem cell says so, and what's left: echo cancellation, an earpiece, the modem's start at boot and the kernel PRs' merge. --- device/tegu/MODEM-PLAN.md | 29 ++++++++++++++++++++++++++++- docs/DEVICES.md | 2 +- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/device/tegu/MODEM-PLAN.md b/device/tegu/MODEM-PLAN.md index 57be5e12c..1d38749e4 100644 --- a/device/tegu/MODEM-PLAN.md +++ b/device/tegu/MODEM-PLAN.md @@ -2017,11 +2017,38 @@ is a US MVNO on a large LTE network. (`omamobile-sit sms send`) reached the owner's phone. A text sent to the palmtop's own number was accepted ("sent") and never came back, which is common on this network. -- **SIM-10:** no call; the 9a has no audio route. +- **SIM-10:** no call on 11-02; the 9a had no audio route. See "Calls" + below. - **SIM-11 passed:** radio off, the RIL stopped, an attended reboot (the unit's stop powered the CP off during shutdown), then M0.1: the six partitions unchanged, `cpif` not loaded, UFS error handler 0. +#### Calls (2026-11-03) + +With `omamobile-modem-sit` 0.3.11 (speakerphone audio for the 9a's AoC +card, omarchy-mobile #367, on #364 and #356) and `[audio] card = auto`: + +- **On the daily kernel:** an outgoing call to the owner's phone, answered; + the far end's voice came out of the palmtop's speaker, and the palmtop's + microphone carried it back (heard at the far end as an echo: there is no + echo cancellation yet). A second outgoing call and an incoming call + (`omamobile-sit answer` while it rang) behaved the same. sitd logged + "AoC tegu speakerphone prepared at conservative TAS gain" at each start + and "AoC call routes restored" after each hang-up; UFS error handler 0. +- **On in-tree drivers end to end** (`7.3.0-rc6-omamobile-push1-g253ddb231a89`: + `omamobile` plus the open kernel PRs: the modem link #187 with its PCIe + stack, GNSS #185, and #162's AoC, GSA and Trusty from the device tree): + the AoC up with 93 services and the `google,tegu-aoc-snd-card` card, + CPIF and the in-tree host booted the CP to ONLINE, and then an outgoing + and an incoming call with audio both ways, mobile data over `rmnet0` + (pings, HTTPS 200) and a text that arrived. The TAS gains read back at + -20 dB during the calls, the mixer routes matched their saved state + after, the AoC kept 93 services with nothing in its log, the same boot + throughout, no oops or WARN, no UFS errors. + +Left for calls: echo cancellation on speakerphone, an earpiece mode, the +Phone app (through `omamobile-mmd`), and starting the modem at boot. + The run kept the full refused record (292 bytes: status 36, CID 1, the IPC extension version at 132, an unidentified extension byte at 133, the suggested retry time at 235-242 as an s64) and the raw indications of the passing run in diff --git a/docs/DEVICES.md b/docs/DEVICES.md index ab8e931f6..a0683d4af 100644 --- a/docs/DEVICES.md +++ b/docs/DEVICES.md @@ -25,7 +25,7 @@ The status of each device, as verified on real hardware. Rows in the matrix have | Pixel 6 | oriole | gs101 (Tensor G1) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); native test image on one phone; slot B marked successful and `vbmeta_b` verification turned off, both without project approval; see notes) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); guarded `userdata` root on test image) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); connected output on test image) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); Panfrost render node present) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); touchscreen detected; input not checked by smoke) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); gpio-keys detected; input not checked by smoke) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); USB network and SSH on test image) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); link up; traffic not checked by smoke) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); controller powered; pairing not checked) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); charge and temperature reported) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); charging reported; control not checked) | no | no | no | no | no | no | no | no | no | no | no | | Pixel 4 | flame | SM8150 (Snapdragon 855) | testing (temporary RAM boot; [notes](../device/flame/BRINGUP-M1.md)) | testing (RAM probe; all UFS read-only) | testing (1080x2280 console; software desktop in separate Arch payload) | testing (separate Arch payload; FD640 contexts, llvmpipe desktop) | testing (separate Arch payload; events and PIN unlock verified) | no | testing (NCM + ACM + SSH; sustained transfers can disconnect) | testing (guarded RAM scan; association untested) | no | no | no | no | no | no | - | no | no | no | no | no | no | - | | Pixel 4 XL ([notes](../device/coral/NOTES.md)) | coral | SM8150 (Snapdragon 855) | WIP (direct ABL v2 boot on the test handset's slot A; slot-B install and §3.1 entry pending; [notes](../device/coral/BRINGUP-M1.md)) | testing (read-only `blockdev` guard + RAM `overlayfs`) | testing (1440x3040@60Hz S6E3HC2 DSC 1.1 KMS, DPMS, brightness) | testing (Adreno 640 / FD640 Mesa Freedreno, Hyprland) | testing (FTS SPI multitouch + read-only flash guard) | testing (power via `qcom-pon` + volume via `gpio-keys`) | testing (CDC ECM + ACM + SSH; stays up with host USB switched off) | testing (`WCN3990` `ath10k_snoc` + `rmtfs -r`, WPA2/DHCP/HTTPS; radio sessions ran before the modem baseline) | WIP (`WCN3990` `hci_qca` `hci0` up + BLE scan; audio/pairing open) | WIP (PM8150B ADC `VBAT_SNS` voltage + FG temp; aftermarket pack on test unit: no reply from `1-0036`) | testing (PM8150B SMB5 charger with `4.20 V` / `500 mA` kernel clamp) | testing (`CS40L25A` I2C click waveform) | testing (PM8150L flash LEDs + quick-settings tile) | no | - | testing (QDSP6 + dual `CS35L36` amps capped at `-26 dB` + `IA8508` SPI mic DSP) | testing (`SLPI` + `fastrpc` + RAM-backed `hexagonrpcd` + QMI SSC: 7 sensors + Soli radar) | WIP (`MPSS` boots with `rmtfs -r` + patched `tqftpserv`, SIM detected; no IPA/voice yet; radio sessions ran before the modem baseline) | no | testing (`CAMSS` + `IMX363`, `IMX481`, `IMX520`, dual `OV7251` NIR; `libcamera` softISP) | no | - | -| Pixel 9a ([notes](../device/tegu/NOTES.md)) | tegu | zumapro (Tensor G4) | works ([#28](https://github.com/derekross/omarchy-mobile/issues/28): native boot from slot B, the Arch root on `userdata`, `omamobile-device-tegu`; slot B was marked successful by hand on 2026-10-28 with the `devinfo` write approved on 2026-10-22, now on hold ([#125](https://github.com/derekross/omarchy-mobile/pull/125)), unmarked by the 10-31 fastboot recovery and marked again on 2026-10-31 during the hold ([record](../device/tegu/NOTES.md#2026-10-31-a-fastboot-flash-of-slot-b-cleared-its-successful-mark-and-b-was-marked-again)), and the package does not mark it; unpublished kernel: the SoC and board device tree is [kernel #81](https://github.com/derekross/linux-omarchy-mobile/pull/81), merged; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (UFS behind the read-only guard; unpublished kernel; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (120 Hz through gs-decon; the panel driver [kernel #89](https://github.com/derekross/linux-omarchy-mobile/pull/89), 120 Hz [kernel #88](https://github.com/derekross/linux-omarchy-mobile/pull/88), merged, the display DT, merged with [kernel #96](https://github.com/derekross/linux-omarchy-mobile/pull/96); brightness, DPMS off and on and the 60/120 Hz switch on the boot of [kernel #125](https://github.com/derekross/linux-omarchy-mobile/pull/125), merged, which also checks the panel's ID; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on), [brightness record](../device/tegu/NOTES.md#2026-11-01-afternoon-and-evening-wi-fi-from-the-package-the-wake-and-the-replug-storage-idle-the-panel-id)) | works (Panthor, the desktop renders, runtime suspend when idle; this boot runs at a fixed 160 MHz, so frequency scaling and the GPU thermal zone count as in review, [kernel #85](https://github.com/derekross/linux-omarchy-mobile/pull/85) in review, [kernel #87](https://github.com/derekross/linux-omarchy-mobile/pull/87) in review; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (Synaptics S3908 over SPI, [kernel #81](https://github.com/derekross/linux-omarchy-mobile/pull/81), merged; survives sleep, [kernel #82](https://github.com/derekross/linux-omarchy-mobile/pull/82), merged; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (gpio-keys: power and volume; the power key wakes from sleep; unpublished kernel; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (CDC NCM and SSH; reconnects after a replug, `omamobile-tegu-usb-rescue`, also after a replug the gadget didn't see ([#280](https://github.com/derekross/omarchy-mobile/pull/280); [the replug record](../device/tegu/NOTES.md#2026-10-28-what-the-device-tables-claims-rest-on)); [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (BCM4383 on PCIe channel 1 through the shared gs201 host and zuma PHY, [kernel #178](https://github.com/derekross/linux-omarchy-mobile/pull/178) on [kernel #156](https://github.com/derekross/linux-omarchy-mobile/pull/156), in review, and brcmfmac, [kernel #56](https://github.com/derekross/linux-omarchy-mobile/pull/56) in review; started at boot by `omamobile-device-tegu` 0.2.4 ([#238](https://github.com/derekross/omarchy-mobile/pull/238)) with the extractor's firmware; WPA2 with iwd, kept loaded across sleep by the package's sleep hook; [record](../device/tegu/NOTES.md#2026-11-01-afternoon-and-evening-wi-fi-from-the-package-the-wake-and-the-replug-storage-idle-the-panel-id)) | works (hci_uart on the bootloader's address, BlueZ, A2DP; [kernel #94](https://github.com/derekross/linux-omarchy-mobile/pull/94); unpublished kernel; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (MAX77779 gauge with temperature, current and time estimates through UPower; [kernel #66](https://github.com/derekross/linux-omarchy-mobile/pull/66); unpublished kernel; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (the MAX77779 charger binds from the device tree, [kernel #161](https://github.com/derekross/linux-omarchy-mobile/pull/161), merged, built by [#227](https://github.com/derekross/omarchy-mobile/pull/227); the charge limit in `omamobile-device-tegu` 0.2.3 holds charging off at the limit through `charge_behaviour` and lets it run again 5 below; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | works (CS40L26A through feedbackd, with brownout prevention, [kernel #95](https://github.com/derekross/linux-omarchy-mobile/pull/95); its DT [kernel #96](https://github.com/derekross/linux-omarchy-mobile/pull/96), merged; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (LM3644, 25 steps to 75 mA, quick-settings tile; its DT [kernel #96](https://github.com/derekross/linux-omarchy-mobile/pull/96), merged; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | testing (Omarchy's Location switch serves fixes from GPS, Galileo, BeiDou and GLONASS once the modem is up, started by hand: a 30-minute session through the switch on 2026-11-01 (omamobile-gnss 0.2.5's start, the modem link left to cycle) ran clean, 1763 of 1765 GGA sentences fixed, first fix 37 s after a client connected; needs [kernel #150](https://github.com/derekross/linux-omarchy-mobile/pull/150), merged, the PERIC0 clock fix [kernel #172](https://github.com/derekross/linux-omarchy-mobile/pull/172) in review (without it the modem link hung the palmtop within minutes) and [#114](https://github.com/derekross/omarchy-mobile/pull/114); [plan](../device/tegu/MODEM-PLAN.md), record with [#202](https://github.com/derekross/omarchy-mobile/pull/202)) | works (audio and sensor DSP through the GSA and Trusty, 93 services, started at boot by `omamobile-device-tegu` 0.2.3 from the device tree, [kernel #162](https://github.com/derekross/linux-omarchy-mobile/pull/162) in review; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | works (the TAS2572 amplifiers and the microphone through the AoC card and PipeWire, at boot with the AoC: a tone from the speaker, the microphone at -32 dBFS; speakers at a -10 dB ceiling; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | works (accelerometer, light, proximity, compass and gyroscope through the AoC and the sensor proxy, at boot with the AoC; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | WIP (on the owner's kernel, 2026-11-02: registered on LTE, mobile data over `rmnet0` and texts both ways with `omamobile-modem-sit` 0.3.8 ([#356](https://github.com/derekross/omarchy-mobile/pull/356)); the package doesn't start the modem, CPIF isn't in the published kernel, and calls have no audio route; [plan](../device/tegu/MODEM-PLAN.md), [record](../device/tegu/MODEM-PLAN.md#sim-test-results-2026-11-02-730-rc6-omamobile-tegu-s2mpg15-m1-g991042e2eff3-dirty)) | works (NXP ST54L through nxp-nci, its clock pad from the PMU ([kernel #104](https://github.com/derekross/linux-omarchy-mobile/pull/104) and [kernel #105](https://github.com/derekross/linux-omarchy-mobile/pull/105), merged, with [kernel #131](https://github.com/derekross/linux-omarchy-mobile/pull/131), merged), loaded at boot by `omamobile-device-tegu` 0.2.3 with neard and the link opener: polls with no I2C errors and read a payment card; polling stops before sleep; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | works (main, ultrawide and front from the device tree, [kernel #164](https://github.com/derekross/linux-omarchy-mobile/pull/164) in review, with [kernel #63](https://github.com/derekross/linux-omarchy-mobile/pull/63) and [kernel #103](https://github.com/derekross/linux-omarchy-mobile/pull/103) in review: their drivers load at boot with nothing by hand, libcamera lists all three, and each streams, main at 19 fps and the others at 30 fps at 1280x960; basic picture quality through libcamera's software ISP; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | testing (s2idle when asked for, or through the shell's auto-sleep with the `omamobile-sleep` toggle on, which ships off; the power key lights the lock screen on the first press ([#268](https://github.com/derekross/omarchy-mobile/pull/268), [#275](https://github.com/derekross/omarchy-mobile/pull/275)), and the RTC wakes it; on 2026-11-01 thirty attended 120 s sleeps ([plan](../device/tegu/SLEEP-PLAN.md) S1) and a day of real use with auto-sleep on ([record](../device/tegu/NOTES.md#2026-11-01-afternoon-and-evening-wi-fi-from-the-package-the-wake-and-the-replug-storage-idle-the-panel-id)) all woke, but six test sleeps since 10-28 did not (one in 21 on the clock-fix kernel on 11-01, and one in 127 in an overnight series of 120 s sleeps on 11-01 to 11-02), so sleep tests stay attended ([plan](../device/tegu/SLEEP-PLAN.md) S1); the drain is about 300 mA asleep, the same as awake with the screen off, because nothing below the CPUs sleeps yet; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (opt-in) (enrolls, matches, refuses other fingers and unlocks the lock screen through Trusty and `omamobile-fingerprint`, 2026-10-29; the sensor binds from the device tree, [kernel #165](https://github.com/derekross/linux-omarchy-mobile/pull/165) in review, with [kernel #126](https://github.com/derekross/linux-omarchy-mobile/pull/126), merged; opt-in as on the 7 Pro, because the service's first run writes Trusty's secure storage; [plan](../device/tegu/FINGERPRINT-PLAN.md), [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | +| Pixel 9a ([notes](../device/tegu/NOTES.md)) | tegu | zumapro (Tensor G4) | works ([#28](https://github.com/derekross/omarchy-mobile/issues/28): native boot from slot B, the Arch root on `userdata`, `omamobile-device-tegu`; slot B was marked successful by hand on 2026-10-28 with the `devinfo` write approved on 2026-10-22, now on hold ([#125](https://github.com/derekross/omarchy-mobile/pull/125)), unmarked by the 10-31 fastboot recovery and marked again on 2026-10-31 during the hold ([record](../device/tegu/NOTES.md#2026-10-31-a-fastboot-flash-of-slot-b-cleared-its-successful-mark-and-b-was-marked-again)), and the package does not mark it; unpublished kernel: the SoC and board device tree is [kernel #81](https://github.com/derekross/linux-omarchy-mobile/pull/81), merged; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (UFS behind the read-only guard; unpublished kernel; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (120 Hz through gs-decon; the panel driver [kernel #89](https://github.com/derekross/linux-omarchy-mobile/pull/89), 120 Hz [kernel #88](https://github.com/derekross/linux-omarchy-mobile/pull/88), merged, the display DT, merged with [kernel #96](https://github.com/derekross/linux-omarchy-mobile/pull/96); brightness, DPMS off and on and the 60/120 Hz switch on the boot of [kernel #125](https://github.com/derekross/linux-omarchy-mobile/pull/125), merged, which also checks the panel's ID; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on), [brightness record](../device/tegu/NOTES.md#2026-11-01-afternoon-and-evening-wi-fi-from-the-package-the-wake-and-the-replug-storage-idle-the-panel-id)) | works (Panthor, the desktop renders, runtime suspend when idle; this boot runs at a fixed 160 MHz, so frequency scaling and the GPU thermal zone count as in review, [kernel #85](https://github.com/derekross/linux-omarchy-mobile/pull/85) in review, [kernel #87](https://github.com/derekross/linux-omarchy-mobile/pull/87) in review; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (Synaptics S3908 over SPI, [kernel #81](https://github.com/derekross/linux-omarchy-mobile/pull/81), merged; survives sleep, [kernel #82](https://github.com/derekross/linux-omarchy-mobile/pull/82), merged; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (gpio-keys: power and volume; the power key wakes from sleep; unpublished kernel; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (CDC NCM and SSH; reconnects after a replug, `omamobile-tegu-usb-rescue`, also after a replug the gadget didn't see ([#280](https://github.com/derekross/omarchy-mobile/pull/280); [the replug record](../device/tegu/NOTES.md#2026-10-28-what-the-device-tables-claims-rest-on)); [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (BCM4383 on PCIe channel 1 through the shared gs201 host and zuma PHY, [kernel #178](https://github.com/derekross/linux-omarchy-mobile/pull/178) on [kernel #156](https://github.com/derekross/linux-omarchy-mobile/pull/156), in review, and brcmfmac, [kernel #56](https://github.com/derekross/linux-omarchy-mobile/pull/56) in review; started at boot by `omamobile-device-tegu` 0.2.4 ([#238](https://github.com/derekross/omarchy-mobile/pull/238)) with the extractor's firmware; WPA2 with iwd, kept loaded across sleep by the package's sleep hook; [record](../device/tegu/NOTES.md#2026-11-01-afternoon-and-evening-wi-fi-from-the-package-the-wake-and-the-replug-storage-idle-the-panel-id)) | works (hci_uart on the bootloader's address, BlueZ, A2DP; [kernel #94](https://github.com/derekross/linux-omarchy-mobile/pull/94); unpublished kernel; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (MAX77779 gauge with temperature, current and time estimates through UPower; [kernel #66](https://github.com/derekross/linux-omarchy-mobile/pull/66); unpublished kernel; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (the MAX77779 charger binds from the device tree, [kernel #161](https://github.com/derekross/linux-omarchy-mobile/pull/161), merged, built by [#227](https://github.com/derekross/omarchy-mobile/pull/227); the charge limit in `omamobile-device-tegu` 0.2.3 holds charging off at the limit through `charge_behaviour` and lets it run again 5 below; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | works (CS40L26A through feedbackd, with brownout prevention, [kernel #95](https://github.com/derekross/linux-omarchy-mobile/pull/95); its DT [kernel #96](https://github.com/derekross/linux-omarchy-mobile/pull/96), merged; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (LM3644, 25 steps to 75 mA, quick-settings tile; its DT [kernel #96](https://github.com/derekross/linux-omarchy-mobile/pull/96), merged; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | testing (Omarchy's Location switch serves fixes from GPS, Galileo, BeiDou and GLONASS once the modem is up, started by hand: a 30-minute session through the switch on 2026-11-01 (omamobile-gnss 0.2.5's start, the modem link left to cycle) ran clean, 1763 of 1765 GGA sentences fixed, first fix 37 s after a client connected; needs [kernel #150](https://github.com/derekross/linux-omarchy-mobile/pull/150), merged, the PERIC0 clock fix [kernel #172](https://github.com/derekross/linux-omarchy-mobile/pull/172) in review (without it the modem link hung the palmtop within minutes) and [#114](https://github.com/derekross/omarchy-mobile/pull/114); [plan](../device/tegu/MODEM-PLAN.md), record with [#202](https://github.com/derekross/omarchy-mobile/pull/202)) | works (audio and sensor DSP through the GSA and Trusty, 93 services, started at boot by `omamobile-device-tegu` 0.2.3 from the device tree, [kernel #162](https://github.com/derekross/linux-omarchy-mobile/pull/162) in review; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | works (the TAS2572 amplifiers and the microphone through the AoC card and PipeWire, at boot with the AoC: a tone from the speaker, the microphone at -32 dBFS; speakers at a -10 dB ceiling; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | works (accelerometer, light, proximity, compass and gyroscope through the AoC and the sensor proxy, at boot with the AoC; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | WIP (registered on LTE, mobile data over `rmnet0`, texts both ways and speakerphone calls in and out with `omamobile-modem-sit` ([#356](https://github.com/derekross/omarchy-mobile/pull/356), [#367](https://github.com/derekross/omarchy-mobile/pull/367)), on the owner's kernel and on in-tree drivers from the open kernel PRs ([kernel #187](https://github.com/derekross/linux-omarchy-mobile/pull/187), [kernel #162](https://github.com/derekross/linux-omarchy-mobile/pull/162)); the package doesn't start the modem, the kernel PRs aren't merged, and calls have no echo cancellation or earpiece yet; [plan](../device/tegu/MODEM-PLAN.md), [record](../device/tegu/MODEM-PLAN.md#sim-test-results-2026-11-02-730-rc6-omamobile-tegu-s2mpg15-m1-g991042e2eff3-dirty)) | works (NXP ST54L through nxp-nci, its clock pad from the PMU ([kernel #104](https://github.com/derekross/linux-omarchy-mobile/pull/104) and [kernel #105](https://github.com/derekross/linux-omarchy-mobile/pull/105), merged, with [kernel #131](https://github.com/derekross/linux-omarchy-mobile/pull/131), merged), loaded at boot by `omamobile-device-tegu` 0.2.3 with neard and the link opener: polls with no I2C errors and read a payment card; polling stops before sleep; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | works (main, ultrawide and front from the device tree, [kernel #164](https://github.com/derekross/linux-omarchy-mobile/pull/164) in review, with [kernel #63](https://github.com/derekross/linux-omarchy-mobile/pull/63) and [kernel #103](https://github.com/derekross/linux-omarchy-mobile/pull/103) in review: their drivers load at boot with nothing by hand, libcamera lists all three, and each streams, main at 19 fps and the others at 30 fps at 1280x960; basic picture quality through libcamera's software ISP; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | testing (s2idle when asked for, or through the shell's auto-sleep with the `omamobile-sleep` toggle on, which ships off; the power key lights the lock screen on the first press ([#268](https://github.com/derekross/omarchy-mobile/pull/268), [#275](https://github.com/derekross/omarchy-mobile/pull/275)), and the RTC wakes it; on 2026-11-01 thirty attended 120 s sleeps ([plan](../device/tegu/SLEEP-PLAN.md) S1) and a day of real use with auto-sleep on ([record](../device/tegu/NOTES.md#2026-11-01-afternoon-and-evening-wi-fi-from-the-package-the-wake-and-the-replug-storage-idle-the-panel-id)) all woke, but six test sleeps since 10-28 did not (one in 21 on the clock-fix kernel on 11-01, and one in 127 in an overnight series of 120 s sleeps on 11-01 to 11-02), so sleep tests stay attended ([plan](../device/tegu/SLEEP-PLAN.md) S1); the drain is about 300 mA asleep, the same as awake with the screen off, because nothing below the CPUs sleeps yet; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (opt-in) (enrolls, matches, refuses other fingers and unlocks the lock screen through Trusty and `omamobile-fingerprint`, 2026-10-29; the sensor binds from the device tree, [kernel #165](https://github.com/derekross/linux-omarchy-mobile/pull/165) in review, with [kernel #126](https://github.com/derekross/linux-omarchy-mobile/pull/126), merged; opt-in as on the 7 Pro, because the service's first run writes Trusty's secure storage; [plan](../device/tegu/FINGERPRINT-PLAN.md), [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | | Pixel 8 Pro ([notes](../device/husky/NOTES.md)) | husky | zuma (Tensor G3) | WIP ([#1](https://github.com/derekross/omarchy-mobile/issues/1): slot B, not marked successful; Omarchy's image from the signed repository boots to the lock screen; the zuma device tree is merged ([kernel #13](https://github.com/derekross/linux-omarchy-mobile/pull/13), [#53](https://github.com/derekross/linux-omarchy-mobile/pull/53))) | testing (UFS at HS-G4 behind the read-only guard; Arch on `userdata`; [UFS-PLAN](../device/husky/UFS-PLAN.md)) | WIP (simple-framebuffer: console and Omarchy's lock screen) | no | testing (ST FTM5 over SPI, merged, [kernel #153](https://github.com/derekross/linux-omarchy-mobile/pull/153); [NOTES](../device/husky/NOTES.md)) | testing (power and volume through `gpio-keys`, merged, [kernel #148](https://github.com/derekross/linux-omarchy-mobile/pull/148); [NOTES](../device/husky/NOTES.md)) | testing (USB and SSH) | testing (BCM4398 on a test kernel, [kernel #156](https://github.com/derekross/linux-omarchy-mobile/pull/156); firmware from the owner's image, [#214](https://github.com/derekross/omarchy-mobile/pull/214); [NOTES](../device/husky/NOTES.md)) | no | testing (gauge with Google's ATL model through a bring-up overlay, temperature, MFD, on a test kernel, [kernel #163](https://github.com/derekross/linux-omarchy-mobile/pull/163); [notes](../device/husky/BATTERY-NOTES.md)) | testing (the charger driver by hand under a dead-man tool, slow on plain 5 V, on a test kernel, [kernel #163](https://github.com/derekross/linux-omarchy-mobile/pull/163); [notes](../device/husky/BATTERY-NOTES.md)) | no | no | no | no | no | no | no | no | no | no | no | | Pixel 7 ([notes](../device/panther/NOTES.md)) | panther | gs201 (Tensor G2) | WIP (slot B, not marked successful; Arch and Hyprland boot; [BRINGUP-M1](../device/panther/BRINGUP-M1.md); board file merged, [kernel #108](https://github.com/derekross/linux-omarchy-mobile/pull/108)) | testing (UFS behind the read-only guard; Arch on `userdata`; merged, [kernel #108](https://github.com/derekross/linux-omarchy-mobile/pull/108)) | WIP (simple-framebuffer: console and the Hyprland desktop; brightness and display off/on over DCS through the S6E3FC3 panel driver and device-panther 0.1.4, in review, [kernel #177](https://github.com/derekross/linux-omarchy-mobile/pull/177); [DISPLAY-PLAN](../device/panther/DISPLAY-PLAN.md)) | testing (Panthor on the Mali-G710; Hyprland renders on it; merged through [kernel #134](https://github.com/derekross/linux-omarchy-mobile/pull/134), with the always-on rule in device-panther 0.1.1, [#145](https://github.com/derekross/omarchy-mobile/pull/145); [notes](../device/panther/NOTES.md#2026-10-28-the-gpu-and-the-haptics-power-off-and-usb-after-a-replug)) | WIP (FocalTech FT3658: touches drive Hyprland and unlock the PIN screen on a test kernel; the driver, [kernel #109](https://github.com/derekross/linux-omarchy-mobile/pull/109), and the touch node, [kernel #134](https://github.com/derekross/linux-omarchy-mobile/pull/134), are merged; stock's interrupt pull-up and CS delay, [kernel #166](https://github.com/derekross/linux-omarchy-mobile/pull/166), the driver's review fixes, [kernel #133](https://github.com/derekross/linux-omarchy-mobile/pull/133), and the kernel option with the touch notes, [#149](https://github.com/derekross/omarchy-mobile/pull/149), are merged) | testing (gpio-keys: power, volume; merged, [kernel #108](https://github.com/derekross/linux-omarchy-mobile/pull/108)) | testing (USB and SSH; merged, [kernel #108](https://github.com/derekross/linux-omarchy-mobile/pull/108); a replug comes back through `omamobile-usb-rescue` in device-panther 0.1.3, on the MAX77759's I2C bus, merged, [kernel #167](https://github.com/derekross/linux-omarchy-mobile/pull/167); [notes](../device/panther/NOTES.md#2026-10-29-usb-comes-back-after-a-replug-u1)) | no | no | WIP (MAX77759 fuel gauge with stock's battery model on a test kernel: percentage, capacity and temperature in upower and the bar; in review, [kernel #171](https://github.com/derekross/linux-omarchy-mobile/pull/171) and the driver fix [#170](https://github.com/derekross/linux-omarchy-mobile/pull/170); [BATTERY-PLAN](../device/panther/BATTERY-PLAN.md)) | no | testing (CS40L26 with the phone's own firmware, `tools/extract-vendor-firmware -d panther`; merged through [kernel #134](https://github.com/derekross/linux-omarchy-mobile/pull/134), with the feedbackd rule in device-panther 0.1.1, [#145](https://github.com/derekross/omarchy-mobile/pull/145); [notes](../device/panther/NOTES.md#2026-10-28-the-gpu-and-the-haptics-power-off-and-usb-after-a-replug)) | no | no | no | no | no | no | no | no | no (s2idle by default since [kernel #134](https://github.com/derekross/linux-omarchy-mobile/pull/134) and device-panther 0.1.1; not run yet) | no | | OnePlus 13 ([notes](../device/dodge/NOTES.md)) | dodge | sm8750 (Snapdragon 8 Elite) | testing (kernel [mrlund/linux-omarchy-mobile `dodge-v3-20261101`](https://github.com/mrlund/linux-omarchy-mobile/tree/dodge-v3-20261101); [kernel #115](https://github.com/derekross/linux-omarchy-mobile/pull/115) closed; [BRINGUP](../device/dodge/BRINGUP-M1.md), [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing ([notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing (msm/dpu; warm-boot drop fixed; [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing (Adreno 830 / gpu2; Vulkan untested; [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing ([notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing ([notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing (CDC NCM + SSH; gadget stuck after replug until reboot; kernel [mrlund/linux-omarchy-mobile `dodge-v3-20261101`](https://github.com/mrlund/linux-omarchy-mobile/tree/dodge-v3-20261101); [kernel #115](https://github.com/derekross/linux-omarchy-mobile/pull/115) closed; [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing (WCN7860 / ath12k; [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing (pairing; A2DP untested; kernel [mrlund/linux-omarchy-mobile `dodge-v3-20261101`](https://github.com/mrlund/linux-omarchy-mobile/tree/dodge-v3-20261101); [kernel #115](https://github.com/derekross/linux-omarchy-mobile/pull/115) closed; [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing (gauge; charging path not claimed; kernel [mrlund/linux-omarchy-mobile `dodge-v3-20261101`](https://github.com/mrlund/linux-omarchy-mobile/tree/dodge-v3-20261101); [kernel #115](https://github.com/derekross/linux-omarchy-mobile/pull/115) closed; [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | no | no | no | no | - | testing (speakers, earpiece, mics; headset plug untested; [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing (accel, prox, compass; autorotate; [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing (LTE data; calls/SMS untested; opt-in flag; [modem](../device/dodge/modem/README.md), [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | no | no | WIP (s2idle not default; [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | no | From 93be99e3cd5a866db7bfb924dbcd647e06bfb5c2 Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Mon, 2 Nov 2026 17:53:45 -0647 Subject: [PATCH 03/31] tegu: plan Phone and Messages integration through mmd Trace the existing app, session agent, ModemManager-compatible bridge and sitd path. Record the tegu installation and unit prerequisites still missing on main, and an attended bridge-only test that preserves the running modem stack. Document the passing offline bridge and apps package suites, activation and audio limits, and the eventual board-specific image integration. --- device/tegu/TELEPHONY-APPS-PLAN.md | 160 +++++++++++++++++++++++++++++ 1 file changed, 160 insertions(+) create mode 100644 device/tegu/TELEPHONY-APPS-PLAN.md diff --git a/device/tegu/TELEPHONY-APPS-PLAN.md b/device/tegu/TELEPHONY-APPS-PLAN.md new file mode 100644 index 000000000..564bd09e2 --- /dev/null +++ b/device/tegu/TELEPHONY-APPS-PLAN.md @@ -0,0 +1,160 @@ + +# Pixel 9a: connect Phone and Messages to sitd + +Status (2026-11-03): offline investigation on `origin/main` at `31fbcf9`. +The owner reports texts both ways and calls through `omamobile-sit` on the +palmtop. No phone contact in this investigation. This is an integration +plan, not a record of app or call-audio qualification on hardware. + +The app protocol already exists. The immediate missing layer in the +recorded tegu setup is `omamobile-mmd`, installed and running. A normal +package install is blocked by the cheetah-only dependency still on main; +sitd's packaged modem-unit dependency also needs the tegu startup work. +Those are existing, separate changes. Do not duplicate them or install +with dependency checks disabled. The first app test can use an already +running, attended sitd; it need not wait for modem startup at boot. + +## The existing path + +```text +Phone / Messages + | session bus: org.omamobile.Phone1, org.omamobile.Messages1 +omatel-agent (the logged-in user's service) + | system bus: org.freedesktop.ModemManager1 +omamobile-mmd (root, ModemManager-compatible API) + | /run/omamobile-sit/socket: JSON requests and status subscription +omamobile-sitd (the only owner of the modem channels) + | SIT / AT +modem +``` + +| Layer | What the repository already supplies | +| --- | --- | +| Apps | `omamobile-apps` depends on `omaphone` and `omamessages`; both pull in `omatel-agent`. Contacts is supplied with Phone and does not need a modem. #361 puts all three packages in the image. | +| Agent | `packages/omatel` packages the agent, its user unit and both session-bus activation files. Opening an app activates it. The disabled user unit is intentional; no root agent and no generic enablement change are needed. | +| Bridge | `packages/omamobile-mmd` owns the system-bus name normally used by ModemManager, exports modem/call/SMS objects, and checks polkit for operations. It conflicts with the real `modemmanager`; installing both is not the solution. | +| Commands | `Voice.CreateCall` plus `Call.Start` maps to sitd `dial`; `Accept`, `Hangup` and `SendDtmf` map to sitd requests. `Messaging.Create` plus `Sms.Send` maps to `sms-send` with a durable request ID. | +| Incoming events | The bridge subscribes to sitd, exports calls, reads `sms-list`, and maps deletion to `sms-delete`. The agent stores SMS before deleting them from the bridge and handles notifications and call history. | +| Privileges | Apps and agent use D-Bus. Only the bridge needs sitd's private socket. Keep socket permissions and the current polkit policy; no wheel-group workaround is needed for app access. | + +Sources: [app package](../../packages/omamobile-apps/PKGBUILD), +[agent packaging and activation](../../packages/omatel/README.md), +[bridge mappings](../../packages/omamobile-mmd/lib/bridge.py), +[socket subscription](../../packages/omamobile-mmd/lib/sitd_link.py), and +[the shared telephony plan](../../docs/TELEPHONY-APPS-PLAN.md), especially +sections 1.5 and 10.1b. The requested old cheetah plan path has moved to +`docs/TELEPHONY-APPS-PLAN.md`. + +Contacts uses the shared local vCard address book; it does not need a modem +or an additional cellular service. + +## What tegu is missing + +1. **A dependency-correct install.** `omamobile-mmd` depends on + `omamobile-modem-sit`, which depends on `omamobile-modem`, which still + depends on `omamobile-device-cheetah`. That conflicts with tegu's device + package. The existing `modem-policy-virtual` change replaces that last + dependency with `omamobile-modem-policy` and adds tegu's provider. It is + not in this base. Land/build that prerequisite first. +2. **The bridge package and its start.** The common rootfs list deliberately + omits mmd and modem-sit. Tegu's `ROOTFS_PACKAGES` does not include them. + `omamobile-mmd.service` ships disabled, has no D-Bus activation file, + and its installer creates no wants link. Merely opening an app cannot + start it. The recorded SIM runbook says mmd was not installed; current + hardware state must be checked by the human rather than inferred here. +3. **The right modem service for later automatic integration.** The shipped + `omamobile-sitd.service` requires `omamobile-modem.service`; the recorded + tegu run uses its own starter and an `/etc` copy of sitd's unit that + removes this dependency. A bridge-only test must retain the already + qualified, running stack. Do not start or restart the stock sitd unit + to attach the bridge. Package tegu's starter/order separately before + making this an image default. +4. **The tested tegu RIL and release safety.** Main still carries the older + RIL; use the independently reviewed tegu SIM fixes and safe unconfirmed + call-release behavior. Do not replace a running test RIL as part of + installing the bridge. An unconfirmed hang-up must not stop the tegu + modem in place. Call audio remains its separate route/qualification. + +There is no evidence that SMS needs an mmd APN, a tegu-specific socket +path, an extra bridge SMS transport, or a second modem daemon. The bridge +forwards SMS through sitd; sitd chooses the transport. Its modem state is +based on SIM/radio/registration and can be REGISTERED without a data bearer. +The hard-coded MM model string `Exynos Modem 5300` is misleading on tegu, +but is display metadata, not a routing selector or a reason to block SMS. + +## The smallest durable changes after the prerequisites + +- Keep `omamobile-apps` modem-independent, as #361 intends. Do not make all + images depend on the modem stack to get Phone or Contacts. +- After tegu's packaged modem start is qualified, add mmd and modem-sit to + tegu's board package list (and its packaged descriptor copy), with a + test that the descriptors agree and resolve against tegu's policy + provider without installing the cheetah device package. +- Enable only the bridge's existing relationship to sitd: + `systemctl enable omamobile-mmd.service` creates + `omamobile-sitd.service.wants/omamobile-mmd.service`. This follows a sitd + start without enabling sitd or starting the CP. Tegu's setup can do this + conditionally when mmd is installed; it need not use `--now`. +- Preserve mmd's one-way relationship: `After=omamobile-sitd.service`, no + `Requires=`, `Wants=` or activation path from the bridge to sitd or the + CP. An app opening or a bridge restart must never power the modem on. +- Test the conditional enablement with a fake systemctl, absent-package + handling, and a scratch unit root. Starting the bridge alone must not + request a CP start; starting qualified sitd must pull in the bridge. + +For the already running palmtop, the manual steps below are enough once +package dependencies are correct. The durable boot/image changes are not +prerequisites for that test. + +## Attended first test (proposed, not executed) + +Keep the existing modem sleep inhibitor throughout; suspend with the CP on +is not qualified by this work. Keep the existing once-per-boot start and +NV checks. No step below starts, stops or restarts the CP or sitd. +Run user commands in the existing graphical user's terminal, root commands +in the attended administrative session. These commands are a runbook for +the human, not authorization to contact the phone in this task. + +| Step / risk | Commands or action | Expect / pass | Stop condition | Rollback | +| --- | --- | --- | --- | --- | +| 1. Read-only / none | `uname -r`; `pacman -Q omaphone omamessages omatel-agent omamobile-mmd omamobile-modem-sit omamobile-modem`; `systemctl is-active omamobile-sitd omamobile-mmd ModemManager`; `systemctl cat omamobile-sitd`; `systemd-inhibit --list` | Record kernel/package versions, actual sitd unit, active inhibitor and existing running sitd. Missing bridge is expected initially. | No confirmed running sitd, wrong starter, competing ModemManager, or no inhibitor. | None; end this session without starting the modem. | +| 2. Install bridge / low | First review `pacman -Sp --print-format '%n %v' omamobile-mmd`. After the dependency fix is available, `pacman -S omamobile-mmd`, only if the transaction adds the bridge/dependencies without changing the running RIL, modem or device package. | No cheetah package, no tegu removal, no modem/RIL upgrade, and nothing starts the CP. | Resolver conflict or any unexpected upgrade/removal. Never use `-dd`. | Cancel before accepting the transaction; if installed, remove only the bridge after stopping it. | +| 3. Start bridge / low | Root: `systemctl start omamobile-mmd.service`; `busctl --system list --no-pager org.freedesktop.ModemManager1`; use `packages/omamobile-mmd/test/libmm-status.py` for states only. | Bus name owned by mmd, a modem object with SIM ready and expected registration; sitd/CP remain the same running instances. | Bridge cannot own the name/connect; sitd exits; hardware warning. | `systemctl stop omamobile-mmd.service`. Do not restart sitd or stop the modem. | +| 4. Agent and apps / low, screen changes | Announce first, then open Phone and Messages as the session user. `systemctl --user is-active omatel-agent`; `busctl --user list --no-pager org.omamobile.Phone1 org.omamobile.Messages1`. | Agent activates, apps see the modem instead of no-modem; Contacts opens without requiring a live modem. | Activation or authorization error. Do not weaken polkit/socket permissions. | Close apps; stop the user agent if it was started only for this test; stop mmd. | +| 5. SMS / carrier charge possible | Human sends one agreed test text in Messages, then sends one back from the other device; reopen the conversation. | One send, one received message, preserved after closing/reopening; no duplicate send on retry/reconnect. | Duplicate, uncertain delivery, or missing inbound text. Do not retry an uncertain send automatically. | Stop testing and stop the bridge; keep private message stores for diagnosis. | +| 6. Calls / medium, screen and sound | Only after the separate safe-release and call-audio checks: announce, place one ordinary agreed call from Phone, receive one, answer/decline and hang up. | UI state follows the call, release is confirmed, and the approved audio route behaves as qualified separately. | Unconfirmed release, unexpected audio level, CP/AoC/UFS fault. No emergency-number test. | Follow the attended safe-release runbook; no modem stop or second start. A reboot needs separate approval. | +| 7. Optional persistence / low | After passing, root: `systemctl enable omamobile-mmd.service` without `--now`. Inspect the resulting sitd wants link. | Bridge follows future *approved* sitd starts; sitd and modem remain disabled at boot. | Any change enabling the modem or sitd itself. | Disable only mmd if this step enabled it, then stop mmd if ending the test. | + +SMS/call numbers, contents, operator identities and object dumps remain +private. Record only states, counts, errors and test outcomes in this plan. +The read-only libmm status helper deliberately prints states and counts. + +A session that has never opened either app needs an additional activation +check before claiming always-on incoming notifications. The shell's call +watcher checks whether the agent owns its name and does not itself start +it. For this first test, open an app before arranging incoming traffic. +Keep #361's app-triggered activation policy until cold-session reception +has a separate test and an explicit decision about login activation. + +App mute/speaker controls are also separate: the shared plan records that +the agent uses callaudiod for those, while sitd owns its own voice PCMs. +A successful dial through mmd does not prove those controls affect tegu's +route. MMS and mobile-data control through ModemManager are outside this +SMS/basic-call integration; keep the existing sitd data ownership. + +## Offline evidence from this investigation + +`packages/omamobile-mmd/test/all` passed on this base with private D-Bus +and local simulator sockets. This covers API/bridge/libmm clients, the +real sitd-to-sit-sim call and SMS chain, and staged unit checks. One test +was skipped because ModemManager's reference introspection XML is absent. +The suite verifies that the bridge has no unit dependency that pulls in +the modem and no system-bus activation file. + +`packages/omamobile-apps/test/all` also passed all 12 checks, including +Phone/Messages dependencies and the absence of a common modem dependency. + +This does not run the packaged Rust agent or either GUI, does not test +tegu hardware or the current private carrier configuration, and does not +qualify polkit for the actual graphical session. The earlier full agent +chain result is recorded in the shared plan; it was not rerun here. From f75a6cfd5721611c544ab144e994c5117bc9e57b Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Mon, 2 Nov 2026 18:16:56 -0647 Subject: [PATCH 04/31] tegu: attach Phone and Messages to an attended running sitd Keep sitd's canonical name while moving the modem dependency into device-owned policy drop-ins. Tegu checks an already running modem and CP ONLINE; cheetah and raven retain their existing starter relationship. Require the device policy capability during RIL upgrades. Add an opt-in telephony package with a bridge policy and attended helper. It checks live sitd readiness, refuses legacy unit shadows and competing managers, and starts only mmd and the graphical user's agent. The service recovery check permits live calls and registration loss; no helper enables or recovers the modem. Remove mmd's service-level conflict so a bridge start cannot stop another modem manager. Package exclusion and D-Bus name ownership remain. Retain the previously developed SIM, safe-release and audio changes in this stack. Validate the helper, dependency policies and composed units offline; run all seven affected/dependency package suites and build the new architecture-independent package without installing dependencies. --- device/tegu/TELEPHONY-APPS-PLAN.md | 24 ++ docs/TELEPHONY-APPS-PLAN.md | 3 +- packages/omamobile-device-cheetah/PKGBUILD | 2 +- packages/omamobile-device-cheetah/test/all | 6 + .../10-device-modem.conf | 5 + packages/omamobile-device-raven/PKGBUILD | 2 +- packages/omamobile-device-raven/test/all | 4 + .../10-device-modem.conf | 5 + packages/omamobile-device-raven/version | 2 +- packages/omamobile-device-tegu/PKGBUILD | 3 +- packages/omamobile-device-tegu/README.md | 15 + packages/omamobile-device-tegu/test/all | 4 + .../10-tegu-no-start.conf | 4 + .../10-device-modem.conf | 10 + .../systemd/omamobile-mmd.service | 3 +- packages/omamobile-mmd/test/all | 3 +- packages/omamobile-mmd/version | 2 +- packages/omamobile-modem-sit/PKGBUILD | 2 +- .../systemd/omamobile-sitd.service | 5 +- packages/omamobile-modem-sit/test/all | 3 + packages/omamobile-telephony-tegu/LICENSE | 21 ++ packages/omamobile-telephony-tegu/PKGBUILD | 19 ++ packages/omamobile-telephony-tegu/README.md | 127 ++++++++ .../bin/omamobile-tegu-mmd-attach | 192 ++++++++++++ packages/omamobile-telephony-tegu/install | 12 + .../omamobile-telephony-tegu.install | 11 + .../systemd/10-tegu-attach.conf | 8 + packages/omamobile-telephony-tegu/test/all | 30 ++ .../test/test_attach.py | 292 ++++++++++++++++++ .../test/test_units.py | 51 +++ packages/omamobile-telephony-tegu/version | 1 + 31 files changed, 860 insertions(+), 11 deletions(-) create mode 100644 packages/omamobile-device-cheetah/vendor/systemd/system/omamobile-sitd.service.d/10-device-modem.conf create mode 100644 packages/omamobile-device-raven/vendor/systemd/system/omamobile-sitd.service.d/10-device-modem.conf create mode 100644 packages/omamobile-device-tegu/vendor/systemd/system/omamobile-modem.service.d/10-tegu-no-start.conf create mode 100644 packages/omamobile-device-tegu/vendor/systemd/system/omamobile-sitd.service.d/10-device-modem.conf create mode 100644 packages/omamobile-telephony-tegu/LICENSE create mode 100644 packages/omamobile-telephony-tegu/PKGBUILD create mode 100644 packages/omamobile-telephony-tegu/README.md create mode 100755 packages/omamobile-telephony-tegu/bin/omamobile-tegu-mmd-attach create mode 100755 packages/omamobile-telephony-tegu/install create mode 100644 packages/omamobile-telephony-tegu/omamobile-telephony-tegu.install create mode 100644 packages/omamobile-telephony-tegu/systemd/10-tegu-attach.conf create mode 100755 packages/omamobile-telephony-tegu/test/all create mode 100644 packages/omamobile-telephony-tegu/test/test_attach.py create mode 100644 packages/omamobile-telephony-tegu/test/test_units.py create mode 100644 packages/omamobile-telephony-tegu/version diff --git a/device/tegu/TELEPHONY-APPS-PLAN.md b/device/tegu/TELEPHONY-APPS-PLAN.md index 564bd09e2..864ba80f1 100644 --- a/device/tegu/TELEPHONY-APPS-PLAN.md +++ b/device/tegu/TELEPHONY-APPS-PLAN.md @@ -1,6 +1,30 @@ # Pixel 9a: connect Phone and Messages to sitd +First-step implementation (2026-11-03), offline: branch `tegu-mmd-attach` +builds on this plan and the dependency fix (#363), with the existing SIM, +safe-release and opt-in tegu audio work retained. The optional +`omamobile-telephony-tegu` package installs mmd, the agent, an active-RIL +bridge policy and `omamobile-tegu-mmd-attach --check|--attach`. It enables +nothing. The canonical sitd unit now gets its modem dependency from a +device-owned drop-in: tegu uses Requisite on its already running starter, +while cheetah and raven retain Requires on their modem unit. A new +`omamobile-sitd-policy` dependency ensures these drop-ins accompany a RIL +upgrade. [Package/runbook](../../packages/omamobile-telephony-tegu/README.md). +No phone contact or hardware qualification was performed for this change. +The seven affected/dependency package suites passed; mmd and the attach +package were rerun after final ownership/recovery changes. The attach +package has 21 offline tests, including systemd verification of all three +device policies. One bridge API comparison skips missing reference XML. +The architecture-independent attach package also built offline with +makepkg (dependency installation and signing disabled). No rootfs or ARM +modem package was built by that native package check. + + +The investigation below records the older base and its missing pieces; +the first-step package implements bridge attachment, not modem boot or +cold-login qualification. + Status (2026-11-03): offline investigation on `origin/main` at `31fbcf9`. The owner reports texts both ways and calls through `omamobile-sit` on the palmtop. No phone contact in this investigation. This is an integration diff --git a/docs/TELEPHONY-APPS-PLAN.md b/docs/TELEPHONY-APPS-PLAN.md index 164c0305d..4fed50af9 100644 --- a/docs/TELEPHONY-APPS-PLAN.md +++ b/docs/TELEPHONY-APPS-PLAN.md @@ -134,7 +134,7 @@ shell status / quick settings ──────────────── └─ AoC voice PCMs (EP5/EP4), rmnet0 ``` -- **Why a separate process.** `omamobile-sitd` holds the safety model: the allow-list, the do-not-send list, durable SMS sends that never repeat, and power-off when a hangup isn't confirmed. Keeping D-Bus out of it keeps that code small and keeps its tests (`tools/sit-sim`) as they are. A crash in the bridge can't drop a call, and the bridge can restart freely, which the RIL can't (a second start-up on the same CP isn't supported). +- **Why a separate process.** `omamobile-sitd` holds the safety model: the allow-list, the do-not-send list, durable SMS sends that never repeat, and radio-off recovery for unconfirmed call release. Keeping D-Bus out of it keeps that code small and keeps its tests (`tools/sit-sim`) as they are. A crash in the bridge can't drop a call, and the bridge can restart freely, which the RIL can't (a second start-up on the same CP isn't supported). - **Why Python, with dbus-fast.** This differs from the apps, and it is Q3. The RIL is Python, and ofono2mm shows that Python with dbus-fast carries MM's whole API. The bridge is a translation layer with no performance load, and the same team reads both sides. Read Droidian's BSD-3-Clause original for structure (compatible with our MIT tree), and FuriLabs' GPL-2.0 fork for reference only. Rust with zbus is the alternative if the owner wants one language for everything new. It would add a toolchain to the system side, and the apps wouldn't share code with it anyway, since they use MM's public API. - **Changes to `omamobile-sitd`'s socket API** (T0, offline, against `tools/sit-sim`): - `subscribe`: a long-lived connection that receives one JSON event per change, with call, SMS, registration, signal and SIM events. The bridge then doesn't poll `state.json`. @@ -144,6 +144,7 @@ shell status / quick settings ──────────────── - **Packaging, as built (T1, `packages/omamobile-mmd` 0.1.0; [MODEM-PLAN](../device/cheetah/MODEM-PLAN.md) "T0/T1: the ModemManager bridge"):** - Its own package, `omamobile-mmd`, with `conflicts=(modemmanager)` and **no `provides=`**: nothing in Arch or Arch Linux ARM hard-depends on `modemmanager` (gnome-calls, chatty, networkmanager and geoclue need only libmm-glib; mmsd-tng is AUR-only and also needs only libmm-glib). - It ships `omamobile-mmd.service`, not `ModemManager.service`, with no `dbus-org.freedesktop.ModemManager1.service` alias: `Type=dbus`, `BusName=org.freedesktop.ModemManager1`, `Conflicts=ModemManager.service`, `WantedBy=omamobile-sitd.service`, and not enabled by the package. It also ships the D-Bus bus policy (only root owns the name) and MM's polkit actions. + - Since mmd 0.1.1, the unit has no `Conflicts=ModemManager.service`: starting the bridge must not stop another modem daemon. Package conflicts and exclusive D-Bus name ownership still provide exclusion. The optional tegu integration adds Requisite on an already active sitd, a read-only service check, and an attended attachment helper; it enables neither modem nor RIL. - **No D-Bus activation file**, so no client can start the bridge. Enabled, it starts with `omamobile-sitd`. - No `mmcli` and no CLI of our own. Phone runbooks read the modem through libmm-glib with `test/libmm-status.py`; mmcli runs only in the conformance container (`test/conformance`). - **Packaging, superseded (the design before T1, kept for history; not built):** a package named `omamobile-mm` with `provides=(modemmanager)` and `conflicts=(modemmanager)`, shipping `ModemManager.service` aliased `dbus-org.freedesktop.ModemManager1.service`, the bus policy, a D-Bus activation file, and `mmcli` or a small `omamobile-mm-cli`. T1 dropped `provides=` (no package needs it), the activation file (so no client can start the bridge) and the takeover of ModemManager's unit name. diff --git a/packages/omamobile-device-cheetah/PKGBUILD b/packages/omamobile-device-cheetah/PKGBUILD index 932d52227..1c8f5d065 100644 --- a/packages/omamobile-device-cheetah/PKGBUILD +++ b/packages/omamobile-device-cheetah/PKGBUILD @@ -9,7 +9,7 @@ url="https://github.com/derekross/omarchy-mobile" license=(MIT Apache-2.0) depends=(bash systemd util-linux omamobile-keyring i2c-tools) # Keep CPIF and its link driver behind the modem's guarded startup. -provides=(omamobile-modem-policy) +provides=(omamobile-modem-policy omamobile-sitd-policy) backup=(etc/pacman.d/omamobile-mirrorlist) install=omamobile-device-cheetah.install optdepends=('omamobile-boot-update: writes kernel package updates to slot B from the boot files this package ships') diff --git a/packages/omamobile-device-cheetah/test/all b/packages/omamobile-device-cheetah/test/all index fba7eb760..12cd88a82 100755 --- a/packages/omamobile-device-cheetah/test/all +++ b/packages/omamobile-device-cheetah/test/all @@ -182,3 +182,9 @@ if [[ -f ../omamobile-modem/systemd/omamobile-modem-boot.target ]]; then || fail "the modem unit the link turns on is skipped on a phone that isn't provisioned" fi pass "sitd waits for the CP; the modem stack is on by default through the target's vendor link; sit-data needs the modem's port" + +# The canonical sitd unit gets its modem dependency from this device policy. +[[ -f $tmp/root/usr/lib/systemd/system/omamobile-sitd.service.d/10-device-modem.conf ]] \ + || fail "the device sitd policy is staged" +grep -q 'omamobile-sitd-policy' PKGBUILD || fail "the package provides its sitd policy capability" +pass "the device sitd policy is staged and provided" diff --git a/packages/omamobile-device-cheetah/vendor/systemd/system/omamobile-sitd.service.d/10-device-modem.conf b/packages/omamobile-device-cheetah/vendor/systemd/system/omamobile-sitd.service.d/10-device-modem.conf new file mode 100644 index 000000000..bfa4628f3 --- /dev/null +++ b/packages/omamobile-device-cheetah/vendor/systemd/system/omamobile-sitd.service.d/10-device-modem.conf @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: MIT +# Preserve this device's modem-start dependency for the canonical sitd unit. +[Unit] +Requires=omamobile-modem.service +After=omamobile-modem.service diff --git a/packages/omamobile-device-raven/PKGBUILD b/packages/omamobile-device-raven/PKGBUILD index 3ab38fb4d..5ed38b3cf 100644 --- a/packages/omamobile-device-raven/PKGBUILD +++ b/packages/omamobile-device-raven/PKGBUILD @@ -8,7 +8,7 @@ url="https://github.com/derekross/omarchy-mobile" license=(MIT Apache-2.0) depends=(bash iproute2 jq systemd util-linux i2c-tools) # The modem's drivers stay blacklisted until its runtime loads them -provides=(omamobile-modem-policy) +provides=(omamobile-modem-policy omamobile-sitd-policy) # The [omamobile] entry in pacman.conf and its mirror list, as cheetah's # package does (rootfs/pacman.conf includes the mirror list). backup=(etc/pacman.d/omamobile-mirrorlist) diff --git a/packages/omamobile-device-raven/test/all b/packages/omamobile-device-raven/test/all index 0203a74ee..aa5ccf414 100755 --- a/packages/omamobile-device-raven/test/all +++ b/packages/omamobile-device-raven/test/all @@ -69,6 +69,10 @@ done [[ $(readlink "$tmp/root/usr/lib/systemd/system-sleep/omamobile") == /usr/bin/omamobile-sleep ]] \ || fail "the sleep hook is linked into system-sleep" [ ! -e "$tmp/root/usr/bin/omamobile-sleepd" ] || fail "the sleep watcher is omamobile-shell's, not this package's" +# The canonical sitd unit gets its modem dependency from this device policy. +[[ -f $tmp/root/usr/lib/systemd/system/omamobile-sitd.service.d/10-device-modem.conf ]] \ + || fail "the device sitd policy is staged" +grep -q 'omamobile-sitd-policy' PKGBUILD || fail "the package provides its sitd policy capability" pass "install stages the package" # omamobile-wlan-mac only ever sets a unicast, globally administered address diff --git a/packages/omamobile-device-raven/vendor/systemd/system/omamobile-sitd.service.d/10-device-modem.conf b/packages/omamobile-device-raven/vendor/systemd/system/omamobile-sitd.service.d/10-device-modem.conf new file mode 100644 index 000000000..bfa4628f3 --- /dev/null +++ b/packages/omamobile-device-raven/vendor/systemd/system/omamobile-sitd.service.d/10-device-modem.conf @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: MIT +# Preserve this device's modem-start dependency for the canonical sitd unit. +[Unit] +Requires=omamobile-modem.service +After=omamobile-modem.service diff --git a/packages/omamobile-device-raven/version b/packages/omamobile-device-raven/version index 013adb716..db7a48047 100644 --- a/packages/omamobile-device-raven/version +++ b/packages/omamobile-device-raven/version @@ -1 +1 @@ -0.1.30 +0.1.31 diff --git a/packages/omamobile-device-tegu/PKGBUILD b/packages/omamobile-device-tegu/PKGBUILD index da1e2b777..2732b538d 100644 --- a/packages/omamobile-device-tegu/PKGBUILD +++ b/packages/omamobile-device-tegu/PKGBUILD @@ -8,7 +8,8 @@ arch=(aarch64) url="https://github.com/derekross/omarchy-mobile" license=(MIT) depends=(bash systemd kmod bluez-utils omamobile-keyring) -provides=(omamobile-device omamobile-modem-policy) +optdepends=('omamobile-telephony-tegu: attach Phone and Messages to an attended running sitd') +provides=(omamobile-device omamobile-modem-policy omamobile-sitd-policy) conflicts=(omamobile-device) backup=(etc/pacman.d/omamobile-mirrorlist) install=omamobile-device-tegu.install diff --git a/packages/omamobile-device-tegu/README.md b/packages/omamobile-device-tegu/README.md index 5d9dafe74..604697628 100644 --- a/packages/omamobile-device-tegu/README.md +++ b/packages/omamobile-device-tegu/README.md @@ -149,3 +149,18 @@ that loaded them, from its own staged copies, not the package: the package blacklists both and starts neither. Licence: MIT. + +## Optional Phone and Messages attachment + +`omamobile-telephony-tegu` is an opt-in companion package; it installs the +ModemManager-compatible bridge and session agent without enabling or +starting the radio. Its attended helper attaches only to a running tegu +modem and sitd. See its [runbook](../omamobile-telephony-tegu/README.md). + +This device package supplies sitd's modem-unit policy under +`omamobile-sitd.service.d/10-device-modem.conf`: Requisite and ordering on +`omamobile-tegu-modem.service`, with a CP ONLINE check before any future +sitd start. It supplies no CP starter and enables neither service. It +also prevents the generic modem runtime unit from starting on tegu. +Remove any old full sitd unit copy in `/etc` using the runbook's attended +migration; the package does not delete human overrides. diff --git a/packages/omamobile-device-tegu/test/all b/packages/omamobile-device-tegu/test/all index 3a55ebd03..121d36bc5 100755 --- a/packages/omamobile-device-tegu/test/all +++ b/packages/omamobile-device-tegu/test/all @@ -147,6 +147,10 @@ for absent in usr/bin/omamobile-boot-success usr/bin/omamobile-bootctl \ usr/lib/udev/rules.d/20-omamobile-gpu-always-on.rules; do [[ ! -e $tmp/root/$absent ]] || fail "install includes $absent" done +# The canonical sitd unit gets its modem dependency from this device policy. +[[ -f $tmp/root/usr/lib/systemd/system/omamobile-sitd.service.d/10-device-modem.conf ]] \ + || fail "the device sitd policy is staged" +grep -q 'omamobile-sitd-policy' PKGBUILD || fail "the package provides its sitd policy capability" pass "install stages the package, enables only the guards, and nothing that marks a slot" for m in cpif shm_ipc pcie_gs201_cp; do diff --git a/packages/omamobile-device-tegu/vendor/systemd/system/omamobile-modem.service.d/10-tegu-no-start.conf b/packages/omamobile-device-tegu/vendor/systemd/system/omamobile-modem.service.d/10-tegu-no-start.conf new file mode 100644 index 000000000..67efa018a --- /dev/null +++ b/packages/omamobile-device-tegu/vendor/systemd/system/omamobile-modem.service.d/10-tegu-no-start.conf @@ -0,0 +1,4 @@ +# SPDX-License-Identifier: MIT +# The tegu starter is attended and separate. Never run the generic profile. +[Unit] +ConditionPathExists=!/usr/share/omamobile/device-tegu/version diff --git a/packages/omamobile-device-tegu/vendor/systemd/system/omamobile-sitd.service.d/10-device-modem.conf b/packages/omamobile-device-tegu/vendor/systemd/system/omamobile-sitd.service.d/10-device-modem.conf new file mode 100644 index 000000000..719317df9 --- /dev/null +++ b/packages/omamobile-device-tegu/vendor/systemd/system/omamobile-sitd.service.d/10-device-modem.conf @@ -0,0 +1,10 @@ +# SPDX-License-Identifier: MIT +# Requisite checks the attended starter without pulling it into a start job. +# A missing/inactive tegu modem must fail, never start cheetah's modem unit. +[Unit] +Requisite=omamobile-tegu-modem.service +After=omamobile-tegu-modem.service omamobile-tegu-aoc.service + +[Service] +# Active alone is insufficient: the CP must already report ONLINE. +ExecStartPre=/usr/lib/omamobile-vendor/omamobile-modem-cp state diff --git a/packages/omamobile-mmd/systemd/omamobile-mmd.service b/packages/omamobile-mmd/systemd/omamobile-mmd.service index 6b41f159a..81fccf220 100644 --- a/packages/omamobile-mmd/systemd/omamobile-mmd.service +++ b/packages/omamobile-mmd/systemd/omamobile-mmd.service @@ -7,7 +7,8 @@ [Unit] Description=Omarchy Mobile ModemManager-compatible bridge (omamobile-sitd on D-Bus) After=dbus.service omamobile-sitd.service -Conflicts=ModemManager.service +# Bus-name ownership and package conflicts provide exclusion. Do not stop +# another modem daemon as a side effect of starting this bridge. [Service] Type=dbus diff --git a/packages/omamobile-mmd/test/all b/packages/omamobile-mmd/test/all index 3b555a4bb..f53ffa2c2 100755 --- a/packages/omamobile-mmd/test/all +++ b/packages/omamobile-mmd/test/all @@ -38,7 +38,8 @@ python3 "$stage/usr/bin/omamobile-mmd" --help >/dev/null || fail "the staged dae # the modem side, no D-Bus activation file. grep -E '^(Requires|Wants|BindsTo|Requisite)=' systemd/omamobile-mmd.service && fail "the unit pulls something in" [[ -z $(find "$stage" -path '*dbus-1/system-services*' -print -quit) ]] || fail "no D-Bus activation file" -grep -qx 'Conflicts=ModemManager.service' systemd/omamobile-mmd.service || fail "the unit conflicts with ModemManager" +! grep -qx 'Conflicts=ModemManager.service' systemd/omamobile-mmd.service \ + || fail "starting the bridge must not stop another modem daemon" if command -v systemd-analyze >/dev/null; then systemd-analyze verify --man=no "$stage/usr/lib/systemd/system/omamobile-mmd.service" 2>&1 | grep -v -e 'not executable' -e 'No such file' -e 'omamobile-sitd.service' -e '^$' && fail "unit verify" || true diff --git a/packages/omamobile-mmd/version b/packages/omamobile-mmd/version index d917d3e26..b1e80bb24 100644 --- a/packages/omamobile-mmd/version +++ b/packages/omamobile-mmd/version @@ -1 +1 @@ -0.1.2 +0.1.3 diff --git a/packages/omamobile-modem-sit/PKGBUILD b/packages/omamobile-modem-sit/PKGBUILD index c73e40211..dbf3a6726 100644 --- a/packages/omamobile-modem-sit/PKGBUILD +++ b/packages/omamobile-modem-sit/PKGBUILD @@ -10,7 +10,7 @@ license=(MIT) # mobile-broadband-provider-info: the carrier database the automatic APN # reads (GNOME, CC-PDDC; arch "any", NetworkManager already pulls it in). # polkit: the Mobile network page's helper runs through pkexec. -depends=(python iproute2 iputils systemd alsa-lib alsa-utils omamobile-modem +depends=(python iproute2 iputils systemd alsa-lib alsa-utils 'omamobile-modem>=0.1.11' omamobile-sitd-policy mobile-broadband-provider-info polkit) backup=(etc/omamobile/modem-sit.conf) install=omamobile-modem-sit.install diff --git a/packages/omamobile-modem-sit/systemd/omamobile-sitd.service b/packages/omamobile-modem-sit/systemd/omamobile-sitd.service index 83879c44e..f235d22a7 100644 --- a/packages/omamobile-modem-sit/systemd/omamobile-sitd.service +++ b/packages/omamobile-modem-sit/systemd/omamobile-sitd.service @@ -6,8 +6,9 @@ # own: a second start-up on the same CP is not supported (reboot instead). [Unit] Description=Omarchy Mobile SIT RIL (S5300 calls, SMS, registration) -Requires=omamobile-modem.service -After=omamobile-modem.service omamobile-audio.service +# The device modem-policy package supplies its modem dependency as a drop-in. +# Tegu checks an already running modem; cheetah/raven retain their starter. +After=omamobile-audio.service ConditionPathExists=/dev/umts_ipc0 [Service] diff --git a/packages/omamobile-modem-sit/test/all b/packages/omamobile-modem-sit/test/all index bba38d704..231ef6a10 100755 --- a/packages/omamobile-modem-sit/test/all +++ b/packages/omamobile-modem-sit/test/all @@ -48,4 +48,7 @@ if command -v systemd-analyze >/dev/null; then -e 'omamobile-sitd.service' -e '^$' && fail "$u verify" || true done fi +! grep -qx 'Requires=omamobile-modem.service' systemd/omamobile-sitd.service \ + || fail "the base unit must use the device's sitd policy" +grep -q 'omamobile-sitd-policy' PKGBUILD || fail "the RIL needs an installed device sitd policy" pass "staged layout, config and units" diff --git a/packages/omamobile-telephony-tegu/LICENSE b/packages/omamobile-telephony-tegu/LICENSE new file mode 100644 index 000000000..aecd59624 --- /dev/null +++ b/packages/omamobile-telephony-tegu/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Derek Ross + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/omamobile-telephony-tegu/PKGBUILD b/packages/omamobile-telephony-tegu/PKGBUILD new file mode 100644 index 000000000..38d41f353 --- /dev/null +++ b/packages/omamobile-telephony-tegu/PKGBUILD @@ -0,0 +1,19 @@ +# SPDX-License-Identifier: MIT +pkgname=omamobile-telephony-tegu +pkgver=$(cat "${startdir:-.}/version") +pkgrel=1 +pkgdesc="Opt-in Pixel 9a Phone/Messages bridge attachment to an already running sitd" +arch=(any) +url="https://github.com/derekross/omarchy-mobile" +license=(MIT) +depends=(python systemd sudo 'omamobile-device-tegu>=0.2.9' + 'omamobile-modem-sit>=0.3.12' 'omamobile-mmd>=0.1.1' 'omatel-agent>=0.2.4') +install=omamobile-telephony-tegu.install + +check() { + "$startdir/test/all" +} + +package() { + "$startdir/install" "$pkgdir" +} diff --git a/packages/omamobile-telephony-tegu/README.md b/packages/omamobile-telephony-tegu/README.md new file mode 100644 index 000000000..20ed62607 --- /dev/null +++ b/packages/omamobile-telephony-tegu/README.md @@ -0,0 +1,127 @@ + +# Pixel 9a: attach Phone and Messages to a running sitd + +This opt-in package installs `omamobile-mmd`, `omatel-agent`, and the tegu +bridge policy. It enables and starts no services. It does not package a +modem starter: the attended tegu modem and RIL must already be running. +Apps speak to the session agent, the agent speaks ModemManager's system +D-Bus API, and mmd forwards requests to sitd's private socket. + +Install the built `omamobile-telephony-tegu` package with ordinary pacman +dependency checking. Inspect the transaction first. Its device/RIL minima +carry the packaged unit policies, the dependency fix, the tegu SIM fixes, +safe unconfirmed-release handling and the opt-in tegu audio route. Prepare +those upgrades before a modem session; never replace a running test RIL +with older code. No firmware or private provisioning comes in this package. + +The common `omamobile-sitd.service` name is preserved for the CLI, bridge +and data helper. Its modem dependency now comes from the device package: + +- Cheetah and raven retain `Requires=omamobile-modem.service` and its order. +- Tegu uses `Requisite=omamobile-tegu-modem.service` plus ordering, and + checks CP ONLINE with the existing state helper before starting sitd. + Requisite fails if that starter is inactive; it never starts it. +- The device packages provide `omamobile-sitd-policy`, which the RIL now + requires, so an upgrade cannot silently omit its device unit dependency. +- The opt-in bridge uses `Requisite=omamobile-sitd.service` and a read-only + service preflight. Starting the bridge cannot pull in sitd or either modem unit. + +## Migrate the old sitd unit (attended preparation) + +The old `/etc/systemd/system/omamobile-sitd.service` copy overrides the +packaged base unit. The attach script refuses it. The package never deletes +or rewrites a human's unit. Prefer migration with the modem off, before +starting the next approved session. For an already running session, only +continue after checking the versions, active tegu starter and unchanged +process IDs; `daemon-reload` changes definitions without restarting them. + +1. Read-only: `systemctl cat omamobile-sitd.service` and + `systemctl show omamobile-sitd.service omamobile-tegu-modem.service -p ActiveState -p MainPID`. + Save those PIDs privately. Stop if the service/starter differs from the + approved tegu setup, or if a call is in progress. Risk: none; rollback: + none. +2. After the new packages are installed, inspect + `/usr/lib/systemd/system/omamobile-sitd.service` and its + `omamobile-sitd.service.d/10-device-modem.conf`. Expect tegu Requisite, + no cheetah Requires, CP ONLINE precheck, and `Restart=no`. Stop on a + mismatch. Risk: none; rollback: none. +3. Only for the legacy full copy, root: + `install -d -m700 /var/lib/omamobile-telephony-tegu`, then + `mv -n /etc/systemd/system/omamobile-sitd.service /var/lib/omamobile-telephony-tegu/omamobile-sitd.service.before-attach`. + Verify the source is gone (an existing backup makes `mv -n` skip; do + not overwrite it), then `systemctl daemon-reload`. Do not use restart, + enable or `--now`. Risk: low (unit definitions). Expect the same PIDs + and `FragmentPath=/usr/lib/systemd/system/omamobile-sitd.service`. + Stop if a PID changes or a service leaves active. Rollback: restore + the saved file and daemon-reload, without restarting the modem or RIL. + +The attach script also refuses pending daemon-reload, unexpected start +relationships, an inactive tegu starter/RIL, another ModemManager, a +non-ready SIM, an unregistered radio, and a live call. It obtains a live +status RPC; it never trusts the public state.json as proof of readiness. +It reads no modem device and sends no radio-control request. IMS or a +mobile-data bearer is not required just to attach. The unit's separate +`--service-check` permits an existing call or registration loss, so the +bridge can recover without dropping call visibility. The attended initial +attachment keeps the stricter no-live-call and registered-SIM checks. + +Mmd 0.1.1 removes the service-level `Conflicts=ModemManager.service`: a +bridge start must not stop another modem daemon. Package conflicts and +exclusive D-Bus name ownership still prevent two managers from serving the +same API; tegu's preflight refuses another owner before starting mmd. + +## Attach (human in the graphical user's terminal) + +Keep the existing, approved sleep inhibitor for the modem session. This +package does not qualify CP-on suspend or change auto-sleep. Confirm the +NV checks and once-per-boot rule from the modem startup runbook; nothing +here repeats the modem start or accesses NV partitions. + +Read-only preflight: + +```sh +omamobile-tegu-mmd-attach --check +``` + +Expect existing running tegu modem and sitd, a registered SIM and no live +calls. This uses sudo for read-only system checks and the private sitd +socket. Stop on any failure; it never attempts recovery. Risk: low; no +rollback is needed because no service is changed. + +Attach, after announcing that incoming calls and message notifications may +now appear on the screen and sound: + +```sh +omamobile-tegu-mmd-attach --attach +``` + +Run as the existing graphical user, not root, in a terminal. Type `ATTACH` +at its prompt. The complete set of service-start commands is: + +```sh +sudo -- systemctl start omamobile-mmd.service +systemctl --user start omatel-agent.service +``` + +The script rechecks the modem/RIL PIDs immediately before the bridge start, +after it, and after the agent start. Repeating it starts already active +services without restarting them. It never enables services or starts, +restarts or stops the modem/RIL. Risk: low (apps begin importing SMS into +the user's store and observing incoming calls). Expect both services +active and unchanged modem/RIL PIDs. Stop on any failure and inspect; +there is no automatic retry or modem recovery. + +Open Messages, then do one agreed SMS each way. Record only outcomes and +counts; number, text and network identities stay private. Stop on duplicate +or uncertain delivery; do not resend automatically. Calls follow the +separate safe-release/audio qualification. This package does not qualify +speech, mute/speaker controls, MMS, emergency calls or suspend. + +Rollback for services started by this test, once there is no live call: +close the apps, `systemctl --user stop omatel-agent.service`, then +`sudo systemctl stop omamobile-mmd.service`. Leave either service running +if it was already active before the test. A partial failure intentionally +leaves a started bridge in place for inspection. Never stop the modem or +restart sitd to recover an app failure. Any reboot is separately attended +and approved. Removing this package also requires stopping the bridge +first; it removes only the opt-in policy/helper, not private message data. diff --git a/packages/omamobile-telephony-tegu/bin/omamobile-tegu-mmd-attach b/packages/omamobile-telephony-tegu/bin/omamobile-tegu-mmd-attach new file mode 100755 index 000000000..10fb3d8ee --- /dev/null +++ b/packages/omamobile-telephony-tegu/bin/omamobile-tegu-mmd-attach @@ -0,0 +1,192 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: MIT +"""Attended attachment of the bridge and session agent to an existing RIL. + +--check: read-only preflight (sudo is used for the private sitd socket). +--attach: preflight, an explicit terminal confirmation, then start only + omamobile-mmd.service and this user's omatel-agent.service. +--system-check: root preflight for the attended script. +--service-check: root unit preflight; permits an existing call or registration loss. +No modem/RIL start, restart, stop, enable, radio request or device ioctl. +""" +import json +import os +from pathlib import Path +import socket +import subprocess +import sys + +SITD = 'omamobile-sitd.service' +MODEM = 'omamobile-tegu-modem.service' +BRIDGE = 'omamobile-mmd.service' +AGENT = 'omatel-agent.service' +BUS = 'org.freedesktop.ModemManager1' +# Only systemd's basic implicit dependencies may start with the bridge. +BASIC = {'sysinit.target', 'basic.target', 'system.slice', 'dbus.socket', 'dbus.service'} + + +class Refused(RuntimeError): + pass + + +def run(args, *, safe_error=False): + try: + result = subprocess.run(args, check=True, capture_output=True, text=True, timeout=30) + return result.stdout.strip() + except subprocess.CalledProcessError as error: + if safe_error and error.stderr.startswith('Attach refused: '): + raise Refused(error.stderr.removeprefix('Attach refused: ').strip()) from None + raise Refused('a required service/bus check failed; no modem recovery attempted') from None + except (OSError, subprocess.SubprocessError): + raise Refused('a required service/bus check failed; no modem recovery attempted') from None + + +def properties(unit): + result = run(['systemctl', 'show', unit, '--property=ActiveState,MainPID,FragmentPath,Requires,Wants,BindsTo,Requisite,Conflicts,NeedDaemonReload']) + return dict(line.split('=', 1) for line in result.splitlines() if '=' in line) + + +def require_active(unit): + props = properties(unit) + if props.get('ActiveState') != 'active' or not props.get('MainPID', '').isdigit() or int(props['MainPID']) <= 0: + raise Refused(f'{unit} must already be active with a running process; start nothing here') + return props + + +def socket_status(path): + # A live read-only RPC, never the potentially stale public state.json. + try: + with socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) as client: + client.settimeout(5) + client.connect(str(path)) + client.sendall(b'{"action":"status"}\n') + with client.makefile('rb') as stream: + line = stream.readline((1 << 20) + 1) + if len(line) > 1 << 20 or not line.endswith(b'\n'): + raise ValueError + reply = json.loads(line) + if reply.get('ok') is not True: + raise ValueError + return reply['result'] + except (OSError, ValueError, KeyError, TypeError, AttributeError): + raise Refused('cannot read a live sitd status; no modem recovery attempted') from None + + +def system_check(*, require_ready=True): + if os.geteuid() != 0: + raise Refused('--system-check requires root') + root = Path(os.environ.get('OMAMOBILE_TEGU_ROOT', '/')) + if not root.is_absolute() or not root.is_dir(): + raise Refused('invalid preflight root') + descriptor = root / 'usr/share/omamobile/device.conf' + try: + tegu = 'CODENAME=tegu' in descriptor.read_text().splitlines() + installed = (root / 'usr/share/omamobile/device-tegu/version').is_file() + except OSError: + tegu = installed = False + if not tegu or not installed: + raise Refused('requires the tegu device package and descriptor') + ril = require_active(SITD) + modem = require_active(MODEM) + if ril.get('FragmentPath') != '/usr/lib/systemd/system/' + SITD: + raise Refused('migrate the legacy /etc sitd unit to the packaged unit first; see the README') + bridge = properties(BRIDGE) + if any(p.get('NeedDaemonReload') != 'no' for p in (ril, bridge)): + raise Refused('unit files need daemon-reload; inspect them before attaching') + if bridge.get('FragmentPath') != '/usr/lib/systemd/system/' + BRIDGE: + raise Refused('requires the packaged bridge unit') + if MODEM not in ril.get('Requisite', '').split() or SITD not in bridge.get('Requisite', '').split(): + raise Refused('tegu attach policy is not loaded; inspect the packaged drop-ins') + for unit in (ril, bridge): + for key in ('Requires', 'Wants', 'BindsTo'): + if set(unit.get(key, '').split()) - BASIC: + raise Refused('bridge or sitd has an unexpected start dependency; inspect its unit before attaching') + if set(bridge.get('Conflicts', '').split()) - {'shutdown.target'}: + raise Refused('bridge has an unexpected stop dependency; inspect its unit before attaching') + # Neither the script nor a direct unit start may stop a real modem daemon. + owner = run(['busctl', '--system', 'call', 'org.freedesktop.DBus', '/org/freedesktop/DBus', + 'org.freedesktop.DBus', 'NameHasOwner', 's', BUS]) + if owner == 'b true' and bridge.get('ActiveState') != 'active': + raise Refused('ModemManager bus name is already owned by another service') + if owner not in ('b true', 'b false'): + raise Refused('cannot determine the ModemManager bus owner') + competing = properties('ModemManager.service') + if competing.get('ActiveState') in ('active', 'activating', 'reloading'): + raise Refused('another ModemManager service is running; it will not be stopped here') + status = socket_status(root / 'run/omamobile-sit/socket') + try: + m = status['modem'] + ready = (m.get('present') is True and m.get('sim', {}).get('state') == 'ready' + and m.get('radio') == 'on' and m.get('registration') in ('home', 'roaming')) + calls = status['calls'] + if not isinstance(calls, list): + raise TypeError + live = any(c.get('state') != 'terminated' for c in calls) + except (AttributeError, KeyError, TypeError): + raise Refused('invalid live sitd status') from None + if require_ready and (not ready or live): + raise Refused('sitd must have a ready SIM, registered radio and no live calls') + # PIDs are used only to detect an unexpected RIL/CP service replacement. + # Never return the private RPC's numbers, network identities or messages. + return {'sitd_pid': ril['MainPID'], 'modem_pid': modem['MainPID']} + + +def user_check(): + if os.geteuid() == 0: + raise Refused('run --check/--attach as the graphical user, not root') + state = run(['systemctl', '--user', 'show', AGENT, '--property=LoadState', '--value']) + if state != 'loaded': + raise Refused('omatel-agent user unit is not installed') + + +def root_check(): + reply = run(['sudo', '--', str(Path(__file__).resolve()), '--system-check'], safe_error=True) + try: + result = json.loads(reply) + if set(result) != {'sitd_pid', 'modem_pid'}: + raise ValueError + return result + except (TypeError, ValueError): + raise Refused('root preflight returned an invalid result') from None + + +def main(argv=None): + argv = sys.argv[1:] if argv is None else argv + if argv in ([], ['--help'], ['-h']): + print(__doc__) + return 0 + try: + if argv in (['--system-check'], ['--service-check']): + print(json.dumps(system_check(require_ready=argv == ['--system-check']))) + return 0 + if argv not in (['--check'], ['--attach']): + raise Refused('use --check or --attach') + if argv == ['--attach'] and not (sys.stdin.isatty() and sys.stdout.isatty()): + raise Refused('--attach needs an attended terminal') + user_check() + before = root_check() + print('Preflight passed: existing tegu modem and sitd, registered SIM, no live calls.') + if argv == ['--check']: + return 0 + print('This starts only the ModemManager bridge and your Phone/Messages agent.') + if input('Type ATTACH to continue: ') != 'ATTACH': + raise Refused('attachment cancelled') + if root_check() != before: + raise Refused('modem or sitd changed during confirmation; no services started') + run(['sudo', '--', 'systemctl', 'start', BRIDGE]) + if root_check() != before: + raise Refused('modem or sitd changed while attaching; stop testing and inspect') + run(['systemctl', '--user', 'start', AGENT]) + run(['systemctl', '--user', 'is-active', '--quiet', AGENT]) + run(['systemctl', 'is-active', '--quiet', BRIDGE]) + if root_check() != before: + raise Refused('modem or sitd changed while attaching; stop testing and inspect') + print('Bridge and session agent active. Open Phone or Messages for the attended test.') + return 0 + except (Refused, EOFError, KeyboardInterrupt) as error: + print(f'Attach refused: {error}', file=sys.stderr) + return 1 + + +if __name__ == '__main__': + sys.exit(main()) diff --git a/packages/omamobile-telephony-tegu/install b/packages/omamobile-telephony-tegu/install new file mode 100755 index 000000000..df5c69d86 --- /dev/null +++ b/packages/omamobile-telephony-tegu/install @@ -0,0 +1,12 @@ +#!/bin/bash +# SPDX-License-Identifier: MIT +# Stage the opt-in bridge integration. No service activation or wants links. +set -euo pipefail +cd -- "$(dirname -- "${BASH_SOURCE[0]}")" +d=${1:?Usage: ./install DESTDIR} +[[ $d == /* && $d != / ]] || { echo "Use an absolute staging directory" >&2; exit 1; } +install -Dm755 bin/omamobile-tegu-mmd-attach "$d/usr/bin/omamobile-tegu-mmd-attach" +install -Dm644 systemd/10-tegu-attach.conf "$d/usr/lib/systemd/system/omamobile-mmd.service.d/10-tegu-attach.conf" +install -Dm644 README.md "$d/usr/share/doc/omamobile-telephony-tegu/README.md" +install -Dm644 LICENSE "$d/usr/share/licenses/omamobile-telephony-tegu/LICENSE" +install -Dm644 version "$d/usr/share/omamobile/telephony-tegu/version" diff --git a/packages/omamobile-telephony-tegu/omamobile-telephony-tegu.install b/packages/omamobile-telephony-tegu/omamobile-telephony-tegu.install new file mode 100644 index 000000000..095527446 --- /dev/null +++ b/packages/omamobile-telephony-tegu/omamobile-telephony-tegu.install @@ -0,0 +1,11 @@ +# SPDX-License-Identifier: MIT +post_install() { + systemctl daemon-reload 2>/dev/null || true + echo "omamobile-telephony-tegu: installed; no services enabled or started." + echo " From the graphical user's terminal, with sitd already running:" + echo " omamobile-tegu-mmd-attach --check, then --attach (attended)." + echo " Migrate any /etc copy of omamobile-sitd.service first; see the README." +} +post_upgrade() { + post_install +} diff --git a/packages/omamobile-telephony-tegu/systemd/10-tegu-attach.conf b/packages/omamobile-telephony-tegu/systemd/10-tegu-attach.conf new file mode 100644 index 000000000..d2e0ad6e3 --- /dev/null +++ b/packages/omamobile-telephony-tegu/systemd/10-tegu-attach.conf @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: MIT +# Check the existing RIL, never pull it or the CP into a start transaction. +[Unit] +Requisite=omamobile-sitd.service +After=omamobile-sitd.service + +[Service] +ExecStartPre=/usr/bin/omamobile-tegu-mmd-attach --service-check diff --git a/packages/omamobile-telephony-tegu/test/all b/packages/omamobile-telephony-tegu/test/all new file mode 100755 index 000000000..9f3a4f1cc --- /dev/null +++ b/packages/omamobile-telephony-tegu/test/all @@ -0,0 +1,30 @@ +#!/bin/bash +# SPDX-License-Identifier: MIT +# Package and attended attachment tests: fixtures only, no phone or system bus. +set -euo pipefail +cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." +for f in PKGBUILD install omamobile-telephony-tegu.install test/all; do bash -n "$f"; done +python3 -B -m unittest discover -s test -p 'test_*.py' +t=$(mktemp -d); trap 'rm -rf "$t"' EXIT +./install "$t/root" +for f in usr/bin/omamobile-tegu-mmd-attach usr/lib/systemd/system/omamobile-mmd.service.d/10-tegu-attach.conf \ + usr/share/doc/omamobile-telephony-tegu/README.md usr/share/omamobile/telephony-tegu/version; do + [[ -f $t/root/$f ]] || { echo "not ok - missing $f"; exit 1; } +done +[[ -z $(find "$t/root" -type l -print) ]] || { echo 'not ok - package enables a unit'; exit 1; } +[[ ! -d $t/root/etc ]] || { echo 'not ok - package copies or overrides /etc'; exit 1; } +[[ -x $t/root/usr/bin/omamobile-tegu-mmd-attach ]] +"$t/root/usr/bin/omamobile-tegu-mmd-attach" --help >/dev/null +python3 -I -c 'import sys; compile(open(sys.argv[1]).read(), sys.argv[1], "exec")' bin/omamobile-tegu-mmd-attach +# Read the dependency declarations, not a grep that can match an optdepend. +deps=$(startdir=$PWD bash -c 'source PKGBUILD; printf "%s\n" "${depends[@]}"') +for dep in 'omamobile-device-tegu>=0.2.9' 'omamobile-modem-sit>=0.3.12' 'omamobile-mmd>=0.1.1' 'omatel-agent>=0.2.4'; do + grep -qxF "$dep" <<<"$deps" +done +! grep -qx omamobile-device-cheetah <<<"$deps" +# Requisite is an active-state check, not a start request. No Wants/Requires +# or multi-user target links may be added by this package. +grep -qx 'Requisite=omamobile-sitd.service' systemd/10-tegu-attach.conf +! grep -E '^(Requires|Wants|BindsTo)=' systemd/10-tegu-attach.conf +! grep -E 'systemctl .*\b(start|restart|enable)\b' omamobile-telephony-tegu.install +echo 'ok - opt-in package stages the attended helper and non-pulling bridge policy' diff --git a/packages/omamobile-telephony-tegu/test/test_attach.py b/packages/omamobile-telephony-tegu/test/test_attach.py new file mode 100644 index 000000000..665abb13c --- /dev/null +++ b/packages/omamobile-telephony-tegu/test/test_attach.py @@ -0,0 +1,292 @@ +# SPDX-License-Identifier: MIT +"""The attended script with fake service/bus calls and private socket data.""" +import contextlib +import copy +import importlib.machinery +import importlib.util +import io +import json +from pathlib import Path +import subprocess +import tempfile +import unittest +from unittest.mock import Mock, patch + +SCRIPT = Path(__file__).resolve().parents[1] / 'bin/omamobile-tegu-mmd-attach' +loader = importlib.machinery.SourceFileLoader('attach', str(SCRIPT)) +spec = importlib.util.spec_from_loader(loader.name, loader) +a = importlib.util.module_from_spec(spec) +loader.exec_module(a) + + +class SystemCheck(unittest.TestCase): + def setUp(self): + self.scratch = tempfile.TemporaryDirectory() + self.addCleanup(self.scratch.cleanup) + self.root = Path(self.scratch.name) + desc = self.root / 'usr/share/omamobile/device.conf' + desc.parent.mkdir(parents=True) + desc.write_text('CODENAME=tegu\n') + ver = self.root / 'usr/share/omamobile/device-tegu/version' + ver.parent.mkdir() + ver.write_text('0.2.9\n') + self.status = dict(modem=dict(present=True, sim=dict(state='ready'), radio='on', + registration='home', ims='unregistered', data=False, + operator='PRIVATE NETWORK'), calls=[], sms={'received': []}) + self.units = { + a.SITD: dict(ActiveState='active', MainPID='123', FragmentPath='/usr/lib/systemd/system/' + a.SITD, + Requisite=a.MODEM, Requires='sysinit.target', Wants='', BindsTo='', NeedDaemonReload='no'), + a.MODEM: dict(ActiveState='active', MainPID='122'), + a.BRIDGE: dict(ActiveState='inactive', MainPID='0', FragmentPath='/usr/lib/systemd/system/' + a.BRIDGE, + Requisite=a.SITD, Requires='dbus.socket sysinit.target', Wants='', BindsTo='', NeedDaemonReload='no'), + 'ModemManager.service': dict(ActiveState='inactive', MainPID='0'), + } + self.owner = 'b false' + self.commands = [] + for target, value in [('os.geteuid', lambda: 0), ('properties', lambda name: self.units[name]), + ('run', self.command), ('socket_status', lambda path: self.status)]: + helper = patch.object(a.os, 'geteuid', value) if target == 'os.geteuid' else patch.object(a, target, value) + helper.start() + self.addCleanup(helper.stop) + helper = patch.dict(a.os.environ, OMAMOBILE_TEGU_ROOT=str(self.root)) + helper.start() + self.addCleanup(helper.stop) + + def command(self, args): + self.commands.append(args) + self.assertEqual(args[:3], ['busctl', '--system', 'call']) + self.assertIn('NameHasOwner', args) + return self.owner + + def refused(self): + with self.assertRaises(a.Refused): + a.system_check() + + def test_live_no_ims_no_bearer_passes_without_radio_actions(self): + self.assertEqual(a.system_check(), {'sitd_pid': '123', 'modem_pid': '122'}) + self.assertEqual(len(self.commands), 1) + self.assertNotIn('PRIVATE', json.dumps(a.system_check())) + + def test_wrong_board_and_non_root_refused(self): + with patch.object(a.os, 'geteuid', return_value=1000): + self.refused() + (self.root / 'usr/share/omamobile/device.conf').write_text('CODENAME=cheetah\n') + self.refused() + + def test_missing_or_inactive_ril_or_modem_refused(self): + for unit in (a.SITD, a.MODEM): + for field, value in [('ActiveState', 'inactive'), ('MainPID', '0')]: + with self.subTest(unit=unit, field=field): + old = self.units[unit][field] + self.units[unit][field] = value + self.refused() + self.units[unit][field] = old + + def test_shadow_units_and_reload_pending_refused(self): + for unit in (a.SITD, a.BRIDGE): + for field, value in [('FragmentPath', '/etc/systemd/system/' + unit), ('NeedDaemonReload', 'yes')]: + with self.subTest(unit=unit, field=field): + old = self.units[unit][field] + self.units[unit][field] = value + self.refused() + self.units[unit][field] = old + + def test_missing_policy_or_pulling_dependency_refused(self): + for unit in (a.SITD, a.BRIDGE): + for field, value in [('Requisite', ''), ('Requires', a.MODEM), ('Wants', a.SITD), ('BindsTo', a.MODEM)]: + with self.subTest(unit=unit, field=field): + old = self.units[unit][field] + self.units[unit][field] = value + self.refused() + self.units[unit][field] = old + + def test_competing_bus_owner_or_real_manager_refused(self): + self.owner = 'b true' + self.refused() + self.units[a.BRIDGE]['ActiveState'] = 'active' + self.assertEqual(a.system_check()['sitd_pid'], '123') + self.units['ModemManager.service']['ActiveState'] = 'activating' + self.refused() + + def test_unready_registration_or_live_call_refused(self): + good = copy.deepcopy(self.status) + for key, value in [('sim', {'state': 'absent'}), ('radio', 'off'), ('registration', 'searching')]: + self.status = copy.deepcopy(good) + self.status['modem'][key] = value + self.refused() + self.status = copy.deepcopy(good) + self.status['calls'] = [dict(state='active', number='PRIVATE NUMBER')] + self.refused() + + def test_service_recovery_allows_live_calls_and_registration_loss(self): + self.status['calls'] = [dict(state='active')] + self.status['modem']['radio'] = 'off' + self.status['modem']['registration'] = 'searching' + self.status['modem']['sim'] = dict(state='absent') + self.refused() + self.assertEqual(a.system_check(require_ready=False)['sitd_pid'], '123') + + def test_stop_dependency_is_refused(self): + self.units[a.BRIDGE]['Conflicts'] = 'ModemManager.service shutdown.target' + self.refused() + + def test_malformed_rpc_is_refused_without_private_output(self): + self.status = {'modem': None, 'calls': ['PRIVATE']} + self.refused() + self.status = dict(modem=dict(present=True, sim=None)) + self.refused() + + +class SocketRead(unittest.TestCase): + def test_only_status_sent_and_refused_payload_hidden(self): + fake = Mock() + fake.__enter__ = Mock(return_value=fake) + fake.__exit__ = Mock(return_value=False) + fake.makefile.return_value = io.BytesIO(b'{"ok":true,"result":{"calls":[]}}\n') + with patch.object(a.socket, 'socket', return_value=fake): + self.assertEqual(a.socket_status('/private/socket'), {'calls': []}) + fake.sendall.assert_called_once_with(b'{"action":"status"}\n') + for response in [b'{"ok":false,"error":"PRIVATE NUMBER"}\n', b'bad PRIVATE JSON\n', b'{}']: + fake.makefile.return_value = io.BytesIO(response) + with patch.object(a.socket, 'socket', return_value=fake), self.assertRaises(a.Refused) as error: + a.socket_status('/private/socket') + self.assertNotIn('PRIVATE', str(error.exception)) + + +class Attended(unittest.TestCase): + def setUp(self): + self.commands = [] + self.identity = {'sitd_pid': '123', 'modem_pid': '122'} + self.output = io.StringIO() + self.output.isatty = lambda: True + self.input = Mock() + self.input.isatty.return_value = True + helpers = [patch.object(a.os, 'geteuid', return_value=1000), + patch.object(a, 'root_check', return_value=self.identity), + patch.object(a, 'run', side_effect=self.command), + patch.object(a.sys, 'stdin', self.input), patch.object(a.sys, 'stdout', self.output), + patch.object(a.sys, 'stderr', new=io.StringIO()), patch('builtins.input', return_value='ATTACH')] + for helper in helpers: + helper.start() + self.addCleanup(helper.stop) + + def command(self, args, **kwargs): + self.commands.append(args) + return 'loaded' if '--property=LoadState' in args else '' + + def mutations(self): + return [cmd for cmd in self.commands if 'start' in cmd] + + def test_check_changes_nothing(self): + self.assertEqual(a.main(['--check']), 0) + self.assertFalse(self.mutations()) + + def test_attach_starts_exactly_bridge_and_user_agent(self): + for _ in range(2): + self.assertEqual(a.main(['--attach']), 0) + self.assertEqual(self.mutations(), [ + ['sudo', '--', 'systemctl', 'start', a.BRIDGE], ['systemctl', '--user', 'start', a.AGENT]] * 2) + self.assertNotIn('restart', str(self.commands)) + self.assertNotIn('enable', str(self.commands)) + self.assertNotIn(a.MODEM, str(self.commands)) + self.assertNotIn(a.SITD, str(self.commands)) + + def test_requires_terminal_and_explicit_confirmation(self): + self.input.isatty.return_value = False + self.assertEqual(a.main(['--attach']), 1) + self.assertFalse(self.commands) + self.input.isatty.return_value = True + with patch('builtins.input', return_value='yes'): + self.assertEqual(a.main(['--attach']), 1) + self.assertFalse(self.mutations()) + + def test_ril_change_or_preflight_failure_never_starts_services(self): + with patch.object(a, 'root_check', side_effect=[self.identity, {'sitd_pid': '124', 'modem_pid': '122'}]): + self.assertEqual(a.main(['--attach']), 1) + self.assertFalse(self.mutations()) + with patch.object(a, 'root_check', side_effect=a.Refused('inactive')): + self.assertEqual(a.main(['--attach']), 1) + self.assertFalse(self.mutations()) + + def test_agent_failure_never_recovers_modem_or_ril(self): + def command(args, **kwargs): + value = self.command(args, **kwargs) + if args == ['systemctl', '--user', 'start', a.AGENT]: + raise a.Refused('agent failed') + return value + with patch.object(a, 'run', side_effect=command): + self.assertEqual(a.main(['--attach']), 1) + self.assertEqual(self.mutations(), [['sudo', '--', 'systemctl', 'start', a.BRIDGE], + ['systemctl', '--user', 'start', a.AGENT]]) + + def test_refuses_root_and_missing_user_unit(self): + with patch.object(a.os, 'geteuid', return_value=0): + self.assertEqual(a.main(['--check']), 1) + with patch.object(a, 'run', return_value='not-found'): + self.assertEqual(a.main(['--check']), 1) + self.assertFalse(self.mutations()) + + +class UnitPolicy(unittest.TestCase): + repo = Path(__file__).resolve().parents[3] + + def unit(self, path): + fields = {} + for line in path.read_text().splitlines(): + if '=' in line and not line.startswith('#'): + key, value = line.split('=', 1) + fields.setdefault(key, []).extend(value.split()) + return fields + + def test_effective_device_dependencies_and_readiness(self): + base_path = self.repo / 'packages/omamobile-modem-sit/systemd/omamobile-sitd.service' + if not base_path.exists(): + self.skipTest('device unit integration needs the repository') + base = self.unit(base_path) + self.assertNotIn('Requires', base) + self.assertIn('omamobile-audio.service', base['After']) + for dev in ('tegu', 'cheetah', 'raven'): + policy = self.unit(self.repo / f'packages/omamobile-device-{dev}/vendor/systemd/system/omamobile-sitd.service.d/10-device-modem.conf') + if dev == 'tegu': + self.assertEqual(policy['Requisite'], [a.MODEM]) + for field in ('Requires', 'Wants', 'BindsTo'): + self.assertNotIn(field, policy) + self.assertEqual(policy['ExecStartPre'], ['/usr/lib/omamobile-vendor/omamobile-modem-cp', 'state']) + self.assertIn(a.MODEM, policy['After']) + else: + self.assertEqual(policy['Requires'], ['omamobile-modem.service']) + self.assertEqual(policy['After'], ['omamobile-modem.service']) + + def test_bridge_dependency_cannot_start_ril_or_cp(self): + base_path = self.repo / 'packages/omamobile-mmd/systemd/omamobile-mmd.service' + if not base_path.exists(): + self.skipTest('bridge unit integration needs the repository') + policy = self.unit(Path(__file__).resolve().parents[1] / 'systemd/10-tegu-attach.conf') + base = self.unit(base_path) + for fields in (base, policy): + for key in ('Requires', 'Wants', 'BindsTo'): + self.assertNotIn(key, fields) + self.assertNotIn('Conflicts', base) + self.assertEqual(policy['Requisite'], [a.SITD]) + self.assertEqual(policy['ExecStartPre'], ['/usr/bin/omamobile-tegu-mmd-attach', '--service-check']) + + def test_ril_requires_device_policy_and_dependency_fix(self): + pkg = self.repo / 'packages/omamobile-modem-sit/PKGBUILD' + if not pkg.exists(): + self.skipTest('package closure needs the repository') + def array(path, name): + return subprocess.run(['bash', '-c', + 'startdir=$(dirname "$1"); source "$1"; declare -p "$2"', '_', str(path), name], + check=True, capture_output=True, text=True).stdout + self.assertIn('omamobile-sitd-policy', array(pkg, 'depends')) + modem = self.repo / 'packages/omamobile-modem/PKGBUILD' + self.assertIn('omamobile-modem-policy', array(modem, 'depends')) + self.assertNotIn('omamobile-device-cheetah', array(modem, 'depends')) + for device in ('cheetah', 'raven', 'tegu'): + provides = array(self.repo / f'packages/omamobile-device-{device}/PKGBUILD', 'provides') + self.assertIn('omamobile-sitd-policy', provides) + self.assertIn('omamobile-modem-policy', provides) + + +if __name__ == '__main__': + unittest.main() diff --git a/packages/omamobile-telephony-tegu/test/test_units.py b/packages/omamobile-telephony-tegu/test/test_units.py new file mode 100644 index 000000000..74d4e8640 --- /dev/null +++ b/packages/omamobile-telephony-tegu/test/test_units.py @@ -0,0 +1,51 @@ +# SPDX-License-Identifier: MIT +"""Have systemd itself validate the three composed unit policies offline.""" +from pathlib import Path +import shutil +import subprocess +import tempfile +import unittest + + +@unittest.skipUnless(shutil.which('systemd-analyze'), 'systemd-analyze not installed') +class Units(unittest.TestCase): + def test_composed_units_verify_for_each_device(self): + repo = Path(__file__).resolve().parents[3] + packages = repo / 'packages' + if not (packages / 'omamobile-mmd').exists(): + self.skipTest('composed unit test needs the repository') + with tempfile.TemporaryDirectory() as directory: + root = Path(directory) + units = root / 'usr/lib/systemd/system' + units.mkdir(parents=True) + for pkg, name in [('omamobile-modem-sit', 'omamobile-sitd'), ('omamobile-mmd', 'omamobile-mmd')]: + shutil.copy2(packages / pkg / f'systemd/{name}.service', units / f'{name}.service') + # Stubs satisfy references only; verify never starts them. + for name in ['basic', 'sysinit', 'shutdown', 'sockets', 'multi-user', 'slices']: + (units / f'{name}.target').write_text('[Unit]\nDescription=Fixture\n') + (units / 'system.slice').write_text('[Unit]\nDescription=Fixture slice\n') + for name in ['omamobile-modem', 'omamobile-tegu-modem', 'omamobile-audio', + 'omamobile-aoc', 'omamobile-tegu-aoc', 'dbus']: + (units / f'{name}.service').write_text('[Service]\nExecStart=/bin/true\n') + (units / 'dbus.socket').write_text('[Socket]\nListenStream=/run/fixture-bus\n') + for name in ['bin/true', 'usr/bin/omamobile-sitd', 'usr/bin/omamobile-mmd', + 'usr/bin/omamobile-tegu-mmd-attach', 'usr/lib/omamobile-vendor/omamobile-modem-cp']: + path = root / name + path.parent.mkdir(parents=True, exist_ok=True) + path.write_text('fixture') + path.chmod(0o755) + drop = units / 'omamobile-sitd.service.d' + drop.mkdir() + bridge = units / 'omamobile-mmd.service.d' + bridge.mkdir() + for device in ['cheetah', 'raven', 'tegu']: + shutil.copy2(packages / f'omamobile-device-{device}/vendor/systemd/system/omamobile-sitd.service.d/10-device-modem.conf', + drop / '10-device-modem.conf') + if device == 'tegu': + shutil.copy2(packages / 'omamobile-telephony-tegu/systemd/10-tegu-attach.conf', bridge / '10-tegu-attach.conf') + result = subprocess.run(['systemd-analyze', '--root', directory, '--man=no', 'verify', + 'omamobile-sitd.service', 'omamobile-mmd.service'], + capture_output=True, text=True) + if result.returncode and 'Operation not permitted' in result.stderr: + self.skipTest('local sandbox blocks systemd verification sockets') + self.assertEqual(result.returncode, 0, f'{device}: {result.stdout}{result.stderr}') diff --git a/packages/omamobile-telephony-tegu/version b/packages/omamobile-telephony-tegu/version new file mode 100644 index 000000000..6e8bf73aa --- /dev/null +++ b/packages/omamobile-telephony-tegu/version @@ -0,0 +1 @@ +0.1.0 From e99705aa95a3f3a5324f0b6927e1370ab857e9f0 Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Mon, 2 Nov 2026 23:03:00 -0647 Subject: [PATCH 05/31] device/tegu TELEPHONY-APPS-PLAN: the 2026-11-02 run, the two ways to start the bridge, and a plan that reads as one Record the palmtop run of Phone and Messages (kernel, versions, what passed, and that opening an app didn't start the agent), say which start fits which case, cite #363 instead of a branch, and drop the lines that read like a task report. --- device/tegu/TELEPHONY-APPS-PLAN.md | 92 ++++++++++++++++++------------ 1 file changed, 55 insertions(+), 37 deletions(-) diff --git a/device/tegu/TELEPHONY-APPS-PLAN.md b/device/tegu/TELEPHONY-APPS-PLAN.md index 864ba80f1..074335381 100644 --- a/device/tegu/TELEPHONY-APPS-PLAN.md +++ b/device/tegu/TELEPHONY-APPS-PLAN.md @@ -1,34 +1,32 @@ # Pixel 9a: connect Phone and Messages to sitd -First-step implementation (2026-11-03), offline: branch `tegu-mmd-attach` -builds on this plan and the dependency fix (#363), with the existing SIM, -safe-release and opt-in tegu audio work retained. The optional +Status (2026-11-03): Phone and Messages ran on the palmtop on 2026-11-02 +through this path (results at the end). The optional `omamobile-telephony-tegu` package installs mmd, the agent, an active-RIL -bridge policy and `omamobile-tegu-mmd-attach --check|--attach`. It enables -nothing. The canonical sitd unit now gets its modem dependency from a -device-owned drop-in: tegu uses Requisite on its already running starter, -while cheetah and raven retain Requires on their modem unit. A new -`omamobile-sitd-policy` dependency ensures these drop-ins accompany a RIL -upgrade. [Package/runbook](../../packages/omamobile-telephony-tegu/README.md). -No phone contact or hardware qualification was performed for this change. -The seven affected/dependency package suites passed; mmd and the attach -package were rerun after final ownership/recovery changes. The attach -package has 21 offline tests, including systemd verification of all three -device policies. One bridge API comparison skips missing reference XML. -The architecture-independent attach package also built offline with -makepkg (dependency installation and signing disabled). No rootfs or ARM -modem package was built by that native package check. - - -The investigation below records the older base and its missing pieces; -the first-step package implements bridge attachment, not modem boot or -cold-login qualification. - -Status (2026-11-03): offline investigation on `origin/main` at `31fbcf9`. -The owner reports texts both ways and calls through `omamobile-sit` on the -palmtop. No phone contact in this investigation. This is an integration -plan, not a record of app or call-audio qualification on hardware. +bridge policy and `omamobile-tegu-mmd-attach --check|--attach`, and enables +nothing. sitd's unit gets its modem dependency from a device-owned drop-in: +tegu uses Requisite on its already running starter, while cheetah and raven +keep Requires on their modem unit, and the virtual `omamobile-sitd-policy` +makes the drop-ins come along with a RIL upgrade. It builds on #363 (the +device modem policy). [Package/runbook](../../packages/omamobile-telephony-tegu/README.md). + +Two ways start the bridge, each for its own case: at boot, #372's opt-in +`omamobile-tegu-modem-boot` starts the modem, sitd and mmd once the CP is +ONLINE (daily use); and `omamobile-tegu-mmd-attach --attach` attaches mmd +and the agent to a modem and sitd already started by hand (bring-up and +tests, where nothing should start the modem for you). The helper refuses +when sitd isn't running and never starts the modem itself. + +Offline: the seven affected package suites pass, the attach package has 21 +tests (including systemd verification of all three device policies), and +the architecture-independent package builds with makepkg. One bridge API +comparison skips when ModemManager's reference XML is missing. + +The sections below are the investigation this started from, on `origin/main` +at `31fbcf9`, before #363 and the attach package. The owner then had texts +both ways and calls through `omamobile-sit`; this was the plan for the apps +on top. The app protocol already exists. The immediate missing layer in the recorded tegu setup is `omamobile-mmd`, installed and running. A normal @@ -55,7 +53,7 @@ modem | Layer | What the repository already supplies | | --- | --- | | Apps | `omamobile-apps` depends on `omaphone` and `omamessages`; both pull in `omatel-agent`. Contacts is supplied with Phone and does not need a modem. #361 puts all three packages in the image. | -| Agent | `packages/omatel` packages the agent, its user unit and both session-bus activation files. Opening an app activates it. The disabled user unit is intentional; no root agent and no generic enablement change are needed. | +| Agent | `packages/omatel` packages the agent, its user unit and both session-bus activation files. Its session-bus activation files are meant to start it when an app opens; on the palmtop that didn't happen (results below), and the user unit had to be started and enabled. The disabled user unit is intentional; no root agent and no generic enablement change are needed. | | Bridge | `packages/omamobile-mmd` owns the system-bus name normally used by ModemManager, exports modem/call/SMS objects, and checks polkit for operations. It conflicts with the real `modemmanager`; installing both is not the solution. | | Commands | `Voice.CreateCall` plus `Call.Start` maps to sitd `dial`; `Accept`, `Hangup` and `SendDtmf` map to sitd requests. `Messaging.Create` plus `Sms.Send` maps to `sms-send` with a durable request ID. | | Incoming events | The bridge subscribes to sitd, exports calls, reads `sms-list`, and maps deletion to `sms-delete`. The agent stores SMS before deleting them from the bridge and handles notifications and call history. | @@ -66,8 +64,7 @@ Sources: [app package](../../packages/omamobile-apps/PKGBUILD), [bridge mappings](../../packages/omamobile-mmd/lib/bridge.py), [socket subscription](../../packages/omamobile-mmd/lib/sitd_link.py), and [the shared telephony plan](../../docs/TELEPHONY-APPS-PLAN.md), especially -sections 1.5 and 10.1b. The requested old cheetah plan path has moved to -`docs/TELEPHONY-APPS-PLAN.md`. +sections 1.5 and 10.1b. Contacts uses the shared local vCard address book; it does not need a modem or an additional cellular service. @@ -77,9 +74,8 @@ or an additional cellular service. 1. **A dependency-correct install.** `omamobile-mmd` depends on `omamobile-modem-sit`, which depends on `omamobile-modem`, which still depends on `omamobile-device-cheetah`. That conflicts with tegu's device - package. The existing `modem-policy-virtual` change replaces that last - dependency with `omamobile-modem-policy` and adds tegu's provider. It is - not in this base. Land/build that prerequisite first. + package. #363 (merged) replaces that last dependency with the virtual + `omamobile-modem-policy` and adds tegu's provider. 2. **The bridge package and its start.** The common rootfs list deliberately omits mmd and modem-sit. Tegu's `ROOTFS_PACKAGES` does not include them. `omamobile-mmd.service` ships disabled, has no D-Bus activation file, @@ -130,14 +126,13 @@ For the already running palmtop, the manual steps below are enough once package dependencies are correct. The durable boot/image changes are not prerequisites for that test. -## Attended first test (proposed, not executed) +## Attended first test (ran on 2026-11-02) Keep the existing modem sleep inhibitor throughout; suspend with the CP on is not qualified by this work. Keep the existing once-per-boot start and NV checks. No step below starts, stops or restarts the CP or sitd. Run user commands in the existing graphical user's terminal, root commands -in the attended administrative session. These commands are a runbook for -the human, not authorization to contact the phone in this task. +in the attended administrative session. | Step / risk | Commands or action | Expect / pass | Stop condition | Rollback | | --- | --- | --- | --- | --- | @@ -166,7 +161,7 @@ A successful dial through mmd does not prove those controls affect tegu's route. MMS and mobile-data control through ModemManager are outside this SMS/basic-call integration; keep the existing sitd data ownership. -## Offline evidence from this investigation +## Offline evidence `packages/omamobile-mmd/test/all` passed on this base with private D-Bus and local simulator sockets. This covers API/bridge/libmm clients, the @@ -182,3 +177,26 @@ This does not run the packaged Rust agent or either GUI, does not test tegu hardware or the current private carrier configuration, and does not qualify polkit for the actual graphical session. The earlier full agent chain result is recorded in the shared plan; it was not rerun here. + +## Results on the palmtop, 2026-11-02 + +The daily kernel (`7.3.0-rc6-omamobile-tegu-s2mpg15-m1-g991042e2eff3-dirty`), +the modem started by hand and sitd running (built from this stack, 0.3.12 +at the time), `omamobile-mmd` 0.1.0 started with `systemctl start`. + +- Steps 1 to 3 passed: the bridge owned `org.freedesktop.ModemManager1` + and exported the modem with the SIM ready; sitd and the CP stayed the + same running instances. +- Step 4: opening Messages did *not* start the agent, and it showed + "service isn't running" until `systemctl --user enable --now + omatel-agent`. After that both apps saw the modem. Cold-session + activation stays open, as above. +- Step 5: texts both ways from Messages, with no duplicate. +- Step 6: calls out from Phone and in, with speakerphone audio (#367), + released cleanly. +- The status bar showed airplane mode until sitd mapped radio state 10 to + on (now on main with #381). + +A `tools/phone-smoke` report from the palmtop is still to come, with the +next run. + From 3c4494cdd1d9cf3cfead793d7e0c746828e469f3 Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Tue, 3 Nov 2026 14:34:26 -0647 Subject: [PATCH 06/31] TELEPHONY-APPS-PLAN, omamobile-telephony-tegu: mmd's Conflicts= goes in 0.1.3, with this pull request The plan and the README dated the removal of the unit's Conflicts=ModemManager.service to mmd 0.1.1, and the bullet above still listed it as built; this pull request is what removes it, in 0.1.3. --- docs/TELEPHONY-APPS-PLAN.md | 4 ++-- packages/omamobile-telephony-tegu/README.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/TELEPHONY-APPS-PLAN.md b/docs/TELEPHONY-APPS-PLAN.md index 4fed50af9..1e4011606 100644 --- a/docs/TELEPHONY-APPS-PLAN.md +++ b/docs/TELEPHONY-APPS-PLAN.md @@ -143,8 +143,8 @@ shell status / quick settings ──────────────── - Received SMS handed over by ID: the bridge exports each one as an `Sms` object, and a client's `Messaging.Delete` deletes it in sitd's store. That is Chatty's pattern: it copies each message into its own database and deletes it from the modem. - **Packaging, as built (T1, `packages/omamobile-mmd` 0.1.0; [MODEM-PLAN](../device/cheetah/MODEM-PLAN.md) "T0/T1: the ModemManager bridge"):** - Its own package, `omamobile-mmd`, with `conflicts=(modemmanager)` and **no `provides=`**: nothing in Arch or Arch Linux ARM hard-depends on `modemmanager` (gnome-calls, chatty, networkmanager and geoclue need only libmm-glib; mmsd-tng is AUR-only and also needs only libmm-glib). - - It ships `omamobile-mmd.service`, not `ModemManager.service`, with no `dbus-org.freedesktop.ModemManager1.service` alias: `Type=dbus`, `BusName=org.freedesktop.ModemManager1`, `Conflicts=ModemManager.service`, `WantedBy=omamobile-sitd.service`, and not enabled by the package. It also ships the D-Bus bus policy (only root owns the name) and MM's polkit actions. - - Since mmd 0.1.1, the unit has no `Conflicts=ModemManager.service`: starting the bridge must not stop another modem daemon. Package conflicts and exclusive D-Bus name ownership still provide exclusion. The optional tegu integration adds Requisite on an already active sitd, a read-only service check, and an attended attachment helper; it enables neither modem nor RIL. + - It ships `omamobile-mmd.service`, not `ModemManager.service`, with no `dbus-org.freedesktop.ModemManager1.service` alias: `Type=dbus`, `BusName=org.freedesktop.ModemManager1`, `WantedBy=omamobile-sitd.service`, and not enabled by the package (up to mmd 0.1.2 it also had `Conflicts=ModemManager.service`). It also ships the D-Bus bus policy (only root owns the name) and MM's polkit actions. + - From mmd 0.1.3 (#371), the unit has no `Conflicts=ModemManager.service`: starting the bridge must not stop another modem daemon. Package conflicts and exclusive D-Bus name ownership still provide exclusion. The optional tegu integration adds Requisite on an already active sitd, a read-only service check, and an attended attachment helper; it enables neither modem nor RIL. - **No D-Bus activation file**, so no client can start the bridge. Enabled, it starts with `omamobile-sitd`. - No `mmcli` and no CLI of our own. Phone runbooks read the modem through libmm-glib with `test/libmm-status.py`; mmcli runs only in the conformance container (`test/conformance`). - **Packaging, superseded (the design before T1, kept for history; not built):** a package named `omamobile-mm` with `provides=(modemmanager)` and `conflicts=(modemmanager)`, shipping `ModemManager.service` aliased `dbus-org.freedesktop.ModemManager1.service`, the bus policy, a D-Bus activation file, and `mmcli` or a small `omamobile-mm-cli`. T1 dropped `provides=` (no package needs it), the activation file (so no client can start the bridge) and the takeover of ModemManager's unit name. diff --git a/packages/omamobile-telephony-tegu/README.md b/packages/omamobile-telephony-tegu/README.md index 20ed62607..78331f18b 100644 --- a/packages/omamobile-telephony-tegu/README.md +++ b/packages/omamobile-telephony-tegu/README.md @@ -65,7 +65,7 @@ mobile-data bearer is not required just to attach. The unit's separate bridge can recover without dropping call visibility. The attended initial attachment keeps the stricter no-live-call and registered-SIM checks. -Mmd 0.1.1 removes the service-level `Conflicts=ModemManager.service`: a +Mmd 0.1.3 (#371) removes the service-level `Conflicts=ModemManager.service`: a bridge start must not stop another modem daemon. Package conflicts and exclusive D-Bus name ownership still prevent two managers from serving the same API; tegu's preflight refuses another owner before starting mmd. From 5571f3a9a5fadacfef0fb21b6bb5fd14a1d7df2e Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Tue, 3 Nov 2026 20:07:53 -0647 Subject: [PATCH 07/31] omamobile-telephony-tegu: the bridge's service check accepts its own WantedBy and tmp.mount, and a refusal isn't retried With #372's boot unit on and this package installed, the bridge's ExecStartPre refused every start: sitd wanted omamobile-mmd.service (the bridge's own WantedBy, once enabled) and both units wanted tmp.mount (systemd adds it). Neither pulls the RIL or the CP into a start, so both are allowed now. A refusal of --service-check exits 3, which the drop-in names in RestartPreventExitStatus=, so a refused bridge stays down instead of retrying every five seconds. --- .../bin/omamobile-tegu-mmd-attach | 22 ++++++++++++++++--- .../systemd/10-tegu-attach.conf | 3 +++ .../test/test_attach.py | 19 ++++++++++++++++ 3 files changed, 41 insertions(+), 3 deletions(-) diff --git a/packages/omamobile-telephony-tegu/bin/omamobile-tegu-mmd-attach b/packages/omamobile-telephony-tegu/bin/omamobile-tegu-mmd-attach index 10fb3d8ee..798056c22 100755 --- a/packages/omamobile-telephony-tegu/bin/omamobile-tegu-mmd-attach +++ b/packages/omamobile-telephony-tegu/bin/omamobile-tegu-mmd-attach @@ -22,7 +22,13 @@ BRIDGE = 'omamobile-mmd.service' AGENT = 'omatel-agent.service' BUS = 'org.freedesktop.ModemManager1' # Only systemd's basic implicit dependencies may start with the bridge. -BASIC = {'sysinit.target', 'basic.target', 'system.slice', 'dbus.socket', 'dbus.service'} +# tmp.mount: systemd adds it to any unit that uses /tmp. Neither it nor +# these pull the CP or the RIL into a start transaction. +BASIC = {'sysinit.target', 'basic.target', 'system.slice', 'dbus.socket', 'dbus.service', 'tmp.mount'} +# A service-check refusal exits with this code, which the bridge's drop-in +# names in RestartPreventExitStatus=, so a refused bridge stays down instead +# of retrying every RestartSec. +REFUSED_SERVICE = 3 class Refused(RuntimeError): @@ -99,7 +105,13 @@ def system_check(*, require_ready=True): raise Refused('tegu attach policy is not loaded; inspect the packaged drop-ins') for unit in (ril, bridge): for key in ('Requires', 'Wants', 'BindsTo'): - if set(unit.get(key, '').split()) - BASIC: + allowed = BASIC + # sitd wanting the bridge comes from the bridge's own + # WantedBy=omamobile-sitd.service once it is enabled: it starts + # the bridge after the RIL, never the RIL or the CP. + if unit is ril and key == 'Wants': + allowed = BASIC | {BRIDGE} + if set(unit.get(key, '').split()) - allowed: raise Refused('bridge or sitd has an unexpected start dependency; inspect its unit before attaching') if set(bridge.get('Conflicts', '').split()) - {'shutdown.target'}: raise Refused('bridge has an unexpected stop dependency; inspect its unit before attaching') @@ -157,7 +169,11 @@ def main(argv=None): return 0 try: if argv in (['--system-check'], ['--service-check']): - print(json.dumps(system_check(require_ready=argv == ['--system-check']))) + try: + print(json.dumps(system_check(require_ready=argv == ['--system-check']))) + except Refused as error: + print(f'Attach refused: {error}', file=sys.stderr) + return REFUSED_SERVICE if argv == ['--service-check'] else 1 return 0 if argv not in (['--check'], ['--attach']): raise Refused('use --check or --attach') diff --git a/packages/omamobile-telephony-tegu/systemd/10-tegu-attach.conf b/packages/omamobile-telephony-tegu/systemd/10-tegu-attach.conf index d2e0ad6e3..a4490fa5c 100644 --- a/packages/omamobile-telephony-tegu/systemd/10-tegu-attach.conf +++ b/packages/omamobile-telephony-tegu/systemd/10-tegu-attach.conf @@ -6,3 +6,6 @@ After=omamobile-sitd.service [Service] ExecStartPre=/usr/bin/omamobile-tegu-mmd-attach --service-check +# A refusal (exit 3) is not retried every RestartSec: the bridge stays down +# until the cause is fixed and it is started again. +RestartPreventExitStatus=3 diff --git a/packages/omamobile-telephony-tegu/test/test_attach.py b/packages/omamobile-telephony-tegu/test/test_attach.py index 665abb13c..a95751b4f 100644 --- a/packages/omamobile-telephony-tegu/test/test_attach.py +++ b/packages/omamobile-telephony-tegu/test/test_attach.py @@ -100,6 +100,24 @@ def test_missing_policy_or_pulling_dependency_refused(self): self.refused() self.units[unit][field] = old + def test_enabled_bridge_and_implicit_tmp_mount_pass(self): + # As on the palmtop once the bridge is enabled: sitd wants it (its + # WantedBy=), and systemd adds tmp.mount to both units. + self.units[a.SITD]['Wants'] = a.BRIDGE + ' tmp.mount' + self.units[a.BRIDGE]['Wants'] = 'tmp.mount' + self.assertEqual(a.system_check()['sitd_pid'], '123') + # sitd wanting anything else, or the bridge wanting itself, still refuses + self.units[a.SITD]['Wants'] = a.BRIDGE + ' ' + a.MODEM + self.refused() + self.units[a.SITD]['Wants'] = '' + self.units[a.BRIDGE]['Wants'] = a.BRIDGE + self.refused() + + def test_service_check_refusal_has_its_own_exit_code(self): + self.units[a.SITD]['Wants'] = a.MODEM + self.assertEqual(a.main(['--service-check']), a.REFUSED_SERVICE) + self.assertEqual(a.main(['--system-check']), 1) + def test_competing_bus_owner_or_real_manager_refused(self): self.owner = 'b true' self.refused() @@ -269,6 +287,7 @@ def test_bridge_dependency_cannot_start_ril_or_cp(self): self.assertNotIn('Conflicts', base) self.assertEqual(policy['Requisite'], [a.SITD]) self.assertEqual(policy['ExecStartPre'], ['/usr/bin/omamobile-tegu-mmd-attach', '--service-check']) + self.assertEqual(policy['RestartPreventExitStatus'], [str(a.REFUSED_SERVICE)]) def test_ril_requires_device_policy_and_dependency_fix(self): pkg = self.repo / 'packages/omamobile-modem-sit/PKGBUILD' From 68fa84892f0b618437ea1b24cf6a263534260add Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Mon, 2 Nov 2026 18:49:00 -0647 Subject: [PATCH 08/31] omamobile-device-tegu 0.2.10: start the modem and phone service at boot, opt-in The 9a's modem only started by hand, from a bring-up script outside the package. omamobile-tegu-modem-up is now packaged: the kernel's own CP drivers when it has them, else the bring-up modules; the NV check, then a sleep inhibitor, then the drivers; a latch written before the drivers and cleared at CP ONLINE, so a start that never got there stops later boots until a human looks; the once-per-boot refusal; and with --phone the phone service and, when installed, the Phone and Messages bridge. omamobile-tegu-modem-boot.service runs it at boot, installed but never enabled by the package. A scratch-root test covers the driver choice, the order, the latch and the refusals. --- packages/omamobile-device-tegu/README.md | 20 +++ .../bin/omamobile-tegu-modem-up | 131 ++++++++++++++++++ packages/omamobile-device-tegu/test/all | 7 +- packages/omamobile-device-tegu/test/modem-up | 87 ++++++++++++ .../system/omamobile-tegu-modem-boot.service | 23 +++ packages/omamobile-device-tegu/version | 2 +- 6 files changed, 268 insertions(+), 2 deletions(-) create mode 100644 packages/omamobile-device-tegu/bin/omamobile-tegu-modem-up create mode 100755 packages/omamobile-device-tegu/test/modem-up create mode 100644 packages/omamobile-device-tegu/vendor/systemd/system/omamobile-tegu-modem-boot.service diff --git a/packages/omamobile-device-tegu/README.md b/packages/omamobile-device-tegu/README.md index 604697628..2d59c9909 100644 --- a/packages/omamobile-device-tegu/README.md +++ b/packages/omamobile-device-tegu/README.md @@ -150,6 +150,26 @@ blacklists both and starts neither. Licence: MIT. +## The modem at boot (opt-in) + +`omamobile-tegu-modem-up` starts the CP once per boot: the kernel's own +drivers when it carries them (`cpif`, `pcie_gs201_cp` and the device tree's +`cpif` node), else the bring-up modules in `/var/lib/omamobile-tegu/modem`. +It runs the read-only NV check, takes a sleep inhibitor before any driver +loads (suspend with the CP up isn't qualified on the 9a, so nothing sleeps +until the reboot), writes a latch before the drivers load and clears it at +CP ONLINE, and with `--phone` starts `omamobile-sitd` and, when installed, +`omamobile-mmd` for Phone and Messages. It refuses a second start in a boot +that already loaded CPIF, and any start while the latch from a failed one is +there (`/var/lib/omamobile/modem-bringup-started`: read +`/var/log/omamobile/modem.log`, then remove it). Never stop the modem by +hand; the reboot's shutdown stops it. + +`omamobile-tegu-modem-boot.service` runs `omamobile-tegu-modem-up --phone` +at boot. The package installs it disabled; to have the palmtop come up as a +phone, `systemctl enable omamobile-tegu-modem-boot`. With it on the battery +drains as if awake, since the palmtop no longer suspends. + ## Optional Phone and Messages attachment `omamobile-telephony-tegu` is an opt-in companion package; it installs the diff --git a/packages/omamobile-device-tegu/bin/omamobile-tegu-modem-up b/packages/omamobile-device-tegu/bin/omamobile-tegu-modem-up new file mode 100644 index 000000000..e1af5e5d6 --- /dev/null +++ b/packages/omamobile-device-tegu/bin/omamobile-tegu-modem-up @@ -0,0 +1,131 @@ +#!/bin/bash +# SPDX-License-Identifier: MIT +# omamobile-tegu-modem-up: start the Pixel 9a's modem once per boot and, with +# --phone, the phone service on top (device/tegu MODEM-PLAN M5 and M-SIM, +# TELEPHONY-PLAN section 2). +# +# omamobile-tegu-modem-up [--gnss] [--phone] +# --gnss gnssd too (OMAMOBILE_MODEM_GNSS=1) +# --phone after CP ONLINE, start omamobile-sitd, and omamobile-mmd when +# it's installed (Phone and Messages); omamobile-tegu-modem.service +# runs it this way at boot when the owner has enabled it +# +# The CP drivers come from the running kernel when it carries them (cpif and +# pcie_gs201_cp, with the device tree's cpif node: the published kernel), else +# from the bring-up modules in /var/lib/omamobile-tegu/modem (the owner's +# integration kernel). The modem profile runs as the transient unit +# omamobile-tegu-modem, whose stop powers the CP off before rfsd goes. +# +# Rules this script keeps (AGENTS.md, "Suspend and modem"): +# - one CP start per boot: a second start in the same boot stalled in the +# ROM, so a boot that loaded CPIF refuses (reboot to start again); +# - never stop the modem by hand: the attended reboot's shutdown stops it; +# - a start that never reached ONLINE leaves a latch, and later boots refuse +# until a human removes it (/var/lib/omamobile/modem-bringup-started); +# - no system suspend once the CP is up: a sleep inhibitor, its own unit, is +# taken before any driver loads and lasts until the reboot. +set -euo pipefail +# The overrides are for test/modem-up's scratch root only. +B=${OMAMOBILE_MODEM_MODULES:-/var/lib/omamobile-tegu/modem} +LATCH=${OMAMOBILE_MODEM_LATCH:-/var/lib/omamobile/modem-bringup-started} +CP_STATE=${OMAMOBILE_MODEM_CP:-/usr/lib/omamobile-vendor/omamobile-modem-cp} +CHROOT=${OMAMOBILE_VENDOR_CHROOT:-/usr/lib/omamobile-vendor/omamobile-vendor-chroot} +SYS=${OMAMOBILE_SYS:-/sys} +DT=${OMAMOBILE_DT:-/proc/device-tree} +LOG=${OMAMOBILE_MODEM_LOG:-/var/log/omamobile} +say() { printf 'omamobile-tegu-modem-up: %s\n' "$*"; } +gnss=0 phone=0 +for a in "$@"; do + case $a in + --gnss) gnss=1 ;; + --phone) phone=1 ;; + *) say "usage: omamobile-tegu-modem-up [--gnss] [--phone]"; exit 2 ;; + esac +done +[[ $EUID -eq 0 || -n ${OMAMOBILE_MODEM_TEST:-} ]] || { say "run as root"; exit 1; } + +phone_up() { + ((phone)) || return 0 + systemctl start omamobile-sitd.service + say "phone service started" + if systemctl cat omamobile-mmd.service >/dev/null 2>&1; then + systemctl start omamobile-mmd.service && say "Phone and Messages bridge started" + fi +} + +if systemctl is-active -q omamobile-tegu-modem; then + say "already running: $($CP_STATE state 2>/dev/null || echo unknown)" + phone_up + exit 0 +fi +if [[ -d $SYS/module/cpif ]]; then + say "CPIF was loaded earlier this boot; reboot before starting the modem again"; exit 1 +fi +if [[ -e $LATCH ]]; then + say "an earlier start never reached ONLINE ($LATCH): look at /var/log/omamobile/modem.log, then remove it to try again" + exit 1 +fi +[[ -e $SYS/bus/platform/devices/154e0000.pinctrl ]] || { say "no FAR_ALIVE pinctrl (old device tree)"; exit 1; } + +# Which drivers: the kernel's own, or the bring-up modules +if [[ -e $DT/cpif ]] && modinfo -n cpif >/dev/null 2>&1 && modinfo -n pcie_gs201_cp >/dev/null 2>&1; then + in_tree=1 +else + in_tree=0 + for f in tegu-modem-cpif-activate.ko tegu-pcie0-cp.ko shm_ipc.ko cpif.ko cpif-keep-link.ko gnss_spi.ko gnssif.ko; do + [[ -f $B/$f ]] || { say "no in-kernel CP drivers and no $B/$f"; exit 1; } + done +fi + +# The NV checks (read-only) before anything touches the modem +$CHROOT modem check + +# No system suspend while the CP has been up this boot: a suspend with it +# ONLINE never woke (2026-10-27). Taken before the drivers load, kept until +# the reboot; systemctl suspend and logind's suspend then refuse. +systemctl is-active -q omamobile-tegu-modem-nosleep || + systemd-run -q --unit=omamobile-tegu-modem-nosleep \ + systemd-inhibit --what=sleep --who=omamobile-tegu-modem \ + --why="suspend with the modem up isn't qualified on the Pixel 9a" --mode=block sleep infinity + +mkdir -p "$(dirname "$LATCH")" "$LOG" +date -Is > "$LATCH"; sync "$LATCH" 2>/dev/null || sync + +if ((in_tree)); then + say "drivers: the running kernel's" + modprobe pcie_gs201_cp allow_hw=1 + modprobe shm_ipc + modprobe cpif + modprobe gnss_spi 2>/dev/null || true + modprobe gnssif 2>/dev/null || true +else + say "drivers: the bring-up modules in $B" + insmod $B/tegu-modem-cpif-activate.ko activate=1 + insmod $B/tegu-pcie0-cp.ko allow_hw=1 + insmod $B/shm_ipc.ko + # cpif with keep_link_up off at load, or the CP never reaches ONLINE + insmod $B/cpif-keep-link.ko keep_link_up=0 + # stock's GNSS SPI setup: mode 0, 32-bit words swapped in gnss_spi, 64-byte reads + insmod $B/gnss_spi.ko word32=2 piece=64 spi_mode=0 + insmod $B/gnssif.ko +fi +echo performance > $SYS/module/pcie_aspm/parameters/policy 2>/dev/null || true + +systemd-run -q --unit=omamobile-tegu-modem -p KillSignal=SIGINT -p TimeoutStopSec=60 \ + -p "ExecStop=$CHROOT modem stop" \ + --setenv=OMAMOBILE_MODEM_GNSS=$gnss \ + bash -c "exec $CHROOT modem start >> $LOG/modem.log 2>&1" +for _ in $(seq 1 60); do + s=$($CP_STATE state 2>/dev/null || true) + [[ $s == ONLINE ]] && break + systemctl is-active -q omamobile-tegu-modem || break + sleep ${OMAMOBILE_MODEM_POLL:-1} +done +s=$($CP_STATE state 2>/dev/null || echo unknown) +if [[ $s != ONLINE ]]; then + say "modem not ONLINE ($s); see /var/log/omamobile/modem.log. The latch stays: reboot, read the log, then remove $LATCH" + exit 1 +fi +rm -f "$LATCH"; sync +say "modem OK: CP ONLINE (log /var/log/omamobile/modem.log)" +phone_up diff --git a/packages/omamobile-device-tegu/test/all b/packages/omamobile-device-tegu/test/all index 121d36bc5..68f828257 100755 --- a/packages/omamobile-device-tegu/test/all +++ b/packages/omamobile-device-tegu/test/all @@ -104,6 +104,11 @@ for unit in omamobile-tegu-graphics omamobile-tegu-usb-rescue; do [[ $(readlink "$tmp/root/usr/lib/systemd/system/multi-user.target.wants/$unit.service") == ../$unit.service ]] \ || fail "$unit is enabled by a vendor wants link" done +# The modem's boot start is opt-in: installed, never enabled by the package +[[ -f $tmp/root/usr/lib/systemd/system/omamobile-tegu-modem-boot.service ]] || fail "install stages the modem's boot start" +[[ -e $tmp/root/usr/lib/systemd/system/multi-user.target.wants/omamobile-tegu-modem-boot.service ]] \ + && fail "the modem's boot start is enabled by the package (it must be opt-in)" +grep -q 'omamobile-tegu-modem-boot' omamobile-device-tegu.install && fail "the install scriptlet must not enable the modem's boot start" # The AoC start runs at every boot (its condition skips a DTB without the # node), and answers to omamobile-aoc.service for the sensor and fp units. [[ $(readlink "$tmp/root/usr/lib/systemd/system/multi-user.target.wants/omamobile-tegu-aoc.service") == ../omamobile-tegu-aoc.service ]] \ @@ -192,7 +197,7 @@ pass "the Bluetooth address is read at run time" grep -c '^for unit in omamobile-sensor-proxy.service omamobile-nfc-open.service; do$' bin/omamobile-setup-system >/dev/null || fail "setup-system enables the sensor proxy and the NFC opener" grep -qE 'omamobile-(fp|gnss-nmea|speaker-protection)' <(grep '^for unit' bin/omamobile-setup-system) && fail "setup-system must not enable fingerprint, GNSS or speaker protection on the 9a" -for t in test/graphics-start test/aoc-start test/usb-rescue test/sleep-hooks test/charge-limit; do +for t in test/graphics-start test/aoc-start test/usb-rescue test/sleep-hooks test/charge-limit test/modem-up; do "$t" || fail "$t" done pass "the scripts behave in a scratch root" diff --git a/packages/omamobile-device-tegu/test/modem-up b/packages/omamobile-device-tegu/test/modem-up new file mode 100755 index 000000000..7ab98d7cf --- /dev/null +++ b/packages/omamobile-device-tegu/test/modem-up @@ -0,0 +1,87 @@ +#!/bin/bash +# SPDX-License-Identifier: MIT +# omamobile-tegu-modem-up in a scratch root with fake commands: no phone, no +# modem. The refusals (CPIF already loaded, the failure latch), the choice of +# the kernel's drivers over the bring-up modules, the latch written before +# any driver and cleared at ONLINE, the sleep inhibitor taken before the +# drivers, and --phone starting sitd and the bridge. +set -euo pipefail +cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." +fail() { printf 'not ok - %s\n' "$1" >&2; exit 1; } +t=$(mktemp -d); trap 'rm -rf "$t"' EXIT +F=$t/bin; mkdir -p "$F" +fake() { printf '#!/bin/bash\n%s\n' "$2" > "$F/$1"; chmod +x "$F/$1"; } +# Every call goes to $t/calls in order; the CP turns ONLINE once the profile runs +fake systemctl 'echo "systemctl $*" >> "$T/calls" +case "$*" in + "is-active -q omamobile-tegu-modem") [[ -e $T/profile ]] ;; + "is-active -q omamobile-tegu-modem-nosleep") false ;; + "cat omamobile-mmd.service") [[ -n ${MMD:-} ]] ;; + *) true ;; +esac' +fake systemd-run 'echo "systemd-run $*" >> "$T/calls"; [[ "$*" == *"--unit=omamobile-tegu-modem "* ]] && touch "$T/profile"; true' +fake modinfo 'echo "modinfo $*" >> "$T/calls"; [[ -n ${IN_TREE:-} ]]' +fake modprobe 'echo "modprobe $*" >> "$T/calls"' +fake insmod 'echo "insmod $*" >> "$T/calls"' +fake sync 'true' +printf '#!/bin/bash\n[[ -e $T/profile && -z ${NEVER:-} ]] && echo ONLINE || echo OFFLINE\n' > "$t/cp"; chmod +x "$t/cp" +printf '#!/bin/bash\necho "chroot $*" >> "$T/calls"\n' > "$t/chroot"; chmod +x "$t/chroot" + +run() { # NAME [env...]: a fresh scratch root, then the script + local r=$t/$1; shift + rm -rf "$r"; mkdir -p "$r/sys/bus/platform/devices/154e0000.pinctrl" "$r/sys/module/pcie_aspm/parameters" "$r/dt" "$r/mods" "$r/log" + for m in tegu-modem-cpif-activate tegu-pcie0-cp shm_ipc cpif cpif-keep-link gnss_spi gnssif; do : > "$r/mods/$m.ko"; done + : > "$r/calls" + env -i PATH="$F:/usr/bin:/bin" T="$r" OMAMOBILE_MODEM_TEST=1 OMAMOBILE_SYS="$r/sys" OMAMOBILE_DT="$r/dt" \ + OMAMOBILE_MODEM_MODULES="$r/mods" OMAMOBILE_MODEM_LATCH="$r/latch" OMAMOBILE_MODEM_CP="$t/cp" \ + OMAMOBILE_VENDOR_CHROOT="$t/chroot" OMAMOBILE_MODEM_LOG="$r/log" OMAMOBILE_MODEM_POLL=0 "$@" \ + bash bin/omamobile-tegu-modem-up --phone > "$r/out" 2>&1 +} + +# The kernel's drivers when it has them and the DT names cpif +run_tree() { local r=$t/$1; shift; rm -rf "$r"; mkdir -p "$r/sys/bus/platform/devices/154e0000.pinctrl" "$r/sys/module/pcie_aspm/parameters" "$r/dt/cpif" "$r/mods" "$r/log"; : > "$r/calls" + env -i PATH="$F:/usr/bin:/bin" T="$r" OMAMOBILE_MODEM_TEST=1 OMAMOBILE_SYS="$r/sys" OMAMOBILE_DT="$r/dt" \ + OMAMOBILE_MODEM_MODULES="$r/mods" OMAMOBILE_MODEM_LATCH="$r/latch" OMAMOBILE_MODEM_CP="$t/cp" \ + OMAMOBILE_VENDOR_CHROOT="$t/chroot" OMAMOBILE_MODEM_LOG="$r/log" OMAMOBILE_MODEM_POLL=0 "$@" \ + bash bin/omamobile-tegu-modem-up --phone > "$r/out" 2>&1; } +run_tree k2 IN_TREE=1 MMD=1 || { cat "$t/k2/out"; fail "a start with the kernel's drivers succeeds"; } +c=$t/k2/calls +grep -qx 'modprobe pcie_gs201_cp allow_hw=1' "$c" || fail "the kernel's link driver is loaded with its hardware steps allowed" +grep -q '^insmod' "$c" && fail "no bring-up module is loaded when the kernel has the drivers" +grep -q 'drivers: the running kernel' "$t/k2/out" || fail "the start says which drivers it used" +n_inhibit=$(grep -n 'unit=omamobile-tegu-modem-nosleep' "$c" | cut -d: -f1) +n_driver=$(grep -n '^modprobe pcie_gs201_cp' "$c" | cut -d: -f1) +n_check=$(grep -n '^chroot modem check' "$c" | cut -d: -f1) +(( n_check < n_inhibit && n_inhibit < n_driver )) || fail "the NV check, then the sleep inhibitor, then the drivers" +[[ ! -e $t/k2/latch ]] || fail "the latch is cleared once the CP is ONLINE" +grep -qx 'systemctl start omamobile-sitd.service' "$c" || fail "--phone starts the phone service" +grep -qx 'systemctl start omamobile-mmd.service' "$c" || fail "--phone starts the bridge when it's installed" +printf 'ok - %s\n' "modem-up: the kernel's drivers, the order, the latch cleared, the phone service and the bridge" + +# The bring-up modules when the kernel lacks the drivers; no bridge without it +run b || { cat "$t/b/out"; fail "a start with the bring-up modules succeeds"; } +grep -q '^insmod .*/tegu-pcie0-cp.ko allow_hw=1$' "$t/b/calls" || fail "the bring-up link driver is loaded" +grep -q '^modprobe' "$t/b/calls" && fail "no kernel driver is modprobed without the kernel's drivers" +grep -qx 'systemctl start omamobile-mmd.service' "$t/b/calls" && fail "no bridge start when it isn't installed" +printf 'ok - %s\n' "modem-up: the bring-up modules otherwise, and no bridge when it isn't installed" + +# Refusals: CPIF already loaded this boot, and the latch of a start that never reached ONLINE +run_c() { local r=$t/c2; rm -rf "$r"; mkdir -p "$r/sys/module/cpif" "$r/sys/bus/platform/devices/154e0000.pinctrl" "$r/dt/cpif" "$r/log"; : > "$r/calls" + env -i PATH="$F:/usr/bin:/bin" T="$r" OMAMOBILE_MODEM_TEST=1 OMAMOBILE_SYS="$r/sys" OMAMOBILE_DT="$r/dt" \ + OMAMOBILE_MODEM_LATCH="$r/latch" OMAMOBILE_MODEM_CP="$t/cp" OMAMOBILE_VENDOR_CHROOT="$t/chroot" OMAMOBILE_MODEM_LOG="$r/log" \ + IN_TREE=1 bash bin/omamobile-tegu-modem-up --phone > "$r/out" 2>&1; } +run_c && fail "a second start in a boot that loaded CPIF is refused" +grep -q 'reboot before starting the modem again' "$t/c2/out" || fail "the refusal says to reboot" +grep -qE '^(modprobe|insmod)' "$t/c2/calls" && fail "nothing loads after the refusal" +run_tree n IN_TREE=1 NEVER=1 && fail "a start that never reaches ONLINE fails" +[[ -e $t/n/latch ]] || fail "the latch stays after a start that never reached ONLINE" +grep -q 'omamobile-sitd' "$t/n/calls" && fail "no phone service without ONLINE" +mkdir -p "$t/l"; date > "$t/l/latch" +run_l() { local r=$t/l; mkdir -p "$r/sys/bus/platform/devices/154e0000.pinctrl" "$r/dt/cpif" "$r/log"; : > "$r/calls" + env -i PATH="$F:/usr/bin:/bin" T="$r" OMAMOBILE_MODEM_TEST=1 OMAMOBILE_SYS="$r/sys" OMAMOBILE_DT="$r/dt" \ + OMAMOBILE_MODEM_LATCH="$r/latch" OMAMOBILE_MODEM_CP="$t/cp" OMAMOBILE_VENDOR_CHROOT="$t/chroot" OMAMOBILE_MODEM_LOG="$r/log" \ + IN_TREE=1 bash bin/omamobile-tegu-modem-up --phone > "$r/out" 2>&1; } +run_l && fail "a start with the latch set is refused" +grep -q 'never reached ONLINE' "$t/l/out" || fail "the refusal names the latch" +grep -qE '^(modprobe|insmod|systemd-run)' "$t/l/calls" && fail "nothing starts while the latch is set" +printf 'ok - %s\n' "modem-up: refuses a second start and a latched boot, and keeps the latch when ONLINE never comes" diff --git a/packages/omamobile-device-tegu/vendor/systemd/system/omamobile-tegu-modem-boot.service b/packages/omamobile-device-tegu/vendor/systemd/system/omamobile-tegu-modem-boot.service new file mode 100644 index 000000000..0d8feec5b --- /dev/null +++ b/packages/omamobile-device-tegu/vendor/systemd/system/omamobile-tegu-modem-boot.service @@ -0,0 +1,23 @@ +# SPDX-License-Identifier: MIT +# The Pixel 9a's modem at boot, opt-in: not enabled by the package. The owner +# turns it on with `systemctl enable omamobile-tegu-modem-boot`. It starts the +# CP once (omamobile-tegu-modem-up keeps the once-per-boot rule, the NV +# checks, the failure latch and the sleep inhibitor), then the phone service +# and, when installed, the Phone and Messages bridge. With it on the palmtop +# doesn't suspend (the modem blocks sleep until suspend with the CP up is +# qualified), so the battery drains as if awake. +[Unit] +Description=Start the Pixel 9a's modem and phone service (opt-in) +Documentation=file:///usr/share/doc/omamobile-device-tegu/README.md +After=omamobile-tegu-aoc.service omamobile-tegu-graphics.service network.target +Wants=network.target +ConditionPathExists=/usr/lib/omamobile-vendor/omamobile-vendor-chroot + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/usr/bin/omamobile-tegu-modem-up --phone +TimeoutStartSec=300 + +[Install] +WantedBy=multi-user.target diff --git a/packages/omamobile-device-tegu/version b/packages/omamobile-device-tegu/version index 1866a362b..13dead7eb 100644 --- a/packages/omamobile-device-tegu/version +++ b/packages/omamobile-device-tegu/version @@ -1 +1 @@ -0.2.9 +0.2.10 From 6d9506011192074c838a12eeadbbcf95165f523c Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Mon, 2 Nov 2026 18:56:01 -0647 Subject: [PATCH 09/31] omamobile-device-tegu 0.2.11: run the modem profile's check after the CP drivers load The profile's check also wants CPIF's ports, so before the drivers it refused ("the CPIF port is not loaded") and the first boot start on the palmtop failed there. It runs after the drivers again, as the bring-up script had it; the inhibitor and the latch still come before any driver. --- packages/omamobile-device-tegu/README.md | 7 +++---- .../omamobile-device-tegu/bin/omamobile-tegu-modem-up | 8 +++++--- packages/omamobile-device-tegu/test/modem-up | 2 +- packages/omamobile-device-tegu/version | 2 +- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/packages/omamobile-device-tegu/README.md b/packages/omamobile-device-tegu/README.md index 2d59c9909..ddf671398 100644 --- a/packages/omamobile-device-tegu/README.md +++ b/packages/omamobile-device-tegu/README.md @@ -155,10 +155,9 @@ Licence: MIT. `omamobile-tegu-modem-up` starts the CP once per boot: the kernel's own drivers when it carries them (`cpif`, `pcie_gs201_cp` and the device tree's `cpif` node), else the bring-up modules in `/var/lib/omamobile-tegu/modem`. -It runs the read-only NV check, takes a sleep inhibitor before any driver -loads (suspend with the CP up isn't qualified on the 9a, so nothing sleeps -until the reboot), writes a latch before the drivers load and clears it at -CP ONLINE, and with `--phone` starts `omamobile-sitd` and, when installed, +It takes a sleep inhibitor before any driver loads (suspend with the CP up isn't qualified on the 9a, so nothing sleeps +until the reboot), writes a latch before the drivers load, runs the modem +profile's read-only NV check once CPIF is loaded, clears the latch at CP ONLINE, and with `--phone` starts `omamobile-sitd` and, when installed, `omamobile-mmd` for Phone and Messages. It refuses a second start in a boot that already loaded CPIF, and any start while the latch from a failed one is there (`/var/lib/omamobile/modem-bringup-started`: read diff --git a/packages/omamobile-device-tegu/bin/omamobile-tegu-modem-up b/packages/omamobile-device-tegu/bin/omamobile-tegu-modem-up index e1af5e5d6..c15188e0f 100644 --- a/packages/omamobile-device-tegu/bin/omamobile-tegu-modem-up +++ b/packages/omamobile-device-tegu/bin/omamobile-tegu-modem-up @@ -77,9 +77,6 @@ else done fi -# The NV checks (read-only) before anything touches the modem -$CHROOT modem check - # No system suspend while the CP has been up this boot: a suspend with it # ONLINE never woke (2026-10-27). Taken before the drivers load, kept until # the reboot; systemctl suspend and logind's suspend then refuse. @@ -111,6 +108,11 @@ else fi echo performance > $SYS/module/pcie_aspm/parameters/policy 2>/dev/null || true +# The profile's preconditions (read-only): the NV partitions read-only, +# unmounted and matching their checksums, and CPIF's ports present, so this +# comes after the drivers. A refusal keeps the latch: a human looks first. +$CHROOT modem check + systemd-run -q --unit=omamobile-tegu-modem -p KillSignal=SIGINT -p TimeoutStopSec=60 \ -p "ExecStop=$CHROOT modem stop" \ --setenv=OMAMOBILE_MODEM_GNSS=$gnss \ diff --git a/packages/omamobile-device-tegu/test/modem-up b/packages/omamobile-device-tegu/test/modem-up index 7ab98d7cf..71bf63f2d 100755 --- a/packages/omamobile-device-tegu/test/modem-up +++ b/packages/omamobile-device-tegu/test/modem-up @@ -52,7 +52,7 @@ grep -q 'drivers: the running kernel' "$t/k2/out" || fail "the start says which n_inhibit=$(grep -n 'unit=omamobile-tegu-modem-nosleep' "$c" | cut -d: -f1) n_driver=$(grep -n '^modprobe pcie_gs201_cp' "$c" | cut -d: -f1) n_check=$(grep -n '^chroot modem check' "$c" | cut -d: -f1) -(( n_check < n_inhibit && n_inhibit < n_driver )) || fail "the NV check, then the sleep inhibitor, then the drivers" +(( n_inhibit < n_driver && n_driver < n_check )) || fail "the sleep inhibitor, then the drivers, then the profile check (it needs CPIF loaded)" [[ ! -e $t/k2/latch ]] || fail "the latch is cleared once the CP is ONLINE" grep -qx 'systemctl start omamobile-sitd.service' "$c" || fail "--phone starts the phone service" grep -qx 'systemctl start omamobile-mmd.service' "$c" || fail "--phone starts the bridge when it's installed" diff --git a/packages/omamobile-device-tegu/version b/packages/omamobile-device-tegu/version index 13dead7eb..d3b5ba4bf 100644 --- a/packages/omamobile-device-tegu/version +++ b/packages/omamobile-device-tegu/version @@ -1 +1 @@ -0.2.10 +0.2.11 From 309b6e51d863167952401c9de014ea06e616e623 Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Mon, 2 Nov 2026 23:09:59 -0647 Subject: [PATCH 10/31] omamobile-device-tegu 0.2.12, omamobile-modem-sit 0.3.24: keep the modem latch until a clean shutdown, and the 9a's screen-on at start The latch was cleared as soon as the CP reached ONLINE, so a hang or reset after that would have started the modem again at every boot. It now stays until the modem profile's unit stops cleanly at shutdown (an ExecStopPost that runs only when the unit's result is success), and the next boot refuses while it's there, as TELEPHONY-PLAN 2.4 plans. The start also refuses a pcie_gs201_cp already loaded without allow_hw, as omamobile-modem-start does, and waits with wait-online instead of reading the state once a second. The screen-on that makes the 9a's modem send signal reports is now set only by tegu's sitd drop-in (OMAMOBILE_SIT_SCREEN_ON_AT_START), so the 7 Pro's start-up is unchanged; #381 already decodes the reports. The README and the boot unit give the order, the preconditions (slot B marked successful, a kernel with linux-omarchy-mobile#172, the charger for the first boots) and the rollback; the test checks the latch is on disk before any driver loads, that it stays past ONLINE, and the allow_hw refusal. --- device/tegu/MODEM-PLAN.md | 2 +- packages/omamobile-device-tegu/README.md | 52 +++++++++++++++---- .../bin/omamobile-tegu-modem-up | 31 ++++++----- packages/omamobile-device-tegu/test/all | 4 ++ packages/omamobile-device-tegu/test/modem-up | 34 ++++++++---- .../10-device-modem.conf | 3 ++ .../system/omamobile-tegu-modem-boot.service | 6 +++ packages/omamobile-device-tegu/version | 2 +- packages/omamobile-modem-sit/lib/service.py | 6 +++ packages/omamobile-modem-sit/version | 2 +- 10 files changed, 106 insertions(+), 36 deletions(-) diff --git a/device/tegu/MODEM-PLAN.md b/device/tegu/MODEM-PLAN.md index 1d38749e4..b9a9af3f9 100644 --- a/device/tegu/MODEM-PLAN.md +++ b/device/tegu/MODEM-PLAN.md @@ -1782,7 +1782,7 @@ Preconditions, as SLEEP-PLAN's: | Piece | State | What it means here | | --- | --- | --- | -| Modem to ONLINE | `/usr/local/bin/omamobile-tegu-modem-up` (M5, once per boot; refuses a second start; arms the sleep inhibitor `omamobile-tegu-modem-nosleep`; its source is [bringup/omamobile-tegu-modem-up](bringup/omamobile-tegu-modem-up)) | the start is this script, not `omamobile-modem.service`, which is `masked-runtime` on the palmtop; the transient unit's ExecStop (the profile's stop, which powers the CP off) runs at shutdown, so the way to stop the modem is an attended reboot, never a stop by hand | +| Modem to ONLINE | `omamobile-tegu-modem-up` from `omamobile-device-tegu` (#372; before it, a bring-up copy in `/usr/local/bin`): once per boot, refuses a second start and a boot that finds the latch, arms the sleep inhibitor `omamobile-tegu-modem-nosleep`; `omamobile-tegu-modem-boot` runs it at boot when enabled (TELEPHONY-PLAN 2.7) | the start is this script, not `omamobile-modem.service`, which is `masked-runtime` on the palmtop; the transient unit's ExecStop (the profile's stop, which powers the CP off) runs at shutdown, so the way to stop the modem is an attended reboot, never a stop by hand | | NV safety | `pacman -Q` says `omamobile-modem` 0.1.4, but the profile files under `/usr/lib/omamobile-vendor` were copied by hand from newer trees (the 27th GNSS try ran 0.1.9's watcher; 0.1.4 predates the 9a's chroot support), so `pacman -Qkk omamobile-modem` is not clean; `/etc/omamobile/modem-nv.sha256` from the 2026-10-28 backup; the profile's `check` runs inside the start script | the NV checks live in that profile, so SIM-1 installs the package from main for real and records the version and the profile's sha256; a stock boot since 2026-10-28 would make `check` refuse; then a fresh read-only backup and a new checksum file come first (AGENTS.md §1) | | The RIL | `omamobile-modem-sit` 0.3.3 installed 2026-10-29 (SIM-1), both units disabled; 0.3.4 () reads the CP state on one open file | 0.3.3's watcher opens and closes the boot device about thirty times a minute, and that cycles the CP link on the 9a (the 10-29 hangs); the run uses 0.3.4 (SIM-1). Its unit `Requires=omamobile-modem.service`, which is masked here, so `systemctl start omamobile-sitd` would fail until SIM-2's unit copy removes that requirement (done 2026-10-29) | | The bridge for apps | `omamobile-mmd` not installed | not part of this test (T2 follows a passing run) | diff --git a/packages/omamobile-device-tegu/README.md b/packages/omamobile-device-tegu/README.md index ddf671398..250c784af 100644 --- a/packages/omamobile-device-tegu/README.md +++ b/packages/omamobile-device-tegu/README.md @@ -155,20 +155,52 @@ Licence: MIT. `omamobile-tegu-modem-up` starts the CP once per boot: the kernel's own drivers when it carries them (`cpif`, `pcie_gs201_cp` and the device tree's `cpif` node), else the bring-up modules in `/var/lib/omamobile-tegu/modem`. -It takes a sleep inhibitor before any driver loads (suspend with the CP up isn't qualified on the 9a, so nothing sleeps -until the reboot), writes a latch before the drivers load, runs the modem -profile's read-only NV check once CPIF is loaded, clears the latch at CP ONLINE, and with `--phone` starts `omamobile-sitd` and, when installed, -`omamobile-mmd` for Phone and Messages. It refuses a second start in a boot -that already loaded CPIF, and any start while the latch from a failed one is -there (`/var/lib/omamobile/modem-bringup-started`: read -`/var/log/omamobile/modem.log`, then remove it). Never stop the modem by -hand; the reboot's shutdown stops it. +In order, it: + +1. takes a sleep inhibitor (suspend with the CP up isn't qualified on the + 9a, so nothing sleeps until the reboot); +2. writes and syncs a latch, `/var/lib/omamobile/modem-bringup-started`; +3. loads the drivers (refusing a `pcie_gs201_cp` already loaded without + `allow_hw`); +4. runs the modem profile's read-only NV check, which needs CPIF loaded; +5. starts the profile and waits for CP ONLINE; +6. with `--phone`, starts `omamobile-sitd` and, when installed, + `omamobile-mmd` for Phone and Messages. + +The latch stays from step 2 until the profile's unit stops cleanly at +shutdown. A start that never reached ONLINE, or a boot that hung or reset +with the modem up, leaves it, and every later start refuses until you've +read `/var/log/omamobile/modem.log` and the last boot's journal and removed +it. It also refuses a second start in a boot that already loaded CPIF. +Never stop the modem by hand; the reboot's shutdown stops it. + +The in-tree driver branch (the kernel's `cpif` and `pcie_gs201_cp`) hasn't +run through this script yet; the in-tree drivers have run from the +bring-up runners. + +### Starting it at boot `omamobile-tegu-modem-boot.service` runs `omamobile-tegu-modem-up --phone` -at boot. The package installs it disabled; to have the palmtop come up as a -phone, `systemctl enable omamobile-tegu-modem-boot`. With it on the battery +at boot. The package installs it disabled. Before enabling it: + +- **Slot B marked successful.** Otherwise every reset spends one of ABL's + three tries, and at zero it boots stock on slot A, which has overwritten + `userdata`. +- **A kernel with linux-omarchy-mobile#172** (the PERIC0 GPIO bus clock + kept on). Without it the modem's GPIO writes hang the palmtop within + minutes. +- **The charger in** for the first boots. + +Then `systemctl enable omamobile-tegu-modem-boot`. With it on the battery drains as if awake, since the palmtop no longer suspends. +**Rollback:** `systemctl disable omamobile-tegu-modem-boot`, then reboot. +If the palmtop resets before you can log in, the latch does the work: the +boot after a reset with the modem up finds it and doesn't start the modem, +so log in then, disable the unit and remove the latch. If it still doesn't +come up, hold Volume Down + Power for fastboot and boot a known-good image +set. + ## Optional Phone and Messages attachment `omamobile-telephony-tegu` is an opt-in companion package; it installs the diff --git a/packages/omamobile-device-tegu/bin/omamobile-tegu-modem-up b/packages/omamobile-device-tegu/bin/omamobile-tegu-modem-up index c15188e0f..eea71db48 100644 --- a/packages/omamobile-device-tegu/bin/omamobile-tegu-modem-up +++ b/packages/omamobile-device-tegu/bin/omamobile-tegu-modem-up @@ -20,8 +20,11 @@ # - one CP start per boot: a second start in the same boot stalled in the # ROM, so a boot that loaded CPIF refuses (reboot to start again); # - never stop the modem by hand: the attended reboot's shutdown stops it; -# - a start that never reached ONLINE leaves a latch, and later boots refuse -# until a human removes it (/var/lib/omamobile/modem-bringup-started); +# - a latch (/var/lib/omamobile/modem-bringup-started) is written before any +# driver loads and removed only when the modem profile's unit stops +# cleanly at shutdown: a start that never reached ONLINE, or a boot that +# hung or reset with the modem up, leaves it, and later boots refuse until +# a human removes it (TELEPHONY-PLAN section 2.4); # - no system suspend once the CP is up: a sleep inhibitor, its own unit, is # taken before any driver loads and lasts until the reboot. set -euo pipefail @@ -62,7 +65,7 @@ if [[ -d $SYS/module/cpif ]]; then say "CPIF was loaded earlier this boot; reboot before starting the modem again"; exit 1 fi if [[ -e $LATCH ]]; then - say "an earlier start never reached ONLINE ($LATCH): look at /var/log/omamobile/modem.log, then remove it to try again" + say "an earlier start never reached ONLINE, or its boot didn't shut down cleanly ($LATCH, $(cat "$LATCH" 2>/dev/null)): look at /var/log/omamobile/modem.log and the last boot's journal, then remove it to try again" exit 1 fi [[ -e $SYS/bus/platform/devices/154e0000.pinctrl ]] || { say "no FAR_ALIVE pinctrl (old device tree)"; exit 1; } @@ -90,6 +93,12 @@ date -Is > "$LATCH"; sync "$LATCH" 2>/dev/null || sync if ((in_tree)); then say "drivers: the running kernel's" + # allow_hw is fixed at load time: a copy loaded without it refuses the + # CP's power-on, so it needs a reboot (as omamobile-modem-start checks). + if [[ -d $SYS/module/pcie_gs201_cp ]]; then + [[ $(cat "$SYS/module/pcie_gs201_cp/parameters/allow_hw" 2>/dev/null) == Y ]] || + { say "pcie_gs201_cp is loaded without allow_hw=1: reboot first"; exit 1; } + fi modprobe pcie_gs201_cp allow_hw=1 modprobe shm_ipc modprobe cpif @@ -113,21 +122,17 @@ echo performance > $SYS/module/pcie_aspm/parameters/policy 2>/dev/null || true # comes after the drivers. A refusal keeps the latch: a human looks first. $CHROOT modem check +# A clean stop of the profile's unit (the reboot's shutdown) is the only +# thing that removes the latch; a failed or killed profile leaves it. systemd-run -q --unit=omamobile-tegu-modem -p KillSignal=SIGINT -p TimeoutStopSec=60 \ -p "ExecStop=$CHROOT modem stop" \ + -p "ExecStopPost=/bin/sh -c '[ \"\$\$SERVICE_RESULT\" = success ] && rm -f $LATCH && sync'" \ --setenv=OMAMOBILE_MODEM_GNSS=$gnss \ bash -c "exec $CHROOT modem start >> $LOG/modem.log 2>&1" -for _ in $(seq 1 60); do - s=$($CP_STATE state 2>/dev/null || true) - [[ $s == ONLINE ]] && break - systemctl is-active -q omamobile-tegu-modem || break - sleep ${OMAMOBILE_MODEM_POLL:-1} -done -s=$($CP_STATE state 2>/dev/null || echo unknown) -if [[ $s != ONLINE ]]; then +if ! $CP_STATE wait-online 60 >/dev/null 2>&1; then + s=$($CP_STATE state 2>/dev/null || echo unknown) say "modem not ONLINE ($s); see /var/log/omamobile/modem.log. The latch stays: reboot, read the log, then remove $LATCH" exit 1 fi -rm -f "$LATCH"; sync -say "modem OK: CP ONLINE (log /var/log/omamobile/modem.log)" +say "modem OK: CP ONLINE (log /var/log/omamobile/modem.log); the latch stays until a clean shutdown" phone_up diff --git a/packages/omamobile-device-tegu/test/all b/packages/omamobile-device-tegu/test/all index 68f828257..172c71631 100755 --- a/packages/omamobile-device-tegu/test/all +++ b/packages/omamobile-device-tegu/test/all @@ -156,6 +156,10 @@ done [[ -f $tmp/root/usr/lib/systemd/system/omamobile-sitd.service.d/10-device-modem.conf ]] \ || fail "the device sitd policy is staged" grep -q 'omamobile-sitd-policy' PKGBUILD || fail "the package provides its sitd policy capability" +grep -qx 'Environment=OMAMOBILE_SIT_SCREEN_ON_AT_START=1' vendor/systemd/system/omamobile-sitd.service.d/10-device-modem.conf \ + || fail "the 9a's sitd tells its modem the screen is on at start-up (signal reports)" +! grep -rq OMAMOBILE_SIT_SCREEN_ON_AT_START ../omamobile-device-cheetah ../omamobile-device-raven \ + || fail "only the 9a sets the start-up screen-on" pass "install stages the package, enables only the guards, and nothing that marks a slot" for m in cpif shm_ipc pcie_gs201_cp; do diff --git a/packages/omamobile-device-tegu/test/modem-up b/packages/omamobile-device-tegu/test/modem-up index 71bf63f2d..ef19fb738 100755 --- a/packages/omamobile-device-tegu/test/modem-up +++ b/packages/omamobile-device-tegu/test/modem-up @@ -1,9 +1,10 @@ #!/bin/bash # SPDX-License-Identifier: MIT # omamobile-tegu-modem-up in a scratch root with fake commands: no phone, no -# modem. The refusals (CPIF already loaded, the failure latch), the choice of -# the kernel's drivers over the bring-up modules, the latch written before -# any driver and cleared at ONLINE, the sleep inhibitor taken before the +# modem. The refusals (CPIF already loaded, the latch, a link driver loaded +# without allow_hw), the choice of the kernel's drivers over the bring-up +# modules, the latch written before any driver and kept past ONLINE for the +# profile's clean stop to remove, the sleep inhibitor taken before the # drivers, and --phone starting sitd and the bridge. set -euo pipefail cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." @@ -21,10 +22,11 @@ case "$*" in esac' fake systemd-run 'echo "systemd-run $*" >> "$T/calls"; [[ "$*" == *"--unit=omamobile-tegu-modem "* ]] && touch "$T/profile"; true' fake modinfo 'echo "modinfo $*" >> "$T/calls"; [[ -n ${IN_TREE:-} ]]' -fake modprobe 'echo "modprobe $*" >> "$T/calls"' -fake insmod 'echo "insmod $*" >> "$T/calls"' +# The drivers record whether the latch was already on disk when they loaded +fake modprobe 'echo "modprobe $* latch=$([[ -e $OMAMOBILE_MODEM_LATCH ]] && echo yes || echo no)" >> "$T/calls"' +fake insmod 'echo "insmod $* latch=$([[ -e $OMAMOBILE_MODEM_LATCH ]] && echo yes || echo no)" >> "$T/calls"' fake sync 'true' -printf '#!/bin/bash\n[[ -e $T/profile && -z ${NEVER:-} ]] && echo ONLINE || echo OFFLINE\n' > "$t/cp"; chmod +x "$t/cp" +printf '#!/bin/bash\nif [[ -e $T/profile && -z ${NEVER:-} ]]; then echo ONLINE; else echo OFFLINE; [[ $1 == wait-online ]] && exit 1; fi; exit 0\n' > "$t/cp"; chmod +x "$t/cp" printf '#!/bin/bash\necho "chroot $*" >> "$T/calls"\n' > "$t/chroot"; chmod +x "$t/chroot" run() { # NAME [env...]: a fresh scratch root, then the script @@ -46,21 +48,23 @@ run_tree() { local r=$t/$1; shift; rm -rf "$r"; mkdir -p "$r/sys/bus/platform/de bash bin/omamobile-tegu-modem-up --phone > "$r/out" 2>&1; } run_tree k2 IN_TREE=1 MMD=1 || { cat "$t/k2/out"; fail "a start with the kernel's drivers succeeds"; } c=$t/k2/calls -grep -qx 'modprobe pcie_gs201_cp allow_hw=1' "$c" || fail "the kernel's link driver is loaded with its hardware steps allowed" +grep -qx 'modprobe pcie_gs201_cp allow_hw=1 latch=yes' "$c" || fail "the kernel's link driver is loaded with its hardware steps allowed, after the latch is on disk" +grep -q 'latch=no' "$c" && fail "no driver loads before the latch is written" grep -q '^insmod' "$c" && fail "no bring-up module is loaded when the kernel has the drivers" grep -q 'drivers: the running kernel' "$t/k2/out" || fail "the start says which drivers it used" n_inhibit=$(grep -n 'unit=omamobile-tegu-modem-nosleep' "$c" | cut -d: -f1) n_driver=$(grep -n '^modprobe pcie_gs201_cp' "$c" | cut -d: -f1) n_check=$(grep -n '^chroot modem check' "$c" | cut -d: -f1) (( n_inhibit < n_driver && n_driver < n_check )) || fail "the sleep inhibitor, then the drivers, then the profile check (it needs CPIF loaded)" -[[ ! -e $t/k2/latch ]] || fail "the latch is cleared once the CP is ONLINE" +[[ -e $t/k2/latch ]] || fail "the latch stays past ONLINE" +grep -q 'ExecStopPost=.*SERVICE_RESULT.*rm -f .*latch' "$c" || fail "the profile's clean stop removes the latch" grep -qx 'systemctl start omamobile-sitd.service' "$c" || fail "--phone starts the phone service" grep -qx 'systemctl start omamobile-mmd.service' "$c" || fail "--phone starts the bridge when it's installed" -printf 'ok - %s\n' "modem-up: the kernel's drivers, the order, the latch cleared, the phone service and the bridge" +printf 'ok - %s\n' "modem-up: the kernel's drivers, the order, the latch kept for a clean stop, the phone service and the bridge" # The bring-up modules when the kernel lacks the drivers; no bridge without it run b || { cat "$t/b/out"; fail "a start with the bring-up modules succeeds"; } -grep -q '^insmod .*/tegu-pcie0-cp.ko allow_hw=1$' "$t/b/calls" || fail "the bring-up link driver is loaded" +grep -q '^insmod .*/tegu-pcie0-cp.ko allow_hw=1 latch=yes$' "$t/b/calls" || fail "the bring-up link driver is loaded, after the latch" grep -q '^modprobe' "$t/b/calls" && fail "no kernel driver is modprobed without the kernel's drivers" grep -qx 'systemctl start omamobile-mmd.service' "$t/b/calls" && fail "no bridge start when it isn't installed" printf 'ok - %s\n' "modem-up: the bring-up modules otherwise, and no bridge when it isn't installed" @@ -85,3 +89,13 @@ run_l && fail "a start with the latch set is refused" grep -q 'never reached ONLINE' "$t/l/out" || fail "the refusal names the latch" grep -qE '^(modprobe|insmod|systemd-run)' "$t/l/calls" && fail "nothing starts while the latch is set" printf 'ok - %s\n' "modem-up: refuses a second start and a latched boot, and keeps the latch when ONLINE never comes" + +# A link driver already loaded without allow_hw: refuse before loading anything +r=$t/hw; mkdir -p "$r/sys/bus/platform/devices/154e0000.pinctrl" "$r/sys/module/pcie_gs201_cp/parameters" "$r/dt/cpif" "$r/log" +echo N > "$r/sys/module/pcie_gs201_cp/parameters/allow_hw"; : > "$r/calls" +env -i PATH="$F:/usr/bin:/bin" T="$r" OMAMOBILE_MODEM_TEST=1 OMAMOBILE_SYS="$r/sys" OMAMOBILE_DT="$r/dt" \ + OMAMOBILE_MODEM_LATCH="$r/latch" OMAMOBILE_MODEM_CP="$t/cp" OMAMOBILE_VENDOR_CHROOT="$t/chroot" OMAMOBILE_MODEM_LOG="$r/log" \ + IN_TREE=1 bash bin/omamobile-tegu-modem-up --phone > "$r/out" 2>&1 && fail "a link driver loaded without allow_hw is refused" +grep -q 'without allow_hw=1: reboot first' "$r/out" || fail "the refusal says to reboot" +grep -qE '^(modprobe|insmod)' "$r/calls" && fail "nothing loads after the allow_hw refusal" +printf 'ok - %s\n' "modem-up: refuses a link driver loaded without allow_hw" diff --git a/packages/omamobile-device-tegu/vendor/systemd/system/omamobile-sitd.service.d/10-device-modem.conf b/packages/omamobile-device-tegu/vendor/systemd/system/omamobile-sitd.service.d/10-device-modem.conf index 719317df9..6bfc2218e 100644 --- a/packages/omamobile-device-tegu/vendor/systemd/system/omamobile-sitd.service.d/10-device-modem.conf +++ b/packages/omamobile-device-tegu/vendor/systemd/system/omamobile-sitd.service.d/10-device-modem.conf @@ -8,3 +8,6 @@ After=omamobile-tegu-modem.service omamobile-tegu-aoc.service [Service] # Active alone is insufficient: the CP must already report ONLINE. ExecStartPre=/usr/lib/omamobile-vendor/omamobile-modem-cp state +# The 9a's modem sends signal reports only after it's told the screen is on, +# and nothing sends the screen state yet: sitd tells it once at start-up. +Environment=OMAMOBILE_SIT_SCREEN_ON_AT_START=1 diff --git a/packages/omamobile-device-tegu/vendor/systemd/system/omamobile-tegu-modem-boot.service b/packages/omamobile-device-tegu/vendor/systemd/system/omamobile-tegu-modem-boot.service index 0d8feec5b..3d6e113a6 100644 --- a/packages/omamobile-device-tegu/vendor/systemd/system/omamobile-tegu-modem-boot.service +++ b/packages/omamobile-device-tegu/vendor/systemd/system/omamobile-tegu-modem-boot.service @@ -6,6 +6,12 @@ # and, when installed, the Phone and Messages bridge. With it on the palmtop # doesn't suspend (the modem blocks sleep until suspend with the CP up is # qualified), so the battery drains as if awake. +# +# Before enabling it (README, "Starting it at boot"): slot B marked +# successful, a kernel with linux-omarchy-mobile#172, and the charger in for +# the first boots. Rollback: systemctl disable omamobile-tegu-modem-boot and +# reboot; after a reset with the modem up, the latch keeps the next boot +# from starting it. [Unit] Description=Start the Pixel 9a's modem and phone service (opt-in) Documentation=file:///usr/share/doc/omamobile-device-tegu/README.md diff --git a/packages/omamobile-device-tegu/version b/packages/omamobile-device-tegu/version index d3b5ba4bf..f2722b133 100644 --- a/packages/omamobile-device-tegu/version +++ b/packages/omamobile-device-tegu/version @@ -1 +1 @@ -0.2.11 +0.2.12 diff --git a/packages/omamobile-modem-sit/lib/service.py b/packages/omamobile-modem-sit/lib/service.py index a7967edd1..1ea9adb6c 100644 --- a/packages/omamobile-modem-sit/lib/service.py +++ b/packages/omamobile-modem-sit/lib/service.py @@ -924,6 +924,12 @@ def stop(*_): SOCKET.chmod(0o660) notify('READY=1\nSTATUS=registered') print('Calls and SMS service ready', flush=True) + # Set by a device whose modem sends signal reports only after it's + # told the screen is on (the Pixel 9a's drop-in), while nothing else + # sends the screen state yet. Never set on the 7 Pro. + if args.bringup and os.environ.get('OMAMOBILE_SIT_SCREEN_ON_AT_START') == '1' \ + and service.screen_on is None: + service.dispatch(dict(action='screen-state', on=True)) next_cp_check = 0 while not stopping: service.pump() diff --git a/packages/omamobile-modem-sit/version b/packages/omamobile-modem-sit/version index cfa5015f6..f18b7fb98 100644 --- a/packages/omamobile-modem-sit/version +++ b/packages/omamobile-modem-sit/version @@ -1 +1 @@ -0.3.30 +0.3.31 From 1a15d6e89f76fa569cb8c7ebd844c0e63fd98c57 Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Tue, 3 Nov 2026 07:09:45 -0647 Subject: [PATCH 11/31] omamobile-device-tegu: queue sitd and the bridge at boot, and DEVICES says the modem starts The boot unit's 300 s timeout could run out while the start waited for sitd to register, and the bridge would never start. The start now queues sitd and the bridge (ordered after sitd) without waiting. The 9a's DEVICES cell no longer says the package doesn't start the modem: its opt-in boot unit does. --- docs/DEVICES.md | 2 +- .../omamobile-device-tegu/bin/omamobile-tegu-modem-up | 9 ++++++--- packages/omamobile-device-tegu/test/modem-up | 6 +++--- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/docs/DEVICES.md b/docs/DEVICES.md index a0683d4af..c1c390213 100644 --- a/docs/DEVICES.md +++ b/docs/DEVICES.md @@ -25,7 +25,7 @@ The status of each device, as verified on real hardware. Rows in the matrix have | Pixel 6 | oriole | gs101 (Tensor G1) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); native test image on one phone; slot B marked successful and `vbmeta_b` verification turned off, both without project approval; see notes) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); guarded `userdata` root on test image) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); connected output on test image) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); Panfrost render node present) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); touchscreen detected; input not checked by smoke) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); gpio-keys detected; input not checked by smoke) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); USB network and SSH on test image) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); link up; traffic not checked by smoke) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); controller powered; pairing not checked) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); charge and temperature reported) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); charging reported; control not checked) | no | no | no | no | no | no | no | no | no | no | no | | Pixel 4 | flame | SM8150 (Snapdragon 855) | testing (temporary RAM boot; [notes](../device/flame/BRINGUP-M1.md)) | testing (RAM probe; all UFS read-only) | testing (1080x2280 console; software desktop in separate Arch payload) | testing (separate Arch payload; FD640 contexts, llvmpipe desktop) | testing (separate Arch payload; events and PIN unlock verified) | no | testing (NCM + ACM + SSH; sustained transfers can disconnect) | testing (guarded RAM scan; association untested) | no | no | no | no | no | no | - | no | no | no | no | no | no | - | | Pixel 4 XL ([notes](../device/coral/NOTES.md)) | coral | SM8150 (Snapdragon 855) | WIP (direct ABL v2 boot on the test handset's slot A; slot-B install and §3.1 entry pending; [notes](../device/coral/BRINGUP-M1.md)) | testing (read-only `blockdev` guard + RAM `overlayfs`) | testing (1440x3040@60Hz S6E3HC2 DSC 1.1 KMS, DPMS, brightness) | testing (Adreno 640 / FD640 Mesa Freedreno, Hyprland) | testing (FTS SPI multitouch + read-only flash guard) | testing (power via `qcom-pon` + volume via `gpio-keys`) | testing (CDC ECM + ACM + SSH; stays up with host USB switched off) | testing (`WCN3990` `ath10k_snoc` + `rmtfs -r`, WPA2/DHCP/HTTPS; radio sessions ran before the modem baseline) | WIP (`WCN3990` `hci_qca` `hci0` up + BLE scan; audio/pairing open) | WIP (PM8150B ADC `VBAT_SNS` voltage + FG temp; aftermarket pack on test unit: no reply from `1-0036`) | testing (PM8150B SMB5 charger with `4.20 V` / `500 mA` kernel clamp) | testing (`CS40L25A` I2C click waveform) | testing (PM8150L flash LEDs + quick-settings tile) | no | - | testing (QDSP6 + dual `CS35L36` amps capped at `-26 dB` + `IA8508` SPI mic DSP) | testing (`SLPI` + `fastrpc` + RAM-backed `hexagonrpcd` + QMI SSC: 7 sensors + Soli radar) | WIP (`MPSS` boots with `rmtfs -r` + patched `tqftpserv`, SIM detected; no IPA/voice yet; radio sessions ran before the modem baseline) | no | testing (`CAMSS` + `IMX363`, `IMX481`, `IMX520`, dual `OV7251` NIR; `libcamera` softISP) | no | - | -| Pixel 9a ([notes](../device/tegu/NOTES.md)) | tegu | zumapro (Tensor G4) | works ([#28](https://github.com/derekross/omarchy-mobile/issues/28): native boot from slot B, the Arch root on `userdata`, `omamobile-device-tegu`; slot B was marked successful by hand on 2026-10-28 with the `devinfo` write approved on 2026-10-22, now on hold ([#125](https://github.com/derekross/omarchy-mobile/pull/125)), unmarked by the 10-31 fastboot recovery and marked again on 2026-10-31 during the hold ([record](../device/tegu/NOTES.md#2026-10-31-a-fastboot-flash-of-slot-b-cleared-its-successful-mark-and-b-was-marked-again)), and the package does not mark it; unpublished kernel: the SoC and board device tree is [kernel #81](https://github.com/derekross/linux-omarchy-mobile/pull/81), merged; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (UFS behind the read-only guard; unpublished kernel; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (120 Hz through gs-decon; the panel driver [kernel #89](https://github.com/derekross/linux-omarchy-mobile/pull/89), 120 Hz [kernel #88](https://github.com/derekross/linux-omarchy-mobile/pull/88), merged, the display DT, merged with [kernel #96](https://github.com/derekross/linux-omarchy-mobile/pull/96); brightness, DPMS off and on and the 60/120 Hz switch on the boot of [kernel #125](https://github.com/derekross/linux-omarchy-mobile/pull/125), merged, which also checks the panel's ID; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on), [brightness record](../device/tegu/NOTES.md#2026-11-01-afternoon-and-evening-wi-fi-from-the-package-the-wake-and-the-replug-storage-idle-the-panel-id)) | works (Panthor, the desktop renders, runtime suspend when idle; this boot runs at a fixed 160 MHz, so frequency scaling and the GPU thermal zone count as in review, [kernel #85](https://github.com/derekross/linux-omarchy-mobile/pull/85) in review, [kernel #87](https://github.com/derekross/linux-omarchy-mobile/pull/87) in review; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (Synaptics S3908 over SPI, [kernel #81](https://github.com/derekross/linux-omarchy-mobile/pull/81), merged; survives sleep, [kernel #82](https://github.com/derekross/linux-omarchy-mobile/pull/82), merged; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (gpio-keys: power and volume; the power key wakes from sleep; unpublished kernel; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (CDC NCM and SSH; reconnects after a replug, `omamobile-tegu-usb-rescue`, also after a replug the gadget didn't see ([#280](https://github.com/derekross/omarchy-mobile/pull/280); [the replug record](../device/tegu/NOTES.md#2026-10-28-what-the-device-tables-claims-rest-on)); [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (BCM4383 on PCIe channel 1 through the shared gs201 host and zuma PHY, [kernel #178](https://github.com/derekross/linux-omarchy-mobile/pull/178) on [kernel #156](https://github.com/derekross/linux-omarchy-mobile/pull/156), in review, and brcmfmac, [kernel #56](https://github.com/derekross/linux-omarchy-mobile/pull/56) in review; started at boot by `omamobile-device-tegu` 0.2.4 ([#238](https://github.com/derekross/omarchy-mobile/pull/238)) with the extractor's firmware; WPA2 with iwd, kept loaded across sleep by the package's sleep hook; [record](../device/tegu/NOTES.md#2026-11-01-afternoon-and-evening-wi-fi-from-the-package-the-wake-and-the-replug-storage-idle-the-panel-id)) | works (hci_uart on the bootloader's address, BlueZ, A2DP; [kernel #94](https://github.com/derekross/linux-omarchy-mobile/pull/94); unpublished kernel; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (MAX77779 gauge with temperature, current and time estimates through UPower; [kernel #66](https://github.com/derekross/linux-omarchy-mobile/pull/66); unpublished kernel; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (the MAX77779 charger binds from the device tree, [kernel #161](https://github.com/derekross/linux-omarchy-mobile/pull/161), merged, built by [#227](https://github.com/derekross/omarchy-mobile/pull/227); the charge limit in `omamobile-device-tegu` 0.2.3 holds charging off at the limit through `charge_behaviour` and lets it run again 5 below; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | works (CS40L26A through feedbackd, with brownout prevention, [kernel #95](https://github.com/derekross/linux-omarchy-mobile/pull/95); its DT [kernel #96](https://github.com/derekross/linux-omarchy-mobile/pull/96), merged; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (LM3644, 25 steps to 75 mA, quick-settings tile; its DT [kernel #96](https://github.com/derekross/linux-omarchy-mobile/pull/96), merged; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | testing (Omarchy's Location switch serves fixes from GPS, Galileo, BeiDou and GLONASS once the modem is up, started by hand: a 30-minute session through the switch on 2026-11-01 (omamobile-gnss 0.2.5's start, the modem link left to cycle) ran clean, 1763 of 1765 GGA sentences fixed, first fix 37 s after a client connected; needs [kernel #150](https://github.com/derekross/linux-omarchy-mobile/pull/150), merged, the PERIC0 clock fix [kernel #172](https://github.com/derekross/linux-omarchy-mobile/pull/172) in review (without it the modem link hung the palmtop within minutes) and [#114](https://github.com/derekross/omarchy-mobile/pull/114); [plan](../device/tegu/MODEM-PLAN.md), record with [#202](https://github.com/derekross/omarchy-mobile/pull/202)) | works (audio and sensor DSP through the GSA and Trusty, 93 services, started at boot by `omamobile-device-tegu` 0.2.3 from the device tree, [kernel #162](https://github.com/derekross/linux-omarchy-mobile/pull/162) in review; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | works (the TAS2572 amplifiers and the microphone through the AoC card and PipeWire, at boot with the AoC: a tone from the speaker, the microphone at -32 dBFS; speakers at a -10 dB ceiling; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | works (accelerometer, light, proximity, compass and gyroscope through the AoC and the sensor proxy, at boot with the AoC; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | WIP (registered on LTE, mobile data over `rmnet0`, texts both ways and speakerphone calls in and out with `omamobile-modem-sit` ([#356](https://github.com/derekross/omarchy-mobile/pull/356), [#367](https://github.com/derekross/omarchy-mobile/pull/367)), on the owner's kernel and on in-tree drivers from the open kernel PRs ([kernel #187](https://github.com/derekross/linux-omarchy-mobile/pull/187), [kernel #162](https://github.com/derekross/linux-omarchy-mobile/pull/162)); the package doesn't start the modem, the kernel PRs aren't merged, and calls have no echo cancellation or earpiece yet; [plan](../device/tegu/MODEM-PLAN.md), [record](../device/tegu/MODEM-PLAN.md#sim-test-results-2026-11-02-730-rc6-omamobile-tegu-s2mpg15-m1-g991042e2eff3-dirty)) | works (NXP ST54L through nxp-nci, its clock pad from the PMU ([kernel #104](https://github.com/derekross/linux-omarchy-mobile/pull/104) and [kernel #105](https://github.com/derekross/linux-omarchy-mobile/pull/105), merged, with [kernel #131](https://github.com/derekross/linux-omarchy-mobile/pull/131), merged), loaded at boot by `omamobile-device-tegu` 0.2.3 with neard and the link opener: polls with no I2C errors and read a payment card; polling stops before sleep; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | works (main, ultrawide and front from the device tree, [kernel #164](https://github.com/derekross/linux-omarchy-mobile/pull/164) in review, with [kernel #63](https://github.com/derekross/linux-omarchy-mobile/pull/63) and [kernel #103](https://github.com/derekross/linux-omarchy-mobile/pull/103) in review: their drivers load at boot with nothing by hand, libcamera lists all three, and each streams, main at 19 fps and the others at 30 fps at 1280x960; basic picture quality through libcamera's software ISP; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | testing (s2idle when asked for, or through the shell's auto-sleep with the `omamobile-sleep` toggle on, which ships off; the power key lights the lock screen on the first press ([#268](https://github.com/derekross/omarchy-mobile/pull/268), [#275](https://github.com/derekross/omarchy-mobile/pull/275)), and the RTC wakes it; on 2026-11-01 thirty attended 120 s sleeps ([plan](../device/tegu/SLEEP-PLAN.md) S1) and a day of real use with auto-sleep on ([record](../device/tegu/NOTES.md#2026-11-01-afternoon-and-evening-wi-fi-from-the-package-the-wake-and-the-replug-storage-idle-the-panel-id)) all woke, but six test sleeps since 10-28 did not (one in 21 on the clock-fix kernel on 11-01, and one in 127 in an overnight series of 120 s sleeps on 11-01 to 11-02), so sleep tests stay attended ([plan](../device/tegu/SLEEP-PLAN.md) S1); the drain is about 300 mA asleep, the same as awake with the screen off, because nothing below the CPUs sleeps yet; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (opt-in) (enrolls, matches, refuses other fingers and unlocks the lock screen through Trusty and `omamobile-fingerprint`, 2026-10-29; the sensor binds from the device tree, [kernel #165](https://github.com/derekross/linux-omarchy-mobile/pull/165) in review, with [kernel #126](https://github.com/derekross/linux-omarchy-mobile/pull/126), merged; opt-in as on the 7 Pro, because the service's first run writes Trusty's secure storage; [plan](../device/tegu/FINGERPRINT-PLAN.md), [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | +| Pixel 9a ([notes](../device/tegu/NOTES.md)) | tegu | zumapro (Tensor G4) | works ([#28](https://github.com/derekross/omarchy-mobile/issues/28): native boot from slot B, the Arch root on `userdata`, `omamobile-device-tegu`; slot B was marked successful by hand on 2026-10-28 with the `devinfo` write approved on 2026-10-22, now on hold ([#125](https://github.com/derekross/omarchy-mobile/pull/125)), unmarked by the 10-31 fastboot recovery and marked again on 2026-10-31 during the hold ([record](../device/tegu/NOTES.md#2026-10-31-a-fastboot-flash-of-slot-b-cleared-its-successful-mark-and-b-was-marked-again)), and the package does not mark it; unpublished kernel: the SoC and board device tree is [kernel #81](https://github.com/derekross/linux-omarchy-mobile/pull/81), merged; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (UFS behind the read-only guard; unpublished kernel; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (120 Hz through gs-decon; the panel driver [kernel #89](https://github.com/derekross/linux-omarchy-mobile/pull/89), 120 Hz [kernel #88](https://github.com/derekross/linux-omarchy-mobile/pull/88), merged, the display DT, merged with [kernel #96](https://github.com/derekross/linux-omarchy-mobile/pull/96); brightness, DPMS off and on and the 60/120 Hz switch on the boot of [kernel #125](https://github.com/derekross/linux-omarchy-mobile/pull/125), merged, which also checks the panel's ID; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on), [brightness record](../device/tegu/NOTES.md#2026-11-01-afternoon-and-evening-wi-fi-from-the-package-the-wake-and-the-replug-storage-idle-the-panel-id)) | works (Panthor, the desktop renders, runtime suspend when idle; this boot runs at a fixed 160 MHz, so frequency scaling and the GPU thermal zone count as in review, [kernel #85](https://github.com/derekross/linux-omarchy-mobile/pull/85) in review, [kernel #87](https://github.com/derekross/linux-omarchy-mobile/pull/87) in review; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (Synaptics S3908 over SPI, [kernel #81](https://github.com/derekross/linux-omarchy-mobile/pull/81), merged; survives sleep, [kernel #82](https://github.com/derekross/linux-omarchy-mobile/pull/82), merged; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (gpio-keys: power and volume; the power key wakes from sleep; unpublished kernel; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (CDC NCM and SSH; reconnects after a replug, `omamobile-tegu-usb-rescue`, also after a replug the gadget didn't see ([#280](https://github.com/derekross/omarchy-mobile/pull/280); [the replug record](../device/tegu/NOTES.md#2026-10-28-what-the-device-tables-claims-rest-on)); [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (BCM4383 on PCIe channel 1 through the shared gs201 host and zuma PHY, [kernel #178](https://github.com/derekross/linux-omarchy-mobile/pull/178) on [kernel #156](https://github.com/derekross/linux-omarchy-mobile/pull/156), in review, and brcmfmac, [kernel #56](https://github.com/derekross/linux-omarchy-mobile/pull/56) in review; started at boot by `omamobile-device-tegu` 0.2.4 ([#238](https://github.com/derekross/omarchy-mobile/pull/238)) with the extractor's firmware; WPA2 with iwd, kept loaded across sleep by the package's sleep hook; [record](../device/tegu/NOTES.md#2026-11-01-afternoon-and-evening-wi-fi-from-the-package-the-wake-and-the-replug-storage-idle-the-panel-id)) | works (hci_uart on the bootloader's address, BlueZ, A2DP; [kernel #94](https://github.com/derekross/linux-omarchy-mobile/pull/94); unpublished kernel; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (MAX77779 gauge with temperature, current and time estimates through UPower; [kernel #66](https://github.com/derekross/linux-omarchy-mobile/pull/66); unpublished kernel; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (the MAX77779 charger binds from the device tree, [kernel #161](https://github.com/derekross/linux-omarchy-mobile/pull/161), merged, built by [#227](https://github.com/derekross/omarchy-mobile/pull/227); the charge limit in `omamobile-device-tegu` 0.2.3 holds charging off at the limit through `charge_behaviour` and lets it run again 5 below; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | works (CS40L26A through feedbackd, with brownout prevention, [kernel #95](https://github.com/derekross/linux-omarchy-mobile/pull/95); its DT [kernel #96](https://github.com/derekross/linux-omarchy-mobile/pull/96), merged; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (LM3644, 25 steps to 75 mA, quick-settings tile; its DT [kernel #96](https://github.com/derekross/linux-omarchy-mobile/pull/96), merged; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | testing (Omarchy's Location switch serves fixes from GPS, Galileo, BeiDou and GLONASS once the modem is up, started by hand: a 30-minute session through the switch on 2026-11-01 (omamobile-gnss 0.2.5's start, the modem link left to cycle) ran clean, 1763 of 1765 GGA sentences fixed, first fix 37 s after a client connected; needs [kernel #150](https://github.com/derekross/linux-omarchy-mobile/pull/150), merged, the PERIC0 clock fix [kernel #172](https://github.com/derekross/linux-omarchy-mobile/pull/172) in review (without it the modem link hung the palmtop within minutes) and [#114](https://github.com/derekross/omarchy-mobile/pull/114); [plan](../device/tegu/MODEM-PLAN.md), record with [#202](https://github.com/derekross/omarchy-mobile/pull/202)) | works (audio and sensor DSP through the GSA and Trusty, 93 services, started at boot by `omamobile-device-tegu` 0.2.3 from the device tree, [kernel #162](https://github.com/derekross/linux-omarchy-mobile/pull/162) in review; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | works (the TAS2572 amplifiers and the microphone through the AoC card and PipeWire, at boot with the AoC: a tone from the speaker, the microphone at -32 dBFS; speakers at a -10 dB ceiling; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | works (accelerometer, light, proximity, compass and gyroscope through the AoC and the sensor proxy, at boot with the AoC; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | WIP (registered on LTE, mobile data over `rmnet0`, texts both ways and speakerphone calls in and out with `omamobile-modem-sit` ([#356](https://github.com/derekross/omarchy-mobile/pull/356), [#367](https://github.com/derekross/omarchy-mobile/pull/367)), on the owner's kernel and on in-tree drivers from the open kernel PRs ([kernel #187](https://github.com/derekross/linux-omarchy-mobile/pull/187), [kernel #162](https://github.com/derekross/linux-omarchy-mobile/pull/162)); `omamobile-device-tegu`'s opt-in boot unit starts the modem and the phone service ([#372](https://github.com/derekross/omarchy-mobile/pull/372)), the kernel PRs aren't merged, and calls have no echo cancellation or earpiece yet; [plan](../device/tegu/MODEM-PLAN.md), [record](../device/tegu/MODEM-PLAN.md#sim-test-results-2026-11-02-730-rc6-omamobile-tegu-s2mpg15-m1-g991042e2eff3-dirty)) | works (NXP ST54L through nxp-nci, its clock pad from the PMU ([kernel #104](https://github.com/derekross/linux-omarchy-mobile/pull/104) and [kernel #105](https://github.com/derekross/linux-omarchy-mobile/pull/105), merged, with [kernel #131](https://github.com/derekross/linux-omarchy-mobile/pull/131), merged), loaded at boot by `omamobile-device-tegu` 0.2.3 with neard and the link opener: polls with no I2C errors and read a payment card; polling stops before sleep; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | works (main, ultrawide and front from the device tree, [kernel #164](https://github.com/derekross/linux-omarchy-mobile/pull/164) in review, with [kernel #63](https://github.com/derekross/linux-omarchy-mobile/pull/63) and [kernel #103](https://github.com/derekross/linux-omarchy-mobile/pull/103) in review: their drivers load at boot with nothing by hand, libcamera lists all three, and each streams, main at 19 fps and the others at 30 fps at 1280x960; basic picture quality through libcamera's software ISP; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | testing (s2idle when asked for, or through the shell's auto-sleep with the `omamobile-sleep` toggle on, which ships off; the power key lights the lock screen on the first press ([#268](https://github.com/derekross/omarchy-mobile/pull/268), [#275](https://github.com/derekross/omarchy-mobile/pull/275)), and the RTC wakes it; on 2026-11-01 thirty attended 120 s sleeps ([plan](../device/tegu/SLEEP-PLAN.md) S1) and a day of real use with auto-sleep on ([record](../device/tegu/NOTES.md#2026-11-01-afternoon-and-evening-wi-fi-from-the-package-the-wake-and-the-replug-storage-idle-the-panel-id)) all woke, but six test sleeps since 10-28 did not (one in 21 on the clock-fix kernel on 11-01, and one in 127 in an overnight series of 120 s sleeps on 11-01 to 11-02), so sleep tests stay attended ([plan](../device/tegu/SLEEP-PLAN.md) S1); the drain is about 300 mA asleep, the same as awake with the screen off, because nothing below the CPUs sleeps yet; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (opt-in) (enrolls, matches, refuses other fingers and unlocks the lock screen through Trusty and `omamobile-fingerprint`, 2026-10-29; the sensor binds from the device tree, [kernel #165](https://github.com/derekross/linux-omarchy-mobile/pull/165) in review, with [kernel #126](https://github.com/derekross/linux-omarchy-mobile/pull/126), merged; opt-in as on the 7 Pro, because the service's first run writes Trusty's secure storage; [plan](../device/tegu/FINGERPRINT-PLAN.md), [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | | Pixel 8 Pro ([notes](../device/husky/NOTES.md)) | husky | zuma (Tensor G3) | WIP ([#1](https://github.com/derekross/omarchy-mobile/issues/1): slot B, not marked successful; Omarchy's image from the signed repository boots to the lock screen; the zuma device tree is merged ([kernel #13](https://github.com/derekross/linux-omarchy-mobile/pull/13), [#53](https://github.com/derekross/linux-omarchy-mobile/pull/53))) | testing (UFS at HS-G4 behind the read-only guard; Arch on `userdata`; [UFS-PLAN](../device/husky/UFS-PLAN.md)) | WIP (simple-framebuffer: console and Omarchy's lock screen) | no | testing (ST FTM5 over SPI, merged, [kernel #153](https://github.com/derekross/linux-omarchy-mobile/pull/153); [NOTES](../device/husky/NOTES.md)) | testing (power and volume through `gpio-keys`, merged, [kernel #148](https://github.com/derekross/linux-omarchy-mobile/pull/148); [NOTES](../device/husky/NOTES.md)) | testing (USB and SSH) | testing (BCM4398 on a test kernel, [kernel #156](https://github.com/derekross/linux-omarchy-mobile/pull/156); firmware from the owner's image, [#214](https://github.com/derekross/omarchy-mobile/pull/214); [NOTES](../device/husky/NOTES.md)) | no | testing (gauge with Google's ATL model through a bring-up overlay, temperature, MFD, on a test kernel, [kernel #163](https://github.com/derekross/linux-omarchy-mobile/pull/163); [notes](../device/husky/BATTERY-NOTES.md)) | testing (the charger driver by hand under a dead-man tool, slow on plain 5 V, on a test kernel, [kernel #163](https://github.com/derekross/linux-omarchy-mobile/pull/163); [notes](../device/husky/BATTERY-NOTES.md)) | no | no | no | no | no | no | no | no | no | no | no | | Pixel 7 ([notes](../device/panther/NOTES.md)) | panther | gs201 (Tensor G2) | WIP (slot B, not marked successful; Arch and Hyprland boot; [BRINGUP-M1](../device/panther/BRINGUP-M1.md); board file merged, [kernel #108](https://github.com/derekross/linux-omarchy-mobile/pull/108)) | testing (UFS behind the read-only guard; Arch on `userdata`; merged, [kernel #108](https://github.com/derekross/linux-omarchy-mobile/pull/108)) | WIP (simple-framebuffer: console and the Hyprland desktop; brightness and display off/on over DCS through the S6E3FC3 panel driver and device-panther 0.1.4, in review, [kernel #177](https://github.com/derekross/linux-omarchy-mobile/pull/177); [DISPLAY-PLAN](../device/panther/DISPLAY-PLAN.md)) | testing (Panthor on the Mali-G710; Hyprland renders on it; merged through [kernel #134](https://github.com/derekross/linux-omarchy-mobile/pull/134), with the always-on rule in device-panther 0.1.1, [#145](https://github.com/derekross/omarchy-mobile/pull/145); [notes](../device/panther/NOTES.md#2026-10-28-the-gpu-and-the-haptics-power-off-and-usb-after-a-replug)) | WIP (FocalTech FT3658: touches drive Hyprland and unlock the PIN screen on a test kernel; the driver, [kernel #109](https://github.com/derekross/linux-omarchy-mobile/pull/109), and the touch node, [kernel #134](https://github.com/derekross/linux-omarchy-mobile/pull/134), are merged; stock's interrupt pull-up and CS delay, [kernel #166](https://github.com/derekross/linux-omarchy-mobile/pull/166), the driver's review fixes, [kernel #133](https://github.com/derekross/linux-omarchy-mobile/pull/133), and the kernel option with the touch notes, [#149](https://github.com/derekross/omarchy-mobile/pull/149), are merged) | testing (gpio-keys: power, volume; merged, [kernel #108](https://github.com/derekross/linux-omarchy-mobile/pull/108)) | testing (USB and SSH; merged, [kernel #108](https://github.com/derekross/linux-omarchy-mobile/pull/108); a replug comes back through `omamobile-usb-rescue` in device-panther 0.1.3, on the MAX77759's I2C bus, merged, [kernel #167](https://github.com/derekross/linux-omarchy-mobile/pull/167); [notes](../device/panther/NOTES.md#2026-10-29-usb-comes-back-after-a-replug-u1)) | no | no | WIP (MAX77759 fuel gauge with stock's battery model on a test kernel: percentage, capacity and temperature in upower and the bar; in review, [kernel #171](https://github.com/derekross/linux-omarchy-mobile/pull/171) and the driver fix [#170](https://github.com/derekross/linux-omarchy-mobile/pull/170); [BATTERY-PLAN](../device/panther/BATTERY-PLAN.md)) | no | testing (CS40L26 with the phone's own firmware, `tools/extract-vendor-firmware -d panther`; merged through [kernel #134](https://github.com/derekross/linux-omarchy-mobile/pull/134), with the feedbackd rule in device-panther 0.1.1, [#145](https://github.com/derekross/omarchy-mobile/pull/145); [notes](../device/panther/NOTES.md#2026-10-28-the-gpu-and-the-haptics-power-off-and-usb-after-a-replug)) | no | no | no | no | no | no | no | no | no (s2idle by default since [kernel #134](https://github.com/derekross/linux-omarchy-mobile/pull/134) and device-panther 0.1.1; not run yet) | no | | OnePlus 13 ([notes](../device/dodge/NOTES.md)) | dodge | sm8750 (Snapdragon 8 Elite) | testing (kernel [mrlund/linux-omarchy-mobile `dodge-v3-20261101`](https://github.com/mrlund/linux-omarchy-mobile/tree/dodge-v3-20261101); [kernel #115](https://github.com/derekross/linux-omarchy-mobile/pull/115) closed; [BRINGUP](../device/dodge/BRINGUP-M1.md), [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing ([notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing (msm/dpu; warm-boot drop fixed; [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing (Adreno 830 / gpu2; Vulkan untested; [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing ([notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing ([notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing (CDC NCM + SSH; gadget stuck after replug until reboot; kernel [mrlund/linux-omarchy-mobile `dodge-v3-20261101`](https://github.com/mrlund/linux-omarchy-mobile/tree/dodge-v3-20261101); [kernel #115](https://github.com/derekross/linux-omarchy-mobile/pull/115) closed; [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing (WCN7860 / ath12k; [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing (pairing; A2DP untested; kernel [mrlund/linux-omarchy-mobile `dodge-v3-20261101`](https://github.com/mrlund/linux-omarchy-mobile/tree/dodge-v3-20261101); [kernel #115](https://github.com/derekross/linux-omarchy-mobile/pull/115) closed; [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing (gauge; charging path not claimed; kernel [mrlund/linux-omarchy-mobile `dodge-v3-20261101`](https://github.com/mrlund/linux-omarchy-mobile/tree/dodge-v3-20261101); [kernel #115](https://github.com/derekross/linux-omarchy-mobile/pull/115) closed; [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | no | no | no | no | - | testing (speakers, earpiece, mics; headset plug untested; [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing (accel, prox, compass; autorotate; [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing (LTE data; calls/SMS untested; opt-in flag; [modem](../device/dodge/modem/README.md), [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | no | no | WIP (s2idle not default; [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | no | diff --git a/packages/omamobile-device-tegu/bin/omamobile-tegu-modem-up b/packages/omamobile-device-tegu/bin/omamobile-tegu-modem-up index eea71db48..c9206ca13 100644 --- a/packages/omamobile-device-tegu/bin/omamobile-tegu-modem-up +++ b/packages/omamobile-device-tegu/bin/omamobile-tegu-modem-up @@ -49,10 +49,13 @@ done phone_up() { ((phone)) || return 0 - systemctl start omamobile-sitd.service - say "phone service started" + # Queued, not waited for: sitd is ready only once it has registered, which + # can take longer than the boot unit's timeout, and the bridge would never + # be started. The bridge is ordered after sitd. + systemctl start --no-block omamobile-sitd.service + say "phone service starting" if systemctl cat omamobile-mmd.service >/dev/null 2>&1; then - systemctl start omamobile-mmd.service && say "Phone and Messages bridge started" + systemctl start --no-block omamobile-mmd.service && say "Phone and Messages bridge starting after it" fi } diff --git a/packages/omamobile-device-tegu/test/modem-up b/packages/omamobile-device-tegu/test/modem-up index ef19fb738..ec7146bc9 100755 --- a/packages/omamobile-device-tegu/test/modem-up +++ b/packages/omamobile-device-tegu/test/modem-up @@ -58,15 +58,15 @@ n_check=$(grep -n '^chroot modem check' "$c" | cut -d: -f1) (( n_inhibit < n_driver && n_driver < n_check )) || fail "the sleep inhibitor, then the drivers, then the profile check (it needs CPIF loaded)" [[ -e $t/k2/latch ]] || fail "the latch stays past ONLINE" grep -q 'ExecStopPost=.*SERVICE_RESULT.*rm -f .*latch' "$c" || fail "the profile's clean stop removes the latch" -grep -qx 'systemctl start omamobile-sitd.service' "$c" || fail "--phone starts the phone service" -grep -qx 'systemctl start omamobile-mmd.service' "$c" || fail "--phone starts the bridge when it's installed" +grep -qx 'systemctl start --no-block omamobile-sitd.service' "$c" || fail "--phone starts the phone service" +grep -qx 'systemctl start --no-block omamobile-mmd.service' "$c" || fail "--phone starts the bridge when it's installed" printf 'ok - %s\n' "modem-up: the kernel's drivers, the order, the latch kept for a clean stop, the phone service and the bridge" # The bring-up modules when the kernel lacks the drivers; no bridge without it run b || { cat "$t/b/out"; fail "a start with the bring-up modules succeeds"; } grep -q '^insmod .*/tegu-pcie0-cp.ko allow_hw=1 latch=yes$' "$t/b/calls" || fail "the bring-up link driver is loaded, after the latch" grep -q '^modprobe' "$t/b/calls" && fail "no kernel driver is modprobed without the kernel's drivers" -grep -qx 'systemctl start omamobile-mmd.service' "$t/b/calls" && fail "no bridge start when it isn't installed" +grep -qx 'systemctl start --no-block omamobile-mmd.service' "$t/b/calls" && fail "no bridge start when it isn't installed" printf 'ok - %s\n' "modem-up: the bring-up modules otherwise, and no bridge when it isn't installed" # Refusals: CPIF already loaded this boot, and the latch of a start that never reached ONLINE From c5e3dca849492935fc5fead70e9f6ad9d6c393ea Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Tue, 3 Nov 2026 08:32:03 -0647 Subject: [PATCH 12/31] omamobile-device-tegu: a deliberate restart after ONLINE doesn't cost the next boot its modem reboot-to (and so bin/omamobile push) skips the clean stop that removes the latch, so the next boot refused the modem as if the last one had hung (#390). The latch now names its boot and records ONLINE, and a latch from a boot that reached ONLINE and ended with reboot-to (its note, #403) is cleared with the note. A start that never reached ONLINE, or a note for another boot, still refuses. --- .../bin/omamobile-tegu-modem-up | 17 +++++++++++++- packages/omamobile-device-tegu/test/modem-up | 22 +++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/packages/omamobile-device-tegu/bin/omamobile-tegu-modem-up b/packages/omamobile-device-tegu/bin/omamobile-tegu-modem-up index c9206ca13..773b92628 100644 --- a/packages/omamobile-device-tegu/bin/omamobile-tegu-modem-up +++ b/packages/omamobile-device-tegu/bin/omamobile-tegu-modem-up @@ -31,6 +31,9 @@ set -euo pipefail # The overrides are for test/modem-up's scratch root only. B=${OMAMOBILE_MODEM_MODULES:-/var/lib/omamobile-tegu/modem} LATCH=${OMAMOBILE_MODEM_LATCH:-/var/lib/omamobile/modem-bringup-started} +# reboot-to notes the boot it ends here (#403): it skips systemd's shutdown, +# and so the clean stop that removes the latch. +NOTE=${OMAMOBILE_DELIBERATE_RESTART:-/var/lib/omamobile/deliberate-restart} CP_STATE=${OMAMOBILE_MODEM_CP:-/usr/lib/omamobile-vendor/omamobile-modem-cp} CHROOT=${OMAMOBILE_VENDOR_CHROOT:-/usr/lib/omamobile-vendor/omamobile-vendor-chroot} SYS=${OMAMOBILE_SYS:-/sys} @@ -67,6 +70,17 @@ fi if [[ -d $SYS/module/cpif ]]; then say "CPIF was loaded earlier this boot; reboot before starting the modem again"; exit 1 fi +boot_id() { cat "${OMAMOBILE_BOOT_ID:-/proc/sys/kernel/random/boot_id}"; } +# A latch from a boot that reached ONLINE and then ended with reboot-to (a +# push, a reboot to the bootloader) ended on purpose, not in a hang or a +# reset: clear it with the note. A start that never reached ONLINE, or a +# note naming another boot, still refuses. +if [[ -e $LATCH && -s $NOTE ]] && grep -qx "online" "$LATCH" && + grep -q "boot $(head -c 64 "$NOTE" | tr -d '\n')\$" "$LATCH"; then + say "the last boot with the modem up ended with reboot-to: $LATCH removed" + rm -f "$LATCH" "$NOTE" + sync +fi if [[ -e $LATCH ]]; then say "an earlier start never reached ONLINE, or its boot didn't shut down cleanly ($LATCH, $(cat "$LATCH" 2>/dev/null)): look at /var/log/omamobile/modem.log and the last boot's journal, then remove it to try again" exit 1 @@ -92,7 +106,7 @@ systemctl is-active -q omamobile-tegu-modem-nosleep || --why="suspend with the modem up isn't qualified on the Pixel 9a" --mode=block sleep infinity mkdir -p "$(dirname "$LATCH")" "$LOG" -date -Is > "$LATCH"; sync "$LATCH" 2>/dev/null || sync +printf '%s boot %s\n' "$(date -Is)" "$(boot_id)" > "$LATCH"; sync "$LATCH" 2>/dev/null || sync if ((in_tree)); then say "drivers: the running kernel's" @@ -137,5 +151,6 @@ if ! $CP_STATE wait-online 60 >/dev/null 2>&1; then say "modem not ONLINE ($s); see /var/log/omamobile/modem.log. The latch stays: reboot, read the log, then remove $LATCH" exit 1 fi +echo online >> "$LATCH"; sync "$LATCH" 2>/dev/null || sync say "modem OK: CP ONLINE (log /var/log/omamobile/modem.log); the latch stays until a clean shutdown" phone_up diff --git a/packages/omamobile-device-tegu/test/modem-up b/packages/omamobile-device-tegu/test/modem-up index ec7146bc9..a91d5e599 100755 --- a/packages/omamobile-device-tegu/test/modem-up +++ b/packages/omamobile-device-tegu/test/modem-up @@ -99,3 +99,25 @@ env -i PATH="$F:/usr/bin:/bin" T="$r" OMAMOBILE_MODEM_TEST=1 OMAMOBILE_SYS="$r/s grep -q 'without allow_hw=1: reboot first' "$r/out" || fail "the refusal says to reboot" grep -qE '^(modprobe|insmod)' "$r/calls" && fail "nothing loads after the allow_hw refusal" printf 'ok - %s\n' "modem-up: refuses a link driver loaded without allow_hw" + +# reboot-to's note (#403): a latch from a boot that reached ONLINE and ended +# with reboot-to is cleared with the note, and the start goes on; one that +# never reached ONLINE, or a note naming another boot, still refuses. +note_case() { # NAME LATCH-LINES NOTE-ID -> runs with a fresh root, latch and note + local r=$t/$1; rm -rf "$r"; mkdir -p "$r/sys/bus/platform/devices/154e0000.pinctrl" "$r/sys/module/pcie_aspm/parameters" "$r/dt/cpif" "$r/log"; : > "$r/calls" + printf '%b' "$2" > "$r/latch"; printf '%s\n' "$3" > "$r/note"; echo 22222222-2222-2222-2222-222222222222 > "$r/boot_id" + env -i PATH="$F:/usr/bin:/bin" T="$r" OMAMOBILE_MODEM_TEST=1 OMAMOBILE_SYS="$r/sys" OMAMOBILE_DT="$r/dt" \ + OMAMOBILE_MODEM_LATCH="$r/latch" OMAMOBILE_DELIBERATE_RESTART="$r/note" OMAMOBILE_BOOT_ID="$r/boot_id" \ + OMAMOBILE_MODEM_CP="$t/cp" OMAMOBILE_VENDOR_CHROOT="$t/chroot" OMAMOBILE_MODEM_LOG="$r/log" OMAMOBILE_MODEM_POLL=0 \ + IN_TREE=1 MMD=1 bash bin/omamobile-tegu-modem-up --phone > "$r/out" 2>&1 +} +old=11111111-1111-1111-1111-111111111111 +note_case n1 "2026-11-03T00:00:00+00:00 boot $old\nonline\n" "$old" || { cat "$t/n1/out"; fail "a deliberate restart after ONLINE starts the modem"; } +grep -q 'ended with reboot-to' "$t/n1/out" || fail "the clear is logged" +[[ ! -e $t/n1/note ]] || fail "the note is removed with the latch" +grep -q "boot 22222222-2222-2222-2222-222222222222" "$t/n1/latch" && grep -qx online "$t/n1/latch" || fail "this boot's latch names its boot and ONLINE" +note_case n2 "2026-11-03T00:00:00+00:00 boot $old\n" "$old" && fail "a start that never reached ONLINE still refuses, note or not" +grep -q 'never reached ONLINE' "$t/n2/out" || fail "the refusal names the latch" +note_case n3 "2026-11-03T00:00:00+00:00 boot $old\nonline\n" 33333333-3333-3333-3333-333333333333 && fail "a note naming another boot clears nothing" +[[ -e $t/n3/latch && -e $t/n3/note ]] || fail "the latch and the note stay" +printf 'ok - %s\n' "modem-up: reboot-to's note clears an ONLINE latch of the boot it names, nothing else" From c56376390b865b9c2ab17d5660a738cf1ac4965a Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Tue, 3 Nov 2026 08:51:56 -0647 Subject: [PATCH 13/31] omamobile-device-tegu: start gnssd with the modem at boot, for Omarchy's Location switch omamobile-gnss serves fixes only when the modem profile runs gnssd (OMAMOBILE_MODEM_GNSS=1), and the boot start didn't ask for it, so every Location request found no gnssd and the service hit its start limit. The boot unit now runs omamobile-tegu-modem-up --phone --gnss. The daily kernel keeps the PERIC0 GPIO bus clock critical, as linux-omarchy-mobile#172 does, so the modem's GNSS traffic can't hang the palmtop. --- packages/omamobile-device-tegu/test/all | 2 ++ .../vendor/systemd/system/omamobile-tegu-modem-boot.service | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/omamobile-device-tegu/test/all b/packages/omamobile-device-tegu/test/all index 172c71631..4fb3a6c3b 100755 --- a/packages/omamobile-device-tegu/test/all +++ b/packages/omamobile-device-tegu/test/all @@ -109,6 +109,8 @@ done [[ -e $tmp/root/usr/lib/systemd/system/multi-user.target.wants/omamobile-tegu-modem-boot.service ]] \ && fail "the modem's boot start is enabled by the package (it must be opt-in)" grep -q 'omamobile-tegu-modem-boot' omamobile-device-tegu.install && fail "the install scriptlet must not enable the modem's boot start" +grep -qx 'ExecStart=/usr/bin/omamobile-tegu-modem-up --phone --gnss' vendor/systemd/system/omamobile-tegu-modem-boot.service \ + || fail "the boot start brings gnssd up with the modem, for the Location switch" # The AoC start runs at every boot (its condition skips a DTB without the # node), and answers to omamobile-aoc.service for the sensor and fp units. [[ $(readlink "$tmp/root/usr/lib/systemd/system/multi-user.target.wants/omamobile-tegu-aoc.service") == ../omamobile-tegu-aoc.service ]] \ diff --git a/packages/omamobile-device-tegu/vendor/systemd/system/omamobile-tegu-modem-boot.service b/packages/omamobile-device-tegu/vendor/systemd/system/omamobile-tegu-modem-boot.service index 3d6e113a6..9a2e7e224 100644 --- a/packages/omamobile-device-tegu/vendor/systemd/system/omamobile-tegu-modem-boot.service +++ b/packages/omamobile-device-tegu/vendor/systemd/system/omamobile-tegu-modem-boot.service @@ -3,7 +3,8 @@ # turns it on with `systemctl enable omamobile-tegu-modem-boot`. It starts the # CP once (omamobile-tegu-modem-up keeps the once-per-boot rule, the NV # checks, the failure latch and the sleep inhibitor), then the phone service -# and, when installed, the Phone and Messages bridge. With it on the palmtop +# and, when installed, the Phone and Messages bridge, with gnssd in the +# modem profile so Omarchy's Location switch gets fixes (omamobile-gnss). With it on the palmtop # doesn't suspend (the modem blocks sleep until suspend with the CP up is # qualified), so the battery drains as if awake. # @@ -22,7 +23,7 @@ ConditionPathExists=/usr/lib/omamobile-vendor/omamobile-vendor-chroot [Service] Type=oneshot RemainAfterExit=yes -ExecStart=/usr/bin/omamobile-tegu-modem-up --phone +ExecStart=/usr/bin/omamobile-tegu-modem-up --phone --gnss TimeoutStartSec=300 [Install] From 8821fe495b9a2264dfa717e66e921c7adf2d6a31 Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Tue, 3 Nov 2026 08:57:27 -0647 Subject: [PATCH 14/31] DEVICES: the 9a's modem and GNSS work, started at boot With the modem, the phone service and the bridge started at boot (this PR) the 9a's calls, texts and data need nothing by hand, and with gnssd started alongside, a session through Omarchy's Location switch had 133 of 135 GGA sentences fixed after a reboot (2026-11-03, first fix 48 s, 18 satellites). Both cells say works, with what's still open: the speakerphone echo, no earpiece route yet, and the in-tree kernel drivers in review. --- docs/DEVICES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/DEVICES.md b/docs/DEVICES.md index c1c390213..1e9339d6f 100644 --- a/docs/DEVICES.md +++ b/docs/DEVICES.md @@ -25,7 +25,7 @@ The status of each device, as verified on real hardware. Rows in the matrix have | Pixel 6 | oriole | gs101 (Tensor G1) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); native test image on one phone; slot B marked successful and `vbmeta_b` verification turned off, both without project approval; see notes) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); guarded `userdata` root on test image) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); connected output on test image) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); Panfrost render node present) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); touchscreen detected; input not checked by smoke) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); gpio-keys detected; input not checked by smoke) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); USB network and SSH on test image) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); link up; traffic not checked by smoke) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); controller powered; pairing not checked) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); charge and temperature reported) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); charging reported; control not checked) | no | no | no | no | no | no | no | no | no | no | no | | Pixel 4 | flame | SM8150 (Snapdragon 855) | testing (temporary RAM boot; [notes](../device/flame/BRINGUP-M1.md)) | testing (RAM probe; all UFS read-only) | testing (1080x2280 console; software desktop in separate Arch payload) | testing (separate Arch payload; FD640 contexts, llvmpipe desktop) | testing (separate Arch payload; events and PIN unlock verified) | no | testing (NCM + ACM + SSH; sustained transfers can disconnect) | testing (guarded RAM scan; association untested) | no | no | no | no | no | no | - | no | no | no | no | no | no | - | | Pixel 4 XL ([notes](../device/coral/NOTES.md)) | coral | SM8150 (Snapdragon 855) | WIP (direct ABL v2 boot on the test handset's slot A; slot-B install and §3.1 entry pending; [notes](../device/coral/BRINGUP-M1.md)) | testing (read-only `blockdev` guard + RAM `overlayfs`) | testing (1440x3040@60Hz S6E3HC2 DSC 1.1 KMS, DPMS, brightness) | testing (Adreno 640 / FD640 Mesa Freedreno, Hyprland) | testing (FTS SPI multitouch + read-only flash guard) | testing (power via `qcom-pon` + volume via `gpio-keys`) | testing (CDC ECM + ACM + SSH; stays up with host USB switched off) | testing (`WCN3990` `ath10k_snoc` + `rmtfs -r`, WPA2/DHCP/HTTPS; radio sessions ran before the modem baseline) | WIP (`WCN3990` `hci_qca` `hci0` up + BLE scan; audio/pairing open) | WIP (PM8150B ADC `VBAT_SNS` voltage + FG temp; aftermarket pack on test unit: no reply from `1-0036`) | testing (PM8150B SMB5 charger with `4.20 V` / `500 mA` kernel clamp) | testing (`CS40L25A` I2C click waveform) | testing (PM8150L flash LEDs + quick-settings tile) | no | - | testing (QDSP6 + dual `CS35L36` amps capped at `-26 dB` + `IA8508` SPI mic DSP) | testing (`SLPI` + `fastrpc` + RAM-backed `hexagonrpcd` + QMI SSC: 7 sensors + Soli radar) | WIP (`MPSS` boots with `rmtfs -r` + patched `tqftpserv`, SIM detected; no IPA/voice yet; radio sessions ran before the modem baseline) | no | testing (`CAMSS` + `IMX363`, `IMX481`, `IMX520`, dual `OV7251` NIR; `libcamera` softISP) | no | - | -| Pixel 9a ([notes](../device/tegu/NOTES.md)) | tegu | zumapro (Tensor G4) | works ([#28](https://github.com/derekross/omarchy-mobile/issues/28): native boot from slot B, the Arch root on `userdata`, `omamobile-device-tegu`; slot B was marked successful by hand on 2026-10-28 with the `devinfo` write approved on 2026-10-22, now on hold ([#125](https://github.com/derekross/omarchy-mobile/pull/125)), unmarked by the 10-31 fastboot recovery and marked again on 2026-10-31 during the hold ([record](../device/tegu/NOTES.md#2026-10-31-a-fastboot-flash-of-slot-b-cleared-its-successful-mark-and-b-was-marked-again)), and the package does not mark it; unpublished kernel: the SoC and board device tree is [kernel #81](https://github.com/derekross/linux-omarchy-mobile/pull/81), merged; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (UFS behind the read-only guard; unpublished kernel; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (120 Hz through gs-decon; the panel driver [kernel #89](https://github.com/derekross/linux-omarchy-mobile/pull/89), 120 Hz [kernel #88](https://github.com/derekross/linux-omarchy-mobile/pull/88), merged, the display DT, merged with [kernel #96](https://github.com/derekross/linux-omarchy-mobile/pull/96); brightness, DPMS off and on and the 60/120 Hz switch on the boot of [kernel #125](https://github.com/derekross/linux-omarchy-mobile/pull/125), merged, which also checks the panel's ID; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on), [brightness record](../device/tegu/NOTES.md#2026-11-01-afternoon-and-evening-wi-fi-from-the-package-the-wake-and-the-replug-storage-idle-the-panel-id)) | works (Panthor, the desktop renders, runtime suspend when idle; this boot runs at a fixed 160 MHz, so frequency scaling and the GPU thermal zone count as in review, [kernel #85](https://github.com/derekross/linux-omarchy-mobile/pull/85) in review, [kernel #87](https://github.com/derekross/linux-omarchy-mobile/pull/87) in review; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (Synaptics S3908 over SPI, [kernel #81](https://github.com/derekross/linux-omarchy-mobile/pull/81), merged; survives sleep, [kernel #82](https://github.com/derekross/linux-omarchy-mobile/pull/82), merged; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (gpio-keys: power and volume; the power key wakes from sleep; unpublished kernel; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (CDC NCM and SSH; reconnects after a replug, `omamobile-tegu-usb-rescue`, also after a replug the gadget didn't see ([#280](https://github.com/derekross/omarchy-mobile/pull/280); [the replug record](../device/tegu/NOTES.md#2026-10-28-what-the-device-tables-claims-rest-on)); [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (BCM4383 on PCIe channel 1 through the shared gs201 host and zuma PHY, [kernel #178](https://github.com/derekross/linux-omarchy-mobile/pull/178) on [kernel #156](https://github.com/derekross/linux-omarchy-mobile/pull/156), in review, and brcmfmac, [kernel #56](https://github.com/derekross/linux-omarchy-mobile/pull/56) in review; started at boot by `omamobile-device-tegu` 0.2.4 ([#238](https://github.com/derekross/omarchy-mobile/pull/238)) with the extractor's firmware; WPA2 with iwd, kept loaded across sleep by the package's sleep hook; [record](../device/tegu/NOTES.md#2026-11-01-afternoon-and-evening-wi-fi-from-the-package-the-wake-and-the-replug-storage-idle-the-panel-id)) | works (hci_uart on the bootloader's address, BlueZ, A2DP; [kernel #94](https://github.com/derekross/linux-omarchy-mobile/pull/94); unpublished kernel; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (MAX77779 gauge with temperature, current and time estimates through UPower; [kernel #66](https://github.com/derekross/linux-omarchy-mobile/pull/66); unpublished kernel; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (the MAX77779 charger binds from the device tree, [kernel #161](https://github.com/derekross/linux-omarchy-mobile/pull/161), merged, built by [#227](https://github.com/derekross/omarchy-mobile/pull/227); the charge limit in `omamobile-device-tegu` 0.2.3 holds charging off at the limit through `charge_behaviour` and lets it run again 5 below; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | works (CS40L26A through feedbackd, with brownout prevention, [kernel #95](https://github.com/derekross/linux-omarchy-mobile/pull/95); its DT [kernel #96](https://github.com/derekross/linux-omarchy-mobile/pull/96), merged; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (LM3644, 25 steps to 75 mA, quick-settings tile; its DT [kernel #96](https://github.com/derekross/linux-omarchy-mobile/pull/96), merged; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | testing (Omarchy's Location switch serves fixes from GPS, Galileo, BeiDou and GLONASS once the modem is up, started by hand: a 30-minute session through the switch on 2026-11-01 (omamobile-gnss 0.2.5's start, the modem link left to cycle) ran clean, 1763 of 1765 GGA sentences fixed, first fix 37 s after a client connected; needs [kernel #150](https://github.com/derekross/linux-omarchy-mobile/pull/150), merged, the PERIC0 clock fix [kernel #172](https://github.com/derekross/linux-omarchy-mobile/pull/172) in review (without it the modem link hung the palmtop within minutes) and [#114](https://github.com/derekross/omarchy-mobile/pull/114); [plan](../device/tegu/MODEM-PLAN.md), record with [#202](https://github.com/derekross/omarchy-mobile/pull/202)) | works (audio and sensor DSP through the GSA and Trusty, 93 services, started at boot by `omamobile-device-tegu` 0.2.3 from the device tree, [kernel #162](https://github.com/derekross/linux-omarchy-mobile/pull/162) in review; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | works (the TAS2572 amplifiers and the microphone through the AoC card and PipeWire, at boot with the AoC: a tone from the speaker, the microphone at -32 dBFS; speakers at a -10 dB ceiling; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | works (accelerometer, light, proximity, compass and gyroscope through the AoC and the sensor proxy, at boot with the AoC; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | WIP (registered on LTE, mobile data over `rmnet0`, texts both ways and speakerphone calls in and out with `omamobile-modem-sit` ([#356](https://github.com/derekross/omarchy-mobile/pull/356), [#367](https://github.com/derekross/omarchy-mobile/pull/367)), on the owner's kernel and on in-tree drivers from the open kernel PRs ([kernel #187](https://github.com/derekross/linux-omarchy-mobile/pull/187), [kernel #162](https://github.com/derekross/linux-omarchy-mobile/pull/162)); `omamobile-device-tegu`'s opt-in boot unit starts the modem and the phone service ([#372](https://github.com/derekross/omarchy-mobile/pull/372)), the kernel PRs aren't merged, and calls have no echo cancellation or earpiece yet; [plan](../device/tegu/MODEM-PLAN.md), [record](../device/tegu/MODEM-PLAN.md#sim-test-results-2026-11-02-730-rc6-omamobile-tegu-s2mpg15-m1-g991042e2eff3-dirty)) | works (NXP ST54L through nxp-nci, its clock pad from the PMU ([kernel #104](https://github.com/derekross/linux-omarchy-mobile/pull/104) and [kernel #105](https://github.com/derekross/linux-omarchy-mobile/pull/105), merged, with [kernel #131](https://github.com/derekross/linux-omarchy-mobile/pull/131), merged), loaded at boot by `omamobile-device-tegu` 0.2.3 with neard and the link opener: polls with no I2C errors and read a payment card; polling stops before sleep; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | works (main, ultrawide and front from the device tree, [kernel #164](https://github.com/derekross/linux-omarchy-mobile/pull/164) in review, with [kernel #63](https://github.com/derekross/linux-omarchy-mobile/pull/63) and [kernel #103](https://github.com/derekross/linux-omarchy-mobile/pull/103) in review: their drivers load at boot with nothing by hand, libcamera lists all three, and each streams, main at 19 fps and the others at 30 fps at 1280x960; basic picture quality through libcamera's software ISP; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | testing (s2idle when asked for, or through the shell's auto-sleep with the `omamobile-sleep` toggle on, which ships off; the power key lights the lock screen on the first press ([#268](https://github.com/derekross/omarchy-mobile/pull/268), [#275](https://github.com/derekross/omarchy-mobile/pull/275)), and the RTC wakes it; on 2026-11-01 thirty attended 120 s sleeps ([plan](../device/tegu/SLEEP-PLAN.md) S1) and a day of real use with auto-sleep on ([record](../device/tegu/NOTES.md#2026-11-01-afternoon-and-evening-wi-fi-from-the-package-the-wake-and-the-replug-storage-idle-the-panel-id)) all woke, but six test sleeps since 10-28 did not (one in 21 on the clock-fix kernel on 11-01, and one in 127 in an overnight series of 120 s sleeps on 11-01 to 11-02), so sleep tests stay attended ([plan](../device/tegu/SLEEP-PLAN.md) S1); the drain is about 300 mA asleep, the same as awake with the screen off, because nothing below the CPUs sleeps yet; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (opt-in) (enrolls, matches, refuses other fingers and unlocks the lock screen through Trusty and `omamobile-fingerprint`, 2026-10-29; the sensor binds from the device tree, [kernel #165](https://github.com/derekross/linux-omarchy-mobile/pull/165) in review, with [kernel #126](https://github.com/derekross/linux-omarchy-mobile/pull/126), merged; opt-in as on the 7 Pro, because the service's first run writes Trusty's secure storage; [plan](../device/tegu/FINGERPRINT-PLAN.md), [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | +| Pixel 9a ([notes](../device/tegu/NOTES.md)) | tegu | zumapro (Tensor G4) | works ([#28](https://github.com/derekross/omarchy-mobile/issues/28): native boot from slot B, the Arch root on `userdata`, `omamobile-device-tegu`; slot B was marked successful by hand on 2026-10-28 with the `devinfo` write approved on 2026-10-22, now on hold ([#125](https://github.com/derekross/omarchy-mobile/pull/125)), unmarked by the 10-31 fastboot recovery and marked again on 2026-10-31 during the hold ([record](../device/tegu/NOTES.md#2026-10-31-a-fastboot-flash-of-slot-b-cleared-its-successful-mark-and-b-was-marked-again)), and the package does not mark it; unpublished kernel: the SoC and board device tree is [kernel #81](https://github.com/derekross/linux-omarchy-mobile/pull/81), merged; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (UFS behind the read-only guard; unpublished kernel; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (120 Hz through gs-decon; the panel driver [kernel #89](https://github.com/derekross/linux-omarchy-mobile/pull/89), 120 Hz [kernel #88](https://github.com/derekross/linux-omarchy-mobile/pull/88), merged, the display DT, merged with [kernel #96](https://github.com/derekross/linux-omarchy-mobile/pull/96); brightness, DPMS off and on and the 60/120 Hz switch on the boot of [kernel #125](https://github.com/derekross/linux-omarchy-mobile/pull/125), merged, which also checks the panel's ID; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on), [brightness record](../device/tegu/NOTES.md#2026-11-01-afternoon-and-evening-wi-fi-from-the-package-the-wake-and-the-replug-storage-idle-the-panel-id)) | works (Panthor, the desktop renders, runtime suspend when idle; this boot runs at a fixed 160 MHz, so frequency scaling and the GPU thermal zone count as in review, [kernel #85](https://github.com/derekross/linux-omarchy-mobile/pull/85) in review, [kernel #87](https://github.com/derekross/linux-omarchy-mobile/pull/87) in review; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (Synaptics S3908 over SPI, [kernel #81](https://github.com/derekross/linux-omarchy-mobile/pull/81), merged; survives sleep, [kernel #82](https://github.com/derekross/linux-omarchy-mobile/pull/82), merged; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (gpio-keys: power and volume; the power key wakes from sleep; unpublished kernel; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (CDC NCM and SSH; reconnects after a replug, `omamobile-tegu-usb-rescue`, also after a replug the gadget didn't see ([#280](https://github.com/derekross/omarchy-mobile/pull/280); [the replug record](../device/tegu/NOTES.md#2026-10-28-what-the-device-tables-claims-rest-on)); [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (BCM4383 on PCIe channel 1 through the shared gs201 host and zuma PHY, [kernel #178](https://github.com/derekross/linux-omarchy-mobile/pull/178) on [kernel #156](https://github.com/derekross/linux-omarchy-mobile/pull/156), in review, and brcmfmac, [kernel #56](https://github.com/derekross/linux-omarchy-mobile/pull/56) in review; started at boot by `omamobile-device-tegu` 0.2.4 ([#238](https://github.com/derekross/omarchy-mobile/pull/238)) with the extractor's firmware; WPA2 with iwd, kept loaded across sleep by the package's sleep hook; [record](../device/tegu/NOTES.md#2026-11-01-afternoon-and-evening-wi-fi-from-the-package-the-wake-and-the-replug-storage-idle-the-panel-id)) | works (hci_uart on the bootloader's address, BlueZ, A2DP; [kernel #94](https://github.com/derekross/linux-omarchy-mobile/pull/94); unpublished kernel; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (MAX77779 gauge with temperature, current and time estimates through UPower; [kernel #66](https://github.com/derekross/linux-omarchy-mobile/pull/66); unpublished kernel; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (the MAX77779 charger binds from the device tree, [kernel #161](https://github.com/derekross/linux-omarchy-mobile/pull/161), merged, built by [#227](https://github.com/derekross/omarchy-mobile/pull/227); the charge limit in `omamobile-device-tegu` 0.2.3 holds charging off at the limit through `charge_behaviour` and lets it run again 5 below; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | works (CS40L26A through feedbackd, with brownout prevention, [kernel #95](https://github.com/derekross/linux-omarchy-mobile/pull/95); its DT [kernel #96](https://github.com/derekross/linux-omarchy-mobile/pull/96), merged; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (LM3644, 25 steps to 75 mA, quick-settings tile; its DT [kernel #96](https://github.com/derekross/linux-omarchy-mobile/pull/96), merged; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (Omarchy's Location switch serves fixes from GPS, Galileo, BeiDou and GLONASS through the modem's Kepler, with gnssd started with the modem at boot by `omamobile-device-tegu`'s opt-in boot unit ([#372](https://github.com/derekross/omarchy-mobile/pull/372)): on 2026-11-03, after a reboot with nothing started by hand, a session through the switch's socket had 133 of 135 GGA sentences fixed, first fix 48 s after the client connected, 18 satellites; a 30-minute session on 2026-11-01 had 1763 of 1765; needs [kernel #150](https://github.com/derekross/linux-omarchy-mobile/pull/150) and the PERIC0 clock fix [kernel #172](https://github.com/derekross/linux-omarchy-mobile/pull/172), both merged, and [#114](https://github.com/derekross/omarchy-mobile/pull/114), merged; [plan](../device/tegu/MODEM-PLAN.md)) | works (audio and sensor DSP through the GSA and Trusty, 93 services, started at boot by `omamobile-device-tegu` 0.2.3 from the device tree, [kernel #162](https://github.com/derekross/linux-omarchy-mobile/pull/162) in review; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | works (the TAS2572 amplifiers and the microphone through the AoC card and PipeWire, at boot with the AoC: a tone from the speaker, the microphone at -32 dBFS; speakers at a -10 dB ceiling; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | works (accelerometer, light, proximity, compass and gyroscope through the AoC and the sensor proxy, at boot with the AoC; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | works (calls in and out on the speakerphone, texts both ways, mobile data over the device `omamobile-sit-data` finds, with the Phone and Messages apps on the bridge ([#356](https://github.com/derekross/omarchy-mobile/pull/356), [#364](https://github.com/derekross/omarchy-mobile/pull/364), [#367](https://github.com/derekross/omarchy-mobile/pull/367), [#371](https://github.com/derekross/omarchy-mobile/pull/371)); `omamobile-device-tegu`'s opt-in boot unit starts the modem, the phone service and the bridge ([#372](https://github.com/derekross/omarchy-mobile/pull/372)); on the owner's kernel with the bring-up modules, and on in-tree drivers from [kernel #187](https://github.com/derekross/linux-omarchy-mobile/pull/187) and [kernel #162](https://github.com/derekross/linux-omarchy-mobile/pull/162), in review; the far end still hears an echo on the speakerphone ([#378](https://github.com/derekross/omarchy-mobile/pull/378)) and there's no earpiece route yet; [plan](../device/tegu/MODEM-PLAN.md), [record](../device/tegu/MODEM-PLAN.md#sim-test-results-2026-11-02-730-rc6-omamobile-tegu-s2mpg15-m1-g991042e2eff3-dirty)) | works (NXP ST54L through nxp-nci, its clock pad from the PMU ([kernel #104](https://github.com/derekross/linux-omarchy-mobile/pull/104) and [kernel #105](https://github.com/derekross/linux-omarchy-mobile/pull/105), merged, with [kernel #131](https://github.com/derekross/linux-omarchy-mobile/pull/131), merged), loaded at boot by `omamobile-device-tegu` 0.2.3 with neard and the link opener: polls with no I2C errors and read a payment card; polling stops before sleep; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | works (main, ultrawide and front from the device tree, [kernel #164](https://github.com/derekross/linux-omarchy-mobile/pull/164) in review, with [kernel #63](https://github.com/derekross/linux-omarchy-mobile/pull/63) and [kernel #103](https://github.com/derekross/linux-omarchy-mobile/pull/103) in review: their drivers load at boot with nothing by hand, libcamera lists all three, and each streams, main at 19 fps and the others at 30 fps at 1280x960; basic picture quality through libcamera's software ISP; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | testing (s2idle when asked for, or through the shell's auto-sleep with the `omamobile-sleep` toggle on, which ships off; the power key lights the lock screen on the first press ([#268](https://github.com/derekross/omarchy-mobile/pull/268), [#275](https://github.com/derekross/omarchy-mobile/pull/275)), and the RTC wakes it; on 2026-11-01 thirty attended 120 s sleeps ([plan](../device/tegu/SLEEP-PLAN.md) S1) and a day of real use with auto-sleep on ([record](../device/tegu/NOTES.md#2026-11-01-afternoon-and-evening-wi-fi-from-the-package-the-wake-and-the-replug-storage-idle-the-panel-id)) all woke, but six test sleeps since 10-28 did not (one in 21 on the clock-fix kernel on 11-01, and one in 127 in an overnight series of 120 s sleeps on 11-01 to 11-02), so sleep tests stay attended ([plan](../device/tegu/SLEEP-PLAN.md) S1); the drain is about 300 mA asleep, the same as awake with the screen off, because nothing below the CPUs sleeps yet; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (opt-in) (enrolls, matches, refuses other fingers and unlocks the lock screen through Trusty and `omamobile-fingerprint`, 2026-10-29; the sensor binds from the device tree, [kernel #165](https://github.com/derekross/linux-omarchy-mobile/pull/165) in review, with [kernel #126](https://github.com/derekross/linux-omarchy-mobile/pull/126), merged; opt-in as on the 7 Pro, because the service's first run writes Trusty's secure storage; [plan](../device/tegu/FINGERPRINT-PLAN.md), [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | | Pixel 8 Pro ([notes](../device/husky/NOTES.md)) | husky | zuma (Tensor G3) | WIP ([#1](https://github.com/derekross/omarchy-mobile/issues/1): slot B, not marked successful; Omarchy's image from the signed repository boots to the lock screen; the zuma device tree is merged ([kernel #13](https://github.com/derekross/linux-omarchy-mobile/pull/13), [#53](https://github.com/derekross/linux-omarchy-mobile/pull/53))) | testing (UFS at HS-G4 behind the read-only guard; Arch on `userdata`; [UFS-PLAN](../device/husky/UFS-PLAN.md)) | WIP (simple-framebuffer: console and Omarchy's lock screen) | no | testing (ST FTM5 over SPI, merged, [kernel #153](https://github.com/derekross/linux-omarchy-mobile/pull/153); [NOTES](../device/husky/NOTES.md)) | testing (power and volume through `gpio-keys`, merged, [kernel #148](https://github.com/derekross/linux-omarchy-mobile/pull/148); [NOTES](../device/husky/NOTES.md)) | testing (USB and SSH) | testing (BCM4398 on a test kernel, [kernel #156](https://github.com/derekross/linux-omarchy-mobile/pull/156); firmware from the owner's image, [#214](https://github.com/derekross/omarchy-mobile/pull/214); [NOTES](../device/husky/NOTES.md)) | no | testing (gauge with Google's ATL model through a bring-up overlay, temperature, MFD, on a test kernel, [kernel #163](https://github.com/derekross/linux-omarchy-mobile/pull/163); [notes](../device/husky/BATTERY-NOTES.md)) | testing (the charger driver by hand under a dead-man tool, slow on plain 5 V, on a test kernel, [kernel #163](https://github.com/derekross/linux-omarchy-mobile/pull/163); [notes](../device/husky/BATTERY-NOTES.md)) | no | no | no | no | no | no | no | no | no | no | no | | Pixel 7 ([notes](../device/panther/NOTES.md)) | panther | gs201 (Tensor G2) | WIP (slot B, not marked successful; Arch and Hyprland boot; [BRINGUP-M1](../device/panther/BRINGUP-M1.md); board file merged, [kernel #108](https://github.com/derekross/linux-omarchy-mobile/pull/108)) | testing (UFS behind the read-only guard; Arch on `userdata`; merged, [kernel #108](https://github.com/derekross/linux-omarchy-mobile/pull/108)) | WIP (simple-framebuffer: console and the Hyprland desktop; brightness and display off/on over DCS through the S6E3FC3 panel driver and device-panther 0.1.4, in review, [kernel #177](https://github.com/derekross/linux-omarchy-mobile/pull/177); [DISPLAY-PLAN](../device/panther/DISPLAY-PLAN.md)) | testing (Panthor on the Mali-G710; Hyprland renders on it; merged through [kernel #134](https://github.com/derekross/linux-omarchy-mobile/pull/134), with the always-on rule in device-panther 0.1.1, [#145](https://github.com/derekross/omarchy-mobile/pull/145); [notes](../device/panther/NOTES.md#2026-10-28-the-gpu-and-the-haptics-power-off-and-usb-after-a-replug)) | WIP (FocalTech FT3658: touches drive Hyprland and unlock the PIN screen on a test kernel; the driver, [kernel #109](https://github.com/derekross/linux-omarchy-mobile/pull/109), and the touch node, [kernel #134](https://github.com/derekross/linux-omarchy-mobile/pull/134), are merged; stock's interrupt pull-up and CS delay, [kernel #166](https://github.com/derekross/linux-omarchy-mobile/pull/166), the driver's review fixes, [kernel #133](https://github.com/derekross/linux-omarchy-mobile/pull/133), and the kernel option with the touch notes, [#149](https://github.com/derekross/omarchy-mobile/pull/149), are merged) | testing (gpio-keys: power, volume; merged, [kernel #108](https://github.com/derekross/linux-omarchy-mobile/pull/108)) | testing (USB and SSH; merged, [kernel #108](https://github.com/derekross/linux-omarchy-mobile/pull/108); a replug comes back through `omamobile-usb-rescue` in device-panther 0.1.3, on the MAX77759's I2C bus, merged, [kernel #167](https://github.com/derekross/linux-omarchy-mobile/pull/167); [notes](../device/panther/NOTES.md#2026-10-29-usb-comes-back-after-a-replug-u1)) | no | no | WIP (MAX77759 fuel gauge with stock's battery model on a test kernel: percentage, capacity and temperature in upower and the bar; in review, [kernel #171](https://github.com/derekross/linux-omarchy-mobile/pull/171) and the driver fix [#170](https://github.com/derekross/linux-omarchy-mobile/pull/170); [BATTERY-PLAN](../device/panther/BATTERY-PLAN.md)) | no | testing (CS40L26 with the phone's own firmware, `tools/extract-vendor-firmware -d panther`; merged through [kernel #134](https://github.com/derekross/linux-omarchy-mobile/pull/134), with the feedbackd rule in device-panther 0.1.1, [#145](https://github.com/derekross/omarchy-mobile/pull/145); [notes](../device/panther/NOTES.md#2026-10-28-the-gpu-and-the-haptics-power-off-and-usb-after-a-replug)) | no | no | no | no | no | no | no | no | no (s2idle by default since [kernel #134](https://github.com/derekross/linux-omarchy-mobile/pull/134) and device-panther 0.1.1; not run yet) | no | | OnePlus 13 ([notes](../device/dodge/NOTES.md)) | dodge | sm8750 (Snapdragon 8 Elite) | testing (kernel [mrlund/linux-omarchy-mobile `dodge-v3-20261101`](https://github.com/mrlund/linux-omarchy-mobile/tree/dodge-v3-20261101); [kernel #115](https://github.com/derekross/linux-omarchy-mobile/pull/115) closed; [BRINGUP](../device/dodge/BRINGUP-M1.md), [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing ([notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing (msm/dpu; warm-boot drop fixed; [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing (Adreno 830 / gpu2; Vulkan untested; [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing ([notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing ([notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing (CDC NCM + SSH; gadget stuck after replug until reboot; kernel [mrlund/linux-omarchy-mobile `dodge-v3-20261101`](https://github.com/mrlund/linux-omarchy-mobile/tree/dodge-v3-20261101); [kernel #115](https://github.com/derekross/linux-omarchy-mobile/pull/115) closed; [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing (WCN7860 / ath12k; [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing (pairing; A2DP untested; kernel [mrlund/linux-omarchy-mobile `dodge-v3-20261101`](https://github.com/mrlund/linux-omarchy-mobile/tree/dodge-v3-20261101); [kernel #115](https://github.com/derekross/linux-omarchy-mobile/pull/115) closed; [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing (gauge; charging path not claimed; kernel [mrlund/linux-omarchy-mobile `dodge-v3-20261101`](https://github.com/mrlund/linux-omarchy-mobile/tree/dodge-v3-20261101); [kernel #115](https://github.com/derekross/linux-omarchy-mobile/pull/115) closed; [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | no | no | no | no | - | testing (speakers, earpiece, mics; headset plug untested; [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing (accel, prox, compass; autorotate; [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing (LTE data; calls/SMS untested; opt-in flag; [modem](../device/dodge/modem/README.md), [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | no | no | WIP (s2idle not default; [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | no | From fda61e0d5becc0da039704996be352af86b92e9c Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Tue, 3 Nov 2026 09:04:13 -0647 Subject: [PATCH 15/31] device/tegu TELEPHONY-PLAN: the boot start's first record (2.7) Two reboots on the palmtop with the boot unit enabled, the NV check, the UFS count after a shutdown with the CP up and a phone-smoke report, as Derek asked before the README tells anyone to enable it. --- device/tegu/TELEPHONY-PLAN.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/device/tegu/TELEPHONY-PLAN.md b/device/tegu/TELEPHONY-PLAN.md index d19766400..ba6764571 100644 --- a/device/tegu/TELEPHONY-PLAN.md +++ b/device/tegu/TELEPHONY-PLAN.md @@ -132,6 +132,34 @@ successful, a kernel with linux-omarchy-mobile#172, an off-repo NV backup. Record each run here with the date, `uname -r`, the package versions, the phone-smoke report and the UFS count. +**2026-11-03, the palmtop** (the daily kernel +`7.3.0-rc6-omamobile-tegu-s2mpg15-m1-g991042e2eff3-dirty`; slot B marked +successful on 2026-10-31 with no fastboot write since; the kernel keeps the +PERIC0 GPIO bus clock critical, as #172 +does; on the charger; `omamobile-device-tegu` 0.2.12, `omamobile-modem-sit` +0.3.36, `omamobile-mmd` 0.1.4 and `omamobile-gnss` 0.2.7, all from this +stack): + +1. Read-only: `tools/nv-backup -d tegu --check` against the 2026-10-28 + backup (#407): every NV partition the same. Passed. +2. Enabled `omamobile-tegu-modem-boot`. Passed. +3. `systemctl reboot` with the unit enabled: "modem OK: CP ONLINE", the + phone service and the bridge queued, IMS registered with nothing started + by hand, gnssd running, the latch reading `boot ` and `online`, the + inhibitor held. A GNSS session through the Location socket had 133 of 135 + GGA sentences fixed (first fix 48 s). Passed. +4. A second `systemctl reboot` with the CP up: the profile's unit stopped + cleanly, the latch was removed and the next boot wrote its own; no + `ufshcd_err_handler` pass in the boot that shut down. Passed. + +`tools/phone-smoke` on the second boot: every required check ok (boot, the +storage guard, root, kernel health, USB, session), and display, GPU, lock, +touch, buttons, Wi-Fi, Bluetooth, battery, sound card, sensors, cameras and +thermal ok. It flagged a stale bring-up unit in `/etc/systemd/system` from +2026-10-28 (`omamobile-tegu-audio.service`, failing), now moved aside, and +new dmesg lines from NFC (an unknown notification opcode) and CPIF (packets +for a channel nobody has opened); neither came with a fault. + Qualification, attended and on the charger: boot to ONLINE, data and texts; the inhibitor; NV and UFS unchanged; then shutdown and reboot on their own. Suspend with the CP on needs its own tests, with NFC polling stopped, and From fcb2c9d1df1632fab23ca79987e850a7fd92b827 Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Tue, 3 Nov 2026 09:22:00 -0647 Subject: [PATCH 16/31] device/tegu TELEPHONY-PLAN: section 2's items 2 to 6 read as sentences again The status words added in #360 left each item's old sentence hanging after them. Each item now says what #372 does and what is still the target, in whole sentences. --- device/tegu/TELEPHONY-PLAN.md | 40 +++++++++++++++++------------------ 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/device/tegu/TELEPHONY-PLAN.md b/device/tegu/TELEPHONY-PLAN.md index ba6764571..cc4589cb9 100644 --- a/device/tegu/TELEPHONY-PLAN.md +++ b/device/tegu/TELEPHONY-PLAN.md @@ -82,39 +82,39 @@ Opt-in and attended at first, with sleep blocked for the boot. policy. `-dd` is never the install method. 2. **One modem service.** *Partly in #372:* `omamobile-tegu-modem-up` is packaged, with the explicit CP ONLINE check and an opt-in boot unit, and - #371 replaces the copied sitd unit with device drop-ins. *Target:* the - transient unit. Give it tegu's start (today the bring-up script - `/usr/local/bin/omamobile-tegu-modem-up` and its transient unit) with the - AoC's ordering, and drop the copied `/etc/systemd/system/omamobile-sitd.service` - and the transient-unit workaround. sitd starts only after an explicit + #371 replaces the copied sitd unit with device drop-ins. *Target:* tegu's + start as one modem service with the AoC's ordering, in place of the + transient unit `omamobile-tegu-modem-up` runs the profile in, and no + copied `/etc/systemd/system/omamobile-sitd.service` or transient-unit + workaround on any palmtop. sitd starts only after an explicit "CP ONLINE" check: a unit being active isn't enough. 3. **Preflight before any hardware access:** *Target.* #372 runs the profile's own check (NV read-only, unmounted, checksums of its RAM copies), after the drivers load because it needs CPIF's ports; the - up-front NV-only check and the gaps below are still to do. the kernel, DT, firmware, - private provisioning and board properties present; the six NV and - firmware partitions found by `PARTNAME`, read-only, unmounted and - matching the checksums. Today's profile hashes five RAM copies, doesn't + up-front NV-only check and the gaps below are still to do: the kernel, + DT, firmware, private provisioning and board properties present, and the + six NV and firmware partitions found by `PARTNAME`, read-only, unmounted + and matching the checksums. Today's profile hashes five RAM copies, doesn't hash `modem_b`, and exempts `persist` from its read-only check: the boot preflight closes those gaps. A mismatch stops the start; the baseline is never refreshed automatically. 4. **Two guards:** *Partly in #372:* a boot that has loaded CPIF refuses a - second start, and the latch is written and synced before any driver. *Target:* - keeping it from ONLINE until a clean shutdown. an atomic per-boot "attempted" marker, never cleared in - that boot, and a persistent failure latch written and synced before any - driver loads, kept through the whole phone-service start while this is - being qualified. No automatic CP or sitd restart, module unload, power + second start, and the latch is written and synced before any driver and + kept from ONLINE until a clean shutdown. *Target:* an atomic per-boot + "attempted" marker, never cleared in that boot, and the failure latch + kept through the whole phone-service start while this is being + qualified. No automatic CP or sitd restart, module unload, power cycle or latch clearing. -5. **Sleep:** *Done in #372*, before the drivers and until the reboot. take and confirm the sleep inhibitor before the modem drivers - load, and hold it past sitd and the profile, until shutdown. Keep the +5. **Sleep:** *Done in #372:* the sleep inhibitor is taken and confirmed + before the modem drivers load, and held past sitd and the profile until + the reboot. Keep the owner's auto-sleep setting as it is; the inhibitor blocks the sleep and says why. No suspend hook that stops and restarts the modem. Low-battery actions must not force an unqualified suspend. 6. **Failure stays visible:** *Partly in #372:* the stage is reported and - the latch stays after a failed start, with no retry. *Target:* the shutdown - order through one modem service. the failed stage reported, diagnostics left in - place, no retry. At shutdown, the established order: the phone service's - cleanup, the CP off, then rfsd. + the latch stays after a failed start, with no retry. *Target:* + diagnostics left in place, and the shutdown order through one modem + service: the phone service's cleanup, the CP off, then rfsd. ### 2.7 Enabling the boot start (gated runbook, #372) From 12ab38f5280db99001b46fe53ab8455a999e17a2 Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Tue, 3 Nov 2026 10:54:38 -0647 Subject: [PATCH 17/31] omamobile-device-tegu: a reboot with the modem up clears its latch The profile unit's ExecStopPost removed the latch only when SERVICE_RESULT was success, and at a shutdown it never is: the CP's power-off in ExecStop ends rfsd or cbd before systemd's SIGINT, so the profile's supervisor exits 1. On the palmtop on 2026-11-03 a systemctl reboot with the modem up left the latch, and the next boot refused the modem. ExecStopPost now runs omamobile-tegu-modem-up --stopped, which removes this boot's latch once the start reached ONLINE, whatever the result, as omamobile-modem-start --stopped does on the Pixel 7 Pro. A hang or a reset never reaches it, so those still refuse the next boot. --- .../bin/omamobile-tegu-modem-up | 34 ++++++++++++++++--- packages/omamobile-device-tegu/test/modem-up | 26 +++++++++++++- 2 files changed, 54 insertions(+), 6 deletions(-) diff --git a/packages/omamobile-device-tegu/bin/omamobile-tegu-modem-up b/packages/omamobile-device-tegu/bin/omamobile-tegu-modem-up index 773b92628..cd12cab5b 100644 --- a/packages/omamobile-device-tegu/bin/omamobile-tegu-modem-up +++ b/packages/omamobile-device-tegu/bin/omamobile-tegu-modem-up @@ -9,6 +9,8 @@ # --phone after CP ONLINE, start omamobile-sitd, and omamobile-mmd when # it's installed (Phone and Messages); omamobile-tegu-modem.service # runs it this way at boot when the owner has enabled it +# omamobile-tegu-modem-up --stopped +# the profile unit's ExecStopPost: removes this boot's latch # # The CP drivers come from the running kernel when it carries them (cpif and # pcie_gs201_cp, with the device tree's cpif node: the published kernel), else @@ -40,16 +42,38 @@ SYS=${OMAMOBILE_SYS:-/sys} DT=${OMAMOBILE_DT:-/proc/device-tree} LOG=${OMAMOBILE_MODEM_LOG:-/var/log/omamobile} say() { printf 'omamobile-tegu-modem-up: %s\n' "$*"; } -gnss=0 phone=0 +gnss=0 phone=0 stopped=0 for a in "$@"; do case $a in --gnss) gnss=1 ;; --phone) phone=1 ;; - *) say "usage: omamobile-tegu-modem-up [--gnss] [--phone]"; exit 2 ;; + --stopped) stopped=1 ;; + *) say "usage: omamobile-tegu-modem-up [--gnss] [--phone] | --stopped"; exit 2 ;; esac done [[ $EUID -eq 0 || -n ${OMAMOBILE_MODEM_TEST:-} ]] || { say "run as root"; exit 1; } +# --stopped: the modem profile unit's ExecStopPost. Reaching it at all means +# the unit stopped (a hang or a reset never gets here), so this boot's latch +# goes once the start had reached ONLINE, whatever the unit's result: at a +# shutdown the CP's power-off ends rfsd or cbd before systemd's SIGINT, and +# the profile's supervisor then exits 1, so the result is never "success" +# (the omamobile-modem-start --stopped rule on the Pixel 7 Pro). A start that +# never reached ONLINE, or another boot's latch, is kept. +if ((stopped)); then + [[ -e $LATCH ]] || exit 0 + id=$(cat "${OMAMOBILE_BOOT_ID:-/proc/sys/kernel/random/boot_id}") + if ! grep -q "boot $id\$" "$LATCH"; then + say "$LATCH is another boot's ($(head -1 "$LATCH")): kept" + elif ! grep -qx online "$LATCH"; then + say "this boot's start never reached ONLINE: $LATCH kept" + else + rm -f "$LATCH"; sync + say "modem stopped (${SERVICE_RESULT:-result unknown}): $LATCH removed" + fi + exit 0 +fi + phone_up() { ((phone)) || return 0 # Queued, not waited for: sitd is ready only once it has registered, which @@ -139,11 +163,11 @@ echo performance > $SYS/module/pcie_aspm/parameters/policy 2>/dev/null || true # comes after the drivers. A refusal keeps the latch: a human looks first. $CHROOT modem check -# A clean stop of the profile's unit (the reboot's shutdown) is the only -# thing that removes the latch; a failed or killed profile leaves it. +# A stop of the profile's unit (the reboot's shutdown) is the only thing +# that removes the latch (--stopped above); a hang or a reset leaves it. systemd-run -q --unit=omamobile-tegu-modem -p KillSignal=SIGINT -p TimeoutStopSec=60 \ -p "ExecStop=$CHROOT modem stop" \ - -p "ExecStopPost=/bin/sh -c '[ \"\$\$SERVICE_RESULT\" = success ] && rm -f $LATCH && sync'" \ + -p "ExecStopPost=${OMAMOBILE_MODEM_UP_SELF:-/usr/bin/omamobile-tegu-modem-up} --stopped" \ --setenv=OMAMOBILE_MODEM_GNSS=$gnss \ bash -c "exec $CHROOT modem start >> $LOG/modem.log 2>&1" if ! $CP_STATE wait-online 60 >/dev/null 2>&1; then diff --git a/packages/omamobile-device-tegu/test/modem-up b/packages/omamobile-device-tegu/test/modem-up index a91d5e599..8b3843ad0 100755 --- a/packages/omamobile-device-tegu/test/modem-up +++ b/packages/omamobile-device-tegu/test/modem-up @@ -57,7 +57,7 @@ n_driver=$(grep -n '^modprobe pcie_gs201_cp' "$c" | cut -d: -f1) n_check=$(grep -n '^chroot modem check' "$c" | cut -d: -f1) (( n_inhibit < n_driver && n_driver < n_check )) || fail "the sleep inhibitor, then the drivers, then the profile check (it needs CPIF loaded)" [[ -e $t/k2/latch ]] || fail "the latch stays past ONLINE" -grep -q 'ExecStopPost=.*SERVICE_RESULT.*rm -f .*latch' "$c" || fail "the profile's clean stop removes the latch" +grep -q 'ExecStopPost=.*omamobile-tegu-modem-up --stopped' "$c" || fail "the profile's stop runs --stopped, which removes the latch" grep -qx 'systemctl start --no-block omamobile-sitd.service' "$c" || fail "--phone starts the phone service" grep -qx 'systemctl start --no-block omamobile-mmd.service' "$c" || fail "--phone starts the bridge when it's installed" printf 'ok - %s\n' "modem-up: the kernel's drivers, the order, the latch kept for a clean stop, the phone service and the bridge" @@ -121,3 +121,27 @@ grep -q 'never reached ONLINE' "$t/n2/out" || fail "the refusal names the latch" note_case n3 "2026-11-03T00:00:00+00:00 boot $old\nonline\n" 33333333-3333-3333-3333-333333333333 && fail "a note naming another boot clears nothing" [[ -e $t/n3/latch && -e $t/n3/note ]] || fail "the latch and the note stay" printf 'ok - %s\n' "modem-up: reboot-to's note clears an ONLINE latch of the boot it names, nothing else" + +# --stopped (the profile unit's ExecStopPost): this boot's latch goes once it +# reached ONLINE, whatever the unit's result (a shutdown's is exit-code: the +# CP's power-off ends a daemon before SIGINT); another boot's latch, or one +# that never reached ONLINE, stays. +stop_case() { # NAME LATCH-LINES RESULT + local r=$t/$1; rm -rf "$r"; mkdir -p "$r" + printf '%b' "$2" > "$r/latch"; echo 22222222-2222-2222-2222-222222222222 > "$r/boot_id" + env -i PATH="$F:/usr/bin:/bin" OMAMOBILE_MODEM_TEST=1 SERVICE_RESULT="$3" \ + OMAMOBILE_MODEM_LATCH="$r/latch" OMAMOBILE_BOOT_ID="$r/boot_id" \ + bash bin/omamobile-tegu-modem-up --stopped > "$r/out" 2>&1 +} +this=22222222-2222-2222-2222-222222222222 +stop_case s1 "2026-11-03T00:00:00+00:00 boot $this\nonline\n" exit-code || fail "--stopped succeeds" +[[ ! -e $t/s1/latch ]] || fail "a stop after ONLINE removes this boot's latch, even with the result exit-code" +grep -q 'modem stopped (exit-code)' "$t/s1/out" || fail "the removal is logged with the unit's result" +stop_case s2 "2026-11-03T00:00:00+00:00 boot $this\n" success +[[ -e $t/s2/latch ]] || fail "a start that never reached ONLINE keeps its latch" +stop_case s3 "2026-11-03T00:00:00+00:00 boot 11111111-1111-1111-1111-111111111111\nonline\n" success +[[ -e $t/s3/latch ]] || fail "another boot's latch is kept" +rm -rf "$t/s4"; mkdir -p "$t/s4" +env -i PATH="$F:/usr/bin:/bin" OMAMOBILE_MODEM_TEST=1 OMAMOBILE_MODEM_LATCH="$t/s4/latch" \ + bash bin/omamobile-tegu-modem-up --stopped > "$t/s4/out" 2>&1 || fail "--stopped with no latch succeeds" +printf 'ok - %s\n' "modem-up: --stopped removes this boot's ONLINE latch whatever the result, and keeps the others" From 8d4eddce8524b20dae5e0259f8f8999c43ee19d6 Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Tue, 3 Nov 2026 14:32:51 -0647 Subject: [PATCH 18/31] DEVICES, TELEPHONY-PLAN, omamobile-device-tegu: the 9a's modem and GNSS testing until the default, the latch's stop as it is now DEVICES reserves works for on by default, and the boot unit is opt-in, so Modem and GNSS read testing until the follow-up that turns it on after kernel #187. The latch is described as removed by the profile unit's stop at shutdown, the README gives the unit's --phone --gnss and says the reboot-to path is under test, and section 2.7 records the reboot that left the latch and the re-run on the fixed script. --- device/tegu/TELEPHONY-PLAN.md | 21 +++++++++++++++---- docs/DEVICES.md | 2 +- packages/omamobile-device-tegu/README.md | 16 ++++++++++---- .../bin/omamobile-tegu-modem-up | 11 +++++----- 4 files changed, 36 insertions(+), 14 deletions(-) diff --git a/device/tegu/TELEPHONY-PLAN.md b/device/tegu/TELEPHONY-PLAN.md index cc4589cb9..878d96ddc 100644 --- a/device/tegu/TELEPHONY-PLAN.md +++ b/device/tegu/TELEPHONY-PLAN.md @@ -100,7 +100,8 @@ Opt-in and attended at first, with sleep blocked for the boot. never refreshed automatically. 4. **Two guards:** *Partly in #372:* a boot that has loaded CPIF refuses a second start, and the latch is written and synced before any driver and - kept from ONLINE until a clean shutdown. *Target:* an atomic per-boot + kept from ONLINE until the profile's unit stops at a shutdown (its + ExecStopPost, whatever the stop's result). *Target:* an atomic per-boot "attempted" marker, never cleared in that boot, and the failure latch kept through the whole phone-service start while this is being qualified. No automatic CP or sitd restart, module unload, power @@ -125,7 +126,7 @@ successful, a kernel with linux-omarchy-mobile#172, an off-repo NV backup. | --- | --- | --- | --- | --- | | 1. Read-only / none | `uname -r`; `pacman -Q omamobile-device-tegu omamobile-modem omamobile-modem-sit omamobile-mmd`; `tools/nv-backup --check "$NV_BACKUP"` (laptop); `ls /var/lib/omamobile/modem-bringup-started` | The kernel and packages recorded, NV matches, no latch | NV mismatch, a latch present, B not marked | None | | 2. Enable / low | `systemctl enable omamobile-tegu-modem-boot` | A wants link, nothing started | Anything starts | `systemctl disable omamobile-tegu-modem-boot` | -| 3. Cold boot / medium (the CP starts at boot, sleep blocked) | Power off, then on; after login: `journalctl -b -u omamobile-tegu-modem-boot`; `omamobile-sit status`; `systemd-inhibit --list`; `tools/phone-smoke` (laptop) | "modem OK: CP ONLINE", sitd running and registered, the inhibitor held, the latch present (it stays until a clean shutdown), phone-smoke clean | No ONLINE, a reset, a UFS or NV error, no inhibitor | `systemctl disable omamobile-tegu-modem-boot`, reboot; after a reset the latch keeps the next boot from starting the modem | +| 3. Cold boot / medium (the CP starts at boot, sleep blocked) | Power off, then on; after login: `journalctl -b -u omamobile-tegu-modem-boot`; `omamobile-sit status`; `systemd-inhibit --list`; `tools/phone-smoke` (laptop) | "modem OK: CP ONLINE", sitd running and registered, the inhibitor held, the latch present (it stays until the profile's unit stops at shutdown), phone-smoke clean | No ONLINE, a reset, a UFS or NV error, no inhibitor | `systemctl disable omamobile-tegu-modem-boot`, reboot; after a reset the latch keeps the next boot from starting the modem | | 4. Clean shutdown / medium (one UFS handler pass expected on the 7 Pro's pattern) | `systemctl reboot`; after login: `journalctl -b -1 -k \| grep -c ufshcd_err_handler`; `ls /var/lib/omamobile/modem-bringup-started`; `tools/nv-backup --check` | The latch gone (clean stop), the CP up again at this boot, the UFS count recorded, NV matches | The latch still there after a clean reboot, I/O errors, NV mismatch | As step 3 | | 5. A day's use / low | Calls, texts and data as usual | No reset, no latch left over | A reset or hang | As step 3 | @@ -137,8 +138,8 @@ phone-smoke report and the UFS count. successful on 2026-10-31 with no fastboot write since; the kernel keeps the PERIC0 GPIO bus clock critical, as #172 does; on the charger; `omamobile-device-tegu` 0.2.12, `omamobile-modem-sit` -0.3.36, `omamobile-mmd` 0.1.4 and `omamobile-gnss` 0.2.7, all from this -stack): +0.3.36 and `omamobile-mmd` 0.1.4 from the pull requests above this one +(#376 to #380), `omamobile-gnss` 0.2.7 from main): 1. Read-only: `tools/nv-backup -d tegu --check` against the 2026-10-28 backup (#407): every NV partition the same. Passed. @@ -151,6 +152,18 @@ stack): 4. A second `systemctl reboot` with the CP up: the profile's unit stopped cleanly, the latch was removed and the next boot wrote its own; no `ufshcd_err_handler` pass in the boot that shut down. Passed. +5. Later the same day (10:03), a `systemctl reboot` with the CP up left the + latch: the CP's power-off in ExecStop ended rfsd before systemd's + SIGINT, the profile's supervisor exited 1 ("CP OFFLINE", then + `Control process exited, status=1`), and the old ExecStopPost removed + the latch only on `SERVICE_RESULT=success`. The next boot (10:33) + refused the modem. Failed; fixed in this pull request's last commit + (ExecStopPost runs `omamobile-tegu-modem-up --stopped`, which removes + this boot's latch after ONLINE whatever the result). Re-run with the + fixed script: modem started and ONLINE, `systemctl reboot` at 10:43 + ("modem stopped (success): … removed"), the next boot ONLINE on its own, + and a second reboot at 10:47 removed that boot's latch too. Passed. + `tools/nv-backup --check` after these reboots is still to come. `tools/phone-smoke` on the second boot: every required check ok (boot, the storage guard, root, kernel health, USB, session), and display, GPU, lock, diff --git a/docs/DEVICES.md b/docs/DEVICES.md index 1e9339d6f..851b63253 100644 --- a/docs/DEVICES.md +++ b/docs/DEVICES.md @@ -25,7 +25,7 @@ The status of each device, as verified on real hardware. Rows in the matrix have | Pixel 6 | oriole | gs101 (Tensor G1) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); native test image on one phone; slot B marked successful and `vbmeta_b` verification turned off, both without project approval; see notes) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); guarded `userdata` root on test image) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); connected output on test image) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); Panfrost render node present) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); touchscreen detected; input not checked by smoke) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); gpio-keys detected; input not checked by smoke) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); USB network and SSH on test image) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); link up; traffic not checked by smoke) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); controller powered; pairing not checked) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); charge and temperature reported) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); charging reported; control not checked) | no | no | no | no | no | no | no | no | no | no | no | | Pixel 4 | flame | SM8150 (Snapdragon 855) | testing (temporary RAM boot; [notes](../device/flame/BRINGUP-M1.md)) | testing (RAM probe; all UFS read-only) | testing (1080x2280 console; software desktop in separate Arch payload) | testing (separate Arch payload; FD640 contexts, llvmpipe desktop) | testing (separate Arch payload; events and PIN unlock verified) | no | testing (NCM + ACM + SSH; sustained transfers can disconnect) | testing (guarded RAM scan; association untested) | no | no | no | no | no | no | - | no | no | no | no | no | no | - | | Pixel 4 XL ([notes](../device/coral/NOTES.md)) | coral | SM8150 (Snapdragon 855) | WIP (direct ABL v2 boot on the test handset's slot A; slot-B install and §3.1 entry pending; [notes](../device/coral/BRINGUP-M1.md)) | testing (read-only `blockdev` guard + RAM `overlayfs`) | testing (1440x3040@60Hz S6E3HC2 DSC 1.1 KMS, DPMS, brightness) | testing (Adreno 640 / FD640 Mesa Freedreno, Hyprland) | testing (FTS SPI multitouch + read-only flash guard) | testing (power via `qcom-pon` + volume via `gpio-keys`) | testing (CDC ECM + ACM + SSH; stays up with host USB switched off) | testing (`WCN3990` `ath10k_snoc` + `rmtfs -r`, WPA2/DHCP/HTTPS; radio sessions ran before the modem baseline) | WIP (`WCN3990` `hci_qca` `hci0` up + BLE scan; audio/pairing open) | WIP (PM8150B ADC `VBAT_SNS` voltage + FG temp; aftermarket pack on test unit: no reply from `1-0036`) | testing (PM8150B SMB5 charger with `4.20 V` / `500 mA` kernel clamp) | testing (`CS40L25A` I2C click waveform) | testing (PM8150L flash LEDs + quick-settings tile) | no | - | testing (QDSP6 + dual `CS35L36` amps capped at `-26 dB` + `IA8508` SPI mic DSP) | testing (`SLPI` + `fastrpc` + RAM-backed `hexagonrpcd` + QMI SSC: 7 sensors + Soli radar) | WIP (`MPSS` boots with `rmtfs -r` + patched `tqftpserv`, SIM detected; no IPA/voice yet; radio sessions ran before the modem baseline) | no | testing (`CAMSS` + `IMX363`, `IMX481`, `IMX520`, dual `OV7251` NIR; `libcamera` softISP) | no | - | -| Pixel 9a ([notes](../device/tegu/NOTES.md)) | tegu | zumapro (Tensor G4) | works ([#28](https://github.com/derekross/omarchy-mobile/issues/28): native boot from slot B, the Arch root on `userdata`, `omamobile-device-tegu`; slot B was marked successful by hand on 2026-10-28 with the `devinfo` write approved on 2026-10-22, now on hold ([#125](https://github.com/derekross/omarchy-mobile/pull/125)), unmarked by the 10-31 fastboot recovery and marked again on 2026-10-31 during the hold ([record](../device/tegu/NOTES.md#2026-10-31-a-fastboot-flash-of-slot-b-cleared-its-successful-mark-and-b-was-marked-again)), and the package does not mark it; unpublished kernel: the SoC and board device tree is [kernel #81](https://github.com/derekross/linux-omarchy-mobile/pull/81), merged; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (UFS behind the read-only guard; unpublished kernel; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (120 Hz through gs-decon; the panel driver [kernel #89](https://github.com/derekross/linux-omarchy-mobile/pull/89), 120 Hz [kernel #88](https://github.com/derekross/linux-omarchy-mobile/pull/88), merged, the display DT, merged with [kernel #96](https://github.com/derekross/linux-omarchy-mobile/pull/96); brightness, DPMS off and on and the 60/120 Hz switch on the boot of [kernel #125](https://github.com/derekross/linux-omarchy-mobile/pull/125), merged, which also checks the panel's ID; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on), [brightness record](../device/tegu/NOTES.md#2026-11-01-afternoon-and-evening-wi-fi-from-the-package-the-wake-and-the-replug-storage-idle-the-panel-id)) | works (Panthor, the desktop renders, runtime suspend when idle; this boot runs at a fixed 160 MHz, so frequency scaling and the GPU thermal zone count as in review, [kernel #85](https://github.com/derekross/linux-omarchy-mobile/pull/85) in review, [kernel #87](https://github.com/derekross/linux-omarchy-mobile/pull/87) in review; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (Synaptics S3908 over SPI, [kernel #81](https://github.com/derekross/linux-omarchy-mobile/pull/81), merged; survives sleep, [kernel #82](https://github.com/derekross/linux-omarchy-mobile/pull/82), merged; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (gpio-keys: power and volume; the power key wakes from sleep; unpublished kernel; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (CDC NCM and SSH; reconnects after a replug, `omamobile-tegu-usb-rescue`, also after a replug the gadget didn't see ([#280](https://github.com/derekross/omarchy-mobile/pull/280); [the replug record](../device/tegu/NOTES.md#2026-10-28-what-the-device-tables-claims-rest-on)); [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (BCM4383 on PCIe channel 1 through the shared gs201 host and zuma PHY, [kernel #178](https://github.com/derekross/linux-omarchy-mobile/pull/178) on [kernel #156](https://github.com/derekross/linux-omarchy-mobile/pull/156), in review, and brcmfmac, [kernel #56](https://github.com/derekross/linux-omarchy-mobile/pull/56) in review; started at boot by `omamobile-device-tegu` 0.2.4 ([#238](https://github.com/derekross/omarchy-mobile/pull/238)) with the extractor's firmware; WPA2 with iwd, kept loaded across sleep by the package's sleep hook; [record](../device/tegu/NOTES.md#2026-11-01-afternoon-and-evening-wi-fi-from-the-package-the-wake-and-the-replug-storage-idle-the-panel-id)) | works (hci_uart on the bootloader's address, BlueZ, A2DP; [kernel #94](https://github.com/derekross/linux-omarchy-mobile/pull/94); unpublished kernel; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (MAX77779 gauge with temperature, current and time estimates through UPower; [kernel #66](https://github.com/derekross/linux-omarchy-mobile/pull/66); unpublished kernel; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (the MAX77779 charger binds from the device tree, [kernel #161](https://github.com/derekross/linux-omarchy-mobile/pull/161), merged, built by [#227](https://github.com/derekross/omarchy-mobile/pull/227); the charge limit in `omamobile-device-tegu` 0.2.3 holds charging off at the limit through `charge_behaviour` and lets it run again 5 below; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | works (CS40L26A through feedbackd, with brownout prevention, [kernel #95](https://github.com/derekross/linux-omarchy-mobile/pull/95); its DT [kernel #96](https://github.com/derekross/linux-omarchy-mobile/pull/96), merged; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (LM3644, 25 steps to 75 mA, quick-settings tile; its DT [kernel #96](https://github.com/derekross/linux-omarchy-mobile/pull/96), merged; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (Omarchy's Location switch serves fixes from GPS, Galileo, BeiDou and GLONASS through the modem's Kepler, with gnssd started with the modem at boot by `omamobile-device-tegu`'s opt-in boot unit ([#372](https://github.com/derekross/omarchy-mobile/pull/372)): on 2026-11-03, after a reboot with nothing started by hand, a session through the switch's socket had 133 of 135 GGA sentences fixed, first fix 48 s after the client connected, 18 satellites; a 30-minute session on 2026-11-01 had 1763 of 1765; needs [kernel #150](https://github.com/derekross/linux-omarchy-mobile/pull/150) and the PERIC0 clock fix [kernel #172](https://github.com/derekross/linux-omarchy-mobile/pull/172), both merged, and [#114](https://github.com/derekross/omarchy-mobile/pull/114), merged; [plan](../device/tegu/MODEM-PLAN.md)) | works (audio and sensor DSP through the GSA and Trusty, 93 services, started at boot by `omamobile-device-tegu` 0.2.3 from the device tree, [kernel #162](https://github.com/derekross/linux-omarchy-mobile/pull/162) in review; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | works (the TAS2572 amplifiers and the microphone through the AoC card and PipeWire, at boot with the AoC: a tone from the speaker, the microphone at -32 dBFS; speakers at a -10 dB ceiling; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | works (accelerometer, light, proximity, compass and gyroscope through the AoC and the sensor proxy, at boot with the AoC; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | works (calls in and out on the speakerphone, texts both ways, mobile data over the device `omamobile-sit-data` finds, with the Phone and Messages apps on the bridge ([#356](https://github.com/derekross/omarchy-mobile/pull/356), [#364](https://github.com/derekross/omarchy-mobile/pull/364), [#367](https://github.com/derekross/omarchy-mobile/pull/367), [#371](https://github.com/derekross/omarchy-mobile/pull/371)); `omamobile-device-tegu`'s opt-in boot unit starts the modem, the phone service and the bridge ([#372](https://github.com/derekross/omarchy-mobile/pull/372)); on the owner's kernel with the bring-up modules, and on in-tree drivers from [kernel #187](https://github.com/derekross/linux-omarchy-mobile/pull/187) and [kernel #162](https://github.com/derekross/linux-omarchy-mobile/pull/162), in review; the far end still hears an echo on the speakerphone ([#378](https://github.com/derekross/omarchy-mobile/pull/378)) and there's no earpiece route yet; [plan](../device/tegu/MODEM-PLAN.md), [record](../device/tegu/MODEM-PLAN.md#sim-test-results-2026-11-02-730-rc6-omamobile-tegu-s2mpg15-m1-g991042e2eff3-dirty)) | works (NXP ST54L through nxp-nci, its clock pad from the PMU ([kernel #104](https://github.com/derekross/linux-omarchy-mobile/pull/104) and [kernel #105](https://github.com/derekross/linux-omarchy-mobile/pull/105), merged, with [kernel #131](https://github.com/derekross/linux-omarchy-mobile/pull/131), merged), loaded at boot by `omamobile-device-tegu` 0.2.3 with neard and the link opener: polls with no I2C errors and read a payment card; polling stops before sleep; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | works (main, ultrawide and front from the device tree, [kernel #164](https://github.com/derekross/linux-omarchy-mobile/pull/164) in review, with [kernel #63](https://github.com/derekross/linux-omarchy-mobile/pull/63) and [kernel #103](https://github.com/derekross/linux-omarchy-mobile/pull/103) in review: their drivers load at boot with nothing by hand, libcamera lists all three, and each streams, main at 19 fps and the others at 30 fps at 1280x960; basic picture quality through libcamera's software ISP; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | testing (s2idle when asked for, or through the shell's auto-sleep with the `omamobile-sleep` toggle on, which ships off; the power key lights the lock screen on the first press ([#268](https://github.com/derekross/omarchy-mobile/pull/268), [#275](https://github.com/derekross/omarchy-mobile/pull/275)), and the RTC wakes it; on 2026-11-01 thirty attended 120 s sleeps ([plan](../device/tegu/SLEEP-PLAN.md) S1) and a day of real use with auto-sleep on ([record](../device/tegu/NOTES.md#2026-11-01-afternoon-and-evening-wi-fi-from-the-package-the-wake-and-the-replug-storage-idle-the-panel-id)) all woke, but six test sleeps since 10-28 did not (one in 21 on the clock-fix kernel on 11-01, and one in 127 in an overnight series of 120 s sleeps on 11-01 to 11-02), so sleep tests stay attended ([plan](../device/tegu/SLEEP-PLAN.md) S1); the drain is about 300 mA asleep, the same as awake with the screen off, because nothing below the CPUs sleeps yet; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (opt-in) (enrolls, matches, refuses other fingers and unlocks the lock screen through Trusty and `omamobile-fingerprint`, 2026-10-29; the sensor binds from the device tree, [kernel #165](https://github.com/derekross/linux-omarchy-mobile/pull/165) in review, with [kernel #126](https://github.com/derekross/linux-omarchy-mobile/pull/126), merged; opt-in as on the 7 Pro, because the service's first run writes Trusty's secure storage; [plan](../device/tegu/FINGERPRINT-PLAN.md), [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | +| Pixel 9a ([notes](../device/tegu/NOTES.md)) | tegu | zumapro (Tensor G4) | works ([#28](https://github.com/derekross/omarchy-mobile/issues/28): native boot from slot B, the Arch root on `userdata`, `omamobile-device-tegu`; slot B was marked successful by hand on 2026-10-28 with the `devinfo` write approved on 2026-10-22, now on hold ([#125](https://github.com/derekross/omarchy-mobile/pull/125)), unmarked by the 10-31 fastboot recovery and marked again on 2026-10-31 during the hold ([record](../device/tegu/NOTES.md#2026-10-31-a-fastboot-flash-of-slot-b-cleared-its-successful-mark-and-b-was-marked-again)), and the package does not mark it; unpublished kernel: the SoC and board device tree is [kernel #81](https://github.com/derekross/linux-omarchy-mobile/pull/81), merged; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (UFS behind the read-only guard; unpublished kernel; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (120 Hz through gs-decon; the panel driver [kernel #89](https://github.com/derekross/linux-omarchy-mobile/pull/89), 120 Hz [kernel #88](https://github.com/derekross/linux-omarchy-mobile/pull/88), merged, the display DT, merged with [kernel #96](https://github.com/derekross/linux-omarchy-mobile/pull/96); brightness, DPMS off and on and the 60/120 Hz switch on the boot of [kernel #125](https://github.com/derekross/linux-omarchy-mobile/pull/125), merged, which also checks the panel's ID; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on), [brightness record](../device/tegu/NOTES.md#2026-11-01-afternoon-and-evening-wi-fi-from-the-package-the-wake-and-the-replug-storage-idle-the-panel-id)) | works (Panthor, the desktop renders, runtime suspend when idle; this boot runs at a fixed 160 MHz, so frequency scaling and the GPU thermal zone count as in review, [kernel #85](https://github.com/derekross/linux-omarchy-mobile/pull/85) in review, [kernel #87](https://github.com/derekross/linux-omarchy-mobile/pull/87) in review; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (Synaptics S3908 over SPI, [kernel #81](https://github.com/derekross/linux-omarchy-mobile/pull/81), merged; survives sleep, [kernel #82](https://github.com/derekross/linux-omarchy-mobile/pull/82), merged; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (gpio-keys: power and volume; the power key wakes from sleep; unpublished kernel; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (CDC NCM and SSH; reconnects after a replug, `omamobile-tegu-usb-rescue`, also after a replug the gadget didn't see ([#280](https://github.com/derekross/omarchy-mobile/pull/280); [the replug record](../device/tegu/NOTES.md#2026-10-28-what-the-device-tables-claims-rest-on)); [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (BCM4383 on PCIe channel 1 through the shared gs201 host and zuma PHY, [kernel #178](https://github.com/derekross/linux-omarchy-mobile/pull/178) on [kernel #156](https://github.com/derekross/linux-omarchy-mobile/pull/156), in review, and brcmfmac, [kernel #56](https://github.com/derekross/linux-omarchy-mobile/pull/56) in review; started at boot by `omamobile-device-tegu` 0.2.4 ([#238](https://github.com/derekross/omarchy-mobile/pull/238)) with the extractor's firmware; WPA2 with iwd, kept loaded across sleep by the package's sleep hook; [record](../device/tegu/NOTES.md#2026-11-01-afternoon-and-evening-wi-fi-from-the-package-the-wake-and-the-replug-storage-idle-the-panel-id)) | works (hci_uart on the bootloader's address, BlueZ, A2DP; [kernel #94](https://github.com/derekross/linux-omarchy-mobile/pull/94); unpublished kernel; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (MAX77779 gauge with temperature, current and time estimates through UPower; [kernel #66](https://github.com/derekross/linux-omarchy-mobile/pull/66); unpublished kernel; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (the MAX77779 charger binds from the device tree, [kernel #161](https://github.com/derekross/linux-omarchy-mobile/pull/161), merged, built by [#227](https://github.com/derekross/omarchy-mobile/pull/227); the charge limit in `omamobile-device-tegu` 0.2.3 holds charging off at the limit through `charge_behaviour` and lets it run again 5 below; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | works (CS40L26A through feedbackd, with brownout prevention, [kernel #95](https://github.com/derekross/linux-omarchy-mobile/pull/95); its DT [kernel #96](https://github.com/derekross/linux-omarchy-mobile/pull/96), merged; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (LM3644, 25 steps to 75 mA, quick-settings tile; its DT [kernel #96](https://github.com/derekross/linux-omarchy-mobile/pull/96), merged; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | testing (Omarchy's Location switch serves fixes from GPS, Galileo, BeiDou and GLONASS through the modem's Kepler, with gnssd started with the modem at boot by `omamobile-device-tegu`'s opt-in boot unit ([#372](https://github.com/derekross/omarchy-mobile/pull/372)): on 2026-11-03, after a reboot with nothing started by hand, a session through the switch's socket had 133 of 135 GGA sentences fixed, first fix 48 s after the client connected, 18 satellites; a 30-minute session on 2026-11-01 had 1763 of 1765; needs [kernel #150](https://github.com/derekross/linux-omarchy-mobile/pull/150) and the PERIC0 clock fix [kernel #172](https://github.com/derekross/linux-omarchy-mobile/pull/172), both merged, and [#114](https://github.com/derekross/omarchy-mobile/pull/114), merged; [plan](../device/tegu/MODEM-PLAN.md)) | works (audio and sensor DSP through the GSA and Trusty, 93 services, started at boot by `omamobile-device-tegu` 0.2.3 from the device tree, [kernel #162](https://github.com/derekross/linux-omarchy-mobile/pull/162) in review; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | works (the TAS2572 amplifiers and the microphone through the AoC card and PipeWire, at boot with the AoC: a tone from the speaker, the microphone at -32 dBFS; speakers at a -10 dB ceiling; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | works (accelerometer, light, proximity, compass and gyroscope through the AoC and the sensor proxy, at boot with the AoC; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | testing (calls in and out on the speakerphone, texts both ways, mobile data over the device `omamobile-sit-data` finds, with the Phone and Messages apps on the bridge ([#356](https://github.com/derekross/omarchy-mobile/pull/356), [#364](https://github.com/derekross/omarchy-mobile/pull/364), [#367](https://github.com/derekross/omarchy-mobile/pull/367), [#371](https://github.com/derekross/omarchy-mobile/pull/371)); `omamobile-device-tegu`'s opt-in boot unit starts the modem, the phone service and the bridge ([#372](https://github.com/derekross/omarchy-mobile/pull/372)); on the owner's kernel with the bring-up modules, and on in-tree drivers from [kernel #187](https://github.com/derekross/linux-omarchy-mobile/pull/187) and [kernel #162](https://github.com/derekross/linux-omarchy-mobile/pull/162), in review; the far end still hears an echo on the speakerphone ([#378](https://github.com/derekross/omarchy-mobile/pull/378)) and there's no earpiece route yet; [plan](../device/tegu/MODEM-PLAN.md), [record](../device/tegu/MODEM-PLAN.md#sim-test-results-2026-11-02-730-rc6-omamobile-tegu-s2mpg15-m1-g991042e2eff3-dirty)) | works (NXP ST54L through nxp-nci, its clock pad from the PMU ([kernel #104](https://github.com/derekross/linux-omarchy-mobile/pull/104) and [kernel #105](https://github.com/derekross/linux-omarchy-mobile/pull/105), merged, with [kernel #131](https://github.com/derekross/linux-omarchy-mobile/pull/131), merged), loaded at boot by `omamobile-device-tegu` 0.2.3 with neard and the link opener: polls with no I2C errors and read a payment card; polling stops before sleep; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | works (main, ultrawide and front from the device tree, [kernel #164](https://github.com/derekross/linux-omarchy-mobile/pull/164) in review, with [kernel #63](https://github.com/derekross/linux-omarchy-mobile/pull/63) and [kernel #103](https://github.com/derekross/linux-omarchy-mobile/pull/103) in review: their drivers load at boot with nothing by hand, libcamera lists all three, and each streams, main at 19 fps and the others at 30 fps at 1280x960; basic picture quality through libcamera's software ISP; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | testing (s2idle when asked for, or through the shell's auto-sleep with the `omamobile-sleep` toggle on, which ships off; the power key lights the lock screen on the first press ([#268](https://github.com/derekross/omarchy-mobile/pull/268), [#275](https://github.com/derekross/omarchy-mobile/pull/275)), and the RTC wakes it; on 2026-11-01 thirty attended 120 s sleeps ([plan](../device/tegu/SLEEP-PLAN.md) S1) and a day of real use with auto-sleep on ([record](../device/tegu/NOTES.md#2026-11-01-afternoon-and-evening-wi-fi-from-the-package-the-wake-and-the-replug-storage-idle-the-panel-id)) all woke, but six test sleeps since 10-28 did not (one in 21 on the clock-fix kernel on 11-01, and one in 127 in an overnight series of 120 s sleeps on 11-01 to 11-02), so sleep tests stay attended ([plan](../device/tegu/SLEEP-PLAN.md) S1); the drain is about 300 mA asleep, the same as awake with the screen off, because nothing below the CPUs sleeps yet; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (opt-in) (enrolls, matches, refuses other fingers and unlocks the lock screen through Trusty and `omamobile-fingerprint`, 2026-10-29; the sensor binds from the device tree, [kernel #165](https://github.com/derekross/linux-omarchy-mobile/pull/165) in review, with [kernel #126](https://github.com/derekross/linux-omarchy-mobile/pull/126), merged; opt-in as on the 7 Pro, because the service's first run writes Trusty's secure storage; [plan](../device/tegu/FINGERPRINT-PLAN.md), [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | | Pixel 8 Pro ([notes](../device/husky/NOTES.md)) | husky | zuma (Tensor G3) | WIP ([#1](https://github.com/derekross/omarchy-mobile/issues/1): slot B, not marked successful; Omarchy's image from the signed repository boots to the lock screen; the zuma device tree is merged ([kernel #13](https://github.com/derekross/linux-omarchy-mobile/pull/13), [#53](https://github.com/derekross/linux-omarchy-mobile/pull/53))) | testing (UFS at HS-G4 behind the read-only guard; Arch on `userdata`; [UFS-PLAN](../device/husky/UFS-PLAN.md)) | WIP (simple-framebuffer: console and Omarchy's lock screen) | no | testing (ST FTM5 over SPI, merged, [kernel #153](https://github.com/derekross/linux-omarchy-mobile/pull/153); [NOTES](../device/husky/NOTES.md)) | testing (power and volume through `gpio-keys`, merged, [kernel #148](https://github.com/derekross/linux-omarchy-mobile/pull/148); [NOTES](../device/husky/NOTES.md)) | testing (USB and SSH) | testing (BCM4398 on a test kernel, [kernel #156](https://github.com/derekross/linux-omarchy-mobile/pull/156); firmware from the owner's image, [#214](https://github.com/derekross/omarchy-mobile/pull/214); [NOTES](../device/husky/NOTES.md)) | no | testing (gauge with Google's ATL model through a bring-up overlay, temperature, MFD, on a test kernel, [kernel #163](https://github.com/derekross/linux-omarchy-mobile/pull/163); [notes](../device/husky/BATTERY-NOTES.md)) | testing (the charger driver by hand under a dead-man tool, slow on plain 5 V, on a test kernel, [kernel #163](https://github.com/derekross/linux-omarchy-mobile/pull/163); [notes](../device/husky/BATTERY-NOTES.md)) | no | no | no | no | no | no | no | no | no | no | no | | Pixel 7 ([notes](../device/panther/NOTES.md)) | panther | gs201 (Tensor G2) | WIP (slot B, not marked successful; Arch and Hyprland boot; [BRINGUP-M1](../device/panther/BRINGUP-M1.md); board file merged, [kernel #108](https://github.com/derekross/linux-omarchy-mobile/pull/108)) | testing (UFS behind the read-only guard; Arch on `userdata`; merged, [kernel #108](https://github.com/derekross/linux-omarchy-mobile/pull/108)) | WIP (simple-framebuffer: console and the Hyprland desktop; brightness and display off/on over DCS through the S6E3FC3 panel driver and device-panther 0.1.4, in review, [kernel #177](https://github.com/derekross/linux-omarchy-mobile/pull/177); [DISPLAY-PLAN](../device/panther/DISPLAY-PLAN.md)) | testing (Panthor on the Mali-G710; Hyprland renders on it; merged through [kernel #134](https://github.com/derekross/linux-omarchy-mobile/pull/134), with the always-on rule in device-panther 0.1.1, [#145](https://github.com/derekross/omarchy-mobile/pull/145); [notes](../device/panther/NOTES.md#2026-10-28-the-gpu-and-the-haptics-power-off-and-usb-after-a-replug)) | WIP (FocalTech FT3658: touches drive Hyprland and unlock the PIN screen on a test kernel; the driver, [kernel #109](https://github.com/derekross/linux-omarchy-mobile/pull/109), and the touch node, [kernel #134](https://github.com/derekross/linux-omarchy-mobile/pull/134), are merged; stock's interrupt pull-up and CS delay, [kernel #166](https://github.com/derekross/linux-omarchy-mobile/pull/166), the driver's review fixes, [kernel #133](https://github.com/derekross/linux-omarchy-mobile/pull/133), and the kernel option with the touch notes, [#149](https://github.com/derekross/omarchy-mobile/pull/149), are merged) | testing (gpio-keys: power, volume; merged, [kernel #108](https://github.com/derekross/linux-omarchy-mobile/pull/108)) | testing (USB and SSH; merged, [kernel #108](https://github.com/derekross/linux-omarchy-mobile/pull/108); a replug comes back through `omamobile-usb-rescue` in device-panther 0.1.3, on the MAX77759's I2C bus, merged, [kernel #167](https://github.com/derekross/linux-omarchy-mobile/pull/167); [notes](../device/panther/NOTES.md#2026-10-29-usb-comes-back-after-a-replug-u1)) | no | no | WIP (MAX77759 fuel gauge with stock's battery model on a test kernel: percentage, capacity and temperature in upower and the bar; in review, [kernel #171](https://github.com/derekross/linux-omarchy-mobile/pull/171) and the driver fix [#170](https://github.com/derekross/linux-omarchy-mobile/pull/170); [BATTERY-PLAN](../device/panther/BATTERY-PLAN.md)) | no | testing (CS40L26 with the phone's own firmware, `tools/extract-vendor-firmware -d panther`; merged through [kernel #134](https://github.com/derekross/linux-omarchy-mobile/pull/134), with the feedbackd rule in device-panther 0.1.1, [#145](https://github.com/derekross/omarchy-mobile/pull/145); [notes](../device/panther/NOTES.md#2026-10-28-the-gpu-and-the-haptics-power-off-and-usb-after-a-replug)) | no | no | no | no | no | no | no | no | no (s2idle by default since [kernel #134](https://github.com/derekross/linux-omarchy-mobile/pull/134) and device-panther 0.1.1; not run yet) | no | | OnePlus 13 ([notes](../device/dodge/NOTES.md)) | dodge | sm8750 (Snapdragon 8 Elite) | testing (kernel [mrlund/linux-omarchy-mobile `dodge-v3-20261101`](https://github.com/mrlund/linux-omarchy-mobile/tree/dodge-v3-20261101); [kernel #115](https://github.com/derekross/linux-omarchy-mobile/pull/115) closed; [BRINGUP](../device/dodge/BRINGUP-M1.md), [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing ([notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing (msm/dpu; warm-boot drop fixed; [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing (Adreno 830 / gpu2; Vulkan untested; [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing ([notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing ([notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing (CDC NCM + SSH; gadget stuck after replug until reboot; kernel [mrlund/linux-omarchy-mobile `dodge-v3-20261101`](https://github.com/mrlund/linux-omarchy-mobile/tree/dodge-v3-20261101); [kernel #115](https://github.com/derekross/linux-omarchy-mobile/pull/115) closed; [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing (WCN7860 / ath12k; [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing (pairing; A2DP untested; kernel [mrlund/linux-omarchy-mobile `dodge-v3-20261101`](https://github.com/mrlund/linux-omarchy-mobile/tree/dodge-v3-20261101); [kernel #115](https://github.com/derekross/linux-omarchy-mobile/pull/115) closed; [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing (gauge; charging path not claimed; kernel [mrlund/linux-omarchy-mobile `dodge-v3-20261101`](https://github.com/mrlund/linux-omarchy-mobile/tree/dodge-v3-20261101); [kernel #115](https://github.com/derekross/linux-omarchy-mobile/pull/115) closed; [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | no | no | no | no | - | testing (speakers, earpiece, mics; headset plug untested; [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing (accel, prox, compass; autorotate; [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing (LTE data; calls/SMS untested; opt-in flag; [modem](../device/dodge/modem/README.md), [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | no | no | WIP (s2idle not default; [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | no | diff --git a/packages/omamobile-device-tegu/README.md b/packages/omamobile-device-tegu/README.md index 250c784af..1f36b8d61 100644 --- a/packages/omamobile-device-tegu/README.md +++ b/packages/omamobile-device-tegu/README.md @@ -167,21 +167,29 @@ In order, it: 6. with `--phone`, starts `omamobile-sitd` and, when installed, `omamobile-mmd` for Phone and Messages. -The latch stays from step 2 until the profile's unit stops cleanly at -shutdown. A start that never reached ONLINE, or a boot that hung or reset +The latch stays from step 2 until the profile's unit stops at shutdown: +its ExecStopPost (`omamobile-tegu-modem-up --stopped`) removes this boot's +latch once the start had reached ONLINE, whatever the stop's result (the +CP's power-off can end rfsd before systemd's SIGINT, so the result is often +not "success"). A start that never reached ONLINE, or a boot that hung or reset with the modem up, leaves it, and every later start refuses until you've read `/var/log/omamobile/modem.log` and the last boot's journal and removed it. It also refuses a second start in a boot that already loaded CPIF. Never stop the modem by hand; the reboot's shutdown stops it. +With #403, a `reboot-to` (and so `bin/omamobile push`) with the CP ONLINE +notes the boot it ends, and the next boot clears that boot's latch and +starts the modem on its own, after a reboot that didn't power the CP off +through the profile. That path is still under test on the 9a. + The in-tree driver branch (the kernel's `cpif` and `pcie_gs201_cp`) hasn't run through this script yet; the in-tree drivers have run from the bring-up runners. ### Starting it at boot -`omamobile-tegu-modem-boot.service` runs `omamobile-tegu-modem-up --phone` -at boot. The package installs it disabled. Before enabling it: +`omamobile-tegu-modem-boot.service` runs `omamobile-tegu-modem-up --phone +--gnss` at boot. The package installs it disabled. Before enabling it: - **Slot B marked successful.** Otherwise every reset spends one of ABL's three tries, and at zero it boots stock on slot A, which has overwritten diff --git a/packages/omamobile-device-tegu/bin/omamobile-tegu-modem-up b/packages/omamobile-device-tegu/bin/omamobile-tegu-modem-up index cd12cab5b..3bab00adf 100644 --- a/packages/omamobile-device-tegu/bin/omamobile-tegu-modem-up +++ b/packages/omamobile-device-tegu/bin/omamobile-tegu-modem-up @@ -23,10 +23,11 @@ # ROM, so a boot that loaded CPIF refuses (reboot to start again); # - never stop the modem by hand: the attended reboot's shutdown stops it; # - a latch (/var/lib/omamobile/modem-bringup-started) is written before any -# driver loads and removed only when the modem profile's unit stops -# cleanly at shutdown: a start that never reached ONLINE, or a boot that -# hung or reset with the modem up, leaves it, and later boots refuse until -# a human removes it (TELEPHONY-PLAN section 2.4); +# driver loads and removed when the modem profile's unit stops (its +# ExecStopPost runs --stopped, at a shutdown) after the start had reached +# ONLINE, whatever the stop's result: a start that never reached ONLINE, +# or a boot that hung or reset with the modem up, leaves it, and later +# boots refuse until a human removes it (TELEPHONY-PLAN section 2.4); # - no system suspend once the CP is up: a sleep inhibitor, its own unit, is # taken before any driver loads and lasts until the reboot. set -euo pipefail @@ -176,5 +177,5 @@ if ! $CP_STATE wait-online 60 >/dev/null 2>&1; then exit 1 fi echo online >> "$LATCH"; sync "$LATCH" 2>/dev/null || sync -say "modem OK: CP ONLINE (log /var/log/omamobile/modem.log); the latch stays until a clean shutdown" +say "modem OK: CP ONLINE (log /var/log/omamobile/modem.log); the latch stays until the profile unit stops at shutdown" phone_up From 61062dc4186819f2427bbb7d8b156d810a656761 Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Wed, 4 Nov 2026 02:49:12 -0647 Subject: [PATCH 19/31] device/tegu TELEPHONY-PLAN, omamobile-device-tegu README: the NV check and the reboot-to path passed (2.7) The radio backup check after the day's reboots read every NV partition the same, and a reboot-to with the CP ONLINE cleared its latch and brought the modem back on its own at the next boot. --- device/tegu/TELEPHONY-PLAN.md | 12 +++++++++++- packages/omamobile-device-tegu/README.md | 3 ++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/device/tegu/TELEPHONY-PLAN.md b/device/tegu/TELEPHONY-PLAN.md index 878d96ddc..b0ef219af 100644 --- a/device/tegu/TELEPHONY-PLAN.md +++ b/device/tegu/TELEPHONY-PLAN.md @@ -163,7 +163,17 @@ does; on the charger; `omamobile-device-tegu` 0.2.12, `omamobile-modem-sit` fixed script: modem started and ONLINE, `systemctl reboot` at 10:43 ("modem stopped (success): … removed"), the next boot ONLINE on its own, and a second reboot at 10:47 removed that boot's latch too. Passed. - `tools/nv-backup --check` after these reboots is still to come. + `tools/nv-backup -d tegu --check` against the same backup after the + day's reboots (these, two kernel pushes and two sysrq reboots after + sleep tests): every NV partition and `metadata` the same, `devinfo` + different, as after any boot-success mark (tegu NOTES, 2026-11-03). + Passed. +6. The `reboot-to` path (#403's `reboot-to` installed): in the evening, + with the CP ONLINE, `reboot-to omamobile`. The next boot logged "the + last boot with the modem up ended with reboot-to: + /var/lib/omamobile/modem-bringup-started removed", started the modem on + its own to "modem OK: CP ONLINE", and left no + `/var/lib/omamobile/deliberate-restart` behind. Passed. `tools/phone-smoke` on the second boot: every required check ok (boot, the storage guard, root, kernel health, USB, session), and display, GPU, lock, diff --git a/packages/omamobile-device-tegu/README.md b/packages/omamobile-device-tegu/README.md index 1f36b8d61..47cd0e2bf 100644 --- a/packages/omamobile-device-tegu/README.md +++ b/packages/omamobile-device-tegu/README.md @@ -180,7 +180,8 @@ Never stop the modem by hand; the reboot's shutdown stops it. With #403, a `reboot-to` (and so `bin/omamobile push`) with the CP ONLINE notes the boot it ends, and the next boot clears that boot's latch and starts the modem on its own, after a reboot that didn't power the CP off -through the profile. That path is still under test on the 9a. +through the profile. On the 9a that path passed once, on 2026-11-03 +(TELEPHONY-PLAN 2.7). The in-tree driver branch (the kernel's `cpif` and `pcie_gs201_cp`) hasn't run through this script yet; the in-tree drivers have run from the From a762f36168a3ee7d1fc740a86a313d8f602388bf Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Mon, 2 Nov 2026 19:05:16 -0647 Subject: [PATCH 20/31] omamobile-modem-sit 0.3.16: add opt-in tegu call tuning and earpiece audio Stage the owner-provided APMg3 uplink and downlink protobufs through the AoC output tuning services, confirm bounded acknowledgements, and refuse another tuning attempt after an unknown outcome. Set the speaker echo reference before capture and disable AEC during confirmed cleanup. Add a conservative top-speaker route with bottom attenuation and gain readback. Keep the complete amplifier profile 0: the examined native voice-handset case is a power-state delta, and the AoC sink bitmap controls are read-only. Document the distinction from stock voice/EM control and the attended qualification gate. Extract six speaker/handset tuning files from the owner image, with synthetic extraction and service-record tests. Defaults leave tuning and call audio disabled; no phone trial is claimed. --- device/tegu/CALL-AUDIO-TUNING.md | 186 ++++++++++++++++++ docs/TELEPHONY-APPS-PLAN.md | 3 + .../etc/omamobile/modem-sit.conf | 10 + .../omamobile-modem-sit/lib/aoc_tuning.py | 121 ++++++++++++ packages/omamobile-modem-sit/lib/paths.py | 3 +- packages/omamobile-modem-sit/lib/service.py | 4 +- .../omamobile-modem-sit/lib/voice_audio.py | 71 +++++-- .../test/test_aoc_tuning.py | 172 ++++++++++++++++ .../test/test_voice_audio.py | 86 +++++++- packages/omamobile-modem-sit/version | 2 +- tests/all | 2 +- tests/extract-tegu-call-tuning | 51 +++++ tools/extract-vendor-firmware | 8 + 13 files changed, 702 insertions(+), 17 deletions(-) create mode 100644 device/tegu/CALL-AUDIO-TUNING.md create mode 100644 packages/omamobile-modem-sit/lib/aoc_tuning.py create mode 100644 packages/omamobile-modem-sit/test/test_aoc_tuning.py create mode 100755 tests/extract-tegu-call-tuning diff --git a/device/tegu/CALL-AUDIO-TUNING.md b/device/tegu/CALL-AUDIO-TUNING.md new file mode 100644 index 000000000..a9b3c1c5f --- /dev/null +++ b/device/tegu/CALL-AUDIO-TUNING.md @@ -0,0 +1,186 @@ + +# Pixel 9a: call tuning and the first earpiece route + +Status, 2026-11-03: **implemented and tested offline, no phone trial**. +Branch `tegu-call-audio-aec-earpiece` builds on `sitd-tegu-call-audio` +(`d826388`); omamobile-modem-sit 0.3.13. AEC is off by default and call +audio still defaults to `card = none`. The earpiece mode below is a +conservative top-speaker route, not a reproduction of every stock codec +profile setting. This note records the remaining distinction explicitly. + +## Sources and the tuning transport + +Read the owner's saved 9a audio HAL, its AoC utility library, mixer paths, +platform configuration and factory-image `/vendor/etc/aoc` files as data. +No vendor program was run or copied into the repository. Compare the +functional interface with our GPL kernel at +[`253ddb231a89792ea845549c55fb0f04536c9317`](https://github.com/derekross/linux-omarchy-mobile/tree/253ddb231a89792ea845549c55fb0f04536c9317): +`drivers/soc/google/aoc/aoc-interface-gs201.h`, `aoc_char_dev.c`, +`alsa/aoc_alsa_ctl.c`, `alsa/aoc_alsa_hw.c`, and +`sound/soc/codecs/tas2781-{i2c,fmwlib}.c` / `include/sound/tas2x20-tlv.h`. +The kernel worktree is `~/android/mainline/wt-call-test`. + +Stock uses the `fmapmg3hybrid` telephony tuner. Its APMg3 adapter wraps +an unchanged protobuf with this **12-byte little-endian envelope**: + +| Offset | Type | Meaning used by the adapter | +| --- | --- | --- | +| 0 | u16 | 2 (envelope tag; its semantic name is not established here) | +| 2 | u16 | Total envelope plus protobuf length | +| 4 | u32 | 19 for uplink tuning, 20 for downlink tuning | +| 8 | u32 | Protobuf length | +| 12 | bytes | Original protobuf | + +Both operations use AoC address **block 19, component 24, address type 0**. +In `AocTuningCommands::SetParameterBulk`, type 0 selects +**`audio_output_tuning`**, not `audio_input_tuning`: block/component names +do not select the character channel. Write the envelope padded to a full +**16384-byte block** to `/dev/acd-audio_bulk_tx`, then send a **22-byte** +CMD_AUDIO_OUTPUT_SET_PARAMETER_BULK (ID 210 / `0x00d2`) record on +`/dev/acd-audio_output_tuning`: + +| Bytes | Field | +| --- | --- | +| 0, 1 | CMD type 0, counter | +| 2–3 | u16 length 22 | +| 4–5, 6–7 | u16 command ID 210, signed i16 reply initially 0 | +| 8, 9 | u8 block 19, component 24 | +| 10–13, 14–17 | u32 TX offset 0, TX address 0 | +| 18–21 | u32 envelope length, not the padding length | + +Stock's utility has a separate type-1 family using `audio_input_tuning`, +`audio_input_bulk_tx/rx`, ID 234 and a 5120-byte staging buffer. That is +not the APMg3 upload described above. Stock opens the output bulk RX service +as part of its generic descriptor set; this write-only implementation +needs no bulk RX read. The tuning reply comes back on the tuning service. + +`aoc_tuning.py` implements only the two uplink/downlink operations, with +bounded nonblocking writes, one-second readiness/acknowledgement deadlines, +exact record lengths, command/counter matching and a zero reply required. +It never resumes a short record, retries an unknown command, maps SRAM or +opens the CP/AoC shared voice window. `aoc_char_dev` makes the service +opens exclusive. An uncertain write/reply leaves the private RAM marker +`/run/omamobile-sit/aoc-voice-tuning-uncertain`; later tuning attempts refuse. +The unit already preserves its runtime directory. Do not delete the marker +to retry on the same AoC session. + +**Echo reference is a separate ALSA step.** +`VoiceCall::EchoReferencePath::Set` selects **FT AEC Reference Source = +SPEAKER** for the speaker and handset paths. Our kernel's setter caches +that choice; `aoc_audio_modem_mic_input()` uses it as the reference input +when constructing MODEM_INPUT_START_2. Set it before EP4 capture starts. +Its saved value is restored after the PCMs stop. There is no additional SIT +request. The existing EP4/EP5 preparation starts the modem voice path. + +`SendCommonCommand` is not the AEC protobuf transport. Its observed caller +here toggles **microphone compensation** with input-family command 355/356, +using an eight-byte CMD_HDR. Sending those would enable a different feature; +the implementation does not send them. The complete stock hybrid tuner's +band, volume and processing-mode policy is outside this first loader. +Actual echo cancellation still needs a far-end listening test. + +## Files and lifecycle + +`tools/extract-vendor-firmware -d tegu` now copies these six owner files +unchanged into **`usr/lib/firmware/updates/omamobile/tegu/aoc/`** in its +output tree, included in `vendor-firmware.sha256`: + +| Route | Uplink on | Uplink cleanup | Downlink | +| --- | --- | --- | --- | +| Speakerphone | `uplink_speaker_aec_on_config.pb` | `uplink_speaker_aec_off_config.pb` | `downlink_speaker_config.pb` | +| Earpiece | `uplink_handset_aec_on_config.pb` | `uplink_handset_aec_off_config.pb` | `downlink_handset_config.pb` | + +The source is `/vendor/etc/aoc/` in the owner's own 9a image. Do not use +another device's protobufs. HAC, wired, Bluetooth, dock and external-speaker +configs are unnecessary for these two routes. Missing any of these six +fails extraction. The loader requires the selected route's on, off and +downlink files before any upload. Files are not shipped in the package. + +With `[audio] tegu_aec = yes`, the route first saves the mixer state and +verifies sink mute, sets the echo reference, uploads uplink-on and downlink, +and starts capture/playback once with the existing voice parameters. It +then applies and reads back the amplifier attenuation before unmuting. +Hang-up mutes, stops both PCMs, sends the same route's uplink-off package, +closes the tuning services and restores the mixers. **This turns AEC off; +it does not claim to restore an unknown previous protobuf**, and leaves the +selected downlink tuning resident in the inactive telephony component. + +A missing or refused tuning setup refuses audio while call signalling +continues. Unknown setup or failed cleanup leaves the sink muted; the CP +is never stopped or reset. Tests cover cleanup, stale/mismatched/negative +acknowledgements, short writes and an unknown outcome blocking another call. + +## Earpiece mapping and the limit of the stock comparison + +The stock GPL TAS parser is +[Google amplifiers `33976d763bc0ace11603e7ecb207fc2b6e3f2608`](https://android.googlesource.com/kernel/google-modules/amplifiers/+/33976d763bc0ace11603e7ecb207fc2b6e3f2608/tas25xx/src/tas25xx-regbin-parser.c). +It builds playback-volume controls from the image's KCNTR table; values +are table indices, not decibels. A bounded private inspection of the owner's +table, following that parser, established: + +| Stock setting | Mainline mapping / implementation | +| --- | --- | +| PLAYBACK_VOLUME_LEFT = 55 | Its coefficient matches **tas2x20 DVC index 220 (unity)**, not index 55. Use a lower first-test level: **Top Speaker Digital Volume = 160 (-30 dB)** | +| Top amplifier only | **Bottom Speaker Digital Volume = 0**, read back before unmuting. This is the table's minimum (-110 dB), not power-off or a hardware mute | +| CODEC PROFILE = voice | Mainline exposes per-amplifier **Speaker Profile Id**, not the vendor enum. The examined native RCA's index **4** is `case05-voice-handset`, but that case contains only one power-state write. It lacks profile 0's full initialization. Selecting 4 on a fresh, uninitialized amplifier is not a complete voice route | +| EM LEFT/RIGHT = OFF | Mainline has **no EM mixer control**. The stock driver writes bits 7:6 of register 0:0:3. The examined full native profile 0 writes EM off; no userspace register write or invented control is added | +| AoC Modem Sink Channel Bitmap | **Read-only**: its SOC_SINGLE_EXT has a get handler and NULL put. It reports a sink's active channel bitmap; it is not a writable TDM-slot selector in this kernel | + +For the first usable top-only mode, retain the existing **full profile 0** +on both amplifiers, load handset AEC/downlink tuning, and attenuate/mute as +above. Refuse earpiece audio if the selected amplifier profiles are not 0, +or AEC was not enabled. This keeps startup on the already working native +initialization instead of treating a profile label as sufficient evidence. +Only the top is intended to be audible; the bottom still powers up. +Exact stock voice-profile and per-amplifier EM control remain a separate +firmware/kernel task if needed after this route is qualified. Gains have +not been acoustically qualified at the ear. + +Configuration (changes apply on the next **fresh CP** session): + +```ini +[audio] +card = none +tegu_aec = no +tegu_route = speaker +``` + +The attended trial chooses `card = auto`, `tegu_aec = yes`, then `speaker` +or `earpiece`. The earpiece mode does not affect the 7 Pro's CS35L41 route; +there is no mid-call route switch in this change. Do not enable it globally. + +## Verification and the attended gate + +Laptop checks, risk **low**, with synthetic service records and an ext4 +fixture containing fictional data only: + +```sh +tests/packages omamobile-modem-sit +tests/extract-tegu-call-tuning +tools/pr-check d826388 +``` + +Expect: all package tests, including the existing cheetah route and sit-sim +calls/SMS, pass; six synthetic tuning files are copied byte-for-byte and +checksummed; missing cleanup tuning fails; the PR gate passes. Stop on a +failure. Rollback is the parent branch or removal of this isolated +worktree. Nothing contacts the phone or executes the saved HAL. + +Before any phone trial, the human reviews a device-specific runbook and +approves the install and fresh boot. First **read-only**, confirm the NV +backup checksums, exact daily kernel/modules, mixer control availability, +profile files and their checksums, and no active call/PCMs. Keep the modem's +sleep inhibitor and once-per-boot rule. Record the actual `uname -r` with +results; no phone kernel release is claimed for these offline checks. + +Then test **speaker AEC only first**, with live kmsg streamed to the laptop, +a watchdog and the human ready to recover. Check command replies, gain +readbacks, two-way audio and the far end's echo before trying the earpiece +on another approved fresh session. Risk **medium**: new AoC tuning and an +unqualified acoustic path. Begin the earpiece test away from the ear at the +fixed attenuation. Stop on an AoC timeout/reset, any NV/UFS error, +unexpected gain, feedback, missing bottom attenuation or unconfirmed +cleanup. Hang up and retain the mute/uncertainty state. Never retry or reset +the running CP in place. Rollback is the previous package/config on an +attended fresh boot; no automatic unit restart, warm modem restart or +manual marker deletion. Hardware results: **not run**. diff --git a/docs/TELEPHONY-APPS-PLAN.md b/docs/TELEPHONY-APPS-PLAN.md index 1e4011606..e71d65364 100644 --- a/docs/TELEPHONY-APPS-PLAN.md +++ b/docs/TELEPHONY-APPS-PLAN.md @@ -207,6 +207,9 @@ On gs201 the voice path never passes through the application processor. **The Ao Beyond the mixer paths, the working stack on this phone model sets `Voice Call Audio Enable`, `Voice Call Mic Source` 1, `Incall Sink Mute` 0, `AoC Modem Downlink ASRC Mode` 1 and a mic gain of 130 cB plus 6 dB. It opens **PCM 4 playback (EP5)** and **PCM 11 capture (EP4)** (MODEM-PLAN 6.1). Our card numbers its PCMs as stock does (AGENTS.md), so those numbers hold. `omamobile-sitd`'s `voice_audio.py` does exactly this and restores every control after the call. Our sound card already describes the back ends these paths need: `BT_RX`/`BT_TX`, `USB_RX`/`USB_TX` and `INCALL_RX`/`INCALL_TX` (`device/cheetah/overlays/aoc-sound-test.dtso`). +The 9a's opt-in AEC upload and conservative earpiece route have a separate +[offline implementation and qualification note](../device/tegu/CALL-AUDIO-TUNING.md). + ### 2.2 The work, per audio route | Route | What's needed | Depends on | Effort | diff --git a/packages/omamobile-modem-sit/etc/omamobile/modem-sit.conf b/packages/omamobile-modem-sit/etc/omamobile/modem-sit.conf index e5a1d2232..a31b8fdea 100644 --- a/packages/omamobile-modem-sit/etc/omamobile/modem-sit.conf +++ b/packages/omamobile-modem-sit/etc/omamobile/modem-sit.conf @@ -147,3 +147,13 @@ earpiece = yes # louder and clean in calls on the 7 Pro) or 0 (stock). The 9a always uses # stock's 130 cB, with no boost. mic_boost_db = 6 + +# Experimental 9a call tuning, from this phone's own factory image. +# Keep off until an attended trial; card = none still disables all audio. +# AEC uploads owner files from /usr/lib/firmware/updates/omamobile/tegu/aoc. +tegu_aec = no +# speaker: both amplifiers at -20 dB; earpiece: top at -30 dB, bottom at +# the minimum digital gain. Earpiece requires tegu_aec = yes and the full +# amplifier profile 0; the stock voice profile has no standalone native +# equivalent. Changing routes mid-call is not implemented. +tegu_route = speaker diff --git a/packages/omamobile-modem-sit/lib/aoc_tuning.py b/packages/omamobile-modem-sit/lib/aoc_tuning.py new file mode 100644 index 000000000..0115c76f6 --- /dev/null +++ b/packages/omamobile-modem-sit/lib/aoc_tuning.py @@ -0,0 +1,121 @@ +# SPDX-License-Identifier: MIT +"""Bounded AoC telephony tuning upload, using the owner's tegu protobufs. + +Only the APMg3 telephony component on audio_output_tuning is addressed. +The GPL AoC interface defines CMD_HDR / SET_PARAMETER_BULK; the route +adapter adds an envelope with tag 2 around each unchanged protobuf. No +vendor executable, shared memory mapping, or arbitrary command API. +""" +import os +from pathlib import Path +import select +import struct + +from paths import RUN + +ROOT = Path('/usr/lib/firmware/updates/omamobile/tegu/aoc') +BULK_SIZE = 16384 +HEADER = struct.Struct(', ..."). PROTECTION = Path(os.environ.get('OMAMOBILE_SPK_STATUS', '/run/omamobile/speaker-protection')) STAGES = ('media', 'c8') @@ -50,6 +52,7 @@ # tas2x20_dvc_table in include/sound/tas2x20-tlv.h: index 220 is unity, # index 180 is -20 dB. Use the index, not the control's misleading dB TLV. TEGU_GAIN = '180' +TEGU_EARPIECE_GAIN = '160' # -30 dB; stock index 55 maps to unity (220) TEGU_GAINS = ('Top Speaker Digital Volume', 'Bottom Speaker Digital Volume') TEGU_ROUTE = ( ('Incall Sink Mute', '1'), @@ -106,7 +109,7 @@ class VoiceAudio: # without earpiece mode (no service installed, or [audio] earpiece = no) earpiece_cmd = None - def __init__(self, *, mic_boost_db=6, card=None, earpiece=True): + def __init__(self, *, mic_boost_db=6, card=None, earpiece=True, tegu_route='speaker', tegu_aec=False): if mic_boost_db not in (0, 6): raise ValueError('unsupported voice microphone boost') self.mic_boost_db = mic_boost_db @@ -118,6 +121,11 @@ def __init__(self, *, mic_boost_db=6, card=None, earpiece=True): # The protection service's earpiece mode is the 7 Pro's CS35L41 # route; the 9a's TAS2572 route sets its own gains. self.earpiece_cmd = None + if tegu_route not in ('speaker', 'earpiece'): + raise ValueError('unsupported tegu call route') + self.tegu_route = tegu_route + self.tegu_aec = tegu_aec + self.tuning = None self.saved = [] self.pcms = [] self.alsa = C.CDLL('libasound.so.2') @@ -267,14 +275,40 @@ def tegu_enter(self): return self # Read everything before changing anything. Mute is first so its # original value is restored last, after closing the voice PCMs. - names = [name for name, _ in TEGU_ROUTE] + list(TEGU_GAINS) - saved = [(name, self.mixer_value(name)) for name in names] + route = list(TEGU_ROUTE) + aec = getattr(self, 'tegu_aec', False) + earpiece = getattr(self, 'tegu_route', 'speaker') == 'earpiece' + if earpiece: + if not aec: + raise AudioRefused('tegu earpiece needs the handset AEC tuning enabled') + # The supplied RCA voice-handset case is only a delta, not a + # standalone initialization. Retain the full profile 0 for + # this conservative top-only route, never guess profile 4. + try: + profiles = [self.mixer_value(amp + ' Speaker Profile Id') for amp in ('Top', 'Bottom')] + except (OSError, RuntimeError, subprocess.TimeoutExpired) as error: + raise AudioRefused('tegu earpiece amplifier profile unavailable') from error + if profiles != ['0', '0']: + raise AudioRefused('tegu earpiece requires the full amplifier profile 0') + if aec: + route.insert(1, ('FT AEC Reference Source', 'SPEAKER')) + names = [name for name, _ in route] + list(TEGU_GAINS) + try: + saved = [(name, self.mixer_value(name)) for name in names] + except (OSError, RuntimeError, subprocess.TimeoutExpired) as error: + raise AudioRefused('tegu call mixer state unavailable') from error self.saved = saved try: - for name, value in TEGU_ROUTE: + for name, value in route: self.mixer('cset', name, value) if name == 'Incall Sink Mute' and self.mixer_value(name) not in ('1', 'on'): raise AudioRefused('tegu call audio refused: sink mute read-back mismatch') + if aec: + try: + self.tuning = VoiceTuning(self.tegu_route) + self.tuning.start() + except (OSError, TuningError) as error: + raise AudioRefused('tegu call audio refused: AoC tuning unavailable or unconfirmed') from error # Capture is ready before playback prepare starts the modem. for device, direction in ((11, 1), (4, 0)): pcm = C.c_void_p() @@ -285,20 +319,28 @@ def tegu_enter(self): self.check(self.alsa.snd_pcm_start(pcm), 'start') # The codec profile resets gain at playback start. These must # happen afterwards, while the modem downlink remains muted. - for name in TEGU_GAINS: - self.mixer('cset', name, TEGU_GAIN) - for name in TEGU_GAINS: + gains = ((TEGU_GAINS[1], '0'), (TEGU_GAINS[0], TEGU_EARPIECE_GAIN)) if earpiece else tuple( + (name, TEGU_GAIN) for name in TEGU_GAINS) + for name, gain in gains: + self.mixer('cset', name, gain) + for name, expected in gains: try: gain = self.mixer_value(name) except (OSError, RuntimeError, subprocess.TimeoutExpired) as error: raise AudioRefused('tegu call audio refused: TAS gain read-back unavailable') from error - if gain != TEGU_GAIN: + if gain != expected: raise AudioRefused('tegu call audio refused: TAS gain read-back mismatch') self.mixer('cset', 'Incall Sink Mute', '0') - print('AoC tegu speakerphone prepared at conservative TAS gain', flush=True) + print('AoC tegu ' + ('earpiece' if earpiece else 'speakerphone') + + ' prepared at conservative TAS gain', flush=True) return self - except BaseException: - self.__exit__(None, None, None) + except BaseException as error: + try: + self.__exit__(None, None, None) + except RuntimeError as cleanup: + if isinstance(error, AudioRefused): + raise AudioRefused('tegu call audio refused; cleanup unconfirmed, sink remains muted') from cleanup + raise raise def __exit__(self, *args): @@ -314,6 +356,13 @@ def __exit__(self, *args): if self.alsa.snd_pcm_close(pcm) < 0: failures.append('PCM close') self.pcms.clear() + if getattr(self, 'tuning', None) is not None: + try: + self.tuning.close() + except (OSError, TuningError): + failures.append('AoC tuning cleanup') + finally: + self.tuning = None for name, value in reversed(self.saved): if getattr(self, 'tegu', False) and name == 'Incall Sink Mute' and failures: continue # uncertain cleanup must leave the call sink muted diff --git a/packages/omamobile-modem-sit/test/test_aoc_tuning.py b/packages/omamobile-modem-sit/test/test_aoc_tuning.py new file mode 100644 index 000000000..e7b34c18b --- /dev/null +++ b/packages/omamobile-modem-sit/test/test_aoc_tuning.py @@ -0,0 +1,172 @@ +# SPDX-License-Identifier: MIT +"""Synthetic AoC service records only; never open a device or use a blob.""" +import env # noqa: F401 +from pathlib import Path +import struct +import tempfile +import unittest +from unittest.mock import patch + +import aoc_tuning as tuning + + +class Services: + def __init__(self): + self.opened = [] + self.closed = [] + self.written = [] + self.reply = None + self.pending = False + self.timeout = False + self.short_fd = None + self.refuse = False + self.bad_reply = False + + def open(self, path, flags): + self.opened.append((path, flags)) + return 10 if path.endswith('output_tuning') else 11 + + def close(self, fd): + self.closed.append(fd) + + def select(self, read, write, errors, timeout): + if write: + return [], write, [] + return (read if (self.pending if timeout == 0 else not self.timeout) else []), [], [] + + def write(self, fd, data): + self.written.append((fd, data)) + if fd == 10: + reply = bytearray(data) + if self.refuse: + struct.pack_into('/dev/null || { echo "ok - tegu call tuning extraction # SKIP missing $tool"; exit 0; } +done +t=$(mktemp -d); trap 'rm -rf "$t"' EXIT +python3 - "$t/vendor" <<'PY' +from pathlib import Path +import sys +r = Path(sys.argv[1]) +files = { + 'build.prop': b'ro.product.vendor.device=tegu\nro.vendor.build.fingerprint=synthetic-test\n', + 'firmware/fw_bcmdhd.bin': b'4383a3-roml Version=1.2.3 (synthetic)', + 'firmware/bcmdhd.cal_4383_a3': b'NVRAMRev=synthetic\n', + 'firmware/bcmdhd_clm.blob_4383_a3': b'synthetic', + 'firmware/bcmdhd_txcap.blob_4383_a3': b'synthetic', + 'firmware/brcm/BCM.hcd': b'BCM4383A3 synthetic[test]', + 'firmware/aoc.bin': b'synthetic', + 'etc/sensors/registry/fictional.json': b'{}\n', +} +for name in ('cs40l26.wmfw', 'cs40l26-calib.wmfw'): + files['firmware/' + name] = b'WMFW' + bytes(6) + b'\x04FIRMWARE_CS40L26 BUZZ_EFFECTS2_BUZZ_LEVEL' +for name in ('cs40l26.bin', 'cs40l26-svc.bin', 'cs40l26-dvl.bin'): + files['firmware/' + name] = b'WMDR-synthetic' +for route in ('speaker', 'handset'): + for name in (f'uplink_{route}_aec_on_config.pb', f'uplink_{route}_aec_off_config.pb', + f'downlink_{route}_config.pb'): + files['etc/aoc/' + name] = b'synthetic-' + name.encode() +for name, data in files.items(): + path = r / name + path.parent.mkdir(parents=True, exist_ok=True) + path.write_bytes(data) +PY +truncate -s 16M "$t/vendor.img" +mkfs.ext4 -q -F -d "$t/vendor" "$t/vendor.img" +tools/extract-vendor-firmware -d tegu -o "$t/out" "$t/vendor.img" > "$t/log" 2>&1 || { cat "$t/log"; exit 1; } +for f in "$t/vendor/etc/aoc/"*.pb; do + cmp "$f" "$t/out/usr/lib/firmware/updates/omamobile/tegu/aoc/$(basename "$f")" +done +(cd "$t/out/usr/lib/firmware/updates" && sha256sum -c "$t/out/vendor-firmware.sha256" >/dev/null) +echo 'ok - all six tegu call tuning files copied unchanged and checksummed' +rm "$t/vendor/etc/aoc/uplink_handset_aec_off_config.pb" +mkfs.ext4 -q -F -d "$t/vendor" "$t/vendor.img" +if tools/extract-vendor-firmware -d tegu -o "$t/missing" "$t/vendor.img" > "$t/log" 2>&1; then + echo 'not ok - missing AEC-off cleanup file accepted' >&2; exit 1 +fi +grep -qF '/vendor/etc/aoc/uplink_handset_aec_off_config.pb is missing' "$t/log" +echo 'ok - missing cleanup tuning fails extraction' diff --git a/tools/extract-vendor-firmware b/tools/extract-vendor-firmware index 534c5d5d0..0465e9d0f 100755 --- a/tools/extract-vendor-firmware +++ b/tools/extract-vendor-firmware @@ -45,6 +45,8 @@ # vendor/firmware/bcmdhd_clm.blob_4383_a3 -> brcm/brcmfmac4383-pcie..clm_blob (regulatory) # vendor/firmware/bcmdhd_txcap.blob_4383_a3 -> brcm/brcmfmac4383-pcie..txcap_blob (TX capabilities) # vendor/firmware/brcm/BCM.hcd -> brcm/BCM..hcd (btbcm) +# vendor/etc/aoc/{uplink_{speaker,handset}_aec_{on,off},downlink_{speaker,handset}}_config.pb +# -> omamobile/tegu/aoc/ (call tuning, unchanged owner files) # vendor/firmware/aoc.bin -> aoc-tegu.bin (the AoC DSP, under the 9a's own name) # vendor/etc/sensors/registry/ -> /usr/share/omamobile/sensors/registry/ # vendor/firmware/cs40l26*.{wmfw,bin} -> the same five files as cheetah's @@ -210,6 +212,12 @@ case $DEVICE_OPT in "firmware/bcmdhd_txcap.blob_4383_a3|brcm/$FW_BASE.$BOARD.txcap_blob" "firmware/brcm/BCM.hcd|brcm/BCM.$BOARD.hcd" "firmware/aoc.bin|aoc-tegu.bin" + "etc/aoc/uplink_speaker_aec_on_config.pb|omamobile/tegu/aoc/uplink_speaker_aec_on_config.pb" + "etc/aoc/uplink_speaker_aec_off_config.pb|omamobile/tegu/aoc/uplink_speaker_aec_off_config.pb" + "etc/aoc/downlink_speaker_config.pb|omamobile/tegu/aoc/downlink_speaker_config.pb" + "etc/aoc/uplink_handset_aec_on_config.pb|omamobile/tegu/aoc/uplink_handset_aec_on_config.pb" + "etc/aoc/uplink_handset_aec_off_config.pb|omamobile/tegu/aoc/uplink_handset_aec_off_config.pb" + "etc/aoc/downlink_handset_config.pb|omamobile/tegu/aoc/downlink_handset_config.pb" "firmware/cs40l26.wmfw|cs40l26.wmfw" "firmware/cs40l26.bin|cs40l26.bin" "firmware/cs40l26-svc.bin|cs40l26-svc.bin" From 1ce21c78124feb82dcf758d5ef238e4c3a0288f0 Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Tue, 3 Nov 2026 06:26:46 -0647 Subject: [PATCH 21/31] omamobile-modem-sit: a second start in the same boot gets data and IMS back Restarting omamobile-sitd failed at once on what the earlier run left in /run/omamobile-sit, though the modem had dropped its bearers when that sitd stopped. Now, after registration and before any setup, sitd clears the earlier start's bearer records, the IMS registration and the record of the modem's own bearers, but only when the modem lists no bearer at all, and only records whose setup had a confirmed outcome. An unanswered reservation stays, so activate() refuses and the start waits for a reboot. If the IMS registration was cleared, sitd sends stock's DelPdnInfo for the old PDN first, so the modem's IMS stack registers again. The LTE-only check also refuses a damaged saved original. On the palmtop a restart got data and signal back (2026-11-02); IMS with the withdrawal hasn't run yet. The sitd unit's comment, MODEM-CLIENT and MODEM-PLAN now describe a second start-up after a clean stop; after a failed one, reboot. --- device/cheetah/MODEM-CLIENT.md | 9 +++-- device/cheetah/MODEM-PLAN.md | 7 ++-- packages/omamobile-modem-sit/lib/bringup.py | 10 ++++-- packages/omamobile-modem-sit/lib/data_call.py | 32 +++++++++++++++++ packages/omamobile-modem-sit/lib/ims.py | 14 ++++++++ .../omamobile-modem-sit/lib/radio_settings.py | 4 ++- .../systemd/omamobile-sitd.service | 4 ++- .../test/test_attach_bearer.py | 2 +- .../omamobile-modem-sit/test/test_bringup.py | 30 +++++++++++++--- .../test/test_carrier_manifest.py | 2 +- .../test/test_data_call.py | 35 +++++++++++++++++++ packages/omamobile-modem-sit/test/test_ims.py | 21 +++++++++++ .../test/test_radio_settings.py | 21 +++++++++++ packages/omamobile-modem-sit/version | 2 +- 14 files changed, 177 insertions(+), 16 deletions(-) diff --git a/device/cheetah/MODEM-CLIENT.md b/device/cheetah/MODEM-CLIENT.md index 8561bb114..665890420 100644 --- a/device/cheetah/MODEM-CLIENT.md +++ b/device/cheetah/MODEM-CLIENT.md @@ -52,8 +52,13 @@ Two packages: Units (`systemd/`), none enabled by the package: - `omamobile-sitd.service`: `Type=notify`, `Requires=`/`After=omamobile-modem.service`, - `ExecStart=omamobile-sitd --bringup`, `Restart=no` (a second start-up on - the same CP is not supported: reboot), `TimeoutStartSec=15min`. + `ExecStart=omamobile-sitd --bringup`, `Restart=no` (it never restarts on + its own), `TimeoutStartSec=15min`. A second start-up on the same CP after + a clean stop clears the earlier start's bearer records whose setup was + confirmed (a reservation with no confirmed outcome stays, and the start + refuses), withdraws the old IMS PDN with DelPdnInfo, and sets up again. + On the 9a this brought data back (2026-11-02); IMS after the withdrawal + hasn't run yet. After a failed start-up, reboot. - `omamobile-sit-data.service`: after the RIL is ready; `omamobile-sit data on|off` starts and stops it. - `/usr/lib/NetworkManager/conf.d/90-omamobile-rmnet.conf`: `rmnet*` unmanaged. diff --git a/device/cheetah/MODEM-PLAN.md b/device/cheetah/MODEM-PLAN.md index 0b9f05962..3e6c12a88 100644 --- a/device/cheetah/MODEM-PLAN.md +++ b/device/cheetah/MODEM-PLAN.md @@ -1514,7 +1514,7 @@ tools/phone-ssh 'omamobile-sit status; systemctl is-active omamobile-sitd' # pass: "network: home LTE ..."; "IMS voice: yes, SMS: yes, data bearer: up"; active # stop: the unit fails (journal names the step: SIM timeout, registration deadline, "data call # did not become active" with its status, IMS deadline). Record the step and status, then reboot -# before another try (a second start-up on the same CP isn't supported; about one start in twenty +# before another try (a second start-up after a failed one isn't qualified; about one start in twenty # crashed the CP during registration on this phone model: the watcher records it) # rollback: `omamobile-sit radio off` (AT+CFUN=0: deregisters; turning it on again may stall # registration until a reboot), then `systemctl stop omamobile-sitd`; or reboot @@ -2508,8 +2508,9 @@ a status. About one fresh CP start in twenty crashed during registration on this phone model (section 4): a crash is recorded, and a reboot recovers it. -**A second start-up on the same CP is not supported**: after any failed -step, reboot before the next try. Every reboot with the modem up powers +**A second start-up after a failed step isn't qualified**: reboot before +the next try. (After a clean stop, a second start-up sets up again: +MODEM-CLIENT, the sitd unit.) Every reboot with the modem up powers it off: one recovered UFS error-handler pass, expected (M2.6, not yet attributed to an edge; M4.1j/M4.1k proved the reboot itself clean). diff --git a/packages/omamobile-modem-sit/lib/bringup.py b/packages/omamobile-modem-sit/lib/bringup.py index 50b86e868..623fc81a9 100644 --- a/packages/omamobile-modem-sit/lib/bringup.py +++ b/packages/omamobile-modem-sit/lib/bringup.py @@ -47,10 +47,10 @@ from at import radio, radio_state import carrier_apn from data_call import APN_TYPES, activate, attach_bearer, configured_profiles, entries, initial_attach -from data_call import owned_ids, provision_profiles, record_modem_owned, summary +from data_call import clear_stale, owned_ids, provision_profiles, record_modem_owned, summary import data_call from data_call import paths as bearer_paths -from ims import register, start_stack +from ims import REGISTRATION, register, start_stack, withdraw_stale from isim import bearer_dns, ipv6_pcscf, resolve_on_bearer, resolve_system from radio_settings import SAVED_NR, nr_mode from sit import ModemError @@ -479,6 +479,12 @@ def registered(): wait_for(service, registered, timeout, stopped) registered_at = time.monotonic() data_snapshot(client, 'at registration') + # A second start-up in the same boot: clear what an earlier sitd left + # (only when the modem lists no bearer), and withdraw its IMS PDN. + stale_ims = REGISTRATION.exists() + clear_stale(client) + if stale_ims and not REGISTRATION.exists(): + withdraw_stale(client) attach = None if attach_none: # Before sitd sets up anything: every bearer listed now is the diff --git a/packages/omamobile-modem-sit/lib/data_call.py b/packages/omamobile-modem-sit/lib/data_call.py index ebe75f0c4..7307f3f8e 100644 --- a/packages/omamobile-modem-sit/lib/data_call.py +++ b/packages/omamobile-modem-sit/lib/data_call.py @@ -190,6 +190,38 @@ def owned_ids(): return result +def clear_stale(client): + """At start-up, an ownership record the modem doesn't list is left from an + earlier sitd in this boot: its bearers, and the IMS registration on them, + ended when that sitd stopped. Clear the records only when the modem lists + no bearer at all, and only those whose setup had a confirmed outcome (the + response was saved). A reservation written before a setup that never got + an answer stays, with the IMS registration on it, so activate() refuses + and the start waits for an attended reboot, as for any unknown outcome.""" + if call_ids(client.request(0x0602)): + return 0 + stale, uncertain = [], [] + for cid in (INTERNET_CID, IMS_CID): + state, response = paths(cid) + if state.exists() and not response.exists(): + uncertain.append(cid) + else: + stale += [p for p in (state, response) if p.exists()] + registration = paths(IMS_CID)[0].with_name('ims-registration.json') + if registration.exists() and IMS_CID not in uncertain: + stale.append(registration) + # The modem's own bearers ended too. + if MODEM_OWNED.exists(): + stale.append(MODEM_OWNED) + for path in stale: + path.unlink() + if stale: + print(f'cleared {len(stale)} bearer record(s) from an earlier start', flush=True) + if uncertain: + print(f'kept the reservation for CID(s) {uncertain}: their setup never had a confirmed outcome', flush=True) + return len(stale) + + def private_write(path, data): fd = os.open(path, os.O_WRONLY | os.O_CREAT | os.O_TRUNC | os.O_CLOEXEC, 0o600) with os.fdopen(fd, 'wb') as out: diff --git a/packages/omamobile-modem-sit/lib/ims.py b/packages/omamobile-modem-sit/lib/ims.py index 043635ebf..ae513c2be 100644 --- a/packages/omamobile-modem-sit/lib/ims.py +++ b/packages/omamobile-modem-sit/lib/ims.py @@ -13,6 +13,7 @@ from data_call import paths, call_ids, entries, ims_capable, modem_owned_ids, pcscf_addresses, private_write, summary from paths import RUN +from sit import ModemError REGISTRATION = RUN / 'ims-registration.json' @@ -205,6 +206,19 @@ def register(client, *, pcscf_required=True, pcscf_fallback=None, attach=None): print('IMS PDN information accepted; awaiting registration indication', flush=True) +def withdraw_stale(client): + """An earlier sitd in this boot registered IMS on a bearer the modem has + since dropped: tell the modem's IMS stack that PDN is gone, as stock's + DelPdnInfo does, so the next ADD_PDN_INFO registers again. Without it a + restarted sitd's ADD_PDN_INFO was accepted and no registration came + (the 9a, 2026-11-02). A refusal is logged and the start goes on.""" + try: + client.request(0x0d38, bytes([1, 2, 0]), timeout=30) + print('IMS PDN of the earlier start withdrawn', flush=True) + except ModemError as error: + print(f'IMS PDN of the earlier start not withdrawn ({error}); registering anyway', flush=True) + + def unregister(client): if not REGISTRATION.exists(): raise RuntimeError('no owned IMS registration attempt') diff --git a/packages/omamobile-modem-sit/lib/radio_settings.py b/packages/omamobile-modem-sit/lib/radio_settings.py index e8303914a..9e30cce7a 100644 --- a/packages/omamobile-modem-sit/lib/radio_settings.py +++ b/packages/omamobile-modem-sit/lib/radio_settings.py @@ -24,7 +24,9 @@ def nr_mode(client, restore=False): if SAVED_NR.exists(): # An earlier start-up on this CP (sitd started again in the same # boot) already set mode 0 and kept the original: nothing to do. - if current == b'\0': + # Any other value after that change, or a damaged saved original, + # is an unknown state: refuse. + if current == b'\0' and len(SAVED_NR.read_bytes()) == 1: print('verified NR mode 0 (set by an earlier start-up this boot)', flush=True) return raise RuntimeError('NR experiment already active') diff --git a/packages/omamobile-modem-sit/systemd/omamobile-sitd.service b/packages/omamobile-modem-sit/systemd/omamobile-sitd.service index f235d22a7..54c9cc489 100644 --- a/packages/omamobile-modem-sit/systemd/omamobile-sitd.service +++ b/packages/omamobile-modem-sit/systemd/omamobile-sitd.service @@ -3,7 +3,9 @@ # bearer, IMS) and then serves calls and SMS on /run/omamobile-sit/socket. # Not enabled by the package: MODEM-PLAN.md M4 enables it after the gated # first runs. It needs the modem unit's CP ONLINE and never restarts on its -# own: a second start-up on the same CP is not supported (reboot instead). +# own. A second start-up on the same CP after a clean stop clears the earlier +# start's confirmed bearer records, withdraws its IMS PDN and sets up again +# (MODEM-CLIENT); after a failed start-up, reboot instead. [Unit] Description=Omarchy Mobile SIT RIL (S5300 calls, SMS, registration) # The device modem-policy package supplies its modem dependency as a drop-in. diff --git a/packages/omamobile-modem-sit/test/test_attach_bearer.py b/packages/omamobile-modem-sit/test/test_attach_bearer.py index d04df240f..22a473a78 100644 --- a/packages/omamobile-modem-sit/test/test_attach_bearer.py +++ b/packages/omamobile-modem-sit/test/test_attach_bearer.py @@ -269,7 +269,7 @@ def find(svc, deadline, stopped, *, adopt_unknown): patch.object(bringup, 'provision_profiles') as profiles, \ patch.object(bringup, 'nr_mode'), patch.object(bringup, 'data_snapshot'), \ patch.object(bringup, 'find_attach_bearer', side_effect=find), \ - patch.object(bringup, 'activate') as activate, patch.object(bringup, 'start_stack'), \ + patch.object(bringup, 'clear_stale', return_value=0), patch.object(bringup, 'activate') as activate, patch.object(bringup, 'start_stack'), \ patch.object(bringup, 'register') as register, patch('builtins.print'): bringup.start(service, settings) sent = [c.args[0] for c in service.client.request.call_args_list] diff --git a/packages/omamobile-modem-sit/test/test_bringup.py b/packages/omamobile-modem-sit/test/test_bringup.py index 5d3eec664..8cf0d740d 100644 --- a/packages/omamobile-modem-sit/test/test_bringup.py +++ b/packages/omamobile-modem-sit/test/test_bringup.py @@ -67,7 +67,7 @@ def test_failed_data_setup_never_attempts_ims(self): with patch.object(bringup, 'wait_for'), patch.object(bringup, 'radio'), \ patch.object(bringup, 'radio_state', return_value=0), \ patch.object(bringup, 'initial_attach'), patch.object(bringup, 'provision_profiles'), \ - patch.object(bringup, 'nr_mode'), patch.object(bringup, 'activate', side_effect=TimeoutError), \ + patch.object(bringup, 'nr_mode'), patch.object(bringup, 'clear_stale', return_value=0), patch.object(bringup, 'activate', side_effect=TimeoutError), \ patch.object(bringup, 'data_snapshot'), \ patch.object(bringup, 'start_stack') as stack, patch.object(bringup, 'register') as register: with self.assertRaises(TimeoutError): @@ -244,11 +244,33 @@ def attach_run(self, attach_apn): patch.object(bringup, 'initial_attach') as attach, \ patch.object(bringup, 'provision_profiles') as profile, \ patch.object(bringup, 'nr_mode'), patch.object(bringup, 'data_snapshot'), \ - patch.object(bringup, 'activate', side_effect=TimeoutError) as activate: + patch.object(bringup, 'clear_stale', return_value=0), patch.object(bringup, 'activate', side_effect=TimeoutError) as activate: with self.assertRaises(TimeoutError): bringup.start(service, settings) return attach, profile, activate + def withdraw_case(self, *, registered, cleared): + service = Mock() + registration = Mock() + registration.exists.side_effect = [registered, registered and not cleared] + with patch.object(bringup, 'wait_for'), patch.object(bringup, 'radio'), \ + patch.object(bringup, 'radio_state', return_value=0), \ + patch.object(bringup, 'initial_attach'), patch.object(bringup, 'provision_profiles'), \ + patch.object(bringup, 'nr_mode'), patch.object(bringup, 'data_snapshot'), \ + patch.object(bringup, 'REGISTRATION', registration), \ + patch.object(bringup, 'clear_stale', return_value=cleared), \ + patch.object(bringup, 'withdraw_stale') as withdraw, \ + patch.object(bringup, 'activate', side_effect=TimeoutError): + with self.assertRaises(TimeoutError): + bringup.start(service, SETTINGS) + return withdraw + + def test_a_stale_ims_registration_is_withdrawn_before_the_bearers(self): + self.withdraw_case(registered=True, cleared=5).assert_called_once() + self.withdraw_case(registered=False, cleared=4).assert_not_called() + # The modem still lists a bearer: nothing cleared, nothing withdrawn. + self.withdraw_case(registered=True, cleared=0).assert_not_called() + def test_attach_apn_is_used_only_for_the_initial_attach(self): attach, profile, activate = self.attach_run('ims.example') self.assertEqual(attach.call_args.args[1], 'ims.example') @@ -319,7 +341,7 @@ def note(name): patch.object(bringup, 'provision_profiles', side_effect=note('profiles')), patch.object(bringup, 'nr_mode', side_effect=note('nr')), patch.object(bringup, 'data_snapshot'), - patch.object(bringup, 'activate', side_effect=TimeoutError('stop here'))] + patch.object(bringup, 'clear_stale', return_value=0), patch.object(bringup, 'activate', side_effect=TimeoutError('stop here'))] printer = patch('builtins.print') if times: patches.append(patch.object(bringup.time, 'monotonic', side_effect=times)) @@ -459,7 +481,7 @@ def run_ims(self, value): patch.object(bringup, 'radio_state', return_value=0), \ patch.object(bringup, 'initial_attach'), patch.object(bringup, 'provision_profiles'), \ patch.object(bringup, 'nr_mode'), patch.object(bringup, 'data_snapshot'), \ - patch.object(bringup, 'activate'), patch.object(bringup, 'start_stack'), \ + patch.object(bringup, 'clear_stale', return_value=0), patch.object(bringup, 'activate'), patch.object(bringup, 'start_stack'), \ patch.object(bringup, 'find_attach_bearer', return_value=None), \ patch.object(bringup, 'ipv6_pcscf', return_value=['x']) as read, \ patch.object(bringup, 'register', side_effect=RuntimeError('stop')) as register, \ diff --git a/packages/omamobile-modem-sit/test/test_carrier_manifest.py b/packages/omamobile-modem-sit/test/test_carrier_manifest.py index b181c0f92..834998c6f 100644 --- a/packages/omamobile-modem-sit/test/test_carrier_manifest.py +++ b/packages/omamobile-modem-sit/test/test_carrier_manifest.py @@ -124,7 +124,7 @@ def wait(svc, predicate, seconds, stopped): patch.object(bringup, 'initial_attach'), patch.object(bringup, 'provision_profiles'), \ patch.object(bringup, 'radio_state', return_value=0), \ patch.object(bringup, 'nr_mode'), patch.object(bringup, 'data_snapshot'), \ - patch.object(bringup, 'activate'), patch.object(bringup, 'find_attach_bearer', return_value=None), \ + patch.object(bringup, 'clear_stale', return_value=0), patch.object(bringup, 'activate'), patch.object(bringup, 'find_attach_bearer', return_value=None), \ patch.object(bringup, 'start_stack', side_effect=lambda c: order.append('stack')), \ patch.object(bringup, 'register', side_effect=RuntimeError('stop here')), \ patch('builtins.print') as out: diff --git a/packages/omamobile-modem-sit/test/test_data_call.py b/packages/omamobile-modem-sit/test/test_data_call.py index ebc7dc6c4..f31e0ed26 100644 --- a/packages/omamobile-modem-sit/test/test_data_call.py +++ b/packages/omamobile-modem-sit/test/test_data_call.py @@ -59,6 +59,41 @@ def tearDown(self): item.stop() self.directory.cleanup() + def test_records_of_an_earlier_start_are_cleared_when_the_modem_lists_none(self): + class Empty: + def request(self, ident, payload=b'', **kwargs): + return b'\0' + ims_state, ims_response = data_call.paths(2) + registration = ims_state.with_name('ims-registration.json') + records = (self.state, self.response, ims_state, ims_response, registration) + for path in records: + path.write_text('{}') + data_call.clear_stale(Empty()) + for path in records: + self.assertFalse(path.exists()) + + def test_a_reservation_without_a_confirmed_outcome_stays(self): + class Empty: + def request(self, ident, payload=b'', **kwargs): + return b'\0' + ims_state, ims_response = data_call.paths(2) + registration = ims_state.with_name('ims-registration.json') + for path in (self.state, self.response, ims_state, registration): + path.write_text('{}') + data_call.clear_stale(Empty()) + self.assertFalse(self.state.exists() or self.response.exists()) # confirmed: cleared + self.assertTrue(ims_state.exists() and registration.exists()) # IMS setup unanswered + + def test_records_stay_while_the_modem_lists_a_bearer(self): + class Listed: + def request(self, ident, payload=b'', **kwargs): + record = bytearray(132) + record[2] = 1 + return b'\1' + bytes(record) + self.state.write_text('{}') + data_call.clear_stale(Listed()) + self.assertTrue(self.state.exists()) + def test_rejected_setup_leaves_no_ownership(self): modem = Modem(status=36) with self.assertRaises(RuntimeError): diff --git a/packages/omamobile-modem-sit/test/test_ims.py b/packages/omamobile-modem-sit/test/test_ims.py index 12b270a6e..cf64944b4 100644 --- a/packages/omamobile-modem-sit/test/test_ims.py +++ b/packages/omamobile-modem-sit/test/test_ims.py @@ -4,7 +4,10 @@ import ipaddress import struct import unittest +from unittest.mock import Mock from data_call import pcscf_addresses +import ims +from sit import ModemError from ims import REG_STATUS, add_pdn_payload, hidden_menu, oma_dm_menu @@ -122,5 +125,23 @@ def test_configuration_segment_length_and_complete_flag(self): self.assertEqual(packet[3:9], struct.pack(' Date: Tue, 3 Nov 2026 08:17:02 -0647 Subject: [PATCH 22/31] omamobile-modem-sit: a restart with the radio on releases the earlier start's bearers A start-up no longer cycles a radio that is already on, so after a sitd restart the modem still lists the earlier start's internet and IMS bearers, the stale-record cleanup rightly leaves them, and activate() refused (the palmtop, 2026-11-03). When the modem lists exactly the bearers our confirmed records own, start-up now releases them, IMS first (DelPdnInfo, then its bearer), and sets up again. A bearer we don't own, a missing one or an unconfirmed record still leave it to activate() to refuse, and a release that fails stops the start for an attended reboot. --- packages/omamobile-modem-sit/lib/bringup.py | 36 ++++++++++++++++--- .../test/test_attach_bearer.py | 2 +- .../omamobile-modem-sit/test/test_bringup.py | 34 +++++++++++++++--- .../test/test_carrier_manifest.py | 2 +- 4 files changed, 63 insertions(+), 11 deletions(-) diff --git a/packages/omamobile-modem-sit/lib/bringup.py b/packages/omamobile-modem-sit/lib/bringup.py index 623fc81a9..415ddcc7b 100644 --- a/packages/omamobile-modem-sit/lib/bringup.py +++ b/packages/omamobile-modem-sit/lib/bringup.py @@ -47,10 +47,11 @@ from at import radio, radio_state import carrier_apn from data_call import APN_TYPES, activate, attach_bearer, configured_profiles, entries, initial_attach -from data_call import clear_stale, owned_ids, provision_profiles, record_modem_owned, summary +from data_call import call_ids, clear_stale, deactivate, modem_owned_ids, owned_ids, provision_profiles +from data_call import record_modem_owned, summary import data_call from data_call import paths as bearer_paths -from ims import REGISTRATION, register, start_stack, withdraw_stale +from ims import REGISTRATION, register, start_stack, unregister, withdraw_stale from isim import bearer_dns, ipv6_pcscf, resolve_on_bearer, resolve_system from radio_settings import SAVED_NR, nr_mode from sit import ModemError @@ -336,6 +337,29 @@ def wait_for(service, predicate, seconds, stopped): raise TimeoutError('Modem registration deadline exceeded') +def release_owned(client): + """A second start-up with the radio left on: the modem still lists the + earlier start's bearers (a start-up no longer cycles a radio that is on). + When it lists exactly the bearers our confirmed records own, release them, + IMS first (DelPdnInfo, then its bearer), and set up again. Anything else, + an unconfirmed record or a bearer we don't own, is left for activate() to + refuse. A release that fails stops the start-up: attended reboot.""" + owned = owned_ids() + listed = call_ids(client.request(0x0602)) - modem_owned_ids() + if not owned or listed != owned: + return False + if any(not bearer_paths(cid)[1].exists() for cid in owned): + return False + if data_call.IMS_CID in owned: + if REGISTRATION.exists(): + unregister(client) + deactivate(client, data_call.IMS_CID) + for cid in sorted(owned - {data_call.IMS_CID}): + deactivate(client, cid) + print("released the earlier start-up's bearers", flush=True) + return True + + def start(service, settings, stopped=lambda: False): client = service.client net = settings['network'] @@ -482,9 +506,11 @@ def registered(): # A second start-up in the same boot: clear what an earlier sitd left # (only when the modem lists no bearer), and withdraw its IMS PDN. stale_ims = REGISTRATION.exists() - clear_stale(client) - if stale_ims and not REGISTRATION.exists(): - withdraw_stale(client) + if clear_stale(client): + if stale_ims and not REGISTRATION.exists(): + withdraw_stale(client) + else: + release_owned(client) attach = None if attach_none: # Before sitd sets up anything: every bearer listed now is the diff --git a/packages/omamobile-modem-sit/test/test_attach_bearer.py b/packages/omamobile-modem-sit/test/test_attach_bearer.py index 22a473a78..b8c083477 100644 --- a/packages/omamobile-modem-sit/test/test_attach_bearer.py +++ b/packages/omamobile-modem-sit/test/test_attach_bearer.py @@ -269,7 +269,7 @@ def find(svc, deadline, stopped, *, adopt_unknown): patch.object(bringup, 'provision_profiles') as profiles, \ patch.object(bringup, 'nr_mode'), patch.object(bringup, 'data_snapshot'), \ patch.object(bringup, 'find_attach_bearer', side_effect=find), \ - patch.object(bringup, 'clear_stale', return_value=0), patch.object(bringup, 'activate') as activate, patch.object(bringup, 'start_stack'), \ + patch.object(bringup, 'clear_stale', return_value=0), patch.object(bringup, 'release_owned', return_value=False), patch.object(bringup, 'activate') as activate, patch.object(bringup, 'start_stack'), \ patch.object(bringup, 'register') as register, patch('builtins.print'): bringup.start(service, settings) sent = [c.args[0] for c in service.client.request.call_args_list] diff --git a/packages/omamobile-modem-sit/test/test_bringup.py b/packages/omamobile-modem-sit/test/test_bringup.py index 8cf0d740d..9fbaffe00 100644 --- a/packages/omamobile-modem-sit/test/test_bringup.py +++ b/packages/omamobile-modem-sit/test/test_bringup.py @@ -67,7 +67,7 @@ def test_failed_data_setup_never_attempts_ims(self): with patch.object(bringup, 'wait_for'), patch.object(bringup, 'radio'), \ patch.object(bringup, 'radio_state', return_value=0), \ patch.object(bringup, 'initial_attach'), patch.object(bringup, 'provision_profiles'), \ - patch.object(bringup, 'nr_mode'), patch.object(bringup, 'clear_stale', return_value=0), patch.object(bringup, 'activate', side_effect=TimeoutError), \ + patch.object(bringup, 'nr_mode'), patch.object(bringup, 'clear_stale', return_value=0), patch.object(bringup, 'release_owned', return_value=False), patch.object(bringup, 'activate', side_effect=TimeoutError), \ patch.object(bringup, 'data_snapshot'), \ patch.object(bringup, 'start_stack') as stack, patch.object(bringup, 'register') as register: with self.assertRaises(TimeoutError): @@ -244,7 +244,7 @@ def attach_run(self, attach_apn): patch.object(bringup, 'initial_attach') as attach, \ patch.object(bringup, 'provision_profiles') as profile, \ patch.object(bringup, 'nr_mode'), patch.object(bringup, 'data_snapshot'), \ - patch.object(bringup, 'clear_stale', return_value=0), patch.object(bringup, 'activate', side_effect=TimeoutError) as activate: + patch.object(bringup, 'clear_stale', return_value=0), patch.object(bringup, 'release_owned', return_value=False), patch.object(bringup, 'activate', side_effect=TimeoutError) as activate: with self.assertRaises(TimeoutError): bringup.start(service, settings) return attach, profile, activate @@ -259,6 +259,7 @@ def withdraw_case(self, *, registered, cleared): patch.object(bringup, 'nr_mode'), patch.object(bringup, 'data_snapshot'), \ patch.object(bringup, 'REGISTRATION', registration), \ patch.object(bringup, 'clear_stale', return_value=cleared), \ + patch.object(bringup, 'release_owned', return_value=False), \ patch.object(bringup, 'withdraw_stale') as withdraw, \ patch.object(bringup, 'activate', side_effect=TimeoutError): with self.assertRaises(TimeoutError): @@ -271,6 +272,31 @@ def test_a_stale_ims_registration_is_withdrawn_before_the_bearers(self): # The modem still lists a bearer: nothing cleared, nothing withdrawn. self.withdraw_case(registered=True, cleared=0).assert_not_called() + def release_case(self, *, owned, listed, confirmed=True, registered=True): + client = Mock() + response = Mock() + response.exists.return_value = confirmed + registration = Mock() + registration.exists.return_value = registered + order = [] + with patch.object(bringup, 'owned_ids', return_value=set(owned)), \ + patch.object(bringup, 'call_ids', return_value=set(listed)), \ + patch.object(bringup, 'modem_owned_ids', return_value=set()), \ + patch.object(bringup, 'bearer_paths', return_value=(Mock(), response)), \ + patch.object(bringup, 'REGISTRATION', registration), \ + patch.object(bringup, 'unregister', side_effect=lambda c: order.append('unregister')), \ + patch.object(bringup, 'deactivate', side_effect=lambda c, cid: order.append(cid)): + return bringup.release_owned(client), order + + def test_a_restart_with_the_radio_on_releases_exactly_our_bearers(self): + self.assertEqual(self.release_case(owned={1, 2}, listed={1, 2}), (True, ['unregister', 2, 1])) + self.assertEqual(self.release_case(owned={1, 2}, listed={1, 2}, registered=False), (True, [2, 1])) + # A bearer we don't own, one we own missing, or an unconfirmed setup: nothing + self.assertEqual(self.release_case(owned={1, 2}, listed={1, 2, 4}), (False, [])) + self.assertEqual(self.release_case(owned={1, 2}, listed={1}), (False, [])) + self.assertEqual(self.release_case(owned={1, 2}, listed={1, 2}, confirmed=False), (False, [])) + self.assertEqual(self.release_case(owned=set(), listed={1}), (False, [])) + def test_attach_apn_is_used_only_for_the_initial_attach(self): attach, profile, activate = self.attach_run('ims.example') self.assertEqual(attach.call_args.args[1], 'ims.example') @@ -341,7 +367,7 @@ def note(name): patch.object(bringup, 'provision_profiles', side_effect=note('profiles')), patch.object(bringup, 'nr_mode', side_effect=note('nr')), patch.object(bringup, 'data_snapshot'), - patch.object(bringup, 'clear_stale', return_value=0), patch.object(bringup, 'activate', side_effect=TimeoutError('stop here'))] + patch.object(bringup, 'clear_stale', return_value=0), patch.object(bringup, 'release_owned', return_value=False), patch.object(bringup, 'activate', side_effect=TimeoutError('stop here'))] printer = patch('builtins.print') if times: patches.append(patch.object(bringup.time, 'monotonic', side_effect=times)) @@ -481,7 +507,7 @@ def run_ims(self, value): patch.object(bringup, 'radio_state', return_value=0), \ patch.object(bringup, 'initial_attach'), patch.object(bringup, 'provision_profiles'), \ patch.object(bringup, 'nr_mode'), patch.object(bringup, 'data_snapshot'), \ - patch.object(bringup, 'clear_stale', return_value=0), patch.object(bringup, 'activate'), patch.object(bringup, 'start_stack'), \ + patch.object(bringup, 'clear_stale', return_value=0), patch.object(bringup, 'release_owned', return_value=False), patch.object(bringup, 'activate'), patch.object(bringup, 'start_stack'), \ patch.object(bringup, 'find_attach_bearer', return_value=None), \ patch.object(bringup, 'ipv6_pcscf', return_value=['x']) as read, \ patch.object(bringup, 'register', side_effect=RuntimeError('stop')) as register, \ diff --git a/packages/omamobile-modem-sit/test/test_carrier_manifest.py b/packages/omamobile-modem-sit/test/test_carrier_manifest.py index 834998c6f..f3540a1f7 100644 --- a/packages/omamobile-modem-sit/test/test_carrier_manifest.py +++ b/packages/omamobile-modem-sit/test/test_carrier_manifest.py @@ -124,7 +124,7 @@ def wait(svc, predicate, seconds, stopped): patch.object(bringup, 'initial_attach'), patch.object(bringup, 'provision_profiles'), \ patch.object(bringup, 'radio_state', return_value=0), \ patch.object(bringup, 'nr_mode'), patch.object(bringup, 'data_snapshot'), \ - patch.object(bringup, 'clear_stale', return_value=0), patch.object(bringup, 'activate'), patch.object(bringup, 'find_attach_bearer', return_value=None), \ + patch.object(bringup, 'clear_stale', return_value=0), patch.object(bringup, 'release_owned', return_value=False), patch.object(bringup, 'activate'), patch.object(bringup, 'find_attach_bearer', return_value=None), \ patch.object(bringup, 'start_stack', side_effect=lambda c: order.append('stack')), \ patch.object(bringup, 'register', side_effect=RuntimeError('stop here')), \ patch('builtins.print') as out: From 01e231373afb6ae1ac95da0db5551b11118c8cc4 Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Tue, 3 Nov 2026 08:46:57 -0647 Subject: [PATCH 23/31] omamobile-modem-sit test: stub the restart cleanup in #373's bring-up tests The bring-up tests added with #373 run start() with a client that answers SIM requests only, so the restart cleanup's bearer list failed to parse. They now stub clear_stale and release_owned, as the other bring-up tests do. --- packages/omamobile-modem-sit/test/test_bringup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/omamobile-modem-sit/test/test_bringup.py b/packages/omamobile-modem-sit/test/test_bringup.py index 9fbaffe00..681d80b85 100644 --- a/packages/omamobile-modem-sit/test/test_bringup.py +++ b/packages/omamobile-modem-sit/test/test_bringup.py @@ -101,6 +101,7 @@ def fake_wait(service_, predicate, seconds, stopped): patch.object(bringup, 'initial_attach') as attach, \ patch.object(bringup, 'provision_profiles') as profiles, \ patch.object(bringup, 'nr_mode'), patch.object(bringup, 'activate') as activate, \ + patch.object(bringup, 'clear_stale', return_value=0), patch.object(bringup, 'release_owned', return_value=False), \ patch.object(bringup, 'data_snapshot'), patch.object(bringup, 'find_attach_bearer', return_value=None), \ patch.object(bringup, 'start_stack'), patch.object(bringup, 'register'), \ patch.object(bringup.carrier_apn, 'OVERRIDES', overrides), \ From 58e8ed542e646e26cdd6ea83ae9f3bd173e3a453 Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Mon, 2 Nov 2026 19:56:33 -0647 Subject: [PATCH 24/31] omamobile-modem-sit 0.3.19: accept the AoC's tuning acknowledgement as it really comes The first call with echo cancellation on the palmtop went silent. The AoC accepted the tuning upload with status 0, but its reply rewrites the second header byte (0x01 sent, 0x3e back), and the check compared the first six bytes, so a successful upload was taken as an unknown outcome and the call audio stayed muted. The check now compares the first byte, the size and the command ID, and the fake AoC in the tests rewrites that byte as the real one does. A refused call now also logs why. --- packages/omamobile-modem-sit/lib/aoc_tuning.py | 5 ++++- packages/omamobile-modem-sit/lib/service.py | 6 ++++-- packages/omamobile-modem-sit/test/test_aoc_tuning.py | 5 ++++- packages/omamobile-modem-sit/version | 2 +- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/packages/omamobile-modem-sit/lib/aoc_tuning.py b/packages/omamobile-modem-sit/lib/aoc_tuning.py index 0115c76f6..9bf659e15 100644 --- a/packages/omamobile-modem-sit/lib/aoc_tuning.py +++ b/packages/omamobile-modem-sit/lib/aoc_tuning.py @@ -76,7 +76,10 @@ def upload(self, data): if not select.select([self.command_fd], [], [], 1)[0]: raise TuningError('AoC tuning acknowledgement deadline exceeded') reply = os.read(self.command_fd, 4096) - if len(reply) != len(command) or reply[:6] != command[:6]: + # The AoC answers with the command's size and ID; it rewrites the + # second header byte (sent 0x01, came back 0x3e on the palmtop, + # 2026-11-02), so that byte isn't compared. + if len(reply) != len(command) or reply[0] != command[0] or reply[2:6] != command[2:6]: raise TuningError('Unexpected AoC tuning acknowledgement') self.uncertain = False UNCERTAIN.unlink() diff --git a/packages/omamobile-modem-sit/lib/service.py b/packages/omamobile-modem-sit/lib/service.py index d568986f6..16969a1b9 100644 --- a/packages/omamobile-modem-sit/lib/service.py +++ b/packages/omamobile-modem-sit/lib/service.py @@ -280,8 +280,10 @@ def audio_start(self): self.audio.__enter__() except (OSError, RuntimeError, ValueError, subprocess.TimeoutExpired) as error: self.audio = None - self.audio_error = str(error) - print('Call audio refused, the call goes on without audio:', error, flush=True) + # The cause says why (an AoC tuning reply, a gain read-back). + cause = f' ({error.__cause__})' if error.__cause__ else '' + self.audio_error = f'{error}{cause}' + print('Call audio refused, the call goes on without audio:', self.audio_error, flush=True) return self.audio_error = '' self.muted = False diff --git a/packages/omamobile-modem-sit/test/test_aoc_tuning.py b/packages/omamobile-modem-sit/test/test_aoc_tuning.py index e7b34c18b..95e3cecb4 100644 --- a/packages/omamobile-modem-sit/test/test_aoc_tuning.py +++ b/packages/omamobile-modem-sit/test/test_aoc_tuning.py @@ -38,11 +38,14 @@ def write(self, fd, data): self.written.append((fd, data)) if fd == 10: reply = bytearray(data) + # As the palmtop's AoC does: the second header byte comes back + # rewritten, the rest of the header as sent. + reply[1] = 0x3e if self.refuse: struct.pack_into(' Date: Mon, 2 Nov 2026 20:03:28 -0647 Subject: [PATCH 25/31] omamobile-modem-sit 0.3.20: put the AoC's DSP in its APMg3 telephony mode for echo cancellation With the tuning uploaded and confirmed (0.3.19), the far end still heard its own voice: the AoC's output DSP stayed in Ambient during calls, and the uploaded tuning is for its APMg3 telephony mode. With tegu_aec on, the call route now sets Audio DSP Mode to Telephony_APMG3 before the upload and puts the old mode back after the tuning is turned off. On the palmtop (a speakerphone call to an iPhone, 2026-11-02) this changed what the far end heard: no echo for the first few seconds and a new low hiss, then the echo came back with the hiss still there. So the mode takes effect, but the cancellation doesn't hold yet; the echo reference or the order of the setup is the next thing to check. --- packages/omamobile-modem-sit/lib/voice_audio.py | 3 +++ packages/omamobile-modem-sit/test/test_voice_audio.py | 6 ++++++ packages/omamobile-modem-sit/version | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/omamobile-modem-sit/lib/voice_audio.py b/packages/omamobile-modem-sit/lib/voice_audio.py index 31c295180..b5dbf40d2 100644 --- a/packages/omamobile-modem-sit/lib/voice_audio.py +++ b/packages/omamobile-modem-sit/lib/voice_audio.py @@ -292,6 +292,9 @@ def tegu_enter(self): raise AudioRefused('tegu earpiece requires the full amplifier profile 0') if aec: route.insert(1, ('FT AEC Reference Source', 'SPEAKER')) + # The output DSP stays in Ambient unless told otherwise, and the + # uploaded tuning is for its APMg3 telephony mode. + route.insert(2, ('Audio DSP Mode', 'Telephony_APMG3')) names = [name for name, _ in route] + list(TEGU_GAINS) try: saved = [(name, self.mixer_value(name)) for name in names] diff --git a/packages/omamobile-modem-sit/test/test_voice_audio.py b/packages/omamobile-modem-sit/test/test_voice_audio.py index 1c3649da9..3d826cf42 100644 --- a/packages/omamobile-modem-sit/test/test_voice_audio.py +++ b/packages/omamobile-modem-sit/test/test_voice_audio.py @@ -247,6 +247,7 @@ def fixture(self, *, mismatch=None, unreadable=None, fail_params=False, controls.update({'BUILDIN MIC ID CAPTURE LIST': '0,1,-1,-1', 'Top Speaker Digital Volume': '220', 'Bottom Speaker Digital Volume': '210', 'FT AEC Reference Source': '0', + 'Audio DSP Mode': '0', 'Top Speaker Profile Id': '0', 'Bottom Speaker Profile Id': '0'}) original = dict(controls) events = [] @@ -386,6 +387,9 @@ def test_aec_starts_before_pcms_and_stops_before_restoring_echo_reference(self): tuning.return_value.close.side_effect = lambda: events.append(('aec-close',)) with audio: self.assertEqual(controls['FT AEC Reference Source'], 'SPEAKER') + self.assertEqual(controls['Audio DSP Mode'], 'Telephony_APMG3') + self.assertLess(events.index(('cset', 'Audio DSP Mode', 'Telephony_APMG3')), + events.index(('aec-start',))) self.assertLess(events.index(('aec-start',)), events.index(('start', 1))) tuning.assert_called_once_with('speaker') tuning.return_value.start.assert_called_once() @@ -394,6 +398,8 @@ def test_aec_starts_before_pcms_and_stops_before_restoring_echo_reference(self): self.assertLess(events.index(('close', 1)), events.index(('aec-close',))) self.assertLess(events.index(('aec-close',)), events.index(('cset', 'FT AEC Reference Source', '0'))) + self.assertLess(events.index(('aec-close',)), + events.index(('cset', 'Audio DSP Mode', '0'))) def test_earpiece_attenuates_top_and_bottom_after_profile_start_before_unmute(self): audio, events, controls, original = self.fixture(route='earpiece', aec=True) diff --git a/packages/omamobile-modem-sit/version b/packages/omamobile-modem-sit/version index 9f558ed0f..1ff34fb37 100644 --- a/packages/omamobile-modem-sit/version +++ b/packages/omamobile-modem-sit/version @@ -1 +1 @@ -0.3.34 +0.3.35 From 018f145b8b7ab4d7bd5ecd6cc962ae2087719b0e Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Mon, 2 Nov 2026 23:21:50 -0647 Subject: [PATCH 26/31] device/tegu CALL-AUDIO-TUNING: the 2026-11-02 calls, and the transport from our own kernel header Record the three calls with the kernel release and what the far end heard, describe the command from struct CMD_AUDIO_OUTPUT_SET_PARAMETER_BULK in our GPL header on omamobile rather than from vendor library names, say the reply's counter byte isn't compared and why, and drop the link to a kernel commit that isn't on linux-omarchy-mobile. --- device/tegu/CALL-AUDIO-TUNING.md | 84 +++++++++++++++++++------------- 1 file changed, 51 insertions(+), 33 deletions(-) diff --git a/device/tegu/CALL-AUDIO-TUNING.md b/device/tegu/CALL-AUDIO-TUNING.md index a9b3c1c5f..38e59c748 100644 --- a/device/tegu/CALL-AUDIO-TUNING.md +++ b/device/tegu/CALL-AUDIO-TUNING.md @@ -1,62 +1,61 @@ # Pixel 9a: call tuning and the first earpiece route -Status, 2026-11-03: **implemented and tested offline, no phone trial**. -Branch `tegu-call-audio-aec-earpiece` builds on `sitd-tegu-call-audio` -(`d826388`); omamobile-modem-sit 0.3.13. AEC is off by default and call -audio still defaults to `card = none`. The earpiece mode below is a -conservative top-speaker route, not a reproduction of every stock codec -profile setting. This note records the remaining distinction explicitly. +Status, 2026-11-03: tried on the palmtop. On 2026-11-02 (the daily kernel +`7.3.0-rc6-omamobile-tegu-s2mpg15-m1-g991042e2eff3-dirty`, speakerphone +calls to the owner's iPhone, results at the end) the AoC accepted both +uploads, but the far end still heard its own voice. AEC is off by default, +and call audio still defaults to `card = none`. The earpiece mode below is +a conservative top-speaker route, not a reproduction of every stock codec +profile setting. ## Sources and the tuning transport -Read the owner's saved 9a audio HAL, its AoC utility library, mixer paths, -platform configuration and factory-image `/vendor/etc/aoc` files as data. -No vendor program was run or copied into the repository. Compare the -functional interface with our GPL kernel at -[`253ddb231a89792ea845549c55fb0f04536c9317`](https://github.com/derekross/linux-omarchy-mobile/tree/253ddb231a89792ea845549c55fb0f04536c9317): -`drivers/soc/google/aoc/aoc-interface-gs201.h`, `aoc_char_dev.c`, -`alsa/aoc_alsa_ctl.c`, `alsa/aoc_alsa_hw.c`, and -`sound/soc/codecs/tas2781-{i2c,fmwlib}.c` / `include/sound/tas2x20-tlv.h`. -The kernel worktree is `~/android/mainline/wt-call-test`. +The command and its fields come from our GPL kernel on `omamobile`: +`struct CMD_AUDIO_OUTPUT_SET_PARAMETER_BULK` (ID 210) and `struct CMD_HDR` +in `drivers/soc/google/aoc/aoc-interface-gs201.h`, the character services +in `aoc_char_dev.c`, and the `Audio DSP Mode` and `FT AEC Reference Source` +controls in `alsa/aoc_alsa_ctl.c`. The tuning files themselves are the +owner's, copied unchanged from the factory image's `/vendor/etc/aoc`; no +vendor program is run or copied into the repository. -Stock uses the `fmapmg3hybrid` telephony tuner. Its APMg3 adapter wraps -an unchanged protobuf with this **12-byte little-endian envelope**: +Each protobuf goes to the AoC wrapped in a 12-byte little-endian envelope, +the form stock's telephony tuning sends and the palmtop's AoC accepts +(status 0): -| Offset | Type | Meaning used by the adapter | +| Offset | Type | Meaning | | --- | --- | --- | -| 0 | u16 | 2 (envelope tag; its semantic name is not established here) | +| 0 | u16 | 2 (a tag; its name isn't known) | | 2 | u16 | Total envelope plus protobuf length | | 4 | u32 | 19 for uplink tuning, 20 for downlink tuning | | 8 | u32 | Protobuf length | -| 12 | bytes | Original protobuf | +| 12 | bytes | The protobuf, unchanged | -Both operations use AoC address **block 19, component 24, address type 0**. -In `AocTuningCommands::SetParameterBulk`, type 0 selects -**`audio_output_tuning`**, not `audio_input_tuning`: block/component names -do not select the character channel. Write the envelope padded to a full +Both operations use AoC **block 19, component 24** on the output tuning +service (`audio_output_tuning`), not the input one. Write the envelope padded to a full **16384-byte block** to `/dev/acd-audio_bulk_tx`, then send a **22-byte** CMD_AUDIO_OUTPUT_SET_PARAMETER_BULK (ID 210 / `0x00d2`) record on `/dev/acd-audio_output_tuning`: | Bytes | Field | | --- | --- | -| 0, 1 | CMD type 0, counter | +| 0, 1 | `CONTAINER_HDR` type 0, counter (the AoC rewrites the counter in its reply) | | 2–3 | u16 length 22 | | 4–5, 6–7 | u16 command ID 210, signed i16 reply initially 0 | | 8, 9 | u8 block 19, component 24 | | 10–13, 14–17 | u32 TX offset 0, TX address 0 | -| 18–21 | u32 envelope length, not the padding length | +| 18–21 | u32 `tx_size`: the envelope length, not the padding length | -Stock's utility has a separate type-1 family using `audio_input_tuning`, -`audio_input_bulk_tx/rx`, ID 234 and a 5120-byte staging buffer. That is -not the APMg3 upload described above. Stock opens the output bulk RX service -as part of its generic descriptor set; this write-only implementation -needs no bulk RX read. The tuning reply comes back on the tuning service. +The input side has its own command, `CMD_AUDIO_INPUT_SET_PARAMETER_BULK` +(ID 234), on `audio_input_tuning`; it isn't used here. This upload needs no +bulk RX read: the reply comes back on the tuning service. `aoc_tuning.py` implements only the two uplink/downlink operations, with bounded nonblocking writes, one-second readiness/acknowledgement deadlines, -exact record lengths, command/counter matching and a zero reply required. +exact record lengths, and a reply that matches the command's type, length +and ID with a zero status. The second header byte, the counter, isn't +compared: the AoC answers with its own (0x01 sent, 0x3e back on the +palmtop), which the first version took for an unknown outcome (0.3.19). It never resumes a short record, retries an unknown command, maps SRAM or opens the CP/AoC shared voice window. `aoc_char_dev` makes the service opens exclusive. An uncertain write/reply leaves the private RAM marker @@ -183,4 +182,23 @@ unexpected gain, feedback, missing bottom attenuation or unconfirmed cleanup. Hang up and retain the mute/uncertainty state. Never retry or reset the running CP in place. Rollback is the previous package/config on an attended fresh boot; no automatic unit restart, warm modem restart or -manual marker deletion. Hardware results: **not run**. +manual marker deletion. + +## Results on the palmtop, 2026-11-02 + +The daily kernel, `7.3.0-rc6-omamobile-tegu-s2mpg15-m1-g991042e2eff3-dirty`, +the six files from the owner's factory image (BP3A.250905.014, matching the +palmtop's AoC firmware), `tegu_aec = yes`, `tegu_route = speaker`, calls to +the owner's iPhone, which the owner answered: + +1. sitd 0.3.18 (before the counter fix): the uplink upload was accepted + with status 0, but the reply's counter byte differed, sitd took it for an + unknown outcome and kept the call silent, as designed. +2. 0.3.19: both uploads confirmed, audio both ways. The far end heard its + own voice come back, as without the tuning. +3. 0.3.20, with `Audio DSP Mode` set to `Telephony_APMG3` before the + uploads: the far end heard no echo for the first few seconds and a new + low hiss, then the echo came back with the hiss still there. + +So the uploads and the DSP mode take effect, but the cancellation doesn't +hold yet. The earpiece route hasn't been tried. From 95d396b656832b6513c62de37daeff1c45efa8fc Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Tue, 3 Nov 2026 07:25:00 -0647 Subject: [PATCH 27/31] device/tegu CALL-AUDIO-TUNING: what to try next for the echo The FT AEC reference changes nothing for the built-in microphone, the modem mixer's ASP stays off during our calls, stock applies wideband tuning to narrowband voice, and stock runs a speaker compensation tuner we don't. --- device/tegu/CALL-AUDIO-TUNING.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/device/tegu/CALL-AUDIO-TUNING.md b/device/tegu/CALL-AUDIO-TUNING.md index 38e59c748..e121352d8 100644 --- a/device/tegu/CALL-AUDIO-TUNING.md +++ b/device/tegu/CALL-AUDIO-TUNING.md @@ -202,3 +202,23 @@ the owner's iPhone, which the owner answered: So the uploads and the DSP mode take effect, but the cancellation doesn't hold yet. The earpiece route hasn't been tried. + +## Next for the echo + +From our kernel's AoC driver and the owner's stock configuration +(`vendor/etc/audio_platform_configuration.xml`, `mixer_paths_aidl.xml`): + +- `FT AEC Reference Source` doesn't reach the AoC when set; it goes out + with the modem microphone's start (`CMD_AUDIO_INPUT_MODEM_INPUT_START_2`, + `ref_input_source`). With the built-in microphone, `SPEAKER` and `Default` + both send index 0, so this control changes nothing for our calls. +- `AoC Modem Mixer ASP Mode` (block 19, component 15, the block the tuning + goes to) read `ASP_OFF` during our calls. Stock's mixer file doesn't set + it, so stock's HAL sets it in code if at all. `ASP_ON` during the call is + the next thing to try, with the tuning and the DSP mode. +- Stock's telephony tuner applies the wideband tuning to narrowband voice + (`APPLY_WB_TUNING_FOR_NB_VOICE`), so which section of the tuning applies + may depend on the call's codec band. +- Stock also runs a telephony speaker compensation tuner with + `compens_spk_l.conf` and `compens_spk_r.conf` (text tables of value + pairs in the factory image's `/vendor/etc`), which we don't apply. From 40df9178f0b036a94991924db4b04953af2fd2cc Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Tue, 3 Nov 2026 07:27:20 -0647 Subject: [PATCH 28/31] omamobile-modem-sit: turn the modem mixer's ASP on for echo cancellation With the tuning confirmed and the DSP in its telephony mode, the echo still came back after a few seconds, and AoC Modem Mixer ASP Mode (block 19, where the tuning goes) read ASP_OFF during the calls. With tegu_aec on, the route now sets it to ASP_ON before the upload and restores it after the call. Not yet tried on a call. --- packages/omamobile-modem-sit/lib/voice_audio.py | 3 +++ packages/omamobile-modem-sit/test/test_voice_audio.py | 7 ++++++- packages/omamobile-modem-sit/version | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/omamobile-modem-sit/lib/voice_audio.py b/packages/omamobile-modem-sit/lib/voice_audio.py index b5dbf40d2..9b5366196 100644 --- a/packages/omamobile-modem-sit/lib/voice_audio.py +++ b/packages/omamobile-modem-sit/lib/voice_audio.py @@ -295,6 +295,9 @@ def tegu_enter(self): # The output DSP stays in Ambient unless told otherwise, and the # uploaded tuning is for its APMg3 telephony mode. route.insert(2, ('Audio DSP Mode', 'Telephony_APMG3')) + # The modem mixer's signal processing (block 19, where the tuning + # goes) read ASP_OFF during our calls, with the echo coming back. + route.insert(3, ('AoC Modem Mixer ASP Mode', 'ASP_ON')) names = [name for name, _ in route] + list(TEGU_GAINS) try: saved = [(name, self.mixer_value(name)) for name in names] diff --git a/packages/omamobile-modem-sit/test/test_voice_audio.py b/packages/omamobile-modem-sit/test/test_voice_audio.py index 3d826cf42..236f68fbc 100644 --- a/packages/omamobile-modem-sit/test/test_voice_audio.py +++ b/packages/omamobile-modem-sit/test/test_voice_audio.py @@ -247,7 +247,7 @@ def fixture(self, *, mismatch=None, unreadable=None, fail_params=False, controls.update({'BUILDIN MIC ID CAPTURE LIST': '0,1,-1,-1', 'Top Speaker Digital Volume': '220', 'Bottom Speaker Digital Volume': '210', 'FT AEC Reference Source': '0', - 'Audio DSP Mode': '0', + 'Audio DSP Mode': '0', 'AoC Modem Mixer ASP Mode': '0', 'Top Speaker Profile Id': '0', 'Bottom Speaker Profile Id': '0'}) original = dict(controls) events = [] @@ -388,6 +388,9 @@ def test_aec_starts_before_pcms_and_stops_before_restoring_echo_reference(self): with audio: self.assertEqual(controls['FT AEC Reference Source'], 'SPEAKER') self.assertEqual(controls['Audio DSP Mode'], 'Telephony_APMG3') + self.assertEqual(controls['AoC Modem Mixer ASP Mode'], 'ASP_ON') + self.assertLess(events.index(('cset', 'AoC Modem Mixer ASP Mode', 'ASP_ON')), + events.index(('aec-start',))) self.assertLess(events.index(('cset', 'Audio DSP Mode', 'Telephony_APMG3')), events.index(('aec-start',))) self.assertLess(events.index(('aec-start',)), events.index(('start', 1))) @@ -400,6 +403,8 @@ def test_aec_starts_before_pcms_and_stops_before_restoring_echo_reference(self): events.index(('cset', 'FT AEC Reference Source', '0'))) self.assertLess(events.index(('aec-close',)), events.index(('cset', 'Audio DSP Mode', '0'))) + self.assertLess(events.index(('aec-close',)), + events.index(('cset', 'AoC Modem Mixer ASP Mode', '0'))) def test_earpiece_attenuates_top_and_bottom_after_profile_start_before_unmute(self): audio, events, controls, original = self.fixture(route='earpiece', aec=True) diff --git a/packages/omamobile-modem-sit/version b/packages/omamobile-modem-sit/version index 1ff34fb37..851786c85 100644 --- a/packages/omamobile-modem-sit/version +++ b/packages/omamobile-modem-sit/version @@ -1 +1 @@ -0.3.35 +0.3.36 From 01c1fb84af754b25621ffd8559c2917ce0a15088 Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Tue, 3 Nov 2026 08:37:52 -0647 Subject: [PATCH 29/31] omamobile-modem-sit: send the call tuning after the voice streams start With the tuning sent before the streams, the far end heard no echo for 2-3 s and then the echo again, with ASP on and at stock's microphone gain alike (2026-11-03). The AoC starts its voice path at the playback start ("Start voice call" in the kernel log, after our upload), which may set it up afresh. The tuning now goes up after both streams have started, while the call sink is still muted; a failed upload closes the streams and keeps the sink muted as before. Not yet tried on a call. --- packages/omamobile-modem-sit/lib/voice_audio.py | 16 ++++++++++------ .../omamobile-modem-sit/test/test_voice_audio.py | 12 ++++++++---- packages/omamobile-modem-sit/version | 2 +- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/packages/omamobile-modem-sit/lib/voice_audio.py b/packages/omamobile-modem-sit/lib/voice_audio.py index 9b5366196..a83440f0a 100644 --- a/packages/omamobile-modem-sit/lib/voice_audio.py +++ b/packages/omamobile-modem-sit/lib/voice_audio.py @@ -309,12 +309,6 @@ def tegu_enter(self): self.mixer('cset', name, value) if name == 'Incall Sink Mute' and self.mixer_value(name) not in ('1', 'on'): raise AudioRefused('tegu call audio refused: sink mute read-back mismatch') - if aec: - try: - self.tuning = VoiceTuning(self.tegu_route) - self.tuning.start() - except (OSError, TuningError) as error: - raise AudioRefused('tegu call audio refused: AoC tuning unavailable or unconfirmed') from error # Capture is ready before playback prepare starts the modem. for device, direction in ((11, 1), (4, 0)): pcm = C.c_void_p() @@ -323,6 +317,16 @@ def tegu_enter(self): self.pcms.append(pcm) self.tegu_params(pcm) self.check(self.alsa.snd_pcm_start(pcm), 'start') + # The tuning goes up once the call's streams have started: the + # AoC starts its voice path at the playback start ("Start voice + # call"), and with the tuning sent before that the echo was gone + # for 2-3 s only (2026-11-03). The sink is still muted here. + if aec: + try: + self.tuning = VoiceTuning(self.tegu_route) + self.tuning.start() + except (OSError, TuningError) as error: + raise AudioRefused('tegu call audio refused: AoC tuning unavailable or unconfirmed') from error # The codec profile resets gain at playback start. These must # happen afterwards, while the modem downlink remains muted. gains = ((TEGU_GAINS[1], '0'), (TEGU_GAINS[0], TEGU_EARPIECE_GAIN)) if earpiece else tuple( diff --git a/packages/omamobile-modem-sit/test/test_voice_audio.py b/packages/omamobile-modem-sit/test/test_voice_audio.py index 236f68fbc..9eb56c41f 100644 --- a/packages/omamobile-modem-sit/test/test_voice_audio.py +++ b/packages/omamobile-modem-sit/test/test_voice_audio.py @@ -380,7 +380,7 @@ def test_route_uses_exact_voice_params_and_checks_gain_before_unmuting(self): self.assertEqual(events[-1], ('cset', 'Incall Sink Mute', '0')) self.assertFalse(audio.saved or audio.pcms) - def test_aec_starts_before_pcms_and_stops_before_restoring_echo_reference(self): + def test_aec_starts_after_the_streams_and_stops_before_restoring_echo_reference(self): audio, events, controls, original = self.fixture(aec=True) with patch.object(voice_audio, 'VoiceTuning') as tuning: tuning.return_value.start.side_effect = lambda: events.append(('aec-start',)) @@ -393,7 +393,9 @@ def test_aec_starts_before_pcms_and_stops_before_restoring_echo_reference(self): events.index(('aec-start',))) self.assertLess(events.index(('cset', 'Audio DSP Mode', 'Telephony_APMG3')), events.index(('aec-start',))) - self.assertLess(events.index(('aec-start',)), events.index(('start', 1))) + # The tuning goes up after both streams have started, before unmute + self.assertLess(events.index(('start', 2)), events.index(('aec-start',))) + self.assertLess(events.index(('aec-start',)), events.index(('cset', 'Incall Sink Mute', '0'))) tuning.assert_called_once_with('speaker') tuning.return_value.start.assert_called_once() tuning.return_value.close.assert_called_once() @@ -452,7 +454,9 @@ def test_missing_tuning_refuses_audio_and_restores_the_mixers(self): self.assertRaises(voice_audio.AudioRefused): audio.__enter__() self.assertEqual(controls, original) - self.assertFalse([e for e in events if e[0] == 'open']) + # The streams started before the tuning; every one is closed again + self.assertEqual(sorted(audio.alsa.closed), [1, 2]) + self.assertFalse(audio.pcms) def test_uncertain_tuning_leaves_sink_muted_but_restores_other_controls(self): audio, events, controls, original = self.fixture(aec=True) @@ -464,7 +468,7 @@ def test_uncertain_tuning_leaves_sink_muted_but_restores_other_controls(self): self.assertEqual(controls['Incall Sink Mute'], '1') self.assertEqual({n: v for n, v in controls.items() if n != 'Incall Sink Mute'}, {n: v for n, v in original.items() if n != 'Incall Sink Mute'}) - self.assertFalse([e for e in events if e[0] in ('open', 'start')]) + self.assertEqual(sorted(audio.alsa.closed), [1, 2]) self.assertNotIn(('cset', 'Incall Sink Mute', '0'), events) def test_partial_pcm_or_mixer_failure_restores_saved_state(self): diff --git a/packages/omamobile-modem-sit/version b/packages/omamobile-modem-sit/version index 851786c85..ba61ff307 100644 --- a/packages/omamobile-modem-sit/version +++ b/packages/omamobile-modem-sit/version @@ -1 +1 @@ -0.3.36 +0.3.37 From 3da13d71cc637ac57dc6044a2e37eb3096616e9c Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Wed, 11 Nov 2026 21:10:19 -0644 Subject: [PATCH 30/31] tests/all: the list as main has it, with the call-tuning extractor's test The commit before this one took a merge of main with the conflict in this file still marked; this resolves it. --- tests/all | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tests/all b/tests/all index 0cf37fd8f..7be5fafaa 100755 --- a/tests/all +++ b/tests/all @@ -49,11 +49,7 @@ python3 tests/boot-arch-label.py python3 tests/persistent-root-boot.py python3 tests/initramfs-root-policy.py python3 tests/bt-uart-gpio.py -<<<<<<< HEAD -for t in tests/pr-check tests/kernel-pr-check tests/phone-smoke tests/alarm-wake-test tests/install-phone tests/build-rootfs tests/rootfs-resolve tests/phone-provision tests/nv-backup tests/initramfs-grow tests/images-layout tests/boot-update-parity tests/stage-boot-files tests/build-packages-host-tools tests/initramfs-reproducible tests/device-overlays tests/simplefb-trigger tests/initramfs-steps tests/storage-guard tests/usb-product tests/grep-q-pipes tests/boot-method tests/modules-push tests/make-bundle-keys tests/make-bundle tests/release-signing tests/pinned-packages tests/flame-probe packages/omamobile-firstboot/test/all packages/omamobile-device-felix/test/all packages/omamobile-device-lynx/test/all packages/omamobile-device-panther/test/all tests/local-builds tests/phone-install-package tests/publish-kernel tests/fetch-toolchain tests/release-upload tests/extract-camera-data tests/extract-tegu-call-tuning tests/release tests/lineage-ref tests/repo-publish tests/repo-publish-stage tests/extract-vendor-firmware tests/alpine-fetch-callers tests/alpine-fetch tests/tools-help tests/install-phone-initramfs; do -======= -for t in tests/pr-check tests/kernel-pr-check tests/phone-smoke tests/alarm-wake-test tests/install-phone tests/build-rootfs tests/rootfs-resolve tests/phone-provision tests/nv-backup tests/initramfs-grow tests/images-layout tests/boot-update-parity tests/stage-boot-files tests/build-packages-host-tools tests/initramfs-reproducible tests/device-overlays tests/simplefb-trigger tests/initramfs-steps tests/storage-guard tests/usb-product tests/grep-q-pipes tests/boot-method tests/modules-push tests/make-bundle-keys tests/make-bundle tests/release-signing tests/pinned-packages tests/flame-probe tests/dipper-probe packages/omamobile-firstboot/test/all packages/omamobile-device-felix/test/all packages/omamobile-device-lynx/test/all packages/omamobile-device-panther/test/all tests/local-builds tests/phone-install-package tests/publish-kernel tests/fetch-toolchain tests/release-upload tests/extract-camera-data tests/release tests/lineage-ref tests/repo-publish tests/repo-publish-stage tests/extract-vendor-firmware tests/alpine-fetch-callers tests/alpine-fetch tests/tools-help tests/install-phone-initramfs; do ->>>>>>> origin/main +for t in tests/pr-check tests/kernel-pr-check tests/phone-smoke tests/alarm-wake-test tests/install-phone tests/build-rootfs tests/rootfs-resolve tests/phone-provision tests/nv-backup tests/initramfs-grow tests/images-layout tests/boot-update-parity tests/stage-boot-files tests/build-packages-host-tools tests/initramfs-reproducible tests/device-overlays tests/simplefb-trigger tests/initramfs-steps tests/storage-guard tests/usb-product tests/grep-q-pipes tests/boot-method tests/modules-push tests/make-bundle-keys tests/make-bundle tests/release-signing tests/pinned-packages tests/flame-probe tests/dipper-probe packages/omamobile-firstboot/test/all packages/omamobile-device-felix/test/all packages/omamobile-device-lynx/test/all packages/omamobile-device-panther/test/all tests/local-builds tests/phone-install-package tests/publish-kernel tests/fetch-toolchain tests/release-upload tests/extract-camera-data tests/extract-tegu-call-tuning tests/release tests/lineage-ref tests/repo-publish tests/repo-publish-stage tests/extract-vendor-firmware tests/alpine-fetch-callers tests/alpine-fetch tests/tools-help tests/install-phone-initramfs; do echo "# $t" "$t" done From c3cfc63da1a6c1a568b4ab5d29511452a4bcf66b Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Thu, 12 Nov 2026 07:10:16 -0644 Subject: [PATCH 31/31] device/tegu CALL-AUDIO-TUNING: the echo-free first seconds are a silent uplink Read through four calls on 2026-11-12, the AoC's own log and the call's mixer controls show nothing changing a few seconds in: the controls are set once, both tuning uploads arrive and are answered, and the APMg3 processor is enabled. What the log does show is the uplink's samples staying near zero for the first 5 s after each answer, with the owner talking and, in one call, with the laptop counting aloud beside the palmtop; after that the uplink carries both. So the seconds without echo in the earlier results were not cancellation. A call to a talking clock shows the echo with no listener: quiet uplink during the ticks, loud samples during the announcements. bringup/call-audio-watch.py is the read-only watcher (palmtop) and call-levels.py reads its output (laptop). --- device/tegu/CALL-AUDIO-TUNING.md | 80 ++++++++++++++++++++++--- device/tegu/bringup/call-audio-watch.py | 59 ++++++++++++++++++ device/tegu/bringup/call-levels.py | 26 ++++++++ 3 files changed, 158 insertions(+), 7 deletions(-) create mode 100755 device/tegu/bringup/call-audio-watch.py create mode 100755 device/tegu/bringup/call-levels.py diff --git a/device/tegu/CALL-AUDIO-TUNING.md b/device/tegu/CALL-AUDIO-TUNING.md index c6c893394..25c88e327 100644 --- a/device/tegu/CALL-AUDIO-TUNING.md +++ b/device/tegu/CALL-AUDIO-TUNING.md @@ -223,16 +223,82 @@ speakerphone, the owner listening on the far end, `tegu_aec = yes`, silent). So nothing tried so far makes the cancellation hold: with the tuning -before or after the streams' start, with ASP on or off, it works for about -2 s and then stops. What changes in the AoC at that point isn't known: the -controls and the AoC's own log weren't read during these calls. +before or after the streams' start, with ASP on or off, the far end hears +no echo for about 2 s and then hears it. Results 3 to 5 read those first +seconds as cancellation that then stopped. The calls of 2026-11-12 below +show they are not that. + +## Results on the palmtop, 2026-11-12: the first seconds are a silent uplink + +The same setup (the daily kernel, sitd 0.3.37 built from this stack's +head, `tegu_aec = yes`, `tegu_route = speaker`), with +`bringup/call-audio-watch.py` running on the palmtop through each call. It +is read-only: it prints the AoC's own log (`/dev/acd-logging`) as it +arrives and, unless `CTL=0`, reads fifteen of the call's mixer controls +every half second and prints the changes. `bringup/call-levels.py` reads +its output on the laptop. + +6. Four calls to the owner's iPhone, the owner in another room, and in + the last in a far one; the watcher ran through the first three. He + heard no echo for 3 to 4 s after answering and then his own voice, as + before. + - **The controls are set once and stay.** At the call's start: + `Audio DSP Mode` `Telephony_APMG3`, `AoC Modem Mixer ASP Mode` + `ASP_ON`, `FT AEC Reference Source` `SPEAKER`, `MIC HW Gain (cB)` 130, + microphones 0 and 1 on. Nothing changed until the hang-up. + - **The AoC has the tuning.** Its log has both uploads right after + "PCIe Modem Telephony Started" (command 0x00d2 on the tuning service, + rc 0, then "APMG3 uplink config received" and "APMG3 downlink config + received"), with "Telephony Voice Processor enabled" and "Mixer 0 + active (APMg3)" just before. Nothing in the log changes a few + seconds into the call. + - **The answer is a new session.** The audio path first gets one modem + session (the ringing; its configuration arrives about 2 s after the + path starts, with "Modem Path Active but no configuration received" + until then), and at the answer a second one: "Session ID changed but + no handoff performed. Forcing FadeOut!", a new "PCIe Modem + Configuration" with the next session number, both resamplers reset. + - **The uplink is silent for the first 5 s of the answered session.** + The AoC prints one uplink and one downlink sample about three times + a second ("PCIe Session N ... Tx: ... Rx: ..."). In the first 5 s + after each answer all sixteen uplink samples were below 80 (16-bit + values), in the three calls, while the downlink carried the owner's voice + at several thousand; after that the uplink had samples in the + hundreds and thousands. +7. The same with a voice next to the palmtop: the laptop beside it counted + aloud through the call while the owner, in the far room, said nothing. + He heard the counting only in the room at first and through the phone + a few counts later. The uplink samples agree: below 80 for the first + 5 s after the answer with the counting going on, then up to 2,560. So + the uplink carries nothing in those seconds, the palmtop's own side + included, and the "no echo" of results 3 to 6 is that silence. +8. A call with no listener: the palmtop dialled a talking clock (NIST's + time line), nobody near it, 80 s. In the 50 s of ticks alone the uplink + stayed below 100 in all but 5 of 156 samples; in the two voice + announcements, a minute apart, it had samples of 21,188 and 27,913. So the echo is in the uplink the AoC sends, and it can be seen + without anyone listening. + +What this says: the APMg3 processor runs and has stock's tuning, and the +echo still passes. What it doesn't say is why, or what the 5 s of silence +are. One sample every 0.32 s is a rough level and no more. ## Next for the echo -First, from the results above: read the AoC's own log (`/dev/acd-logging`) -and the three controls (`Audio DSP Mode`, `AoC Modem Mixer ASP Mode`, the -microphone's gain) every half second through a call, to see what changes -about 2 s in. That needs a call but no listener. +A call to a talking clock with `call-audio-watch.py` running is now the +test, with no listener: the uplink's samples during the announcements +against those during the ticks. To do, each on a fresh boot since the +configuration is read at sitd's start: + +- The same call with `tegu_aec = no`, for the echo's level without the + tuning. If it is the same, the processor is passing the echo untouched. +- A better level than one sample in 0.32 s: stock's in-call capture + (`Incall Capture Stream0` at `UL_DL`, the `audio_incall_cap_0` PCM), + which nothing here has opened during a call yet. +- The speaker tuning's own layout, read from the owner's file with + `protoc --decode_raw`: it declares a two-channel reference and three + capture channels (the handset one a one-channel reference). Whether the + reference the processor gets on our route is what that layout expects, + both speakers and in step with the microphones, isn't checked. From our kernel's AoC driver and the owner's stock configuration diff --git a/device/tegu/bringup/call-audio-watch.py b/device/tegu/bringup/call-audio-watch.py new file mode 100755 index 000000000..f2f7382d4 --- /dev/null +++ b/device/tegu/bringup/call-audio-watch.py @@ -0,0 +1,59 @@ +#!/usr/bin/env python3 +# On the palmtop: watch the AoC through a phone call, read-only. For D seconds it reads +# the call's mixer controls every half second and prints one line whenever a value +# changes, and it reads the AoC's own log (/dev/acd-logging) and prints its text as it +# arrives, every line stamped with the seconds since the start and the wall clock. Start +# it, place the call, hang up, and read where the lines change about 2 s into the call. +# Nothing is written to the mixer or the AoC. CTL=0 leaves the controls unread (the log +# alone), in case reading them changes what the call does. +# python3 call-audio-watch.py [D s, default 120] > /run/call-audio-watch.txt +import os, re, subprocess, sys, threading, time + +D = float(sys.argv[1]) if len(sys.argv) > 1 else 120 +CARD = "0" +CTLS = ["Audio DSP Mode", "AoC Modem Mixer ASP Mode", "AoC Speaker Mixer ASP Mode", + "AoC Modem Downlink ASRC Mode", "AoC Modem Sink Channel Bitmap", "Incall Mic Gain (dB)", + "Incall Mic Mute", "Incall Sink Mute", "MIC HW Gain (cB)", "BUILTIN MIC Process Mode", + "FT AEC Reference Source", "Audio Capture Mic Source", "BUILDIN MIC POWER STATE", + "Incall Capture Stream0", "Incall Playback Stream0"] +t0 = time.monotonic() +lock = threading.Lock() + + +def say(kind, text): + with lock: + print("%7.2f %s %s %s" % (time.monotonic() - t0, time.strftime("%H:%M:%S"), kind, text), flush=True) + + +def get(name): + r = subprocess.run(["amixer", "-c", CARD, "cget", "name=" + name], capture_output=True, text=True) + m = re.search(r": values=(.*)", r.stdout) + return m.group(1).strip() if m else "?" + + +def aoclog(): + try: + fd = os.open("/dev/acd-logging", os.O_RDONLY) + except OSError as e: + say("log", "can't open /dev/acd-logging: %s" % e); return + while time.monotonic() - t0 < D: + try: + b = os.read(fd, 65536) + except OSError as e: + say("log", "read failed: %s" % e); return + for s in re.findall(rb"[\x20-\x7e]{6,}", b): + say("log", s.decode()) + + +threading.Thread(target=aoclog, daemon=True).start() +say("start", open("/proc/sys/kernel/osrelease").read().strip()) +last = {} +while time.monotonic() - t0 < D: + if os.environ.get("CTL", "1") != "0": + for c in CTLS: + v = get(c) + if last.get(c) != v: + say("ctl", "%s: %s%s" % (c, v, "" if c not in last else " (was %s)" % last[c])) + last[c] = v + time.sleep(0.5) +say("end", "") diff --git a/device/tegu/bringup/call-levels.py b/device/tegu/bringup/call-levels.py new file mode 100755 index 000000000..0f1ac166b --- /dev/null +++ b/device/tegu/bringup/call-levels.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python3 +# Laptop: from a call-audio-watch log, the uplink (Tx) and downlink (Rx) sample values the +# AoC prints about three times a second, per session and in 5 s windows after its start: +# how many, the median and the largest magnitude of each. One sample per 0.32 s is a rough +# level, enough to tell a silent uplink from one that carries speech. +# call-levels.py call-watch-N.txt +import re, sys, statistics +s = lambda h: (int(h, 16) ^ 0x8000) - 0x8000 +rows = {} +for l in open(sys.argv[1]): + m = re.match(r"\s*([\d.]+) \S+ log #### PCIe Session (\d+) .*Tx:\s*\d+ \(0x([0-9a-f]+)\), Rx:\s*\d+ \(0x([0-9a-f]+)\)", l) + if m: + rows.setdefault(m.group(2), []).append((float(m.group(1)), abs(s(m.group(3))), abs(s(m.group(4))))) +for sid, r in rows.items(): + t0 = r[0][0] + print("session %s: %d samples over %.0f s from %.1f" % (sid, len(r), r[-1][0] - t0, t0)) + w = 0 + while True: + x = [(a, b) for t, a, b in r if w <= t - t0 < w + 5] + if not x: + if w > r[-1][0] - t0: break + w += 5; continue + tx = [a for a, b in x]; rx = [b for a, b in x] + print(" %3d-%3d s: n %2d uplink median %5d max %6d over100 %2d | downlink median %5d max %6d over100 %2d" % ( + w, w + 5, len(x), statistics.median(tx), max(tx), sum(a > 100 for a in tx), statistics.median(rx), max(rx), sum(b > 100 for b in rx))) + w += 5