Skip to content

feat(doorbird): add continuous audio for live view and HKSV recordings#2001

Open
mrsvan wants to merge 1 commit intokoush:mainfrom
mrsvan:doorbird-continuous-audio
Open

feat(doorbird): add continuous audio for live view and HKSV recordings#2001
mrsvan wants to merge 1 commit intokoush:mainfrom
mrsvan:doorbird-continuous-audio

Conversation

@mrsvan
Copy link
Copy Markdown

@mrsvan mrsvan commented Mar 23, 2026

Summary

  • Add a Continuous Audio setting (enabled by default) that keeps a persistent connection to the Doorbird microphone (audio-receive.cgi)
  • When disabled, the original silence generator behavior is preserved
  • Auto-reconnects on connection drop via FFmpeg reconnect flags and process restart

Problem

The Doorbird D101S (and other models) does not include audio in its RTSP video stream. Audio and video use separate endpoints:

  • Video: RTSP at /mpeg/media.amp (H.264 only, no audio track)
  • Audio: HTTP at /bha-api/audio-receive.cgi (pcm_mulaw, 8kHz, mono)

The plugin currently feeds silence (anullsrc) into the audio track and only connects to the real microphone during two-way intercom. This means:

  • HomeKit live view has no audio
  • HKSV recordings have no audio
  • Audio only works when the intercom/talk button is pressed

This has been reported in #934 and #996.

Solution

Replace the silence generator with a continuous connection to audio-receive.cgi so the Doorbird's microphone audio flows at all times. The change is in startSilenceGenerator() which conditionally uses either the real audio endpoint or the original anullsrc based on the new setting.

Key design decisions:

  • Opt-in setting (defaults to enabled) for backward compatibility
  • FFmpeg -reconnect flags handle HTTP stream drops gracefully
  • Auto-restart on exit with 2-second delay if the ffmpeg process exits unexpectedly
  • No changes to intercom flow — the existing doorbellAudioActive guard ensures intercom audio takes priority

Test plan

  • Enable "Continuous Audio" (default) — verify audio in HomeKit live view without pressing talk
  • Trigger motion event — verify HKSV recording has audio in Apple Home timeline
  • Press talk button — verify two-way intercom still works correctly
  • Disable "Continuous Audio" — verify silence is restored (original behavior)
  • Kill the Doorbird network temporarily — verify ffmpeg reconnects automatically

Fixes #934, fixes #996

The Doorbird does not include audio in its RTSP video stream. Audio is
only available via the separate HTTP audio-receive.cgi endpoint. The
plugin previously fed silence (anullsrc) into the audio track, only
connecting to the real microphone during two-way intercom.

Add a "Continuous Audio" setting (enabled by default) that keeps a
persistent connection to the Doorbird microphone. This provides real
audio for HomeKit live view and HKSV recordings without requiring the
intercom to be active.

The implementation reuses the existing startSilenceGenerator method,
replacing the anullsrc input with audio-receive.cgi when continuous
audio is enabled. FFmpeg reconnect flags and auto-restart on exit
provide resilience against connection drops. The existing intercom
flow is unchanged — the doorbellAudioActive guard ensures intercom
audio takes priority when two-way talk is active.

Fixes koush#934, fixes koush#996
@koush
Copy link
Copy Markdown
Owner

koush commented Apr 7, 2026

What's the implications of having the intercom always on? Does this change the audio provide to use echo cancellation and stuff like other 2 way systems?

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.

Homekit: Audio only after clicking on "Speak" Doorbird HKSV recording are missing audio

2 participants