Voice Channels (LiveKit)
Spokes handles persistent drop-in voice channels, video calls, and screen sharing across the Web/PWA, Desktop, and official native iOS (Apple App Store) and Android (Google Play) apps by bundling an embedded instance of LiveKit (https://livekit.io/), an open-source WebRTC media server.
This page explains how the LiveKit integration works inside the container and how to configure or troubleshoot it.
High-Level Architecture
Section titled “High-Level Architecture”When you deploy Spokes, the container runs an internal LiveKit server alongside the main Spokes server:
- Single Container: LiveKit runs inside the same Docker container as Spokes, managed by Supervisor (
supervisord). You do not need to deploy or maintain a separate voice server or TURN container. - Dynamic Configuration: Spokes automatically generates
/app/livekit.yamlon boot (and whenever you change voice settings in the UI), provisioning internal API keys, port ranges, and logging rules automatically. - Dynamic WAN IP Monitor: For home servers without a static IP, the container runs a lightweight background monitor (
wan_ip_monitor) that checks your public IP every 2 minutes and automatically restarts LiveKit if your ISP changes your home IP address. - Client Connection: When a user joins a voice channel, the Spokes server signs a scoped LiveKit access token and sends it to the client. The client then establishes a direct WebRTC media connection to the embedded LiveKit server.
Same-Room Voice (Physical Rooms)
Section titled “Same-Room Voice (Physical Rooms)”If two or more people sit in the same room (such as side-by-side desks in a gaming room) and join the same voice channel with remote friends, Spokes includes Physical Rooms to remove echo, microphone bleed, and headset delay. Spokes Desktop clients in the same room on the same LAN use encrypted direct LAN audio (under 20 ms) with real-time cross-mic bleed cancellation, and automatically fall back to server-side audio cleanup on Web and Mobile.
See Physical Rooms (Same-Room Voice) for setup steps and audio modes, or read the blog post.
Port Configuration
Section titled “Port Configuration”LiveKit uses two sets of ports for WebRTC media traffic:
- TCP Fallback Port: Used when UDP traffic is blocked by a restrictive network or firewall. Defaults to
7881. - UDP Mux Ports: Used for low-latency audio, video, and screen sharing. Defaults to
30000through30007(8 multiplexed UDP ports). LiveKit multiplexes all concurrent participants across these ports so you do not need to open hundreds of ports or worry about hitting a per-user port ceiling. If you prefer a single UDP port, set both UDP Start Port and UDP End Port to the same port (for example,30000).
You can configure these ports during the Setup Wizard or at any time inside Server Settings -> System Setup -> Server & Network Setup. When you save new port numbers in Server Settings, Spokes rewrites livekit.yaml and hot-reloads LiveKit automatically.
(Upgrading from an older Spokes release that used 30000-30499 or a custom 500-port range? Spokes automatically migrates your server to 8-port UDP Mux starting at your existing UDP Start Port — for example, 30000-30007 — which sits inside your existing Docker and router rules so upgrades work with zero manual changes. You can optionally narrow your Docker and router forwarding rules to match whenever convenient.)
(Note: If you want to pre-seed custom default ports via environment variables before running the Setup Wizard for the first time, you can set Spokes_Voice_Fallback_Port, Spokes_Voice_UDP_Start_Port, and Spokes_VOICE_UDP_PORT_COUNT on your container.)
Troubleshooting & Debugging
Section titled “Troubleshooting & Debugging”If users run into voice connection drops or get stuck on "Connecting...", you can verify the embedded voice server directly from the admin UI or inspect the LiveKit container logs.
Running the Voice Bot Self-Test
Section titled “Running the Voice Bot Self-Test”Spokes includes a built-in server-side diagnostic that joins a hidden temporary room, publishes test audio frames, checks that chime sound assets are loaded, and inspects WebRTC transport statistics to confirm whether the internal Voice Bot is communicating with LiveKit over UDP (or falling back to TCP):
- Sign into Spokes as an admin and open Server Settings (
/settings). - Select System Setup and locate the Server & Network Setup card.
- Click Test Voice Bot beneath the LiveKit port settings.
LiveKit's output is also streamed into the main Spokes container logs (viewable with docker logs spokes_server). By default, the log level is set to info.
Enabling Debug Logs in the UI
Section titled “Enabling Debug Logs in the UI”You can change LiveKit's logging verbosity directly from the Spokes admin interface without restarting your Docker container:
- Sign into Spokes as an admin and open Server Settings (
/settings). - Select Server Logs from the top menu.
- In the Diagnostics card, change the LiveKit Log Level dropdown to Debug (Detailed Events).
Spokes immediately updates livekit.yaml and reloads the LiveKit process. You can also set the Spokes_LiveKit_Log_Level environment variable (error, warn, info, or debug) if you need to configure the default log level before completing the Setup Wizard.
