![]() |
![]() |
![]() |
![]() |
This chapter describes how to use control contexts, zones and output devices in the MME. For more detailed information about how to start the MME and how to connect to it, see the chapter Starting Up and Connecting to the MME in this guide, and the “MME Quickstart Guide” in the Introduction to the MME.
To use the MME, you need to define at least one control context in the controlcontexts table in the MME database. With one control context defined, you can connect to the MME. To play media, you also need to define at minimum one output zone and one output device.
A client application works with the MME in a control context. The MME is a resource manager, and control contexts are the mount points to the MME resource manager. They are responsible for managing requests from the client applications, and for directing other components in the MME and io-media to complete these requests.
The client application connects to an MME control context in order to be able to create, set and play track sessions, synchronize mediastores, copy and rip files, play tracks, and perform other operations with the MME.
Control contexts are defined statically in the MME database table before the MME starts up. They exist regardless of whether or not clients are connected, and regardless of how many clients are connected. Each control context in the MME has its own thread, so the MME is capable of scaling with as many control contexts as required.
Multiple client application connections can be made to a single control context, but a control context will manage only one track session at a time, and will control only one io-media instance at a time. The io-media that is controlled by the control context will output to only one output zone at a time.
The figure below shows:
Note that there is also a one-to-one relationship between control contexts and output zones.
Client, control context, MME process, io-media, output zone and output device relationships.
The MME's design allows client applications to be built to use only one connection to the MME, or to use multiple connections, with, for example, one connection, “frontseat”, to perform all operations, and another connection,“backseats”, functioning as a passive output connection that outputs media controlled and played by “frontseat”.
The figure on the next page illustrates an implementation of MME with two control contexts in an automobile.
Other possible implementations might be in a home entertainment system where multiple clients connect to a single control context from different interfaces in the house, or an implementation for an aircraft entertainment system that would run the MME in a central location and a control context with an instance of io-media at every seat to offer passengers play-on-demand music and video.
Illustration of MME implementation with two control contexts.
The maximum number of control contexts is configured in the MME configuration file mme.conf. For more information, see “Global settings” in the MME Configuration Guide.
Zones are passive output containers through which the MME sends played media to output devices. Zones can be:
For more information, see “Example configurations” and “Runtime control of zones and output devices” below.
The MME sends playback from a control context only to the zones attached to that control context. For example, in an automobile with two zones: “driver” and “passengers”, the zone “passengers” could be attached to a control context playing a video, while the zone “driver” would not be attached. A DVD-video played back in the control context would be available only in the zone “passengers”, but not in the zone “driver”.
An output device is a device to which media content can be output. Three classes of output can be sent to devices:
The MME uses combinations of control contexts, zones and output devices to play media and direct output to the output locations requested by end-users:
Since there is a one-to-one relationship between control contexts and zones, a common approach at start up is to create all the control contexts required, a zone for each control context, and attach at least one output device to each zone.
The examples below show how to set up control contexts, zones and output devices at startup.
The example below shows how to define, in the mme database schema, a single control context and one zone with a single output device.
INSERT INTO zones( zoneid, name ) VALUES ( 1,'Zone1' ); INSERT INTO outputdevices( type, permanent, name, devicepath ) VALUES( 1, 1, 'defaultoutput', '/dev/snd/pcmC0D1p' ); INSERT INTO zoneoutputs( zoneid, outputdeviceid ) SELECT 1, outputdeviceid FROM outputdevices WHERE name='defaultoutput'; INSERT INTO renderers( path ) VALUES( '/dev/io-media' ); INSERT INTO controlcontexts( zoneid, rendid, name ) VALUES( 1, 1, 'default' );
The example below shows how to define in the mme database schema, two control contexts and two output zones with one output device per zone.
INSERT INTO zones( zoneid, name ) VALUES ( 1,'Zone1'); INSERT INTO outputdevices( type, permanent, name, devicepath ) VALUES( 1, 1, 'output1', '/dev/snd/pcmC0D1p' ); INSERT INTO zoneoutputs( zoneid, outputdeviceid ) SELECT 1, outputdeviceid FROM outputdevices WHERE name='output1'; INSERT INTO renderers( path ) VALUES( '/dev/io-media' ); INSERT INTO controlcontexts( zoneid, rendid, name ) VALUES( 1, 1, 'cc1' ); INSERT INTO zones(zoneid, name) VALUES ( 2,'Zone2'); INSERT INTO outputdevices( type, permanent, name, devicepath ) VALUES( 1, 1, 'output2', '/dev/snd/pcmC0D2p'); INSERT INTO zoneoutputs( zoneid, outputdeviceid ) SELECT 2, outputdeviceid FROM outputdevices WHERE name='output2'; INSERT INTO controlcontexts( zoneid, rendid, name ) VALUES( 2, 1, 'cc2' );
After you have defined your output zones, you must create them in your control context and attach your output to them. For instructions, see “Runtime control of zones and output devices” below.
For more information about how to configure the MME, see the MME Configuration Guide.
The MME can get media and send output to a remote node, as required.
The MME uses the MCD (Media Content Detector) utility to detect media content. This utility supports media content detection across a network. To access media on remote devices, you must configure:
For information on how to configure the MCD for multi-node support, see “Configuring multi-node support” in the chapter Configuring Device Support of the MME Configuration Guide. For more detailed information about the MCD, see the MME Utilities Reference.
For more information about configuring the slots table for supported devices, see “Configuring the slots table for supported devices” in the chapter Configuring Device Support of the MME Configuration Guide.
The MME supports output to devices across a network. To output to a device on a remote network node, you need to:
You can use an output device that is accessible over Qnet by specifying the full path to the device in your client application, or by setting the device path in the mme_data.sql. For example, by changing /dev/snd/pcmC0D1p (for a local output device) to /net...full path .../dev/snd/pcmC0D1p for a remote output device:
INSERT INTO outputdevices(type, permanent, name, devicepath) VALUES(1, 1,'defaultoutput', '/net/edosk7780/dev/snd/pcmC0D1p');
This section describes how to manage zones and output devices at runtime.
You must set a zone for the control context where you will play media in order to output the playback to an output device. If a zone is no longer required, you can remove it.
To create and use a zone, use the following functions:
To remove a zone that is no longer required, simply call mme_zone_delete() specifying the ID of the zone you want to remove.
You should also attach output devices to zones, so that the control context will use these devices for playback. To attach a new output device to a zone, use mme_play_attach_output(); to detach an output device from a zone, use mme_play_detach_output().
You may wish to mark some output devices, such as built-in car speakers, as permanent, and others, such as removable headphones, as not permanent. To mark an output device as permanently attached to an output zone, call mme_output_set_permanent() with the permanent argument set to 1 (one). To tell the MME that a device is not permanent, call the same function, with the permanent argument set to 0 (zero).
To get output attributes, such as volume, balance, mute, or GF/video layer, call mme_play_get_output_attr(). To set these attributes, use mme_play_set_output_attr().
![]() |
![]() |
![]() |
![]() |