dragonflight/services/capture
Claude c083d1006a fix: deltacast audio missing after ffmpeg restart (EPIPE cascade + stale FIFO guard)
Root cause A (main.c): audio_thread set the global g_stop flag on EPIPE
(ffmpeg reader died). This killed ALL port threads across the entire bridge
process. Bridge process then exited with all 8 ports gone.

Root cause B (node-agent/index.js): startDeltacastBridge() skipped respawn
when FIFOs existed in /dev/shm/deltacast, even if the bridge process was dead.
Next ffmpeg opened the audio FIFO read-end and blocked forever (no writer) →
no audio (or video) for any new recording.

Fix A (main.c):
- Add per-port atomic g_port_stop[MAX_PORTS] flags.
- Audio thread: on EPIPE, close the FIFO fd and loop back to reopen it.
  The VHD ANC stream stays open across reconnects. Other ports unaffected.
- Video thread: on EPIPE or stream error, set only g_port_stop[port], not
  the global g_stop. Other ports keep running.
- MAX_PORTS #define moved before globals so g_port_stop[MAX_PORTS] compiles.

Fix B (node-agent/index.js):
- Add _dcBridgeProcessAlive() — scans /proc/<pid>/cmdline for deltacast-bridge.
- startDeltacastBridge(): if FIFOs exist but no live bridge process is found,
  spawn a fresh bridge instead of silently returning. Detects bridges started
  externally (e.g. sudo on the host before node-agent started).

Requires: bridge rebuild + restart on zampp3. No capture image rebuild needed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-02 01:35:07 +00:00
..
deltacast-bridge fix: deltacast audio missing after ffmpeg restart (EPIPE cascade + stale FIFO guard) 2026-06-02 01:35:07 +00:00
sdk chore(capture): commit Blackmagic DeckLink SDK 16.0 Linux headers 2026-05-31 18:07:12 -04:00
src fix(capture-manager): default deltacast framerate to 60000/1001 (1080p59.94) 2026-06-02 01:15:42 +00:00
build-with-decklink.sh capture: custom FFmpeg 7.1 build with DeckLink + D-Bus mounts + SDI deinterlace 2026-05-22 00:01:43 +00:00
decklink-sdk16.patch fix(capture): proper SDK 16 patch via upstream FFmpeg master diff 2026-05-22 00:53:03 +00:00
Dockerfile merge: integrate remote changes + deltacast bridge capture 2026-06-01 08:41:05 -04:00
package.json add services/capture/package.json 2026-04-07 21:58:29 -04:00
patch_decklink.py fix(capture): proper SDK 16 patch via upstream FFmpeg master diff 2026-05-22 00:53:03 +00:00