Voice Channels (LiveKit)
Spokes provides a seamless real-time voice and video experience by bundling an embedded instance of LiveKit (https://livekit.com/), a powerful, open-source WebRTC server.
This page explains how the LiveKit integration works under the hood and how to configure and troubleshoot it.
High-Level Architecture
Section titled “High-Level Architecture”When you deploy Spokes, the container automatically spins up an internal LiveKit server to handle all WebRTC media traffic (voice, video, and screen sharing).
- Embedded Service: LiveKit runs inside the exact same Docker container as the main Spokes application. A process manager (Supervisor) handles keeping both the Spokes Server and LiveKit running smoothly.
- Dynamic Configuration: Spokes dynamically configures LiveKit on every boot. It automatically provisions the necessary API keys, port ranges, and configuration files (
livekit.yaml) so that you do not need to manually configure WebRTC settings. - Client Connection: When a user joins a voice channel, the Spokes C# backend generates a secure token and passes it to the user’s browser. The browser then connects directly to the internal LiveKit instance using WebRTC.
Port Configuration
Section titled “Port Configuration”LiveKit requires specific ports to be exposed to allow peer-to-peer WebRTC traffic to flow.
- TCP Fallback Port: Used if UDP traffic is blocked. Configured via
Spokes_Voice_Fallback_Port(Defaults to7881). - UDP Port Range: Used for high-performance media streaming. Configured via
Spokes_Voice_UDP_Start_Port(Defaults to50000) andSpokes_VOICE_UDP_PORT_COUNT(Defaults to500).
Ensure that Docker host firewall allows traffic on these ports.
Troubleshooting & Debugging
Section titled “Troubleshooting & Debugging”If you are experiencing connection drops or voice issues, it can be helpful to view the raw logs from the LiveKit server.
By default, LiveKit’s logs are merged into the main Spokes container logs (viewable via docker logs Spokes_Server), and the logging verbosity is set to info.
Enabling Debug Logs
Section titled “Enabling Debug Logs”If you need deeper insights, you can enable verbose debugging by setting an environment variable in your Docker or Unraid template:
- Add a new environment variable:
Spokes_LiveKit_Log_Level - Set the value to
debug. (Other valid values areinfo,warn, orerror). - Restart the container.
On the next boot, Spokes will inject this setting into the LiveKit configuration, and you will see highly detailed WebRTC connection logs stream directly into your main Docker console.