start_stream() command.
Configuration Schema
All configuration is provided when callingstart_stream(). There is no persistent configuration file; settings are managed by the frontend application.
Device Configuration
device_name
Name of the audio input device to capture from.Valid values: Any device name returned by
get_input_devices()Platform notes:- On Windows, loopback devices are prefixed with
[Loopback] - On Linux, ALSA virtual devices are automatically filtered out
- Device must support 2-channel (stereo) audio
is_loopback
Whether the selected device is a loopback device for system audio capture.Valid values:
true, falseEffect:- When
true, searches output devices instead of input devices - Uses
BufferSize::Defaultinstead of fixed buffer size - Increases minimum ring buffer to 8000ms (vs 5000ms for standard input)
- Adjusts adaptive buffer range to 4000-12000ms
Network Configuration
ip
Target server IPv4 address.Valid values: Any valid IPv4 address (e.g.,
"192.168.1.100", "10.0.0.5")Examples:- Local network:
"192.168.1.100" - Localhost:
"127.0.0.1"
port
Target server port number.Valid values: 1-65535Common values: 5000-5010 (convention for audio streaming)
auto_reconnect
Enable automatic reconnection on connection loss.Valid values:
true, falseBehavior:- Uses exponential backoff: 2s → 4s → 8s → … → 60s (max)
- Adds ±500ms jitter to prevent thundering herd
- Minimum retry delay: 2 seconds
- Drains stale audio from buffer before reconnecting
dscp_strategy
DSCP/QoS marking strategy for network packets.Valid values:
"voip"- Expedited Forwarding (EF, DSCP 46, TOS 0xB8) - Recommended for audio"lowdelay"- Low Delay (IPTOS_LOWDELAY, TOS 0x10)"throughput"- Throughput (IPTOS_THROUGHPUT, TOS 0x08)"besteffort"- Best Effort (TOS 0x00)
"voip" if invalid value providedPlatform notes:- Requires administrator/root privileges on some systems
- May be ignored by some network equipment
- Most effective on managed networks with QoS policies
Audio Configuration
sample_rate
Audio sample rate in Hz.Valid values: Device-dependent, typically:
- 44100 (CD quality)
- 48000 (professional audio, recommended)
- 96000 (high-resolution)
- 44100 Hz = ~1411 kbps
- 48000 Hz = ~1536 kbps
- 96000 Hz = ~3072 kbps
buffer_size
Hardware audio buffer size in frames.Valid values: Device-dependent, typically 128-2048Common values:
- 128 frames (~2.7ms at 48kHz) - Ultra-low latency
- 480 frames (~10ms at 48kHz) - Balanced
- 1024 frames (~21ms at 48kHz) - Stable for older hardware
- Ignored for loopback devices (uses system default)
- Lower values = lower latency but higher CPU usage
- Too low may cause audio glitches on slower systems
chunk_size
Number of samples (frames) per network transmission packet.Valid values: Typically 240-4800Effect:
- Smaller values = lower latency, more CPU/network overhead
- Larger values = higher latency, more efficient
- 480 samples (~10ms at 48kHz) - Low latency
- 960 samples (~20ms at 48kHz) - Balanced
- 2400 samples (~50ms at 48kHz) - Efficient for high-bandwidth
Buffer Configuration
ring_buffer_duration_ms
Duration of the internal ring buffer in milliseconds.Valid values: Any positive value, but automatically adjusted:
- Standard input: Minimum 5000ms
- Loopback device: Minimum 8000ms
- 5000ms = ~1.8 MB
- 8000ms = ~2.9 MB
- 10000ms = ~3.7 MB
enable_adaptive_buffer
Enable dynamic buffer resizing based on network conditions.Valid values:
true, falseBehavior:- Monitors jitter every 10 seconds
- Increases buffer size if jitter >15ms
- Decreases buffer size if jitter <5ms
- Only resizes if change exceeds 10% of current size
- Emits
buffer-resize-eventon changes
min_buffer_ms
Minimum buffer size for adaptive buffering.Valid values: Any positive value, but automatically adjusted:
- Standard input: Minimum 2000ms
- Loopback device: Minimum 4000ms
enable_adaptive_buffer is truemax_buffer_ms
Maximum buffer size for adaptive buffering.Valid values: Any positive value, but automatically adjusted:
- Standard input: Maximum 6000ms
- Loopback device: Maximum 12000ms
enable_adaptive_buffer is truePerformance Configuration
high_priority
Set network thread to maximum priority.Valid values:
true, falseEffect:- Reduces network thread scheduling latency
- May improve stability under heavy system load
- Requires elevated privileges on some systems
Audio Format
TCP Streamer automatically negotiates audio format with the device:Supported Formats
- F32 (32-bit float) - Preferred, native on PipeWire/Linux
- I16 (16-bit signed integer) - Common, good compatibility
- U16 (16-bit unsigned integer) - Fallback for older devices
Transmission Format
All audio is converted to 16-bit signed little-endian PCM before transmission over the network, regardless of capture format.Channel Configuration
- Required: 2 channels (stereo)
- Mono or multi-channel devices are not supported