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