Fri Jul 14 19:45:01 EDT 2017


RTSP: signaling
RTP: streaming

To get started with this, focus on playing back an RTP raw audio



What can be used as a source?

(/ (* 48000 2) 1492)  64 p/s

Some useful payloads:
PT=10 : stereo 44100 16-bit

00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 
VER-- P- X- CC--------- M- PT------------------ SequenceNumber---------------------------------
CSRC [0..15]

For just stero audio:
P=0 (no padding)
X=0 (no header extension)
CC=0 (number of CSRC identifiers)
M=0 (marker?)
PT=10 (L16 linear PCM 44100Hz, 2 channels)
SequenceNumber (increment for each packet sent)
Timestamp (increment per data sample)
SSRC (random?, fixed for stream)
CSRC (contributing source, don't include)

So it seems quite straightforward.

max UDP payload 1492
max RTP payload 1480

network fields are big-endian
L16 data is signed, network order, left first.

Next: make a small C program that performs the encoding.
Can socat do this actually?


Maybe a good excuse to try Rust.
No, let's keep it simple.  See pool/src/rtp_L16.c

EDIT: Wireshark can decode it, but I have nothing to play it.
Maybe this needs some RTSP to set up a stream?

This works:
$ cat /dev/urandom | pv -L 176400 | ./rtp_L16.elf 12345
$ cvlc -v rtp://@:12345

And fairly well.  Doesn't accumulate delay.
Delay is large though (about a second) but that might be due to throttling.

Bottom line: low delay, use dedicated analog or digital wire.  Don't
use Ethernet.

EDIT: seems to work fine on wifi as well with a similar 1-second delay.