From 41604626cf88b3b7f37df335461655233f3c8a98 Mon Sep 17 00:00:00 2001 From: Alex P Date: Wed, 19 Nov 2025 17:05:54 +0200 Subject: [PATCH] Remove inaccurate and redundant comments Fix comment inaccuracies: - NEON: Change from "required" to "optimizations" (scalar fallback exists) - capture_channels: Remove "always stereo" claim (configurable via API) Remove redundant comments that duplicate code: - "Apply boolean flags directly" (line duplicates what code does) - Mutex comments in setAudioTrack (visible from code structure) Also remove accidentally committed review artifacts (PR_REVIEW.md, jetkvm_default_edid.bin). --- audio.go | 3 --- internal/audio/c/audio.c | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/audio.go b/audio.go index 5a8c0ac2..cf8a6611 100644 --- a/audio.go +++ b/audio.go @@ -71,7 +71,6 @@ func getAudioConfig() audio.AudioConfig { cfg.Complexity = uint8(complexity) } - // Apply boolean flags directly cfg.DTXEnabled = config.AudioDTXEnabled cfg.FECEnabled = config.AudioFECEnabled @@ -232,7 +231,6 @@ func setAudioTrack(audioTrack *webrtc.TrackLocalStaticSample) { audioMutex.Lock() defer audioMutex.Unlock() - // Stop output without mutex (already holding audioMutex) outRelay := outputRelay.Swap(nil) outSource := outputSource.Swap(nil) if outRelay != nil { @@ -244,7 +242,6 @@ func setAudioTrack(audioTrack *webrtc.TrackLocalStaticSample) { currentAudioTrack = audioTrack - // Start audio without taking mutex again (already holding audioMutex) if audioInitialized && activeConnections.Load() > 0 && audioOutputEnabled.Load() && currentAudioTrack != nil { if err := startOutputAudioUnderMutex(getAlsaDevice(config.AudioOutputSource)); err != nil { audioLogger.Error().Err(err).Msg("Failed to start output audio after track change") diff --git a/internal/audio/c/audio.c b/internal/audio/c/audio.c index 85968986..45c621fa 100644 --- a/internal/audio/c/audio.c +++ b/internal/audio/c/audio.c @@ -27,7 +27,7 @@ #include #include -// ARM NEON SIMD support (required - JetKVM hardware provides ARM Cortex-A7 with NEON) +// ARM NEON SIMD optimizations (Cortex-A7 accelerates buffer operations, with scalar fallback) #include // RV1106 (Cortex-A7) has 64-byte cache lines @@ -47,7 +47,7 @@ static OpusDecoder *decoder = NULL; // Audio format (S16_LE @ 48kHz) static uint32_t sample_rate = 48000; -static uint8_t capture_channels = 2; // OUTPUT: Audio source (HDMI or USB) → client (always stereo for current hardware) +static uint8_t capture_channels = 2; // OUTPUT: Audio source (HDMI or USB) → client (stereo by default) static uint8_t playback_channels = 1; // INPUT: Client mono mic → device (always mono for USB audio gadget) static uint16_t frame_size = 960; // 20ms frames at 48kHz