Simple Overtone streaming with VLC
For my Sylt project https://github.com/jave/overtone-sylt, I wanted a very simple and robust way to stream the output from a jackd sound server to a client machine on the network.
There are many ways to do this, but a pretty simple way is to use VLC.
An advantage over netjack, which is another method, is that you can do it after-the-fact. You can start jackd and do things locally. Then you can attach a listener, and remove it on the fly. Netjack is much more convoluted.
1sudo dnf install vlc-plugin-jack
2
3vlc \
4jack://channels=2:ports=.* \
5--sout "#transcode{vcodec=none,acodec=mp3,ab=128,channels=2,samplerate=44100}:http{mux=mp3,dst=:9999/test}"
A quick test is to use hyrogen play through this stack.
- start hydrogen
- qjackctl
- and the vlc on server
- and vlc on client
Latency isn't too great with this method though.
Opus, which is a nice new codec, might help. It's listed as supported with:
1vlc --list-verbose
For this test I used RTSP, which is like RTP but with more docorations such as a control layer and other niceties.
1vlc \
2jack://channels=2:ports=.* \
3--sout "#transcode{vcodec=none,acodec=opus,ab=128,channels=2,samplerate=44100}:rtp{port=1234,sdp=rtsp://192.168.200.15:9999/test.sdp"
on the client(s), run:
1vlc rtsp://192.168.200.15:9999/test.sdp
When using sdp=rtsp, it is possible not to give any destination address. VLC will then send the stream to any client that connects to it.
There seems to be a bug in vlc, such that I was able to rdp strem with the "vorb" codec, but not "opus". Latency with vorb are a couple of seconds.
Mplayer, on the other hand, works fine with opus on the client side:
1mplayer rtsp://192.168.200.15:9999/test.sdp
The latency is better but still in the seconds range, not the desired milliseconds-range.
I will work to improve this for Sylt!