Overview
Advanced settings provide fine-grained control over TCP Streamer’s internal behavior. These settings are designed for power users, challenging network conditions, and performance optimization.Adaptive Buffer
Automatically adjusts ring buffer size based on real-time network jitter measurements.Enable dynamic buffer sizing based on network conditions
How It Works
The adaptive buffer system continuously monitors network jitter and resizes the ring buffer to prevent dropouts:Configuration
Minimum ring buffer size in milliseconds (floor)
Maximum ring buffer size in milliseconds (ceiling)
Network-Aware Ranges
TCP Streamer automatically adjusts adaptive ranges based on device type:WASAPI Loopback (Windows)
- WiFi jitter (50-100ms)
- Laptop CPU throttling (20-50ms)
- WASAPI timing unpredictability
- Multiple audio subsystem layers
Standard Input / Virtual Cable
- Direct audio capture path
- Lower CPU overhead
- More aggressive buffer management
Sizing Algorithm
Buffer size is determined by measured jitter:Resize Conditions
Buffer only resizes when:- Time interval: At least 10 seconds since last check
- Significant difference: >10% change from current size
- Stable jitter: EWMA-smoothed value (not instant spike)
Example Scenarios
Ethernet Connection (Stable)
WiFi Connection (Variable)
Poor Connection (Unstable)
Adaptive buffer emits a log event and UI notification each time it resizes, showing the reason (jitter value) and new size.
Trade-offs
Advantages:- Automatically responds to network conditions
- Minimizes latency during stable periods
- Prevents dropouts during jitter spikes
- Ideal for variable networks (WiFi, cellular)
- Adds 10s monitoring overhead
- Latency varies over time
- Not suitable for fixed-latency requirements
- Can cause brief audio gap during resize (future versions will fix)
Network Presets (Advanced)
Network presets (see Network Settings) automatically configure adaptive buffer ranges:| Preset | Min Buffer | Max Buffer | Adaptive |
|---|---|---|---|
| Ethernet | 2000ms | 6000ms | Enabled |
| WiFi | 3000ms | 10000ms | Enabled |
| WiFi (Poor) | 5000ms | 15000ms | Enabled |
Custom Configuration
You can manually override preset values:Spin Strategy
Hybrid spin-loop wait strategy for sub-millisecond timing precision.Use spin-loop for precise timing (always enabled in v1.7.0+)
How It Works
Introduced in v1.7.0, the spin strategy uses a two-phase wait:Benefits
- Sub-millisecond precision: Accurate to ~10-100 microseconds
- Consistent timing: Reduces jitter by 50-80%
- Predictable scheduling: Not subject to OS scheduler quantum
Trade-offs
- CPU usage: ~1-2% higher during streaming (minimal impact)
- Power consumption: Slightly higher on battery devices
- Heat generation: Negligible on modern CPUs
Spin strategy is always enabled as of v1.7.0 and cannot be disabled. The precision benefits far outweigh the minimal CPU cost.
Prefill Gate
Buffering mechanism that eliminates startup stutter.Number of samples to buffer before transmission (always 1000ms)
How It Works
Introduced in v1.8.1, the prefill gate prevents “cold start” stuttering:Why It’s Needed
Without prefill:- Audio capture starts
- Network thread immediately starts sending
- Buffer is nearly empty
- First packets are delayed/dropped
- Receiver hears stuttering
- Audio capture starts
- Buffer fills to 1000ms
- Network thread starts with cushion
- Smooth, immediate playback
Configuration
Prefill is always 1000ms (1 second) and cannot be changed:- Too short (< 500ms): Doesn’t eliminate stutter
- Too long (> 2000ms): Adds unnecessary startup delay
- 1000ms: Perfect balance
Buffer Health Monitoring
Real-time tracking of ring buffer usage.Metrics
Buffer Health (0.0 to 1.0):- 1.0: Buffer empty (maximum health)
- 0.8: Buffer 20% full (good)
- 0.5: Buffer 50% full (fair)
- 0.2: Buffer 80% full (critical)
- 0.0: Buffer completely full (overflow imminent)
Monitoring
Buffer health is emitted every 30 seconds via heartbeat:Critical Levels
| Usage | Status | Action |
|---|---|---|
| < 50% | Healthy | No action needed |
| 50-80% | Warning | Monitor for increase |
| > 80% | Critical | Increase buffer size or chunk size |
| 100% | Overflow | Audio is being dropped |
Logging System
Multi-level logging with rate limiting.Log Levels
Logging verbosity level
Log Output
Frontend (UI):- Rate limited to 5 logs per second
- Prevents UI flooding during errors
- Circular buffer (max 100 entries)
- Color-coded by level
- Unlimited rate (all logs written)
- Rust
logcrate integration - Timestamp with millisecond precision
- Useful for debugging and monitoring
Filtering
UI includes log filter dropdown:Common Log Messages
Startup
Connection
Errors
Adaptive Buffer
Performance Monitoring
Real-time statistics and quality metrics.Statistics (Every 2 seconds)
Quality Metrics (Every 4 seconds)
Heartbeat (Every 30 seconds)
All metrics are emitted via Tauri event system and displayed in real-time in the UI statistics bar.
TCP Socket Configuration
Advanced socket options for network optimization.Send Buffer Size
TCP Keepalive
TCP Nodelay (Nagle’s Algorithm)
Write Timeout
Audio Format Detection
Dynamic format negotiation with fallback.Format Priority
- F32 (32-bit float) - Preferred for quality, native on PipeWire/Linux
- I16 (16-bit signed integer) - Standard PCM format
- U16 (16-bit unsigned integer) - Fallback format
Internal Pipeline
All audio is processed as F32 internally:- No clipping during processing
- Consistent internal representation
- High-quality conversion
- Future-proof for DSP features
Conversion Functions
Introduced in v1.8.0, the F32 internal pipeline eliminates clipping and Linux noise issues present in earlier versions.
Troubleshooting
Adaptive Buffer Not Resizing
Symptoms: Buffer size never changes despite jitter Solutions:- Verify adaptive buffer is enabled
- Check jitter values in quality metrics
- Ensure >10% difference threshold is met
- Wait at least 10 seconds between checks
- Review logs for “Adaptive buffer” messages
High CPU Usage with Spin Strategy
Symptoms: >5% CPU usage during streaming Solutions:- Verify you’re running v1.7.0+ (older versions may have issues)
- Check for other system load (spin strategy adds ~1-2%)
- Increase chunk size to reduce packet frequency
- Consider hardware limitations (very old CPUs may struggle)
Buffer Overflow Warnings
Symptoms: “Buffer overflow: Dropped X samples” in logs Solutions:- Increase ring buffer duration
- Increase chunk size (drains buffer faster)
- Check network latency (slow drain)
- Verify high-priority threading is enabled
- Enable adaptive buffer to dynamically adjust
Prefill Never Completes
Symptoms: “Buffering…” message persists indefinitely Solutions:- Check audio device is functioning
- Verify device is not muted
- Try different input device
- Check device permissions (macOS/Linux)
- Look for audio capture errors in logs
Related Settings
- Audio Settings - Configure ring buffer duration
- Network Settings - Network presets configure adaptive ranges
- Automation - Auto-reconnect works with adaptive buffer