From 42e33cd9f6492cfd247038be2dfe66ef78903dcd Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Mon, 2 Aug 2010 12:05:59 +0200 Subject: More detailed packet payload/UDP port descriptions Add explanations about what port each kind of UDP packet goes, and in which direction they travel (sender => server or server => sender). --- airtunes2.rst | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'airtunes2.rst') diff --git a/airtunes2.rst b/airtunes2.rst index 29779ca..4af1764 100644 --- a/airtunes2.rst +++ b/airtunes2.rst @@ -27,7 +27,8 @@ encryption, 16 bytes each, should be generated. Every stream has a timestamp (uint64; initially set to ``INITIAL_TIMESTAMP``, see Constants_) and sequence number (int16; initially set to 0) attached to it. -Both are updated when sending audio packets. +Both are updated when sending audio packets. Audio data is encapsulated in +RTP packets which are sent sent as UDP packets to the audio port. There are ``TIMESTAMPS_PER_SECOND`` timestamp ticks per second (equivalent to the number of frames per second). @@ -336,6 +337,7 @@ Headers ``Transport: RTP/AVP/UDP;unicast;interleaved=0-1;mode=record;control_por Get ``server_port``, ``control_port`` and ``timing_port`` from ``Transport`` response header. Get ``Session`` response header and use it as server session ID. +(TODO server_port is missing from the Transport: example above) TEARDOWN ~~~~~~~~ @@ -444,6 +446,10 @@ If ``Apple-Response``, ``Server`` or ``Audio-Latency`` in response: Timing ------ +The server will send Timing request UDP packets to the timing port. The +sender will answer to this Timing request with a Timing response UDP packet +sent to the server timing port. + Replying to timing packet ~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -466,7 +472,9 @@ Replying to timing packet Sync ---- -Sync packets are sent once per second or when adding a speaker. +Sync packets are sent once per second or when adding a speaker. They are sent +to the device control port as UDP packets. The next_timestamp field corresponds +to the RTP timestamp of the next audio packet that will be sent. TODO: More details such as timing adjustments. -- cgit v1.2.3-59-g8ed1b