Configuring and Starting mm-renderer

Updated: April 19, 2023

The multimedia renderer is a connection-based service that runs on the target system and allows media applications to control and monitor playback activity through API calls.

Prerequisites

To run mm-renderer, you must prepare a configuration file. This file specifies which plugins the service should load and any settings for plugin parameters that can be overridden through the configuration. Full details about this file, including where it can be stored on the target, are given in the Configuration file for mm-renderer section.

For mm-renderer to work, the Persistent Publish/Subscribe (PPS) service must be running. In the buildfile used to generate the OS image for your target system, you can define a sequence of commands to be run at startup, to explicitly run PPS before mm-renderer. Details on defining this command sequence in your buildfile are given in the Scripts section of Building Embedded Systems. Information about the PPS service is given in the QNX Neutrino PPS Developer's Guide.

If necessary, mm-renderer will create the PPS state directory, which holds the PPS objects it uses, and the control object within that directory. But if these items already exist, the service will use them. This design lets you create these items before starting the mm-renderer service, and set their ownership and permissions based on which applications you want to be able to talk to the service.

Typically, you do this by including the PPS state directory and control object in your OS image. The state directory is either the default of /pps/services/multimedia/renderer or a non-default path, which you must then provide in the -r option when launching mm-renderer. For information on adding directories and files to your OS image and on setting file ownership and permissions, see the OS Image Buildfiles chapter of Building Embedded Systems.

If you explicitly create the control object, you need to create it as a server object, using the ?server suffix; see the PPS Developer's Guide for details.

Starting the service

Most likely, you'll want to launch mm-renderer during bootup (e.g., through a startup script) so that your media applications can begin playing content as soon as your embedded system loads. Occasionally, you may have to manually run mm-renderer; for instance, if the service crashes or if you're debugging an application and you want to make a configuration change take effect without rebooting the system.

Before trying to start mm-renderer manually, always confirm that the service isn't already running by checking the list of active processes with pidin or ps. If you suspect that mm-renderer has stopped responding and want to terminate its process, you can first try the slay mm-renderer command. This makes the service attempt some cleanup before exiting. But if a serious error has made the service lock up, most likely that initial command won't work. In this case, you should use slay -s mm-renderer or kill -9 pid.

The Command line for mm-renderer section explains the syntax and options available for the command line that starts the service. This applies whether you're launching it through a startup script or a QNX Neutrino terminal.

Note:

While this release of mm-renderer still uses PPS, future releases might not. This won't affect the API but will affect the steps in launching the service, including the command-line options.

The new preferred way of reading state information and input details is through the API. In particular, the data field in the mmr_event_t structure (which is returned when you retrieve the latest event) contains a dictionary with the same fields stored in the PPS objects within the /pps/services/multimedia/renderer/context directory. Also, the mmr_plugin_info() function provides the same information about supported MIME types that's found in /pps/services/multimedia/renderer/component/.all.