mmsyncclient command utility

Manage mediastore synchronizations

Synopsis:

mmsyncclient [-e] <mmsync_dev> <command> [<command args>]

Options:

-e
Enable event listen mode. This option causes mmsyncclient to print synchronization events to the standard output. You can redirect the output to a file if you want to save the output.
The following is an example of typical output produced when the -e option is enabled:
Event listen mode, Ctrl + C to exit.
MMSYNC_EVENT_MS_SYNC_STARTED(operation ID 3)
MMSYNC_EVENT_MS_SYNC_FIRST_EXISTING_FID(1, operation ID 3)
MMSYNC_EVENT_MS_1PASSCOMPLETE(operation ID 3)
MMSYNC_EVENT_MS_2PASSCOMPLETE(operation ID 3)
MMSYNC_EVENT_MS_3PASSCOMPLETE(operation ID 3)
MMSYNC_EVENT_MS_SYNCCOMPLETE(operation ID 3)

Arguments:

<mmsync_dev>
The device object to use in synchronizations. You must specify the same device used by the mm-sync service that you started earlier. The default device is /dev/mm-sync, but if you overrode this when starting mm-sync, the device specified here must match.
<command> [<command args>]

The following synchronization commands are supported:

Description:

The mmsyncclient utility allows you to perform synchronizations and monitor their progress through the command line. When you start a synchronization, mmsyncclient displays an operation ID that you can use to pause, resume, or cancel the operation or to check its progress. You can also control how much activity and debugging information is logged, which is useful for troubleshooting.

Commands:

sync_start

Start synchronizing media content from the specified path on the mediastore that is accessible at the specified mountpoint. The media content is uploaded to the database identified by the device path.

mmsyncclient [-e] <mmsync_dev> 
  sync_start <db> <mountpoint> <syncpath> <options> [<extended_options>]
This command accepts the following parameters:
<db>
The device path of the database where the content is to be synchronized.
<mountpoint>
The mountpoint of the mediastore to synchronize.
<syncpath>
The relative path of the file or folder tree to synchronize.
<options>
The synchronization options (MMSYNC_OPTION_*), specified as a hexadecimal string. You may set one or more options to control which synchronization passes get done, whether subfolders are synchronized, and when folder information is updated to reflect the current mediastore content.
Suppose you want to perform recursive synchronization for all three passes (files, metadata, playlist). You would then enable the MMSYNC_OPTION_RECURSIVE and MMSYNC_OPTION_PASS_ALL flags by setting options to 0x4007.
<extended_options>
(Optional) A set of key-value pairs specifying extra options, formatted as follows: key1=value1,key2=value2,key3=value3,...
Key Value Description
use_synchronizer A supported synchronizer, as a string in quotes; for example, "dvdaudio" Use the requested synchronizer unless it doesn't support the current operation.
force_synchronizer A supported synchronizer, as a string in quotes; for example, "dvdvideo" Force the use of the requested synchronizer, whether or not it supports the current operation.
dynamic_folder enable or disable

Whether to enable or disable the dynamic setting for the folder listed in syncpath. By default, this setting is disabled.

While this setting is enabled, the file IDs (fids) and playlist IDs (plids) for items in this folder remain constant. The setting is nonrecursive, so only the files in the top-level folder in syncpath are affected; files in subfolders aren't.

For details on how this setting impacts synchronization, see Maintaining constant IDs for updated files and playlists.

metadata_keys

The metadata fields to be read, as name-value pairs separated by semi-colons:

md_title_name=Diablo;
md_title_genre=Horror;
md_title_album=DemonSeed;
md_title_artist=Mr_X

Retrieve only the listed metadata fields. This setting affects only directed synchronizations in which dynamic_folder is enabled.

When you define metadata_keys, the libmd library is not used for metadata extraction; instead, mm-sync sets the metadata fields to the values listed in this option. You must provide values for each field that you list.

medialib_uid

The UID of the Media Library to synchronize. This setting applies only if you're using the mss-ipodiap2.so synchronizer to upload metadata from Apple devices that use iAP2.

The value is a long alphanumeric string with individual sections followed by a version number:

38D4C73C-AACA-4015-B5E8-
5EC83AC9B521-4954524C-
9.2.1

To learn the UID of a Media Library, you can call a certain function in the iPod Accessory Protocol version 2 (iAP2) API and read the UID from a data structure written by this function. The iAP2 interface is fully explained in the Working with Apple Devices reference available through the Apple documentation package in QNX Software Center.

You can also read the UID from the PPS object located at /pps/services/multimedia/iap2/medialibrary, which contains the same information provided by the iAP2 API.

If you don't specify the medialib_uid option, mm-sync synchronizes the metadata from the first Media Library, which contains all of the device's media content.

sync_file_types One or more media types. Individual values must be separated by semi-colons (;). Values can be any of: audio, video, photo, or device

The media types to be synchronized. Any file that's in the synchronization path and whose type matches one of the listed types will have its metadata synchronized.

For example, suppose you synchronize a mediastore folder containing .mp4 files, some of which are audio and some of which are video. If you set sync_file_types to audio, only the audio files (i.e., those that don't have a video component) have their metadata synchronized.

sync_suspend

Suspend a synchronization.

mmsyncclient [-e] <mmsync_dev> sync_suspend <op_id> [flags]
This command accepts the following parameters:
<op_id>
The operation ID of the synchronization to suspend
flags
(Optional) Use MM_SYNC_SUSPEND_FLAGS_WAIT to block until the synchronization thread has been suspended; otherwise, set to 0

sync_resume

Resume a suspended synchronization.

mmsyncclient [-e] <mmsync_dev> sync_resume <op_id> [flags]
This command accepts the following parameters:
<op_id>
The operation ID of the suspended synchronization to resume
flags
(Optional) Must be 0; reserved for future use

sync_cancel

Cancel a synchronization.

mmsyncclient [-e] <mmsync_dev> sync_cancel <op_id> [flags]
This command accepts the following parameters:
<op_id>
The operation ID of the synchronization to cancel
flags
(Optional) Must be 0; reserved for future use

sync_status_get_byid

Get the status of a synchronization, based on the operation ID.

mmsyncclient [-e] <mmsync_dev> sync_status_get_byid <op_id> [flags]
This command accepts the following parameters:
<op_id>
The operation ID of the synchronization whose status is to be returned
flags
(Optional) Must be 0; reserved for future use

sync_status_get_bydbname

Get the status of a synchronization, based on the database name.

mmsyncclient [-e] <mmsync_dev> 
                   sync_status_get_bydbname <db_name> [flags]
This command accepts the following parameters:
<db_name>
The name of the database whose status information is to be returned
flags
(Optional) Must be 0; reserved for future use

sync_status_get

Get the statuses of all current synchronizations.

mmsyncclient [-e] <mmsync_dev> sync_status_get

This command has no parameters.

sync_status_get_dbname

Get the name of the database being used in a specific synchronization.

mmsyncclient [-e] <mmsync_dev> sync_status_get_dbname <op_id> [flags]
This command accepts the following parameters:
<op_id>
The operation ID of the synchronization whose database's name is to be returned
flags
(Optional) Must be 0; reserved for future use

sync_debug_set

Set the logging verbosity and debugging levels.

mmsyncclient [-e] <mmsync_dev> sync_debug_set <verbose> <debug>
This command accepts the following parameters:
<verbose>
The new verbosity setting to use
<debug>
The new debug setting to use

sync_control

Send commands to a synchronization in progress.

mmsyncclient [-e] <mmsync_dev> 
                   sync_control <op_id> <extended_options> [flags]
This command accepts the following parameters:
<op_id>
The operation ID of the synchronization being controlled
<extended_options>
(Optional) A set of key-value pairs specifying extra options, formatted as follows: key1=value1,key2=value2,key3=value3,...
Key Value Description
action Currently, only one action is supported: priority_folder_set The action to perform on the synchronization.
folderid An integer storing a mediastore folder ID. The folder to perform the action on. Either this field or folder_path must be defined for actions that affect a certain folder, such as priority_folder_set.
folder_path A string storing a mediastore folder path. The path is relative to the mediastore's filesystem, so / means the root folder. The folder to perform the action on. Either this field or folderid must be defined for actions that affect a certain folder, such as priority_folder_set.
dynamic_folder enable or disable

Enable or disable the dynamic setting for the folder referred to by folderid or folder_path. By default, this setting is disabled.

When this setting is enabled, the file IDs (fids) and playlist IDs (plids) for items in this folder remain constant. The setting is nonrecursive, so the only files affected are those in the top-level folder in the synchronization path for the operation <op_id>; files in subfolders aren't affected.

For details on the impact of this setting, see Maintaining constant IDs for updated files and playlists.

Action Description
priority_folder_set Initiates a priority folder synchronization. Requires one of folderid and folder_path to be defined. You can also define dynamic_folder (see its description, above).
flags
(Optional) Must be 0; reserved for future use

Returns:

With the sync_start command, when the synchronization starts successfully, mmsyncclient returns a text string with the operation ID. This ID allows you to monitor and control the synchronization in follow-up commands. When the synchronization does not start successfully, a text string with a failure message and a return code of -1 are returned.

All other commands return, at a minimum, a text string with the return code and error number (errno). A return code of 0 means the operation completed successfully and is accompanied by an error number of 0. A nonzero return code (typically, -1) means an error occurred; see errno for which error it was and slog2info for its details.

The synchronization status retrieval commands return information about one or many synchronizations, when those commands complete successfully. For sync_status_get_byid and sync_status_get_bydbname, mmsyncclient returns a text string with these fields:
  • op_id, the operation ID of the synchronization
  • Completed, flags indicating which synchronization passes have been completed
  • Current, flag indicating which synchronization pass, if any, is in progress
  • Pending, flags indicating which synchronization passes have not yet been started

When either of these two commands fails, mmsyncclient returns a text string with the operation ID or database name for the synchronization that has an unknown status, along with an error string and number. If you provide an unknown operation ID or database name, both the return code and error number are 0 (because no error actually occurred).

The sync_status_get command produces similar output except that on success, the statuses of not just one but all active synchronizations are displayed, and the return code is the number of synchronizations. On failure, the return code is nonzero and the error number is set to the errno value.

With sync_status_get_dbname, if the operation ID refers to an active synchronization, a text string naming the database being used is returned. If there's no active synchronization with that ID, the return code is 0. If the command fails, the return code is nonzero and errno is set.