Dive Architecture

Dive 3 Reference Manual
Web site: <http://www.sics.se/dive/manual/architecture.html>

Emmanuel Frécon - <emmanuel@sics.se>
Olof Hagsand - <olof@sics.se>
The Swedish Institute of Computer Science, Stockholm, September, 1996

1. Introduction

This document describes the internal Dive 3 software architecture: basic structure of code, libraries, etc. It is primarily intended for advanced use.

The basic modules of Dive (with their libraries) are the following:

In the following, we will describe the Dive libraries corresponding to the basic modules above.

The Dive platform is basically implemented in C. Dynamic behaviour and user interface is implemented in Tcl/Tk. The core Dive source therefore consists of C (.c and .h) files, tcl files (.tcl) and yacc/lex files (.y and .l).

The source is compiled into libraries (.a files). An "application" C file therefore needs to be compiled and linked with the Dive libraries and (possibly) external libraries to create an executable application. The application C file needs to access the Dive functionalities via the Dive C interface [1].

An alternative interface consists of the Dive/Tcl interface where an application can be constructed solely by Dive/Tcl commands [2, 3].

2. Applications and Diva

A Dive application is a binary constructed by compiling a C/C++ file and linking some Dive libraries. A "minimal" Dive application need only link the threads, sid and core dive functionality:

cc -o mini mini.c libdive.a libsid.a libthrutil.a -lm

The standard Dive interface is named "diva" and links a graphics library, audio, video and the dive aux module - essentially incorporating the complete functionality of the Dive system. Some additional libraries such as the compresstion library or the GSM encoding library are not listed here:

        cc -o diva diva.o libdivegl.a libdiveaudio.a libdiveaux.a \
              libdive.a libsid.a libthrutil.a libdivevideo.a -lgl \
              -ltcl7.6.a -ltk4.2.a  -laudio -lm -lX11 

The diva binary therefore has a 3D graphics interface, 3D audio and Dive/Tcl. Diva introduces an actor, a virtual representation of the real user. This actor is called a "person actor" and is associated with an avatar, i.e., the virtual body of the user.

3. Threads module

The threads module is a P-threads based module. It is based on qthreads [4] and offers a subset of the POSIX threads standard. It also contains added functionalities for I/O multiplexing, e.g. binding threads to input, and timers.

Instead of using the qthreads package, it is possible to link a standard P-threads library and only link in the added Dive functionality.

A selected subset of the extended functionalities are the following: http://www.sics.se/dive/manual/cref.i.html#iomgr_forkinput http://www.sics.se/dive/manual/cref.i.html#iomgr_init http://www.sics.se/dive/manual/cref.i.html#iomgr_poll http://www.sics.se/dive/manual/cref.i.html#iomgr_waitinput http://www.sics.se/dive/manual/cref.i.html#iomgr_waitoutput http://www.sics.se/dive/manual/cref.i.html#iomgr_waittimeout http://www.sics.se/dive/manual/cref.t.html#threads_barrier_create http://www.sics.se/dive/manual/cref.i.html#iomgr_waitoutput http://www.sics.se/dive/manual/cref.i.html#iomgr_waittimeout http://www.sics.se/dive/manual/cref.t.html#threads_barrier_create http://www.sics.se/dive/manual/cref.t.html#threads_cv_notify http://www.sics.se/dive/manual/cref.t.html#threads_fork http://www.sics.se/dive/manual/cref.t.html#threads_self http://www.sics.se/dive/manual/cref.t.html#threads_wait http://www.sics.se/dive/manual/cref.t.html#threads_yield

4. Communications module - Sid 2

Sid 2 is a communication module offering support for scalable reliable multicast (SRM) and group communication in a wide-area internet environment. The package is based on UDP/IP multicast and pthreads. For more information see [5]. Sid 2 requires the threads package.

5. Dive core

The Dive core library includes basic functionality common to all Dive processes. The functionality is divided into the following parts:

The Dive core is initialized simply by a call to dive_init().

5.1 Support

The support part contains the most basic datastructures and functionalities. The modules are the following:

5.2 Objects

The objects part introduces Dive entities [6] and functions on these, including intersection, initialization, etc.

5.3 Distribution

The distribution part introduces networking of Dive entities, thus making use of the basic communication facilities of Sid. It also provides marshalling (XDR), nameserver interface, callbacks and threads.

6. Dive aux

The Dive aux module consists of a number of sub-modules. As the user links the libdiveaux.a library, the modules that the user references will be inserted into the executable. The default apllication (diva) essentially links all the sub-modules.

Some sub-modules are the following:

And many more.

7. Dive graphics

The Dive graphics libraries implement a rendering service (see [7]) for a graphics library. Essentially, the rendering function render() is called every time a new frame is drawn. The function then iterates through the complete entity database and renders the graphical representation of the database.

8. Dive Audio

The Dive audio module implements a 3D audio module for object sounds and conference audio.

References

[1] Dive 3.2 manual, available at http://www.sics.se/dive/manual.

[2] Emmanuel Frécon and Olof Hagsand, "The Dive Client Interface", Dive 3 Reference Document, 1995,
<http://www.sics.se/dce/dive/dci.html>

[3] Emmanuel Frécon and Olof Hagsand, "The Dive/Tcl Behaviour Interface", Reference Document,
<http://www.sics.se/dce/dive/tcl-behaviour.html>

[4] Qthreads University of Washington CS&E Technical report #93-05-06, available via anonymous ftp from `ftp.cs.washington.edu' (128.95.1.4, as of Oct. '94) in `tr/1993/05/UW-CSE-93-05-06.PS.Z'.

[5] Olof Hagsand, SID2 Interface specification, <http://www.sics.se/dive/manual/sid2.html>

[6] Emmanuel Frécon, Olof Hagsand, Olov Ståhl, "Dive entity interface", <http://www.sics.se/dive/manual/entity.html>

[7] Olof Hagsand, "Dive Renderer Interface", <http://www.sics.se/dive/manual/render.html>