mirror of https://github.com/jetkvm/kvm.git
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).
This commit is contained in:
parent
3897a61729
commit
41604626cf
3
audio.go
3
audio.go
|
|
@ -71,7 +71,6 @@ func getAudioConfig() audio.AudioConfig {
|
||||||
cfg.Complexity = uint8(complexity)
|
cfg.Complexity = uint8(complexity)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Apply boolean flags directly
|
|
||||||
cfg.DTXEnabled = config.AudioDTXEnabled
|
cfg.DTXEnabled = config.AudioDTXEnabled
|
||||||
cfg.FECEnabled = config.AudioFECEnabled
|
cfg.FECEnabled = config.AudioFECEnabled
|
||||||
|
|
||||||
|
|
@ -232,7 +231,6 @@ func setAudioTrack(audioTrack *webrtc.TrackLocalStaticSample) {
|
||||||
audioMutex.Lock()
|
audioMutex.Lock()
|
||||||
defer audioMutex.Unlock()
|
defer audioMutex.Unlock()
|
||||||
|
|
||||||
// Stop output without mutex (already holding audioMutex)
|
|
||||||
outRelay := outputRelay.Swap(nil)
|
outRelay := outputRelay.Swap(nil)
|
||||||
outSource := outputSource.Swap(nil)
|
outSource := outputSource.Swap(nil)
|
||||||
if outRelay != nil {
|
if outRelay != nil {
|
||||||
|
|
@ -244,7 +242,6 @@ func setAudioTrack(audioTrack *webrtc.TrackLocalStaticSample) {
|
||||||
|
|
||||||
currentAudioTrack = audioTrack
|
currentAudioTrack = audioTrack
|
||||||
|
|
||||||
// Start audio without taking mutex again (already holding audioMutex)
|
|
||||||
if audioInitialized && activeConnections.Load() > 0 && audioOutputEnabled.Load() && currentAudioTrack != nil {
|
if audioInitialized && activeConnections.Load() > 0 && audioOutputEnabled.Load() && currentAudioTrack != nil {
|
||||||
if err := startOutputAudioUnderMutex(getAlsaDevice(config.AudioOutputSource)); err != nil {
|
if err := startOutputAudioUnderMutex(getAlsaDevice(config.AudioOutputSource)); err != nil {
|
||||||
audioLogger.Error().Err(err).Msg("Failed to start output audio after track change")
|
audioLogger.Error().Err(err).Msg("Failed to start output audio after track change")
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <stdatomic.h>
|
#include <stdatomic.h>
|
||||||
|
|
||||||
// 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 <arm_neon.h>
|
#include <arm_neon.h>
|
||||||
|
|
||||||
// RV1106 (Cortex-A7) has 64-byte cache lines
|
// RV1106 (Cortex-A7) has 64-byte cache lines
|
||||||
|
|
@ -47,7 +47,7 @@ static OpusDecoder *decoder = NULL;
|
||||||
|
|
||||||
// Audio format (S16_LE @ 48kHz)
|
// Audio format (S16_LE @ 48kHz)
|
||||||
static uint32_t sample_rate = 48000;
|
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 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
|
static uint16_t frame_size = 960; // 20ms frames at 48kHz
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue