Skip to content

audio: record-only mode via negative audioPort#88

Merged
snokvist merged 1 commit into
OpenIPC:masterfrom
snokvist:sync/audio-port-record-only
Jun 15, 2026
Merged

audio: record-only mode via negative audioPort#88
snokvist merged 1 commit into
OpenIPC:masterfrom
snokvist:sync/audio-port-record-only

Conversation

@snokvist

Copy link
Copy Markdown
Collaborator

Summary

Adds a way to enable + record audio without streaming it, by making outgoing.audioPort a signed tri-state:

audioPort Behavior
< 0 (e.g. -1) Capture + record only, never stream (new)
0 Share the video target (unchanged)
> 0 Dedicated UDP audio port (unchanged)

The capture/encode thread still runs and feeds the recording ring on the record-only path; only the network send is skipped. Recording is gated on record.enabled/audio.enabled, independent of audioPort, so audio still lands in TS-format recordings.

Motivation: previously there was no clean knob for this. audio.enabled=false kills recording too; audio.mute silences the source; audioPort=0 mixes audio onto the video stream (UDP) or fully disables audio in SHM mode. A negative value cleanly expresses "capture + record, never transmit" without depending on the video transport.

Changes

  • Widen audio_port uint16_tint32_t (venc_config.h, maruko_config.h)
  • Drop the truncating (uint16_t) parse cast; render via pp_field_int
  • FIELD type FT_UINT16FT_INT (accepts negatives via strtol, still MUT_RESTART); settable via config file or /api/v1/set?outgoing.audioPort=-1
  • stream_disabled flag on both audio backends (star6e_audio.c, maruko_audio.c); skip output-socket init and guard both send sites; record-only (no stream) init log
  • Test: -1 survives parse + save/reload round-trip
  • Docs (README.md, AUDIO_UDP_OUTPUT_FEASIBILITY.md) + dashboard tooltip + regenerated venc_webui.c

Constraints

  • Record-only audio only works with a TS-family record.format — HEVC recordings carry no audio track (pre-existing).

Verification

  • make test-werror1659 passed, 0 failed (incl. new -1 parse + round-trip)
  • make verify → passed end-to-end (Star6E + Maruko builds + webui-check)
  • Device-verified on Star6E (SHM video, opus audio): audioPort=-1 produces no audio socket on the wire while the .ts recording contains the opus track (3527 packets / 72.7 s). Also verified the runtime API set: /api/v1/set?outgoing.audioPort=-1 applies, persists, and respawns into record-only mode.

🤖 Generated with Claude Code

Make `outgoing.audioPort` a signed tri-state so audio can be captured and
recorded without ever being streamed:

  < 0 (e.g. -1)  capture + record only, no UDP send (NEW)
  0              share the video target (unchanged)
  > 0            dedicated UDP audio port (unchanged)

The capture/encode thread still runs and feeds the recording ring on the
record-only path; only the network send is skipped. Recording is gated on
record.enabled/audio.enabled, independent of audioPort, so audio still lands
in TS-format recordings (HEVC recordings carry no audio track).

- Widen audio_port uint16_t -> int32_t (venc_config.h, maruko_config.h)
- Drop truncating (uint16_t) parse cast; render via pp_field_int
- FIELD type FT_UINT16 -> FT_INT (accepts negatives, still MUT_RESTART);
  settable via config file or /api/v1/set?outgoing.audioPort=-1
- stream_disabled flag on both audio backends; skip output init + guard
  both send sites; "record-only (no stream)" init log
- Test: -1 survives parse + save/reload round-trip
- Docs (README, AUDIO_UDP_OUTPUT_FEASIBILITY) + dashboard tooltip + webui blob

make test-werror: 1659 passed. make verify: clean (Star6E + Maruko).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@snokvist snokvist merged commit b28d162 into OpenIPC:master Jun 15, 2026
7 checks passed
@snokvist snokvist deleted the sync/audio-port-record-only branch June 15, 2026 18:53
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