From f9041684333c5cee7992ea98042257cde3bad34d Mon Sep 17 00:00:00 2001 From: Carlos Rafael Giani Date: Fri, 12 Jun 2026 10:47:24 +0200 Subject: [PATCH] module-rtp: Copy sess.ts-direct in RTP sink and add direct ts documentation In the past, it made no difference whether or not an RTP sink's sess.ts-direct property was set to true. This changed in commit 6bf81ebe592989b9b061cf652d639fcec82e9acd . Now, sess.ts-direct must be set to true if an associated RTP source is using direct timestamp mode. That's because when the RTP sink's direct timestamp mode is not enabled, it will set the new internal ts_align offset to a nonzero value, which then corrupts timestamps and causes out of sync playback in the RTP sources. Also, copy the sess.ts-direct property from the global RTP sink props to the stream props to match the behavior of the RTP source module. --- src/modules/module-rtp-sink.c | 5 +++++ src/modules/module-rtp-source.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/src/modules/module-rtp-sink.c b/src/modules/module-rtp-sink.c index 0c1a3d188..2e294d63f 100644 --- a/src/modules/module-rtp-sink.c +++ b/src/modules/module-rtp-sink.c @@ -65,6 +65,10 @@ * - `sess.ts-offset = `: an offset to apply to the timestamp, default -1 = random offset * - `sess.ts-refclk = `: the name of a reference clock * - `sess.media = `: the media type audio|midi|opus, default audio + * - `sess.ts-direct = `: use direct timestamp mode, default false. + * \note RTP sources that use direct timestamp mode expect the + * associated RTP sink to use direct timestamp mode as well. See the + * `sess.ts-direct` documentation in \ref page_module_rtp_source for more. * - `stream.props = {}`: properties to be passed to the stream * - `aes67.driver-group = `: for AES67 streams, can be specified in order to allow * the sink to be driven by a different node than the PTP driver. @@ -590,6 +594,7 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args) copy_props(impl, props, "sess.min-ptime"); copy_props(impl, props, "sess.max-ptime"); copy_props(impl, props, "sess.latency.msec"); + copy_props(impl, props, "sess.ts-direct"); copy_props(impl, props, "sess.ts-refclk"); copy_props(impl, props, "aes67.driver-group"); diff --git a/src/modules/module-rtp-source.c b/src/modules/module-rtp-source.c index 72683ca90..332d126d5 100644 --- a/src/modules/module-rtp-source.c +++ b/src/modules/module-rtp-source.c @@ -149,6 +149,8 @@ * so any output sinks in the graph will already adjust their consumption pace to * match the pace of the graph driver. * AES67 sessions use this mode, for example. + * \note If an RTP source uses this mode, the associated \ref page_module_rtp_sink + * _must_ use this mode as well. * * \since 0.3.60 */