Skip to content

build: camex 4.0.1 in the tunnel, TCP fixed (2.24.3) - #282

Merged
compot-dev merged 1 commit into
v2from
build/camex-4.0.1
Nov 18, 2026
Merged

compot-dev merged 1 commit into
v2from
build/camex-4.0.1

Conversation

@compot-dev

Copy link
Copy Markdown
Collaborator

camex 4.0.1 (OpenIPC/camex#180, PR OpenIPC/camex#181) fixes the tunnel over TCP: a frame body read in pieces lost its first piece, so traffic from the server to the box stalled at about 10 KB/s. The bug was in the shared receive path, so the client library needs the fix too, not only the server. UDP is unaffected; no protocol or CLI changes.

  • bundles/camex → 9e721e5 (4.0.1); version 2.24.3 (versionCode 60), CHANGELOG, README (three languages) name camex 4.0.1.
  • tests/e2e.sh: TRANSPORT=UDP|TCP for the tunnel in Network; on TCP it checks the app's TCP connection to the hub; on both it checks the video rate through tun0 (100 KB/s or more) and prints the tunnel's ping RTT. docs/testing.md: 15 checks, 16 with TCP.

The rate check does not catch #180 itself: the Docker network has a few ms of RTT and camex 4.0.0 passed it over TCP (874 KB/s). A real round trip in the test is #281.

Tests (local, Docker):

  • testDebugUnitTest lintDebug assembleDebug in compot/android:2026.10: pass.
  • TRANSPORT=TCP tests/e2e.sh 34: 16 passed (904 KB/s); TRANSPORT=TCP tests/e2e.sh 21: 16 passed (892 KB/s); tests/e2e.sh 34 (UDP): 15 passed (899 KB/s).

After the release: the sberbox-1 tunnel to a 4.0.1 server switched to TCP (real RTT ~80 ms).

camex 4.0.1 (OpenIPC/camex#180) fixes the tunnel over TCP: a frame body read
in pieces lost its first piece and server-to-client traffic stalled at about
10 KB/s. The client library had the bug as well, so the box needs this build.

tests/e2e.sh takes TRANSPORT=TCP, checks the TCP connection to the hub and the
video rate through tun0, and prints the tunnel's ping RTT. On the Docker
network the RTT is a few ms and #180 does not show there (#281).
@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

PR Summary by Qodo

Upgrade camex to 4.0.1 for the TCP tunnel fix

🐞 Bug fix 🧪 Tests 📝 Documentation 🕐 10-20 Minutes

Grey Divider

AI Description

• Upgrade the bundled camex client to 4.0.1 to fix TCP tunnel receive stalls.
• Test TCP connectivity and video throughput; Docker latency cannot reproduce the original bug.
• Release Decoder 2.24.3 and update the changelog and multilingual documentation.
Merge Risk 🟡 Medium

Blast radius 🟡 Medium 💥 2 capabilities

  • 2 affected capabilities within one bounded functional scope: camex tunnel integration.
  • The changed tunnel library is the runtime transport between Decoder and a remote camera.
  • Tunnel transport failure directly prevents the end-to-end camera playback behavior; the Android player and tunnel are related parts of the same bounded camera-tunnel integration, not independent scopes.
  • This is a distinct user/system outcome from camera playback—retrieving Decoder diagnostics through the tunnel—but it uses the same bounded camex tunnel integration and does not establish an independent functional scope merely because the consumer is a different server endpoint.
Sources

CHANGELOG.md[15-20]

## 2.24.3 — 2026-11-18

- The camex tunnel is built from camex 4.0.1 (was 4.0.0), which fixes the tunnel over TCP:
  a frame body read in pieces lost its first piece, so traffic from the server to the box
  stalled at about 10 KB/s (OpenIPC/camex#180). The client library had the bug too, so a
  TCP tunnel needs this build as well as a 4.0.1 server. UDP is unaffected.
Behavioral complexity 🟡 Medium 🧩 Compatibility cases

  • Before: the embedded tunnel used camex 4.0.0, and the documented TCP framing defect could lose the first piece of a split frame; the Android client and server versions also had to interoperate.
  • After: the embedded client is changed to camex 4.0.1, whose documented fix changes TCP frame-body handling, while UDP remains a separate transport path.
  • New correctness condition: TCP client/server deployments must use compatible camex behavior so split frame bodies are reconstructed and delivered correctly across the tunnel; the first upgraded client/server adoption and mixed-version transition must preserve connectivity and throughput.
  • This is a compatibility interaction introduced by changing the protocol implementation, not complexity inferred merely from using an existing tunnel or test helper.
Sources

CHANGELOG.md[15-20]

## 2.24.3 — 2026-11-18

- The camex tunnel is built from camex 4.0.1 (was 4.0.0), which fixes the tunnel over TCP:
  a frame body read in pieces lost its first piece, so traffic from the server to the box
  stalled at about 10 KB/s (OpenIPC/camex#180). The client library had the bug too, so a
  TCP tunnel needs this build as well as a 4.0.1 server. UDP is unaffected.
Potential damage 🟡 Medium 🩹 Temporary loss

  • A reachable tunnel fault can make remote camera playback unavailable or unusably slow, particularly for TCP traffic.
  • Reverting the Decoder APK alone may restore the old client behavior but does not repair an already incompatible or defective server deployment; the supported recovery is to use compatible camex 4.0.1 client and server builds or disable/reconfigure the tunnel.
  • No persistent camera state or external financial/data side effect is indicated.
  • Recoverable by restoring a compatible tunnel endpoint/library, changing transport, or disabling the tunnel and using another camera path.
  • Recovery may require updating the server as well as the first client that adopts the new protocol; reverting code does not necessarily repair a deployed server or already-established connection.
Sources

CHANGELOG.md[15-20]

## 2.24.3 — 2026-11-18

- The camex tunnel is built from camex 4.0.1 (was 4.0.0), which fixes the tunnel over TCP:
  a frame body read in pieces lost its first piece, so traffic from the server to the box
  stalled at about 10 KB/s (OpenIPC/camex#180). The client library had the bug too, so a
  TCP tunnel needs this build as well as a 4.0.1 server. UDP is unaffected.
Assessed commit 60c7428 > Snapshot assessment: the current PR revision could not be verified.
Diagram

graph TD
  Camera["RTSP camera"] --> Edge["Linux client"] --> Hub["camex hub"] --> Client["Decoder camex 4.0.1"] --> VPN["Android tun0"] --> Player["Decoder playback"]
  Tests["e2e.sh"] -. "TCP check" .-> Client
  Tests -. "RX rate" .-> VPN
Loading
High-Level Assessment

Updating the upstream camex submodule is preferable to carrying a local client patch: the shared receive-path fix requires an updated client as well as a 4.0.1 server. The new integration checks verify connectivity and traffic, but do not claim to reproduce the high-RTT regression; that needs a separate test with a realistic round trip.

Files changed (8) +40 / -10

Tests (1) +25 / -3
e2e.shExercise selectable tunnel transport and video throughput +25/-3

Exercise selectable tunnel transport and video throughput

• Adds a validated TRANSPORT setting, an established TCP-connection check for TCP runs, tunnel ping RTT output, and a minimum received-video-rate check on tun0. Notes that the low-latency Docker network cannot reproduce the original high-RTT stall.

tests/e2e.sh

Documentation (5) +12 / -4
CHANGELOG.mdDocument the 2.24.3 TCP tunnel fix +8/-0

Document the 2.24.3 TCP tunnel fix

• Adds release notes for the camex 4.0.1 client update, its requirement alongside a 4.0.1 server for TCP, and the expanded end-to-end checks. Clarifies that UDP is unaffected.

CHANGELOG.md

README.mdUpdate the English tunnel version +1/-1

Update the English tunnel version

• Changes the documented bundled camex version from 4.0.0 to 4.0.1.

README.md

README.ru.mdUpdate the Russian tunnel version +1/-1

Update the Russian tunnel version

• Changes the documented bundled camex version from 4.0.0 to 4.0.1.

README.ru.md

README.zh-CN.mdUpdate the Chinese tunnel version +1/-1

Update the Chinese tunnel version

• Changes the documented bundled camex version from 4.0.0 to 4.0.1.

README.zh-CN.md

testing.mdDocument UDP and TCP end-to-end check counts +1/-1

Document UDP and TCP end-to-end check counts

• Updates the test guide to state that the suite has 15 default checks or 16 when TRANSPORT=TCP.

docs/testing.md

Other (2) +3 / -3
build.gradleBump Decoder to 2.24.3 +2/-2

Bump Decoder to 2.24.3

• Increments the Android versionCode to 60 and versionName to 2.24.3 for this release.

android/app/build.gradle

camexAdvance the camex submodule to 4.0.1 +1/-1

Advance the camex submodule to 4.0.1

• Moves the bundled camex commit from 0712dcb to 9e721e5, bringing the upstream client receive-path fix into the tunnel build.

bundles/camex

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (2) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Rate check passes the buggy camex 4.0.0 📎 Requirement gap ≡ Correctness
Description
The 100 KB/s video-rate check in tests/e2e.sh runs on the low-latency Docker network without netem
delay on the hub or edge links. At that few-millisecond RTT, camex 4.0.0 passes over TCP at 874
KB/s, so the approximately 60 ms camex#180 stall does not appear and the check cannot distinguish
4.0.0 from 4.0.1.
Code

tests/e2e.sh[R312-314]

+RATE_KB=$(( (${r2:-0} - ${r1:-0}) / 10240 ))
+if [ "$RATE_KB" -ge 100 ]; then ok "video through the tunnel at $RATE_KB KB/s"; else
+    bad "video through the tunnel at $RATE_KB KB/s (want 100 or more)"; fi
Evidence
The checklist calls for 30 ms of netem delay in each direction, but the diff applies none before the
rate check at lines 310–314. The added comment says the Docker network does not show the bug, and
the PR description reports camex 4.0.0 passing the TCP threshold at 874 KB/s.

Verify the TCP video-rate regression test distinguishes camex versions
tests/e2e.sh[312-314]
tests/e2e.sh[308-309]
tests/e2e.sh[310-314]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The 100 KB/s TCP video-rate check runs at Docker-network latency without the round-trip delay needed to expose the camex#180 stall, allowing camex 4.0.0 to pass.
## Fix Focus Areas
- tests/e2e.sh[308-314]
## Recommended Fix
Apply `tc qdisc add dev ... netem delay 30ms` to the hub and edge links, one per direction, before running the rate check. Confirm the resulting approximately 60 ms RTT using the existing ping output, then verify that the check fails with camex 4.0.0 and passes with 4.0.1 under that delay.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Upload throughput goes unmeasured 📎 Requirement gap ≡ Correctness
Description
The rx() helper reads only the receive counter of tun0 from /proc/net/dev, so the rate check
measures only the hub-to-box direction on both TCP and UDP. A regression in box-to-hub throughput
would pass this test unnoticed.
Code

tests/e2e.sh[R310-311]

+rx() { $ADB shell cat /proc/net/dev | awk -F'[: ]+' '$2 == "tun0" { print $3 }'; }
+r1=$(rx); sleep 10; r2=$(rx)
Evidence
The checklist requires throughput measured in both directions, but the added rx() helper reads
only the receive field and no transmit or reverse-direction traffic is measured anywhere in the
added lines.

Cover both tunnel directions and transports in throughput testing
tests/e2e.sh[310-311]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
Issue description
The throughput check reads only the receive counter of `tun0`, so the box-to-hub direction is not measured on TCP or UDP.
Fix Focus Areas
- tests/e2e.sh[310-314]
Recommended Fix
Add a transmit-side measurement (field `$11` of the `tun0` line in `/proc/net/dev`), generate traffic from the box toward the hub, and check a rate threshold for each direction on both transports.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Tip of the day
💡 Did you know, you can type 'qodo, fix this' on a finding and the fix lands right on your PR

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@compot-dev

Copy link
Copy Markdown
Collaborator Author

Qodo review on 60c7428:

  1. Rate check passes camex 4.0.0 — right, and said so in the description and in the comment above the check: the Docker network has a few ms of RTT. The netem delay on the hub and edge links (compot/cross has no tc) and the 4.0.0-fails / 4.0.1-passes check are e2e: a real round trip in the tunnel test (catch camex#180-like TCP stalls) #281. This PR only bumps camex and adds TCP to the test; the real-RTT check of this build is the TV box on a 4.0.1 server after the release.
  2. Box-to-hub rate not measured — on purpose: Decoder only receives video through the tunnel; what goes from the box to the hub is RTSP control, keepalives and the debug page. camex's own docker/test-e2e-throughput.sh checks both directions over UDP and TCP with 60 ms RTT.

@compot-dev
compot-dev merged commit 1b3edaa into v2 Nov 18, 2026
7 checks passed
@compot-dev
compot-dev deleted the build/camex-4.0.1 branch November 18, 2026 00:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant