How does stream relay work?
Learn how stream relays work in SPCast: source ingestion, edge load balancing, fallback routing, and seamless live stream distribution.
A stream relay (also known as a slave or edge server) receives an existing audio broadcast from an upstream master server or external audio source and redistributes that stream to a large listener audience. With SPCast, you can easily configure stream relays to conserve uplink bandwidth, scale reach, and build robust failover setups.
How Stream Relays Operate
The fundamental purpose of a stream relay is decoupling broadcast encoders from end-user listener distribution:
- Master Source Feed: Your studio encoder or an external broadcast provider (such as laut.fm, a local Icecast server, or a syndicated network feed) transmits a single audio stream.
- Relay Pull Connection: The SPCast instance connects to the configured source URL and continuously ingests the audio bitstream.
- Local Audience Distribution: Listeners connect directly to your SPCast relay server. The upstream master server experiences the resource load of only a single listener connection.
Common Use Cases for Stream Relays
Broadcasters deploy relay architectures in several everyday production scenarios:
1. Studio Bandwidth Offloading
Home studios and small broadcast booths often have limited residential upload speeds and cannot serve hundreds of simultaneous listeners directly. The studio encoder sends a single stream to an internal master, while high-capacity SPCast relay servers in datacenter clusters distribute the stream to thousands of listeners.
2. External Platform Ingestion
If you broadcast on existing platforms (like laut.fm) but wish to provide custom HLS streams, branded HTML5 web players, and dedicated listener statistics on your own station website, you can ingest that external feed into SPCast as a relay source.
3. Geographic Edge Clustering
For global audiences, relay nodes can be positioned across different regions (such as Europe and North America). Listeners automatically connect to their regional relay, reducing latency and avoiding network buffer underruns.
Comparing Pull Relays and Push Relays
Depending on your network topology, two fundamental relay methodologies exist:
- Pull Relay (Standard in SPCast): The relay node actively reaches out to the master server URL to request and pull the audio stream. This requires no administrative access to the source server configuration.
- Push Relay: The source encoder or master server pushes live audio packets directly toward configured relay endpoints.
In SPCast, you can utilize both approaches and combine them seamlessly with automated real-time transcoding pipelines (MP3 and AAC+).
Seamless Integration with AutoDJ
SPCast gives you full control over server behavior when the upstream relay feed disconnects:
- Automatic Fallback to AutoDJ: If the live relay source drops (for instance, due to a local studio Internet outage), the integrated AutoDJ immediately initiates playback from your pre-loaded backup playlists. Your audience experiences no silence or abrupt stream disconnections.
- Seamless Live Restoration: Once the upstream master source comes back online, the server smoothly transitions back to the live relay signal.
- Live Metadata Passthrough: Track titles, artist names, and ID3 metadata provided by the master source are passed through to all connected listeners in real time.
Configuring a Relay in the Web Dashboard
Setting up an audio relay in SPCast requires only a few configuration steps:
- Navigate to the server settings in your SPCast dashboard.
- Select the operating mode: Relay or Master with AutoDJ Fallback.
- Enter the full URL of the source instance (e.g.,
http://master.example.com:8000/live). - Provide optional authentication credentials if the source stream is password-protected.
- Set the reconnect interval (e.g., 5 seconds) to ensure prompt reconnection after temporary network dropouts.
- Save changes. The server will immediately establish the pull connection to the remote stream.