Skip to content

feat(audio): add negotiated and authenticated live MAT transport - #40

Merged
qiin2333 merged 12 commits into
micfrom
codex/atmos-mat-transport
Oct 23, 2026
Merged

qiin2333 merged 12 commits into
micfrom
codex/atmos-mat-transport

Conversation

@qiin2333

@qiin2333 qiin2333 commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

改了啥呀

把有限回放这只杂鱼从生产路径请出去,共享层收敛为最小实时 MAT 协议、认证和接收回调。

  • live7 mat-live-v1:严格 DESCRIBE/ANNOUNCE/ACK、HKDF-SHA256、AES-128-GCM、64 位包计数、完整周期重组和 cycle/EOS 回调。
  • 本地 AUTO6 只选 live7 或 Opus0。故障终止,不在会话中换码,不把断流当成功 EOS。
  • 删除 codec4/5 的协商、有限 SHA/count 接收器、相关公开常量与死分支,以及无调用方的 Finish 轮询接口。编号 4/5 保留为退役编号并在联网前拒绝。
  • 文件发布、SHA/count 检查与离线输入只留在 主机诊断工具,不注册生产网络 codec。
  • 相对 mic 的新增量由 1216 降至 899 行:生产代码 577、测试 232、文档 38、构建/CI 52。

验证

当前 head 62c0bcff392f9d78c443a1448083a7ab2ce92a73,base mic。

  • MinGW、MSVC 静态 CTest 各 13 项通过,覆盖 live 回调/消费者失败、缺失 END、排空期限和并发时间戳;Windows CI 保留静态构建/CTest 与 C11 atomics 配置。
  • 完整主机软件回归 build/mat-minimal-live-v1/proof.json 通过:22 个实际 RTSP 客户端协商场景、独立 Python HKDF/GCM oracle、两组 1300 周期 UDP/FEC、391 个刻意丢包恢复,以及源契约/租约/管道/管理入口回归。
  • 真实 AudioStream UDP 接收/解码线程:正常认证 END 成功,缺失 END/尾分片约 2.6 秒失败;mock 消费端无硬件和文件输出。独立诊断另通过 7 个落盘、7 个原始录制输入及成功/截断检查。测试字节均现场软件生成。
  • 当前 head 的 构建 CI 18 项全部通过(push/PR 各 9 项);Windows x64/ARM64 包含静态构建/CTest。此前 4 个 Copilot 问题已修复并关闭线程,不代表新 head 获得审查批准。

边界

实时 profile/密文格式不变;这些未发布 API 的删除要求消费者重建。Android 应用及其 shared 指针不升级,客户端继续 mock;不将历史原生短测算作当前重构验收。没有设备 MAT/Atmos 播放结论。PR 已 squash 合入 mic,落点 24f23691a1c303e49cab9334414d35e023ba7f97,代码树与上述已验证 head 完全一致;CodeRabbit 对 mic base 禁用审查,跳过不算通过。

@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5c9e9d07-2b03-4544-8efa-0cfbc42f2aa9

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@qiin2333 qiin2333 changed the title feat(audio): experimental finite MAT transport and cross-PC handoff feat(audio): add negotiated and authenticated live MAT transport Oct 23, 2026
@qiin2333
qiin2333 marked this pull request as ready for review October 23, 2026 02:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved timeout handling and build compatibility issues can disconnect healthy streams, leave finite sessions stalled, or break supported builds.

4 open issues
What changed in this PR

Adds negotiated, authenticated live MAT audio transport to the shared library, keeping file handling and offline input in host diagnostic tools.

Changes:

  • Adds live MAT negotiation, authenticated packets, cycle reassembly, and cycle/EOS callbacks.
  • Restricts normal MAT preference to live MAT or Opus while retaining explicit finite profiles.
  • Adds transport, parser, and AudioStream regression tests and documents the integration boundary.
File Description
tests/​RtspParserMatTest.c Tests duplicate headers and existing parser behavior.
tests/​MatPlaybackSelectionTest.c Tests finite-profile selection and fallback.
tests/​MatLiveTest.c Tests authentication, sequencing, integrity, and callbacks.
tests/​MatLiveRtpTest.c Exercises live MAT through RTP and AudioStream.
tests/​AudioCodecSelectionTest.c Tests negotiated startup and finite callbacks.
src/​SdpGenerator.c Emits MAT negotiation attributes and transport timing.
src/​RtspParser.c Preserves duplicate-header evidence.
src/​RtspConnection.c Validates MAT capabilities and confirmations.
src/​Rtsp.h Defines the duplicate-header flag.
src/​MatWire.h Defines MAT packet layout and helpers.
src/​MatReceiver.h Declares cycle and completion interfaces.
src/​MatReceiver.c Connects reassembly to consumer callbacks.
src/​MatProfile.h Centralizes carrier constants and SDP parsing.
src/​MatPlaybackProfile.h Defines finite playback negotiation.
src/​MatPlayback.h Declares the finite playback receiver.
src/​MatPlayback.c Validates finite stream SHA/count and delivers callbacks.
src/​MatLiveProfile.h Defines live-profile parsing and confirmation.
src/​MatLivePlayback.h Declares the authenticated live receiver.
src/​MatLivePlayback.c Authenticates packets and enforces sequence continuity.
src/​MatLiveCrypto.h Implements key derivation and authenticated encryption.
src/​MatDumpProfile.h Defines finite diagnostic profile validation.
src/​MatDepacketizer.h Declares bounded cycle reassembly state.
src/​MatDepacketizer.c Validates fragments, cycles, and stream completion.
src/​Limelight.h Exposes MAT codecs and consumer callbacks.
src/​Limelight-internal.h Exposes internal MAT profile state.
src/​Connection.c Initializes profiles and selects requested MAT modes.
src/​AudioStream.c Integrates MAT reception, lifecycle, and failure handling.
docs/​MAT-HANDOFF.md Documents ownership boundaries and validation limits.
CMakeLists.txt Registers MAT regression test targets.

Review effort: Balanced

Comment thread CMakeLists.txt Resolved
Comment thread src/MatPlayback.c Resolved
Comment thread src/AudioStream.c Resolved
Comment thread src/AudioStream.c Resolved
@qiin2333
qiin2333 merged commit 24f2369 into mic Oct 23, 2026
19 checks passed
@Yundi339
Yundi339 deleted the codex/atmos-mat-transport branch November 7, 2026 04:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants