Commit Graph
231 Commits
Author SHA1 Message Date
b9fbc1800a Merge latest Barnard fork improvements
Merge the newest logging, jitter recovery, AGC hotkey, and channel tree refresh work from bmmcginty/barnard-stormdragon-ai-fork dev.

Co-authored-by: Brandon McGinty <git@bmcginty.us>

Co-authored-by: Tyler Spivey <tspivey@pcdesk.net>
2026-08-14 20:14:46 -04:00
Tyler SpiveyandClaude Opus 5 f58d9f5dce Refresh channel tree after volume changes
Tree items render a display string snapshotted at build time, so
changing a user's volume updated the gain but left the stale
percentage on screen. Rebuild the tree and refresh after volume
change and reset, matching what the mute hotkeys already do.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-14 15:29:44 -07:00
Tyler SpiveyandClaude Opus 5 4393739ffa Add F12 hotkey to toggle microphone AGC
Automatic gain control was always on with no way to turn it off. Toggle
it with F12, the /agc command, or the agc FIFO command, and persist the
choice in the configuration file the same way noise suppression does.

AgcEnabled defaults to true so existing setups keep their current
behavior, and the saved value is applied to the stream on connect. The
enabled flag becomes an atomic.Bool because the capture goroutine reads
it while the UI goroutine writes it, and the lazily created right
channel AGC now inherits the left channel's state.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-14 13:16:44 -07:00
Tyler SpiveyandClaude Opus 5 132df6863a Resync jitter buffer when a sender restarts frame numbering
Mumble destroys and recreates AudioInput when the sender switches audio
devices. The destructor sends no terminator, and the replacement resets
iFrameCounter to zero, so a sender who never unkeys silently restarts its
frame numbering mid-burst. The jitter buffer kept expecting the old
sequence and discarded every packet as late until the next unkey.

Resync on a sustained run of late packets combined with a backwards jump
too large to be network reordering. Both conditions are needed: the run
length alone would let a clump of reordered packets drag the expected
sequence backwards, and small jumps need no intervention because the
restarted stream climbs past the stale expectation on its own.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-14 13:00:06 -07:00
Brandon McGinty (deepseek) 2cdbce8edb Show enable/disable logs and pass debug logging to barnard 2026-08-14 12:32:41 -04:00
Brandon McGinty (deepseek) d2dff7f521 Add barnard-ui session logging and wormhole log sharing 2026-08-14 12:29:42 -04:00
Storm DragonandBrandon McGinty 8a8cfde01d Merge Brandon McGinty's UDP and reliability work
Merge the full history from bmmcginty/barnard-stormdragon-ai-fork dev, including UDP audio transport, jitter handling, concurrency fixes, and regression coverage.

Co-authored-by: Brandon McGinty <git@bmcginty.us>
2026-08-14 11:52:00 -04:00
Brandon McGinty (chatgpt) c0ef036934 Add configurable incoming audio jitter buffer 2026-08-13 17:54:30 -04:00
Brandon McGinty (chatgpt) d338925da6 Add outgoing audio packet interval option 2026-08-13 16:00:30 -04:00
Brandon McGinty (chatgpt) 893908f9a1 Reset audio jitter state at talk burst end 2026-08-13 13:37:47 -04:00
Brandon McGinty (chatgpt) 05dc6e4e0e Set TLS server name from Mumble address 2026-08-13 12:53:35 -04:00
Brandon McGinty (chatgpt) 883f7250f5 Avoid debug logging induced UDP loss 2026-08-12 17:38:04 -04:00
Brandon McGinty (chatgpt) 4510c25350 Recover UDP crypto after packet loss 2026-08-12 16:30:38 -04:00
Storm Dragon d4f8d56c8e Reverted because of audio problems. Will try again when things are fixed. 2026-08-11 20:55:25 -04:00
Storm Dragon c77d4bac3e Finally tracked down and fixed the problems with buffers. 2026-08-11 20:50:58 -04:00
Storm Dragon 0f34831c5b Attempt to fix a bug that can randomly drop audio streams. 2026-08-11 20:15:49 -04:00
Storm Dragon 4c5a54c2dd Fixed wording for notifications so it sounds more natural. 2026-08-11 19:51:25 -04:00
Storm Dragon eae1d8b99a Attempt to improve over all voice code. 2026-08-11 19:47:01 -04:00
Brandon McGinty (deepseek) 90f8a1ca5f Fix recording truncation and rate mismatch causing static
The recording pipeline had two bugs that combined to produce
buzzing/static in recorded audio:

1. NormalizeStereoFrame truncated incoming audio frames to
   frameSize*AudioChannels samples. When the Opus decoder produced
   20ms frames (1920 stereo samples) but the recorder used a 10ms
   frameSize (960 samples), half the audio from every packet was
   silently dropped.

2. The recorder's run() loop dequeued one fixed-length frame per
   source per tick. After truncation, the remaining 10ms of each
   20ms packet was gone, so every other tick produced silence.
   This 50 Hz on/off pattern sounded like static.

Fixes:
- NormalizeStereoFrame no longer truncates; it only converts mono
  to stereo and preserves all audio data
- RecordAudioFrame now accepts an explicit stereo flag from callers
  instead of guessing from sample count (which failed for even-length
  mono data like 480-sample mic frames)
- run() accumulates variable-length frames per source and consumes
  them in fixed-size chunks, preserving any leftover for the next tick
2026-08-10 18:34:52 -04:00
Brandon McGinty (deepseek) cd003d7ac4 Fix jitter buffer: late-packet blockage and frame-step tracking
- popNext() now computes the actual frame step from PCM sample count
  instead of always advancing by 1. Mumble 1.5 frame numbers are 10ms
  timestamps, so 20ms stereo frames advance by 2, eliminating the
  'seq gap' skip that fired on every single packet.

- Drain loop now discards late/duplicate packets (sequence < expected)
  instead of letting them permanently block the buffer. Previously a
  single late packet at jitterBuf[0] would cause popNext to always
  return nil without the gap check catching it (only handled >), so
  all subsequent drains would break immediately.

- Reduced reclaim log verbosity: log every 50th or on state change,
  not every call with processed==0.
2026-08-10 18:11:26 -04:00
Brandon McGinty (deepseek) 3613a42fce Add debug logging for OpenAL playback and jitter buffer pipeline
- Log OpenAL vendor/version/renderer at startup
- Log buffer creation count and user volume on new audio stream
- Enhanced reclaim(): log source state, processed/queued/empty counts,
  and check for OpenAL errors; log every 50th cycle or on unusual state
- Log jitter buffer drain events (first 3 + periodic) with buffer counts
- Log sequence gap skips in jitter buffer
- WARN when processAudioPacket has no empty buffers (audio dropped)
- Check OpenAL errors after Buffer.SetData, QueueBuffer, and Play()
- Log source state transitions when calling Play() on non-playing source
2026-08-10 18:03:43 -04:00
Brandon McGinty fd6b7514bf config ignore 2026-08-10 16:12:14 -04:00
Brandon McGinty (chatgpt) 99f1f4b9ab Keep OpenAL jitter playback continuous 2026-08-10 16:07:47 -04:00
Brandon McGinty (chatgpt) 5b0879ddaa Fix UDP audio frame timestamp handling 2026-08-10 15:18:04 -04:00
Brandon McGinty (chatgpt) 9c487c2586 Add Windows platform integration scaffolding 2026-08-10 12:36:47 -04:00
Brandon McGinty (chatgpt) fab4fd50d2 Test exclusive tone-test output creation 2026-08-10 11:25:52 -04:00
Brandon McGinty (chatgpt) e9ba7f580a Synchronize connection-owned stream access 2026-08-10 11:25:08 -04:00
Brandon McGinty (chatgpt) f0aa5ff35a Update Go dependencies 2026-08-10 11:25:08 -04:00
Brandon McGinty (chatgpt) ef8a92149d Report configuration persistence failures 2026-08-10 11:25:08 -04:00
Brandon McGinty (chatgpt) 655a109ce8 Create tone-test outputs exclusively 2026-08-10 11:25:08 -04:00
Brandon McGinty (chatgpt) 65489fd367 Prevent recording output path replacement 2026-08-10 11:25:08 -04:00
Brandon McGinty (chatgpt) 57961ffc9f Synchronize connection-owned audio resources 2026-08-10 10:28:01 -04:00
Brandon McGinty (chatgpt) b407a20132 Snapshot mutable tree display state 2026-08-10 10:27:12 -04:00
Brandon McGinty (chatgpt) 461f172035 Validate admin targets before actions 2026-08-10 10:26:03 -04:00
Brandon McGinty (chatgpt) cf9e1c6d0a Terminate file playback process groups 2026-08-10 10:25:25 -04:00
Brandon McGinty (chatgpt) 1d6ab79ed0 Cancel reconnect retries during shutdown 2026-08-10 10:24:38 -04:00
Brandon McGinty (chatgpt) e68546eec5 Compare UDP authentication tags in constant time 2026-08-10 09:42:49 -04:00
Brandon McGinty (chatgpt) 9fdcf6171d Reserve recording paths atomically 2026-08-10 08:55:25 -04:00
Brandon McGinty (chatgpt) 43d7addc15 Protect regular files from FIFO setup 2026-08-10 08:50:56 -04:00
Brandon McGinty (chatgpt) dcffa1efa1 Use secure temporary config files 2026-08-10 08:44:58 -04:00
Brandon McGinty (chatgpt) 3ba5e03208 Restore output navigation hotkeys 2026-08-10 08:26:37 -04:00
Brandon McGinty (chatgpt) 95c7394b01 Snapshot context actions under client lock 2026-08-10 07:31:18 -04:00
Brandon McGinty (chatgpt) 7785f0a5b5 Synchronize audio encoder selection 2026-08-10 05:03:45 -04:00
Brandon McGinty (chatgpt) d399650198 Protect crypto initialization checks 2026-08-10 04:28:38 -04:00
Brandon McGinty (chatgpt) fa84373a81 Synchronize legacy UDP crypto setup 2026-08-10 04:06:12 -04:00
Brandon McGinty (chatgpt) 42861dfcd5 Close audio streams when listeners detach 2026-08-10 04:01:42 -04:00
Brandon McGinty (chatgpt) 2eed3c809f Synchronize audio stream teardown 2026-08-10 03:35:35 -04:00
Brandon McGinty (chatgpt) e8e2fc46a9 Reject overflowing manual ban durations 2026-08-10 01:11:58 -04:00
Brandon McGinty (chatgpt) 55772fa459 Synchronize connection and transmission state 2026-08-10 00:45:22 -04:00
Brandon McGinty (chatgpt) 3efbd019ce Synchronize selected user access 2026-08-10 00:42:09 -04:00