Subject: [MMUSIC] RTSP state machine

From: Magnus Westerlund <[email-masked]>
Date: Wed, 20 Feb 2002 16:24:11 +0100

Hi all RTSP interested people,

Here comes an updated RTSP state machine which tries to clarify the
different transactions possible and their differences in functionality.
It is based on the current proposal for handling aggregated and
non-aggregated control. PAUSE and PLAY can't be used on individual
media. If that is allowed there will be a number of extra versions of
transitions with requirements on the different media state.

It reflects my understanding of the currently proposed functionality and
I hope that intressted people take the time to at least read through it.
Please comment if you have questions or found errors or omitted things.
The goal is that this state machine will help give a common view and
understanding.

This state machine does not contain RECORD which needs to be added.

State transitions not present are not allowed. Some RTSP methods like
options, and  SET_PARAMETER does not effect these states.

States          Explanation
-----------------------------------------------------------------------
Init            Initial state no session exist
Ready-na        Non aggregated session in Ready state
Playing-na      Non aggregated session in Playing state
Paused-na       Non aggregated session in Paused state
Ready-a         Aggregated session in Ready state
Playing-a       Aggregated session in Playing
Paused-a        Aggregated session in Pause

The reason for separating aggregated and non aggregated states are the
following:
- Play and Pause may only be done on aggregate URL and not media URLs
  in aggregated control. In non-aggregated the two are the same.

State variables
---------------
Nr-media    The number of media which are currently ready.

State: Init
Action          Prerequisite    New State       Response
-----------------------------------------------------------------------
SETUP                           Ready-na        Nr-media = 1

State: Ready-na
Action          Prerequisite    New State       Response
-----------------------------------------------------------------------
SETUP           New URL         Ready-a         Nr-media = 2
SETUP           Present URL     Ready-na        Change transport param.
TEARDOWN                        Init            Ok
PLAY            No range        Playing-na      from beginning of media
PLAY            Range           Playing-na      according to range
Timeout                         Init

State: Playing-na
Action          Prerequisite    New State       Response
-----------------------------------------------------------------------
PLAY                            Playing-na      Queue play
PAUSE           No range        Paused-na       Set pause-point
PAUSE           Range > now     Playing-na      Set pause-point
Pause point reached             Paused-na
End of media                    Ready-na
Timeout                         Init
SETUP          New URL,Allowed? Playing-a       Nr-media +=1
SETUP     Present URL, Allowed? Playing-na      Change transport param.
TEARDOWN        Allowed?        Init

State: Paused-na
Action          Prerequisite    New State       Response
-----------------------------------------------------------------------
PLAY            No range        Playing-na      Play from pause point
PLAY            Range           Playing-na      according to range
Timeout                         Init
SETUP           New URL         Paused-a        Nr-media +=1
SETUP           Present URL     Ready-na        Change transport param.
TEARDOWN                        Init

State: Ready-a
Action          Prerequisite    New State       Response
-----------------------------------------------------------------------
SETUP           New URL         Ready-a         Nr-media +=1
SETUP           Present URL     Ready-a         Change transport param.
TEARDOWN        Nr-media >2     Ready-a         Nr-media -=1
TEARDOWN        Nr-media == 2   Ready-na        Nr-media = 1
Timeout                         Init
PLAY            No range,AggURL Playing-a       from beginning of media
PLAY            Range, Agg URL  Playing-a       according to range

State: Playing-a
Action          Prerequisite    New State       Response
-----------------------------------------------------------------------
PLAY                            Playing-a       Queue play
PAUSE           No range        Paused-a        Set pause-point
PAUSE           Range > now     Playing-a       Set pause-point
Pause point reached             Paused-a
End of media    >=1 Media plays Playing-a
End of media    All media ended Ready-a
Timeout                         Init
SETUP          New URL,Allowed? Playing-a       Nr-media +=1
SETUP      Present URL,Allowed? Ready-na        Change transport param.
TEARDOWN        Allowed? Nr-m>2 Playing-a       Nr-media -=1
TEARDOWN        Allowed? Nr-m=2 Playing-na      Nr-media = 1

State: Paused-a
Action          Prerequisite    New State       Response
-----------------------------------------------------------------------
PLAY            No range        Playing-a       Play from pause point
PLAY            Range           Playing-a       according to range
Timeout                         Init
SETUP           New URL         Paused-a        Nr-media +=1
SETUP           Present URL     Ready-na        Change transport param.
TEARDOWN        Nr-media >2     Paused-a        Nr-media -=1
TEARDOWN        Nr-media == 2   Paused-na       Nr-media = 1

