YAACC - UPNP Client and Server
Loading...
Searching...
No Matches
de.yaacc.multiroom.engine.ClientEngineConfig Class Reference

The tunable numbers of the engine, with defaults. More...

Collaboration diagram for de.yaacc.multiroom.engine.ClientEngineConfig:
Collaboration graph

Public Member Functions

ClientEngineConfig blockMs (int value)
 Length of a block written to the output (default 20 ms).
 
ClientEngineConfig maxAheadMs (int value)
 How far ahead of the output the engine writes (default 120 ms).
 
ClientEngineConfig prefillMs (int value)
 Silence written before the output reports its first position (default 60 ms).
 
ClientEngineConfig maxChunkMs (int value)
 The longest audio a chunk may hold (default 2 s); a longer one is dropped.
 
ClientEngineConfig chunkAhead (int limitMs, int queuedChunks)
 The most decoded audio that waits for its time (default 3 s).
 
ClientEngineConfig maxFifoMs (int value)
 
ClientEngineConfig releaseLeadMs (int value)
 A chunk is decoded and queued this long before its time (default 250 ms).
 
ClientEngineConfig lateToleranceMs (int value)
 A chunk that starts later than this after its time is dropped (default 20 ms).
 
ClientEngineConfig continuityToleranceMs (int value)
 The jitter of chunk timestamps that is not treated as a gap or overlap (default 10 ms).
 
ClientEngineConfig maxGapFillMs (int value)
 A gap in the timestamps up to this is filled with silence; a longer one starts the timeline anew (default 3 s).
 
ClientEngineConfig maxPadMs (int value)
 The most silence inserted at once to wait for a chunk's time (default 15 s).
 
ClientEngineConfig alignToleranceMicros (int value)
 The first sample is placed within this many microseconds of its time (default 1000).
 
ClientEngineConfig deadBandMicros (int value)
 Drift below this is left alone (default 2000 microseconds).
 
ClientEngineConfig gradualLimitMs (int value)
 Drift up to this is corrected frame by frame, more is a step of silence or a skip (default 50 ms).
 
ClientEngineConfig hardResyncMs (int value)
 Playback this late (the output holds old audio) is flushed (default 300 ms).
 
ClientEngineConfig hardResyncReports (int value)
 The output must be this late in this many consecutive fresh position reports before it is flushed (default 3).
 
ClientEngineConfig smoothCorrections (boolean value)
 A dropped or repeated frame is spread over a short window by interpolation (a local resampling of 32 frames to 31 or 33) instead of cutting one sample; the step in a pure tone is then no larger than the signal's own slope (default off: the engine tests read the marker of every frame; the client service switches it on).
 
ClientEngineConfig flacGapMs (int value)
 A flac chunk whose timestamp is more than this far from where the chunk before it ended (the source paused for seconds, many chunks were lost, the server clock jumped) starts the timeline anew: flac chunks are placed by counting frames, which cannot see a pause.
 
ClientEngineConfig flacTimeGuard (boolean on)
 Switches the FlacTimeGuard (the shift of a flac stream against its timestamps, found from the position of each chunk read from its FLAC frame header) off; for tests of what is left.
 
ClientEngineConfig maxSkipMs (int value)
 The most audio the engine throws away in one go because it thinks the stream is late; beyond it the timeline is dropped and the next chunk is placed by its own timestamp (default 1000 ms).
 
ClientEngineConfig underrunConfirmMs (int value)
 A rise of the platform's underrun counter flushes only when the position confirms it (stalled, or the output holds less than underrunAheadMs(int) ms); the position gets this long to confirm (default 250 ms).
 
ClientEngineConfig underrunAheadMs (int value)
 The output holds less than this many ms ahead: confirms an underrun (default 10 ms).
 
ClientEngineConfig adaptiveWriteAhead (boolean on)
 When the platform counts an underrun that the position does not confirm (the output holds more than it needs to look dry, but less than its mixer needs) the write-ahead is raised by step ms, at most once per
cooldown
ms, up to max ms; it is never lowered during a session (defaults 40, 3000, 350; on by default).
 
ClientEngineConfig writeAheadSteps (int stepMs, int cooldownMs, int maxMs)
 
ClientEngineConfig positionOutlierMs (int value)
 A position report that is off the extrapolation of the previous one by more than this is held back until the next report confirms it (default 150 ms).
 
ClientEngineConfig primeAfterMs (int value)
 When the output has not given a position this long after the first write, the engine keeps queueing silence until the output is full: an output that waits for a full buffer before it plays would never start otherwise (default 200).
 
ClientEngineConfig correctionIntervalFrames (int value)
 At most one frame is dropped or repeated per this many frames (default 400, 0.25 percent).
 
ClientEngineConfig minFlushIntervalMs (int value)
 The output is flushed at most this often because of lateness or an underrun (default 500 ms).
 
ClientEngineConfig maxDecoderRestartsPerMinute (int value)
 A different codec header restarts the decoder; more restarts than this per minute end the session (default 12).
 
ClientEngineConfig maxConsecutiveDecodeFailures (int value)
 Chunks in a row that may fail to decode before the session ends (default 8).
 
ClientEngineConfig maxDecoderFailuresPerMinute (int value)
 Chunks that fail to decode or are too large for the decoder may happen this often in 60 seconds before the session ends (default 12, the figure of the header restarts); a platform decoder is made anew after each one.
 
ClientEngineConfig positionTimeoutMs (int value)
 The output must report a position within this time after it started (default 5 s).
 
ClientEngineConfig tickMs (int value)
 How long the engine thread waits between cycles (default 10 ms).
 
ClientEngineConfig rebaseFrames (long value)
 The timeline is shifted in place (whole seconds, exactly) when this many frames have run from its anchor, so the frame counts stay small whatever the length of the session (default 2^34, days of playback).
 
int getTickMs ()
 

Public Attributes

int maxAheadMs = 120
 
boolean smoothCorrections
 
boolean flacTimeGuard = true
 

Detailed Description

The tunable numbers of the engine, with defaults.

Setters validate and return this. Times in milliseconds unless the name says otherwise.

Member Function Documentation

◆ chunkAhead()

ClientEngineConfig de.yaacc.multiroom.engine.ClientEngineConfig.chunkAhead ( int limitMs,
int queuedChunks )

The most decoded audio that waits for its time (default 3 s).

How far after the clock a chunk may be stamped before it is dropped (default 5 s, a Snapcast server stamps near the time of the recording), and how many chunks may wait (default 512). A Sendspin server sends as far ahead as the buffer announced by the player.

◆ flacGapMs()

ClientEngineConfig de.yaacc.multiroom.engine.ClientEngineConfig.flacGapMs ( int value)

A flac chunk whose timestamp is more than this far from where the chunk before it ended (the source paused for seconds, many chunks were lost, the server clock jumped) starts the timeline anew: flac chunks are placed by counting frames, which cannot see a pause.

Shorter pauses are found by FlacTimeGuard (the skew of the timestamps against the frame count) and filled with silence like the gap of a pcm stream (default 3000 ms, the gap a pcm stream fills).

◆ flacTimeGuard()

ClientEngineConfig de.yaacc.multiroom.engine.ClientEngineConfig.flacTimeGuard ( boolean on)

Switches the FlacTimeGuard (the shift of a flac stream against its timestamps, found from the position of each chunk read from its FLAC frame header) off; for tests of what is left.

The guard acts only on positions read from frame headers: when they can not be read the guard does nothing (it never works from a count of decoded frames), whatever this says; without the guard a jump of the timestamps of 300 ms or more places the stream anew.


The documentation for this class was generated from the following file: