Tracer Tutorial, Part 1

by Larry Applegate and Ben Weinrach

This tutorial is an introduction to the Tracer interface and its basic functionality. The sample DVD project demonstrated here is that from the article "Simple DVD Spec. Re-Authoring with DVDAfterEdit 3, Part 3" by Ben Weinrach and is available in the download area. Please refer to the Tracer User Manual for more detailed information regarding the relevant topics discussed below.

When you pop a DVD into your player you are usually presented with a Copyright warning, some introductory logos, and then a main menu from which you can choose a few options. When you make choices, you are "navigating" through the DVD, and the DVD is navigating through various commands - just like a computer program. Navigating can be quite simple, or in the case of a trivia or other game, quite complex.

DVD Authoring applications give you various levels of control over the programming of this navigation, from very simple ones with fixed choices, to much more capable applications with complex "behind the scenes" abstraction layers, all the way to the most complex "Spec. Level" programs that provide access to all or most of the complete DVD Specification. None of these applications gives anything approaching the level of debugging control that is taken for granted by software engineers working in C++, Pascal, or even Basic. This can make it difficult for a DVD author to be really sure that his or her DVD will navigate correctly in all players, and to track down what is causing misbehavior.

Tracer is a tool to give you that control, in a visual and interactive environment. This tutorial will explain and demonstrate many of its features.

[inline:104_initial_tracer_window.jpg=Initial Tracer Window]

Above is the Tracer window as it first opens for the current active project, which simulates the player status of when a DVD is first inserted. Since we have just opened the DVD, Tracer displays the First Play PGC and its Pre Commands (see image above). The window is divided into several panes (or sections) containing everything we need to know about the status of the DVD's navigation. Explanations for each pane of the Tracer window follow below.

System Parameters

There are 21 System Parameters, also known as SPRMs, numbered from 0 through 20. In Tracer, most of these can be displayed in two notations: decimal or hexadecimal.

Some SPRMs represent user player settings and preferences, such as what language is "preferred" in menus (SPRM0). Another choice, or player characteristic, is the Region Code (SPRM20). Other SPRMs are the direct result of DVD navigation. Some system parameters can also be edited directly or indirectly by user operations on the remote, like the subtitle stream, for example.

SPRM14 is both a preference and a result. The preference is whether the screen is 16 x 9 or 4 x 3, and if 4 x 3, whether to choose pan and scan if available in 16 x 9 content, or letterbox. The result is how the player has chosen to play the current video, if video is playing, which depends both on the preference and on flags in the video attributes.

Those SPRMs which are preferences are saved in the general preferences file any time they are changed in Tracer. They are not saved in the project preferences.

To change the notation to decimal, click on Hex, found at the top of the SPRM pane. This will cause all of the numeric values to be displayed in hexadecimal, and change Hex to display as Decimal. To change back to hexadecimal notation, click on Decimal at the top of the SPRM pane. In addition, you may click on an individual SPRM description, which will change that particular SPRM to the opposite notation.

The SPRMs may be edited either by typing directly on the SPRM value or by choosing a popup where applicable. This is not "normal" in a DVD player, of course; the author in many cases may not change SPRM values - only create programming that reacts to them. The ability to edit SPRMs gives the author the power to test for all end-user player variables, ensuring that the DVD will function as intended.

General Parameters

There are 16 General Parameters, also known as GPRMs, numbered 0 through 15. GPRMs are registers similar to SPRMs, but are user-definable, controllable, and flexible. Generally, abstraction-layer DVD authoring applications take control of some GPRMs, in order to make programming certain kinds of functionality more easy for the user. In the command areas, in both the main and Tracer windows, they are referred to as simply r0 through r15, to save space and typing (r = register). The GPRMs may also be edited directly in the Tracer pane, and their notation changed between hexadecimal and decimal.

Resume Parameters

The Resume Parameters contain all of the information that the player saves when playback of a title is "interrupted," often by hitting the Title or Root Menu Call keys on the remote (various players use other names for these keys, such as Top Menu and Menu). This information is used to "Resume" play at the interrupted point. At this time the Resume Parameters are not editable.

Status Information

There are two lines of status information just below the Resume Parameters. The first line identifies the current location in the DVD structure, the largest unit of which is a Program Chain (PGC). PGCs are found in the following domains: First Play, Video Manager (VMG), Video Title Set Menu (VTSM), and Video Title Set (VTS). The status information displays the domain, and the relevant PGC, Title (TT), Program (PG), Cell, and Nav Pack numbers.

