Commit Graph

27 Commits

Author SHA1 Message Date
Logan Cusano b0a8ed2a5a Fix tail truncation, decouple call length from buffer, trim silence
CI / lint (push) Failing after 4s
CI / test (push) Successful in 21s
Measured six recordings off a live P25 node and found two independent
defects causing lost audio at the end of calls:

- stop_recording() sliced the ring buffer immediately, so if the MP3
  muxer had not yet delivered the tail the file was silently short.
  Now waits (bounded, 2s) until buffered audio covers the end epoch.
- TGID-change closes used the new grant's epoch as the end with no pad
  at all, guaranteeing truncation on every split. Tail pad is now a
  setting, default raised 0.5s -> 1.0s.

The ring buffer also capped maximum call length: a call longer than the
buffer had its front silently clamped. The ring now serves the pre-roll
only, with a per-call accumulator for the rest, bounded at 4.8MB.
Clamping is loudly warned rather than silent.

Uploads averaged 63% silence, which inflates STT cost and is a known
Whisper hallucination trigger. Leading/trailing silence is now trimmed
conservatively (-40dB, 0.25s guard, internal pauses untouched).
started_at/ended_at still describe the call; new audio_* fields carry
the trimmed audio bounds so playback can map back to wall clock.
All-silence recordings are skipped and logged instead of uploaded.

