ADTF
Playback Service Plugin

Playback Service

Introduction

The Playback Service plays back .adtfdat Files recorded with the ADTFDAT File Recorder.

Plugin Information
Plugin Filenameadtf_playback.adtfplugin
Plugin Descriptionadtf_playback.plugindescription
Plugin NamePlayback Service Plugin
LicenseADTF
Support Mailsupport@digitalwerk.net
Homepage URLsupport.digitalwerk.net
Plugin Versions
Plugin Version3.99.99
Plugin File Version1.0
adtf3.99.99
adtf::ucom3.1.0
Component Information
NamePlayback Service
CIDplayback.service.adtf.cid
DescriptionUse this System Service to extend the ADTF System with playback support for ADTF 3.x .adtfdat, ADTF 2.x .dat files and adtf_file::Reader objects.
TypeService
Default Runlevelsystem
Properties
NameValueTypeDescriptionSubproperties
control_clocktruetBoolIf enabled, all Play()/Pause() calls will also control the current stream clock.
emulate_clockstruetBoolIf enabled, clocks recorded in the files will also be emulated during playback.
extract_attached_files_fromcFilenameListA semi-colon separated list of ADTFDAT files that the attached files should be extracted from during service initialization.
extract_attached_files_from_opened_filesfalsetBoolIf set, attached files will be extracted whenever a set of playback files is opened.
extraction_destination_directory$(ADTF_SESSION_DIR)/attached_filescFilepathThe directory where all attached files should be extracted to.
ignore_invalid_timestampsfalsetBoolCAUTION! When enabled playback will continue even in the case that chunk timestamps within each playback file are NOT monotonically increasing. The Playback Service will ignore these INVALID timestamps and the clock will be frozen at the latest/highest timestamp while already outdated stream elements catch up without any ordering guarantees. The use of this option is greatly discouraged as it CANNOT offer a determenistic and usable playback in any way and only hides errors already present further up your data processing chain!
ignore_open_errorsfalsetBoolif enabled, files that can not be opened are ignored.
ignore_unknown_classesfalsetBoolIf enabled, playback will continue even in case it cannot find the deserializer implementation of one ore more streams.
interpolate_stream_timefalsetBoolWhen enabled the stream time will continue to go forward between two playback items being sent. Otherwise the time will be increased in discrete steps. Mind that this property only has an effect when 'control_clock' is enabled.
load_referenced_filestruetBoolif the property is set, additional files referenced in the current playback file are loaded as well.
loop_mode0tUInt32Whether or not and how playback should be restarted when the end of all streams is reached. This also applies to playlists.Value List:
do not loop = 0
seek to start = 1
change runlevel = 2
maximum_playback_thread_count1tUInt32Specifies the maximum number of threads that should be used for playback. If this is not equal to 1, multi threaded playback will be used. Keep in mind that the order of samples is non-deterministic in this case! Note that you have to set interpolate_stream_time = True and emulate_clocks = False in this setup. A value of 0 means that as many threads as possible will be used for the current set of files.
playback_clock_mode0tInt32Whether or not the playback clock should advertise itself as a system clock. This is relevant for Sync2Ref handling during playback. Auto-detect tries to make a guess based on timestamp size and clock names. Mind that this property only has an effect when 'control_clock' is enabled.Value List:
auto detect = 0
system clock = 1
independent clock = 2
playback_filenamescFilenameListThe list of files (semi-colon) that should be played back. This might be overriden by the Playback Input Source.Filename Extension Filter:
ADTF DAT files (*.dat *.adtfdat),All files (*)
playback_speed1.000000tFloat32The playback speed factor: e.g. 0.5 = half the playback speed, 4 = four times faster.
playlist_filenamecFilenameIf set, each line in the given file will be used to open the specified files, start playback and wait until the end of all streams is reached. Use the 'loop_mode' and 'runlevel_after_end_of_streams' properties to control what happens in between of playlist entries. This property and the 'playback_filenames' property can only be used exclusively.Filename Extension Filter:
ADTF Playlist files (*.adtfplaylist),All files (*)
read_ahead_queue_length1000000tUInt64The time span (us) that the read thread will contineously read form the file in advance.
reader_idcStringUse this property to force the use of a specific reader implementation. If empty, the first capable reader will be used.
reset_simulation_clocktruetBoolIf enabled, the simulation clock will be reset to the beginning of the playback sequence.
runlevel_after_end_of_playlist0tInt32If the property is != -1 then the service will decrease the runlevel to this value after the end of the playlist has been reached. Note that it will never increase the runlevel based on this property.Value List:
none = -1
Filter Graph = 4
Streaming Graph = 3
Session = 2
System = 1
Shutdown = 0
runlevel_after_end_of_streams4tInt32If the property is != -1 then the service will decrease the runlevel to this value after the end of all streams has been reached. Note that it will never increase the runlevel based on this property.Value List:
none = -1
Filter Graph = 4
Streaming Graph = 3
Session = 2
System = 1
Shutdown = 0
try_realtime_playbacktruetBoolThis property is no longer in use, please use change this settting at the clock service directly.
Required Interfaces
IID
reference_clock.riddler.streaming.adtf.iid
kernel.penguin.services.adtf.iid
adtf_file_objects.devil.services.adtf.iid
Provided Interfaces
IID
playback_service.services.adtf.iid
player.ant.services.adtf.iid
player.bat.services.adtf.iid
player.elasto.remote.adtf
player.quiet.services.adtf.iid

Playback Service Concept

The Playback Service will create Time Barriers for all playback items at the current ADTF Stream Clock (see Time Barrier Architecture and Offline Mode (Playback/Re-Simulation)). This ensures that the simulated ADTF Stream Time matches the progress of time during recording. There can be only one ADTFDAT File Player in the current Streaming Graph and Filter Graph.

To create a Streaming Source for a Player instance within your Streaming Graph / Filter Graph to provide the Samples, use the ADTFDAT File Player.

Playback of Multiple Files

The Playback Service supports playback of multiple .adtfdat Files and will always play back the recorded Samples in correct relation and timestamps compared to recording. This is not only mandatory to guarantee that the Offline Mode (Playback/Re-Simulation) is equal to to the Online Mode (Live) during recording, it also required when loading several .adtfdat files at once. These are the possible options for simultaneously playback of multiple .adtfdat files:

  • property playback_filenames: You can specify multiple filenames seperated by semicolon.
  • property load_referenced_files: .adtfdat Files can reference other adtfdat Files.
    • When the Playback Service encounters such a .adtfdat file it will automatically load the referenced files as well.
    • This will happen when there had been several ADTFDAT File Recorder within your Graph

In both cases, ADTF will merge all files together and plays each Sample according to its timestamp.

Note
The split option is a special implementation of referenced file but seperated from one recorder. The behaviour for playback matches the same

Player Control

The delivered service implementation follows the interface definition of adtf::services::ant::IPlayer.

The Playback Service can be control from any instance. It will not react on or result in a runlevel change of the system! See ADTFDAT File Player for controlling.

The control interface is delivered within your installation:

include/plugins/player_intf.h

See adtf::services::ant::IPlayer for interface documentation.