The second stus line identifies which category of commands are displayed, if any: Pre Commands, Post Commands, Cell Commands, or Button Commands. If there are no commands displayed, the second line will normally say "Waiting for Remote key...." When video is actively playing, this line will not display any information.

Remote

Tracer's remote offers full control over standard DVD player functionality. To simulate a DVD player's onscreen display when activating functions with potential multiple options (subtitle streams, for example), popup menus appear displaying all relevant and available choices. Additionally, some buttons will invoke a dialog box.

Many of these buttons correspond directly to "User Operations" in the DVD Spec. Most user ops can be permitted or disallowed at various times during the playing of the DVD, at the author's discretion. For example, most Hollywood DVD's force the user to watch the Copyright warning before you can start playing the movie. This is accomplished by disabling buttons that would allow the user to skip the warning and go directly to the main menu.

Buttons in Tracer are grayed out if the corresponding user op is disabled at the moment. Buttons are also (independently) italicized if their function is not appropriate or cannot do anything at the moment, even if it might be enabled. For example, if there is only one audio stream available, the remote prevents you from trying to choose another.

Rather than describe the button functions here, examples of their respective uses are given throughout the tutorial.

Trace Buttons

The Trace buttons control the execution of commands in Tracer. In a DVD player, the commands are always executed immediately when encountered; Tracer's Run mode is comparable to normal DVD player operation and playback.

The Step button executes commands one at a time, so the changes resulting from those commands in the Parameter Panes can be viewed step by step (System, General, and Resume). When a value changes, it is drawn in red for one command cycle.

The Stride button executes commands in groups, such as all of the pre commands in a PGC, and stops at each branch (Jump, Link, or Call) to another Cell, Program, PGC, or play of a group of Nav Packs with the same button highlights.

The back button steps backwards to the previously executed command.

The Show button reveals the current PGC in the main window of DVDAfterEdit 3, making the PGC available for further editing immediately.

Trace Slider

The Trace Speed Slider allows you to slow down or speed up the execution of commands as they display in the command pane.
The speed you set is remembered in the general preferences for the next use.

Preview Slider

The Preview Slider controls the video playback speed, from 1/15th to 15 times full speed.

The First Play PGC Pre Commands

Let's return to the sample project. After clearing GPRM0, the First Play jumps to Title 2. If you look in the main window and select Video Manager (VMG) in the left pane, and open up the Title Play Map in the right pane, you will see that there are two titles, one in VTS 1 and one in VTS 2. Each title is also labeled VTS_TT 1. That means it is the first (and only) title in that Video Title Set (VTS).

Strike the 'S' key, click the Step button, or choose Step from the Tracer Menu. You will see the arrow that was pointing at "1: Set r0 = 0" advance to point at the second command, "2: Jump TT 2". Nothing changes in the General Parameters since GPRM0 was previously a value of 0.

Now let's take a side trip to examine the Stop and Play keys in the Remote pane. The Stop key has the common square icon found on many set top remotes, and to its left is the Play key, the familiar hollow triangle icon. They're both near the lower left area of the remote.

Click on the Stop key. Notice that the status area now displays "Player stopped - waiting for user to start play". Now click the Play key; the First Play Pre Commands reappear. This is a simple way to start over in the Tracer window, and is also DVD Specification-compliant.

If video is playing when the Stop key is clicked, it will stop as in the previous example, but clicking the Play key will resume the video from where it was stopped. However, clicking the Stop key twice if video is playing will cause Tracer to navigate to the First Play PGC. This behavior is recommended in an addendum to the DVD Specification and is implemented in most players.

Now Step twice to execute both commands in the First Play PGC. Here is the resulting display:

[inline:104_first_play_pgc.gif=First Play PGC]

Not much has changed, except that now there is a black preview pane, and the status line displays:

"VTS 2, PGC 1 TT 2: PG 1, Cell 1, NavPack 1"

Click the Show Trace button. You will see PGC 1 TT 2 (1 program) highlighted in the left pane of the main window. If you open the triangles (drill down) to the lowest level, you will see each of the items in the status line above. Holding down the option key while clicking on a triangle will open all lower-level items.

Notice that the QuickTime Controller at the bottom of the Preview pane shows the play head at the very end of the black video. Since we used Step to get to this point, Tracer stopped after the last frame of video instead of going directly to the Post Commands. Click Step again; the following Post Command is displayed in the status information:

"Call VMG PGC 1 resume C1"

(continued...)