kpreid / shinysdr

Software-defined radio receiver application built on GNU Radio with a web-based UI and plugins. In development, usable but incomplete. Compatible with RTL-SDR.
https://shinysdr.switchb.org/
GNU General Public License v3.0
1.07k stars 115 forks source link

Investigate WebRTC #11

Open kpreid opened 9 years ago

kpreid commented 9 years ago

Right now, receive audio is delivered to the client as a custom protocol over WebSockets and then copied via JavaScript into Web Audio buffers. This is problematic in a number of ways:

The way to improve this situation that I see is to use WebRTC instead. I assume this would allow the client JS to get out of the way of the audio samples, improve latency, use UDP if possible, compress, etc.

However, most of the documentation I have found for WebRTC describes how to get two browsers to talk to each other, possibly with an off-the-shelf intermediary server. We need to find documentation of the actual VoIP protocol(s) used by WebRTC and figure out whether it would be practical to implement one in Twisted (or use an external process to handle it).

corpr8 commented 9 years ago

This looks interesting - gstreamer > janus > webRTP streaming audio / video to browsers:

http://the.randomengineer.com/2014/05/21/lightweight-live-video-in-a-webpage-with-gstreamer-and-webrtc/comment-page-1/

jbg commented 7 years ago

I've got quite a lot of experience with WebRTC between the browser and some custom Rust server-side code, as well as (separately from the WebRTC work) experience with Python and Twisted. I've got an RTL-SDR stick arriving tomorrow and would be interested in working on this once I've got everything up and running.

kpreid commented 7 years ago

@jbg Great!

Since this would generally involve overhauling the audio bus code, I'll also note that for multi-session support we want there to be multiple audio buses rather than a single one (everyone listening to the same audio). Two ways this could be approached:

After having written all that up, I think I prefer the server-managed version as much simpler and not actually an obstacle to any future development (the hard part will be having multiple buses at all).