Repository navigation
jaguar3: make the coex/phydm runtime thread optional (tuning.j3_runtime_thread); skip_dig on Jaguar3 - #498
Conversation
…me_thread) After bring-up RtlJaguar3Device starts coex_runtime_loop. With no RX loop running it keeps a 16 KiB bulk-IN read posted to drain firmware C2H reports, and every ~2 s it writes coex, TX-power-tracking and DIG/EDCCA registers. A host that owns bulk-IN itself (raw C2H transfers) or needs fixed gain (LA-mode capture) loses packets to that read and sees its IGI rewritten. tuning.j3_runtime_thread (default true; env DEVOURER_J3_RUNTIME=0) lets such a host skip the thread. Every join is already guarded by joinable(). Measured on an 8812CU (8822C cut 5): host C2H 16 KiB went from 4-32 packets per run (the reads that won the race) to 1600/1600 with the thread off. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WAgKg5Azt5HiWAvzGdGnuW
PR Summary by QodoMake the Jaguar3 coex/PHYDM runtime thread optional
AI Description
Diagram
High-Level Assessment
Files changed (3)
|
Code Review by Qodo
1. Wide transmissions change fixed receive gain
|
…ad docs Review on OpenIPC#498: with j3_runtime_thread off, StartRxLoop still starts its own phydm worker, whose tick() runs DIG every ~2 s, so the flag alone does not give fixed gain during an RX session. Keep that worker (ordinary RX sessions want it) and let tuning.skip_dig (DEVOURER_SKIP_DIG, so far Jaguar2-only) skip the DIG step on Jaguar3 too, in both tick() callers. The j3_runtime_thread comment now says what it covers. 8812CU ch36, rxdemo 14 s per arm: runtime off -> 'Jaguar3 dig: IGI=0x1e' written by the RX worker; runtime off + DEVOURER_SKIP_DIG=1 -> no DIG step; default unchanged. ctest 83/83. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WAgKg5Azt5HiWAvzGdGnuW
|
/review |
|
Code review by qodo was updated up to the latest commit 4afa386 |
The floor still raises IGI on the first 40/80 MHz frame and clamps it on leaving; say so, and point at DEVOURER_WIDE_TX_IGI_FLOOR=0 for fully fixed IGI. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
josephnef
left a comment
There was a problem hiding this comment.
Code is fine and works on hardware. Two doc gaps to close before merge, plus two nits.
On-air check. An 8812EU (8822E) in a TX-only session, ch36 MCS1/20, 10 000 frames (~22 s of sustained 5 GHz TX), an 8822B receiving:
| rep 1 | rep 2 | |
|---|---|---|
| default (thread on) | 99.4 % | 99.2 % |
DEVOURER_J3_RUNTIME=0 |
99.5 % | 99.4 % |
With the flag off there are no coex ticks, the "not started" line is logged, and Stop/teardown is clean. Within 22 s on the 8822E I did not see the antenna go silent, which src/jaguar3/CLAUDE.md says happens without this thread. Longer runs and the 8822C were not tested.
Requested changes
- Say in the title/body that
skip_dignow applies on Jaguar3 (4afa386). It was Jaguar2-only before, so this is a behaviour change for anyone who setsDEVOURER_SKIP_DIGon a J3 part. The change is reasonable; it just isn't mentioned. - Document what a TX-only session loses with the flag off. Nothing drains C2H, so
tx.report(CCX) is never emitted.pwr_track(thermal TX-power compensation for upper 5 GHz) and the coex/FW heartbeats also stop. Please put this in thej3_runtime_threadcomment inDeviceConfig.h, and add the opt-out to the "Coex runtime thread" bullet insrc/jaguar3/CLAUDE.md. That bullet currently says sustained 5 GHz TX needs the thread and that the thread is what feedstx.reportin TX-only sessions.
Nits
env_config.cpp: useenv_str("DEVOURER_J3_RUNTIME")like the neighbouring default-on knobs (DEVOURER_THERMAL_TRACK), not rawstd::getenv.PhydmRuntimeJaguar3::tick(..., bool dig_track = true): both callers pass the argument, so drop the default.
…n; review nits - DeviceConfig.h / src/jaguar3/CLAUDE.md: with the thread off, a TX-only session gets no tx.report (nothing drains C2H), no pwr_track and no coex/FW heartbeats; CLAUDE.md's coex bullet names the opt-out. - env_config: DEVOURER_J3_RUNTIME via env_str, like the other default-on knobs. - PhydmRuntimeJaguar3::tick: no default for dig_track (both callers pass it). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…jaguar3-runtime-thread-optional
… names the opt-out - DeviceConfig.h: on J2, skip_dig stops StartRxLoop's DIG thread (not a bring-up step, as 4afa386 said). - PhydmRuntimeJaguar3::tick: dig_track = false skips DIG, but the wide-TX IGI floor still writes IGI (as the skip_dig comment says since ca7cdf7). - CLAUDE.md (Jaguar3 bullet): sustained 5 GHz TX needs the coex thread; name the j3_runtime_thread opt-out and point to src/jaguar3/CLAUDE.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@josephnef thanks for the on-air run. All four points are addressed in 2282164 and 49a9fbf. I merged master in instead of rebasing, so your review still applies to the commits you saw. Requested changes
Nits
Also fixed while there
Not claimed
Build clean; ctest 83/83 (2 skipped, as on master). |
josephnef
left a comment
There was a problem hiding this comment.
All four points are addressed in 2282164 / 49a9fbf. Approving.
- The title and description now disclose
skip_digon Jaguar3. - What a TX-only session loses with the thread off is documented in
DeviceConfig.h,src/jaguar3/CLAUDE.mdand the rootCLAUDE.md. env_strreplaces the rawgetenv, and thedig_trackdefault is dropped.- The new J2
skip_digwording matches the code:StartRxLooponly starts the DIG thread under!skip_dig.
Re-checked on hardware at 49a9fbf, since the env parsing changed: 8812EU, TX-only, ch36 MCS1, 3000 frames.
DEVOURER_J3_RUNTIME |
"not started" logged | coex ticks | submitted | exit |
|---|---|---|---|---|
0 |
yes | 0 | 3050 | clean |
1 |
no | 5 | 3050 | clean |
The CLAUDE.md claim that sustained 5 GHz TX needs the thread still stands as written. I couldn't reproduce the silencing in 22 s on the 8822E. That is tracked in #499 and does not block this PR.
What this is
After bring-up,
RtlJaguar3Devicealways startscoex_runtime_loop. With no RX loop running, that thread keeps a synchronous 16 KiB bulk-IN read posted on the Wi-Fi bulk-IN endpoint to drain firmware C2H reports. Every ~2 s it also writes coex, TX-power-tracking and DIG/EDCCA registers.A host that owns bulk-IN itself, or needs a fixed gain, has no way to opt out:
This adds an opt-out. The default is unchanged.
What changed
DeviceConfig::tuning.j3_runtime_thread(defaulttrue), plus envDEVOURER_J3_RUNTIME=0inexamples/common/env_config.cpp.RtlJaguar3Devicestartscoex_runtime_looponly when the flag is set, and logs when it does not.joinable(), soStop()and the destructor need no change. TheStartRxLoopphydm thread keys on the coex thread not running, which is the right behaviour for an RX session with the flag off.Behaviour change:
skip_dignow applies on Jaguar3 (4afa386).tuning.skip_dig/DEVOURER_SKIP_DIGused to be Jaguar2-only.PhydmRuntimeJaguar3::tick: the runtime thread and theStartRxLoopworker.DEVOURER_SKIP_DIGon a J3 part will now keep their IGI instead of having DIG move it.wide_tx_igi_floor) still writes IGI. UseDEVOURER_WIDE_TX_IGI_FLOOR=0as well for a fully fixed IGI.Documentation
DeviceConfig.henv:tags: whatj3_runtime_thread = falsecosts. An RX session still runs DIG, viaStartRxLoop's worker. A TX-only session gets notx.report(nothing drains C2H), nopwr_trackand no coex/FW heartbeats. Also whatskip_digcovers on J2 vs J3, and the wide-TX floor exception.src/jaguar3/CLAUDE.mdcoex bullet and the Jaguar3 bullet in the rootCLAUDE.md: name the opt-out and its cost.Verification
Hardware: an 8812CU (8822C cut 5) on USB 2. A host program staged its own C2H packets (24-byte RX descriptor + PRBS payload) and read bulk-IN EP 0x84 with async transfers.
skip_digon J3: 8812CU, ch36,rxdemofor 14 s per arm. WithDEVOURER_J3_RUNTIME=0, theStartRxLoopworker still wrote IGI (Jaguar3 dig: IGI=0x1e); addingDEVOURER_SKIP_DIG=1gave no DIG writes. Default unchanged.Not covered
tx.reportand (outsideStartRxLoop) DIG do not run. That is intended for the raw-transfer / fixed-gain use case and not suitable for a normal Wi-Fi session.🤖 Generated with Claude Code