O2  1.2
Inter-process communication system for media applications
O2 Documentation


This documentation is divided into modules. Each module describes a different area of functionality: Basics, Return Codes, Low-Level Message Send, and Low-Level Message Parsing.


O2 is a communication protocol for interactive music and media applications. O2 is inspired by Open Sound Control (OSC) and uses similar means to form addresses, specify types, and encode messages.

However, in addition to providing message delivery, O2 offers a discovery mechanism where processes automatically discover and connect to other processes. Each process can offer zero or more named "services," which are top-level nodes in a global, tree-structured address space for a distributed O2 application. In O2, services replace the notion of network addresses (e.g. in OSC.

O2 is based on IP (Internet Protocol), but there are some mechanisms that allow an O2 process to serve as a bridge to other networks such as Bluetooth.

O2 addresses begin with the service name. Thus, a complete O2 address would be written simply as "/synth/filter/cutoff," where "synth" is the service name.

Furthermore, O2 implements a clock synchronization protocol. A single process is designated as the "master," and other processes automatically synchronize their local clocks to the master. All O2 messages are timestamped. Messages are delivered immediately, but their designated operations are invoked according to the timestamp. A timestamp of zero (0.0) means deliver the message immediately. Messages with non-zero timestamps are only deliverable after both the sender and receiver have synchronized clocks.

A service is created using the functions:



o2_method_new("address," "types," handler, user_data, coerce, parse),

where o2_method_new is called to install a handler for each node, and each "address" includes the service name as the first node.

Some major components and concepts of O2 are the following: