Configuration file

The mm-player configuration file defines playback settings, such as the audio output device and the progression mode for randomized playback. The file also defines settings for individual Media Player Plugins (MPPs), such as whether they manage their own tracksessions.

The QNX CAR Platform for Infotainment includes a default mm-player configuration file (/etc/mm-player.cfg). You can modify this included file or create your own. To use your own file, you must specify its path in the -c option on the mm-player command line.

The configuration file must be in JSON format. Two top-level JSON objects can be defined: a "player" object, which lists playback settings to assign to players, and a "plugins" object, which lists properties of the various plugins (MPPs). In either object, member fields must consist of key-value pairs, with both elements encoded as strings.

The player object

The player object can contain the following fields:

audio_output
The URL naming the audio output device. For details on the required URL format and its meaning, see "mmr_output_attach()" in the Multimedia Renderer Developer's Guide.
video_output
The URL naming the video output device. For details on the required URL format and its meaning, see "mmr_output_attach()".
Although mm-player presently doesn't support video playback, this field is required for certain plugins to work. In this release, you can use the URL value given in the default file.
update_interval
The frequency (in milliseconds) of the track position updates sent by MPPs to the mm-player server. The server publishes these position updates in PPS.
The default frequency is 750 ms.
progression_mode
The method mm-player uses to fetch the next track during randomized playback. Can be one of two values: "rosp" (random order sequential progression) or "sorp" (sequential order random progression).
The default setting is "sorp".
lastmode_audio
This nested object configures the "last mode" audio restoration feature, in which the media player tries to resume playback following a system reboot that interrupted the previous playback. The lastmode_audio object contains these fields:
timeout
A time limit (in seconds) on how long the audio restoration feature should attempt to resume playback.
The default limit is 5 seconds.
max_try
The maximum number of tracks that the media player should look for when trying to resume playback. This setting supports the case where the previous track is unavailable because, for example, the user removed the media storing this track during the reboot. The media player first tries to resume playing the previous track (i.e., the one playing when the system rebooted) and then tries to play a fixed number of other tracks, based on the max_try setting.
The default setting is 5.
device_type
The hardware type of the media accessed by this player. Can be one of HDD, USB, or IPOD.
The default setting is HDD.
recursion_depth
The number of directory levels to search to find tracks when building a tracksession from a "base" media node. When this value is set to -1, there's no depth limit on the directories searched. Otherwise, this value must be greater than 0. When it's set to 1, only the immediate directory of the base media node is searched.
The default depth is 4.

To play media on POSIX devices, Bluetooth devices, or iPods, you must include the audio_output, video_output, and update_interval fields. The progression_mode field is optional.

The plugins object

The plugins object contains other objects that configure specific MPPs. Each of these objects must have the same name as the library file that implements the corresponding plugin. For example, the object for the POSIX plugin must be named "mpp-default.so". The plugin objects can contain the following fields:

mode
The playback mode, which determines which layer manages the tracksessions. Can be one of two values: "player" (to indicate that mm-player manages the tracksessions) or "device" (to indicate that the plugin manages its own tracksessions). The default setting for all plugins is "player".
view_name
Name of the view used for accessing metadata on devices supported by this plugin. The view affects how media information can be presented in the HMI. For example, the view may determine which extended metadata fields can be read from the device. The default configuration file uses the synced and live views, but you can define others to suit your HMI's needs.
audio_ext
A JSON-formatted string listing all the audio file extensions that the plugin recognizes. The plugin can browse and play only those audio files with extensions contained in this list.
You must escape the double quotes enclosing the individual list values with a backslash (\).
video_ext
A JSON-formatted string listing all the video file extensions that the plugin recognizes. The plugin can browse and play only those video files with extensions contained in this list.
You must escape the double quotes enclosing the individual list values with a backslash (\).
cfgfilename
Applies only to the synceddb plugin
The name of the configuration file. This field is mandatory for the "mpp-synced_default.so" object.

Default configuration file

The contents of the default configuration file look like this:

{
    "player":{
        "audio_output":"audio:default",
        "video_output":"screen:?dstx=320&dsty=85&zorder=100&dstw=460&dsth=259",
        "update_interval":"750",
        "progression_mode":"sorp",
        "lastmode_audio":{
            "timeout":"5",
            "max_try":"5",
            "device_type":["HDD","USB"]
        },
        "recursion_depth":"4"
    },
    "plugins":{
        "mpp-default.so":{
            "mode":"player",
            "view_name":"LIVE",
            "audio_ext":"[\"aac\",\"cda\",\"m4a\",\"m4b\",\"mp3\",\"wav\"]",
            "video_ext":"[\"m4v\",\"mp4\",\"mpeg4\",\"mov\",\"mpg\",\"mpeg\",\"3gp\",\"3g2\"]"
        },
        "mpp-synced_default.so":{
            "mode":"player",
            "view_name":"SYNCED",
            "cfgfilename":"anything"
        }
    }
}