Streaming a live-produced radio show to the studio with Linux, JACK over VLC+SSH or Jitsi

We’re at a remote location, we want to stream a live-produced radio show into the studio for further re-broadcasting.
We have two possibilities:
A. let VLC transcode and server, and we’ll reverse-tunnel it to the receiver
B. we funnel the mixed audio through the web-based (video) conferencing app Jitsi

We have

  • a proper soundcard, like a Behringer U-Phoria UMC404HD USB interface
  • some mics
  • a laptop running Linux, with
    • JACK
    • a JACK patchbay, like Catia
    • Ardour (or a mixer)
    • an audio player with JACK output, like Aqualung (I have used other but this is the only one that doesn’t pop on track change)
    • WiFi

When you’re WiFi is strong, we can try…

A. CBR MP3 stream over http via VLC through a SSH tunnel

Additionally to the above, we need

  • a server, let’s say yourvps.com, that we can SSH into, that can open ports and tunnels
    # /etc/ssh/sshd_config
    GatewayPorts yes
  • VLC

Screenshot: ardour, aqualung, catia, vlc, ssh tunnel, iftop

  1. Start JACK. Try to keep the latency as low as possible.
  2. Set up an Ardour session.
    We’re essentially using it as a mixer. Something more dedicated might work better for you. Ardour gives us back up recording, plugin hosting and MIDI control.

    1. Make mono tracks for mics, connect them
    2. One stereo track for the music, connect Aqualung
    3. if we’re streaming strictly mono, reduce stereo separation for the music track in Ardour’s mixer
  3. Don’t forget to hit record 😉
  4. Launch VLC transcoder & stream
    vlc -vvv jack://channels=1:ports=.* --no-jack-input-auto-connect --no-jack-auto-connect --live-caching=3000 --sout '#transcode{vcodec=none,acodec=mp3,ab=128,channels=1,samplerate=44100,scodec=none}:http{mux=mp3,dst=:18080}'
  5. Connect one of Ardour’s master outs to VLC’s in
  6. Start the tunnel
    ssh yourvps.com -v -N -T -R yourvps.com:18081:localhost:18080
  7. Test it, e.g.
    mpv -ao jack yourvps.com:18081
    (notice the buffer latency!)
  8. To receive in the studio, run the command from above, preferably with a bigger buffer.

Notes

  • One time I noticed that iftop showed not the expected 128k+overhead, but >700k. No idea where that came from.
  • I have used a MIDI controller hooked up to Ardour automation as faders, and also the XY controller that comes with Catia et al.
  • Obviously, adjust the transcode parameters. Especially the MP3 muxer might not be ideal.

…when people show up and pollute the WiFi space with their smartphones, we switch to…

B. stream over Jitsi

Additionally to the above, we need

  • a decent browser
  • PulseAudio
  • “Jack support for PulseAudio” (pulseaudio-jack in Arch)
  • pavucontrol

Screenshot: ardour, aqualung, catia, jitsi, pavucontrol, iftop

  1. same
  2. as
  3. above
  4. Connect Ardour’s master outs to PulseAudio JACK Source
  5. Spin up a Jitsi session in your browser.
    Settings › Manage Call Quality › Audio only
  6. Via pavucontrol, set the browser’s input to JACK Source
  7. To test, open the Jitsi link in a different browser/session
  8. To receive in the studio, open the Jitsi link there, disable video.

Notes

  • Obviously, quality won’t be as good, but stability should be better.
  • Instead of Jitsi we can use Google Hangouts or web.skype.com the same way.