Regards

Magnus Westerlund

Multimedia Technologies, Ericsson Research ERA/T/VA
----------------------------------------------------------------------
Ericsson Radio Systems AB  | Phone +46 8 4048287
Torshamsgatan 23           | Fax   +46 8 7575550
S-164 80 Stockholm, Sweden | mailto: [email-masked]

_______________________________________________
mmusic mailing list
[email-masked]
https://www1.ietf.org/mailman/listinfo/mmusic

---

From: Thomas Zeng <[email-masked]>
Date: Thu, 28 Feb 2002 14:49:22 -0800

Dear Magnus:

A couple of comments on your state machine document:

1. For ready state, you have:

State: Ready-na
Teardown        *|media URL     Init            Ok

I think in last telecon we agreed that TEARDOWN with "Presentation URL"
releases the session ID and takes the session 
to INIT state.

BTW, I don't believe TEARDOWN on "media URL", even if  Nr-media = 0 as a
result, should release
the session ID.  Suggest the addition of "Ready-No-Track" state?

2. On TIMEOUT handling:

If the server times out on a client, I would suggest that server send a
TEARDOWN to client (if TEARDOWN is allowed in the S->C direction, which is a
separate  thread of discussion).

3. On end of stream/range notification:

I agree with your proposal. Please also see the feature request I submited
to sourceforge below. Incidentally, Rob L. suggested that TEARDOWN in the
S->C direction be used to serve as notification before END_OF_STREAM  is
added to RTSP.

Best regards,
thomas

---------------cut here ---------------

Feature Requests item #522607, was opened at 2002-02-25 11:49
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=377747&aid=522607&group_id=
23194

Category: None
Group: None
Status: Open
Priority: 5
Submitted By: Thomas M Zeng (zengtm)
Assigned to: Nobody/Anonymous (nobody)
Summary: Need END_OF_STREAM request

Initial Comment:
Currently there is no way for Server to inform Client 
the completion of a presentation (VOD or Live) without 
issuing a TEARDOWN and thus release reources. What if 
the player wants to use the same resources (pertinent 
to its sessionID) to watch another clip? It would be 
wasteful to teardown and then acquire another 
sessionID immediately.

Would like to see a END_OF_STREAM method added on the 
S->C direction. E.g.:

END_OF_STREAM <p_URI> or <track_URL> RTSP/1.0
SESSION: <session_ID>
REASON: <text describing reason of EOS>

-----Original Message-----
From: Magnus Westerlund [mailto:[email-masked]]
Sent: Thursday, February 28, 2002 8:51 AM
Cc: IETF MMUSIC WG
Subject: Re: [MMUSIC] RTSP state machine

Hi Rob, Tom and Jonathan,

I have reconsidered about removing pause state and I can agree that it is
unnecessary. I attach an updated version of the state machine without the
paused
state. Instead I replaced it with setting of the pause point or as I have
called it
in the state machine resume point (RP). I think that is a better name for
it.

I do believe we have the following  issues regarding pause, play and
reaching end
of media or range.

- When a presentation reaches end of media or range. Shall it automatically
return
to ready state?

- When a presentation reaches end of media. What shall the resume point be
set to?

- When reaching end of a range, should the resume point be set to 0 or end
of
range?

- Should we add a end of clip/range notification.

I will start with the last issue. I do believe such a mechanism is need for
more
than this reason to signal the state transition. It will also be good for
the
buffer handling, retransmission, adaptation, and notification to user. So I
do
agree that we should add one

Then I do believe you are suggesting a control model like a old tape player,
I have
always thought of it in terms of CD player control. All my CD players return
to the
beginning of the disc when reaching end. But one thing we really do need to
consider is backwards compatibility. Will an RFC 2326 implemented client be
able to
use a server that would requires a pause before each play after the first? I
would
guess that it would get into trouble. Also how should this work relative to
queued
play? Even if we remove as suggested I belive it will be difficult to
combine this
model with that. Therefore I would like to have automatic return to state
READY.

I think that the resume point should be reset to 0.0 when reaching end of
media.
Actually I don't care that much about this behavior except that it should be
backwards compatible. If it does not return without a explicit play 0- can
this
break any client?

Regarding reaching end of range I have no strong opinion on what to do as
long as
it is resolved. The state machine says to set it to 0.0 for moment which is
harmonized with end of media behavior.

By removing play without range while playing and also queued plays we remove
the
functionality that has potentials for messing up at end of streams.

Regards

Magnus Westerlund