Jamulus protocol study notes
Examine the first 2 bytes of each packet to determine the packet type.
- Begins with
00 00
— control packet - Otherwise, it is an Opus packet.
Flow
- Client streams Opus frames to server.
- Server sends 0x1f (31: MUTE_STATE_CHANGED).
- Client acknowledges.
- Server sends 0x20 (32: CLIENT_ID).
- Client acknowledges.
- Server sends 0x18 (24: CONN_CLIENTS_LIST).
- Client acknowledges.
- Server sends 0x22 (34: REQ_SPLIT_MESS_SUPPORT).
- Client sends 0x23 (35: SPLIT_MESS_SUPPORTED).
- Server acknowledges.
- Client acknowledges.
- Client sends 0x23 (35: SPLIT_MESS_SUPPORTED).
- Server sends 0x03f7 (1015: CLM_CHANNEL_LEVEL_LIST).
- Server sends 0x15 (21: REQ_NETW_TRANSPORT_PROPS).
- Client sends 0x14 (20: NETW_TRANSPORT_PROPS).
a5 00 00 00
— packet size 16502 00
— block size factor 202
— stereo80 bb 00 00
— 48000 Hz02 00
— opus00 00
— no flags00 00 00 00
— no extra parameters
- Client acknowledges.
- Client sends 0x14 (20: NETW_TRANSPORT_PROPS).
- Server sends 0x0b (11: REQ_JITT_BUF_SIZE).
- Client sends 0x0a (10: JITT_BUF_SIZE).
04 00
— jitter buffer size of 4
- Client sends 0x0a (10: JITT_BUF_SIZE).
- Server sends 0x17 (23: REQ_CHANNEL_INFOS).
- Client sends 0x16 (22: CHANNEL_INFOS).
d3 00
— thailand07 00 00 00
— instrument id 701
— skill level 10f 00
— name length 15- (name)
00 00
— city length 0- (city)
- Client acknowledges.
- Client sends 0x16 (22: CHANNEL_INFOS).
- Server sends 0x1d (29: VERSION_AND_OS).
00
OS05 00
version length- (version)
- Client sends 0x14 (20: NETW_TRANSPORT_PROPS).
- With flags
01 00
to indicate support for sequence number.
- With flags
- Client acknowledges.
- At this point server is now streaming audio.
Opus packet
https://datatracker.ietf.org/doc/html/rfc6716#section-3.2
First byte:
& 0x04
If set, it is stereo, otherwise it is mono.