Also: log measured control-channel idle on idle-timeout closes so
CALL_IDLE_TIMEOUT can be tuned from data, and quiet the httpx logger
which emitted ~170k lines/day of poll noise.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-04 21:39:36 -04:00
Logan Cusano efdbe7d803 Move recording and Discord voice to PulseAudio
CI / lint (push) Failing after 26s
CI / test (push) Successful in 41s
2026-08-04 19:53:45 -04:00
Logan Cusano cc9af6ff26 feat: Buffer offline call_end events and relay them upon MQTT reconnection 2026-07-13 00:16:24 -04:00
Logan Cusano 857325af85 feat: Add local system override and manual entry controls with offline systems caching
CI / lint (push) Failing after 5s
CI / test (push) Successful in 19s
Build edge-node / build (push) Successful in 32s
2026-07-12 23:06:05 -04:00
Logan Cusano 9f026fa262 update: scanner dashboard UI and Docker configuration for edge node
CI / lint (push) Failing after 5s
CI / test (push) Successful in 20s
Build edge-node / build (push) Successful in 33s
2026-07-12 21:44:36 -04:00
Logan Cusano 3fbdc50536 feat: implement FastAPI router, web + local UI updates, and metadata monitoring for the edge node
CI / lint (push) Failing after 31s
CI / test (push) Successful in 45s
Build edge-node / build (push) Successful in 8m44s
2026-07-12 21:30:30 -04:00
Logan 16f6e0de95 audio fixes attempt
CI / lint (push) Failing after 6s
CI / test (push) Successful in 19s
Build edge-node / build (push) Successful in 7m54s
Build op25 / build (push) Successful in 1h25m50s
2026-05-23 14:59:48 -04:00
Logan dccbab00d6 feat: bot Discord presence + system name on voice join
CI / lint (push) Failing after 35s
CI / test (push) Successful in 46s
Build edge-node / build (push) Successful in 11m13s
- RadioBot.join() accepts system_name parameter
- Sets bot activity to ActivityType.listening → system name on connect
- Clears presence (activity=None) on leave
- main.py passes system_name from MQTT payload to radio_bot.join()
2026-05-10 19:47:22 -04:00
Logan 432e455853 Add updates
CI / lint (push) Successful in 6s
CI / test (push) Successful in 21s
Build edge-node / build (push) Successful in 38s
2026-04-21 01:51:40 -04:00
Logan d0e4734cf9 Linting + touches
CI / lint (push) Successful in 8s
Build edge-node / build (push) Failing after 22s
Build icecast / build (push) Failing after 23s
CI / test (push) Successful in 23s
Build op25 / build (push) Failing after 16s
2026-04-21 00:56:50 -04:00
Logan 6ac05eff64 more call recording fixes 2026-04-19 16:38:15 -04:00
Logan 6878155230 Call recorder updates 2026-04-19 15:24:53 -04:00
Logan 6b38f191a8 switch back to icecast???? 2026-04-13 00:16:03 -04:00
Logan f028f08d6b Fix pulseaudio breaking 2026-04-13 00:09:54 -04:00
Logan be785a453c metadata fixes 2026-04-12 21:58:24 -04:00
Logan 4e41df9f95 updates 2026-04-12 03:34:11 -04:00
Logan 3cf5bc0d05 updates 2026-04-12 03:26:33 -04:00
Logan 33cad7ed24 updates 2026-04-12 03:05:48 -04:00
Logan 26d21d42e1 Updates back on claude 2026-04-12 01:32:05 -04:00
Logan f8c58dbda8 gemini changes 2 2026-04-11 22:28:46 -04:00
Logan b4b2f19e10 gemini changes? idk 2026-04-11 22:23:59 -04:00
Logan fb86d79930 File Change
op25-container/system.pa	New PulseAudio config: auth-anonymous=1 so the edge-node can connect without group membership
op25-container/Dockerfile	Copies system.pa into /etc/pulse/system.pa
drb-edge-node/Dockerfile	Added libpulse0 — ffmpeg needs this runtime library to use -f pulse
drb-edge-node/app/internal/call_recorder.py	Switched recording from Icecast (burst-buffer overlap) to PulseAudio monitor (zero-delay, exact call boundaries)
2026-04-11 21:16:32 -04:00
Logan d201d8124e Issue 1 — Discord Audio (PulseAudio)
docker-compose.yml: Added a pulse_socket named volume mounted at /run/pulse in both op25 and edge-node. Also set PULSE_SERVER=unix:/run/pulse/native in edge-node so libpulse (and ffmpeg's pulse input) finds the right socket.

discord_radio.py: Removed _icecast_url and changed _play_stream() to use -f pulse -i default.monitor. This reads directly from the PulseAudio sink monitor — zero buffer delay. The PULSE_SERVER env var is inherited by the ffmpeg subprocess.

Note: default.monitor captures whatever audio is playing on the default sink. If OP25 uses a named virtual sink, you may need to replace default.monitor with <sink_name>.monitor (run pactl list sinks short inside the op25 container to find the name).

Issue 2 — No audio URL / GCS credentials

storage.py: storage.Client() was using ADC but ADC isn't configured in the container. Now uses storage.Client.from_service_account_json(settings.gcp_credentials_path) when GCP_CREDENTIALS_PATH is set — same credential file Firebase already loads.

You also need to mount the key file into the server container in docker-compose.yml:

c2-core:
  volumes:
    - ./gcp-key.json:/app/gcp-key.json:ro
And set GCS_BUCKET=your-bucket-name in .env.

Issue 3 — Token orphaning

mqtt_manager.py: Every checkin now includes "discord_connected": radio_bot.is_connected.

mqtt_handler.py: On checkin, if discord_connected is explicitly False, calls release_token(node_id). Only fires on explicit false (missing field = unknown = no action).

node_sweeper.py: When a node is swept to offline, its token is released too. This covers the case where the node stops checking in entirely (crash/power loss).
2026-04-11 20:29:33 -04:00
Logan e47a9623b5 VC Update 2026-04-11 20:01:47 -04:00
Logan 97ebcad3bc Discord bot updates 2026-04-11 13:43:59 -04:00
Logan 7de55f9885 changes 2026-04-06 00:23:33 -04:00
Logan 1a9c92b6db Initial commit — DRB client (edge node) stack
Includes edge-node (FastAPI/MQTT/Discord voice), op25-container (SDR decoder),
and icecast (audio streaming).
2026-04-05 19:01:51 -04:00