Commit graph

8031 commits

Author SHA1 Message Date
Carlos Rafael Giani
f904168433 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
6bf81ebe59 . 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.
2026-06-14 22:05:30 +02:00
Carlos Rafael Giani
e85e8d8c31 module-rtp: Minor cleanup
* Rename do_disconnect to do_disconnect_core, since the original name
  is ambiguous (it can be interpreted as being about disconnecting
  a network socket).
* impl->session_name is not used at all, so remove it.
2026-06-14 22:05:30 +02:00
Carlos Rafael Giani
222c8753d1 module-rtp: Convert received packet SSRC from network to host byte order 2026-06-14 22:05:30 +02:00
Carlos Rafael Giani
8f8183e266 module-rtp: Move incoming RTP packet checks to rtp_stream_receive_packet()
This fixes code duplication, since the checks are the same regardless
of payload type. hlen is also calculated the same across payload types,
so it is moved as well. The impl->receive_rtp() function pointer then
solely addresses the actual payload processing.
2026-06-14 22:05:30 +02:00
Carlos Rafael Giani
61e78b25ef module-rtp: Clarify audio info variables and modify info for Opus and MIDI
Rename format_info to rtp_format_info to make the purpose of that struct
and the associated variable clearer.

Document what info and stream_info are there for, since their purpose
is not immediately obvious.

Using find_audio_format_info() for Opus and MIDI makes no sense, since
both of these only have one info each, which is always found, so one might
as well just use that single, always-matching RTP format info directly.
This means that the audio_format_info array remains there solely for PCM,
so rename it to rtp_pcm_audio_format_info.
2026-06-14 22:05:30 +02:00
Martin Geier
7f7fc2f77a module-rtp: allow dynamically enable or disable announcements 2026-06-14 22:05:30 +02:00
Martin Geier
f935eb255c module-rtp: make audio buffer size configurable
Add new sess.buffer-size property that can override default 1<<22b buffer
size.
2026-06-14 12:01:34 +02:00
Carlos Rafael Giani
e7563b19b6 module-rtp: Add calculate_seqnum_delta() utility function 2026-06-14 12:01:34 +02:00
Wim Taymans
b5555cc3f6 port-config: add internalFormat to PortConfig
Use the Format for all possible formats on the
EnumPortConfig and the configured external format on PortConfig.

Make a new internalFormat that contains the configured format of the
adapter follower.

Make pw-top use the PortConfig internalFormat in the FORMAT view and fall
back to Format, when not available (for older clients).
2026-06-12 17:50:46 +02:00
Wim Taymans
d780f4f535 Reapply "pw-top: use PortConfig to get the node format"
This reverts commit 91bc0adc07.
2026-06-12 14:36:09 +02:00
Wim Taymans
91bc0adc07 Revert "pw-top: use PortConfig to get the node format"
This reverts commit 5553d30f94.

Accidentally commited, it's a little too soon for this. The PortConfig
Format is not correctly set yet in all cases.
2026-06-12 14:28:14 +02:00
Wim Taymans
5553d30f94 pw-top: use PortConfig to get the node format
A node can have multiple port groups and the PortConfig can hold the
current format for each group, so use that in pw-top.
2026-06-12 13:10:58 +02:00
Wim Taymans
d7f32af545 keys: add follow-suspend passive mode to keys docs
Add the missing follow-suspend values for the passive modes.

Make the string to passive mode conversion a bit more explicit about
true and false.
2026-06-12 11:59:36 +02:00
Martin Geier
fa9eb6320a combine-stream: fix incorrect compensate samples on playback restart
update_delay is called primarily when the stream format or latency changes,
and from playback thread, if stream reports different delay as before.
This function calculates the number of compensate samples for each stream
based on the latencies of other streams (which must be in a streaming state).

During the first playback on a new format, update_delay is called multiple times
due to format or latency changes. The delay is calculated only from streams
that are currently streaming. If some streams are not yet streaming, their
latencies are ignored, and the delay is updated later in the processing
thread. The processing thread also stores the stream delay in a local variable
(accessed only from that thread, thus requiring no locking).

On a subsequent playback using the same format, update_delay is still called a
few times, and the delay is updated based on the currently streaming streams.
If some streams are not streaming, their latencies are ignored.
However, this time, the processing thread fails to update the delay for the
previously non-streaming streams. Because the format didn't change, the streams
delay matches the last stored delay from the previous playback. As a
result, the compensate samples are not recalculated.

To properly update the compensate samples, update_delay must also be called
when a stream's state changes to streaming (avoiding the need to clear the
thread-buffered value, which would require locking in the processing
thread).
2026-06-11 20:34:22 +02:00
sirmbcode
593c5d5b07 copied all entity strings to add to descriptor 2026-06-10 23:40:01 -07:00
hackerman-kl
8966d62606 milan-avb: demote periodic MSRP/gPTP/stream dumps from info to debug 2026-06-09 14:28:30 +00:00
hackerman-kl
2eb7fc4588 milan-avb: prefill talker ring with one quantum to kill return-to-zero notches 2026-06-09 14:28:15 +00:00
hackerman-kl
bd17904bbe milan-avb: don't arm SPA_IO_IN on the talker (STREAM_OUTPUT) socket 2026-06-09 14:26:48 +00:00
hackerman-kl
7262d0f34c milan-avb: ensure the pw streams match the milan AVB stream format and derives correct strides,
also fix crash in entity parser when not available
2026-06-09 12:53:38 +00:00
hackerman-kl
a6ad8b3b62 milan-avb: keep the last-known gPTP grandmaster across transient ptp4l management-query timeouts so the ADP does not flap to advertising self-as-GM 2026-06-05 07:31:43 +00:00
hackerman-kl
024f7201cb milan-avb: revert own-LeaveAll registrar aging — it tears down active SRP reservations on a spec-compliant bridge (802.1Q-2018 8.8.7 Dynamic Reservation Entry); talker disconnect-reset to be redone via the listener explicit MSRP Leave on UNBIND 2026-06-05 07:31:43 +00:00
hackerman-kl
95f796f08c milan-avb: age MRP registrations on the node own LeaveAll so a talker resets its STREAM_OUTPUT on ACMP disconnect — fire the shared MSRP/MVRP/MMRP LeaveAll timer periodically (prime + re-arm, RX_LVA no longer resets it) and transition the registrar IN->LV on TX_LVA, so a departed Listener ages LV->MT -> NOTIFY_LEAVE -> listener_observed=false (802.1Q-2018 10.7.5.20) 2026-06-05 07:31:43 +00:00
hackerman-kl
2bcec2f3f0 milan-avb: bit-perfect AAF audio path — avb.sink/avb.source self-driven drivers (drive_timer + trigger_process), 4-quanta ring (no per-quantum overwrite), rate_diff=1.0 coherent talker drive (no pw-cat resample), monotonic PHC-anchored AVTP timestamps, listener sample-lock driven at recovered mc.rate 2026-06-05 07:31:43 +00:00
hackerman-kl
5b8fa0a9b6 milan-avb: UNSUPPORTED_FORMAT per-PDU vs current format from descriptor 2026-06-05 07:31:43 +00:00
hackerman-kl
5fe0a7e575 milan-avb: pace the talker flush timer on the RT data loop 2026-06-05 07:31:43 +00:00
hackerman-kl
895e3a4fa1 milan-avb: ACMP listener self-heal, CBS-exclusive egress, per-iface MVRP, Milan MaxFrameSize + channel-strict RX 2026-06-05 07:31:43 +00:00
hackerman-kl
90114c9839 milan-avb: AAF media-clock recovery estimator + play-loop actuator + io_changed, SET_CLOCK_SOURCE switch, skip CRF audio data plane 2026-06-05 07:31:43 +00:00
hackerman-kl
66959ca678 milan-avb: read gPTP PHC time for talker/listener via NIC PHC mapped onto CLOCK_MONOTONIC_RAW, decoupled from system clock 2026-06-05 07:31:43 +00:00
hackerman-kl
afc7724070 milan-avb: stabilization extras - MRP registrar-before-notify, scoped-fd cleanup, VLAN sub-iface RX, SET_NAME validation, entity/firmware/8ch, MEDIA_UNLOCK 100ms + seq-settle, MRP Leave on teardown, reset STREAM_INPUT counters on bind 2026-06-05 07:31:43 +00:00
hackerman-kl
93e4957959 milan-avb: msrp: scope Domain re-adjust to matching sr_class_id 2026-06-05 07:31:43 +00:00
hackerman-kl
f3071aa549 milan-avb: msrp: set Listener AskingFailed on RX TalkerFailed 2026-06-05 07:31:43 +00:00
hackerman-kl
7c4fc7027b milan-avb: mrp: do not apply RX_LVA to own attributes when transmitting LeaveAll 2026-06-05 07:31:43 +00:00
hackerman-kl
1f969b51a8 milan-avb: stream: stop bumping STREAM_INTERRUPTED on ringbuffer overrun 2026-06-05 07:31:43 +00:00
hackerman-kl
e9e5bb72a6 milan-avb: acmp: preserve talker entity_id across BIND_RX -> CONNECT_TX round-trip 2026-06-05 07:31:43 +00:00
Barnabás Pőcze
ed951081b1 treewide: avoid unitialized spa_dict::flags
In multiple cases the `flags` member of `spa_dict` is left unitialized,
so try to avoid that. For example in `fill_node_info_proplist()` it is
accessed in `spa_dict_lookup_item()`.

This also modifies `collect_props()` to not depend on a partially initialized
`dict` parameter.
2026-06-04 21:35:47 +02:00
Barnabás Pőcze
bb073d8250 pipewire: introspect: copy SPA_DICT_FLAG_SORTED
When making a copy of the dictionary, copy the sorted flag
as well since the order is preserved.
2026-06-04 21:35:45 +02:00
Wim Taymans
707e5e2643 pulse-server: avoid division by 0 in delay calculation
When we are not yet negotiated and the rate is not yet stored in the
stream sample spec, use a 0 delay instead of dividing by 0.
2026-06-04 21:13:09 +02:00
Wim Taymans
a5c7dd3127 avb: fix compilation
This thing was broken.. mismatched brackets and const missing.
2026-06-03 12:43:15 +02:00
Wang Yu
8c8bd150ad sendspin: reject unsupported receive codecs
Commit b1b565339 ("sendspin: negotiate the first raw format") says that
FLAC and Opus are not supported yet. The receiver also only advertises
PCM formats in its player support.

Reject non-PCM stream/start codecs in the receiver. Otherwise
parse_player() accepts FLAC or Opus without setting client->stride,
while the receive path later uses client->stride as a raw frame size.

Signed-off-by: Wang Yu <wangyu@uniontech.com>
2026-06-03 10:38:50 +00:00
sirmbcode
1a1cd8d743 added zero padding and utf8-validation to entity parser for first test 2026-06-03 10:37:53 +00:00
sirmbcode
925cea5822 fixed spacing issues 2026-06-03 10:37:53 +00:00
sirmbcode
4cacdfcdf9 added calls to entity-parser.h for entity struct 2026-06-03 10:37:53 +00:00
sirmbcode
55172b92f9 added entity fields to avb conf 2026-06-03 10:37:53 +00:00
sirmbcode
8efbdcc022 added entity-parser.h 2026-06-03 10:37:53 +00:00
Wim Taymans
350eb9a041 midi: don't write trailing continuation 0xf0 for SysEx
Because our midi messages already have a size, we don't need the 0xf0
continuation terminator. Also having the terminator optionally requires
you to check and strip it if it's there.

The easiest algorithm is to check the first byte for start (0xf0) or
continuation (0xf7) and the last byte for end (0xf7) and that should be
enough to process the messages without having to ever stip the last
byte.
2026-06-01 13:08:11 +02:00
Wim Taymans
b41d117609 impl-port: make suspend go from INIT -> CONFIGURE
Bring the port to INIT before going to CONFIGURE when we do the suspend
logic.

This is to ensure that there always is a state change to emit the state
change notification. This was, the link can detect the suspend case and
cancel any pending results.

One of the problem with suspend is that the state changes on the ports
are done from different places; the port and link. This causes issues
like:

1. do_negotiate calls pw_port_set_param(Format,..) with the negotiated
   format. This returns async and the link queues a complete_ready
   callback.
2. The node is suspended, pw_impl_port_set_param(Format, NULL) is called
   to clear the port format. This bypasses the link.
3. The reply from step 2 arrives and triggers complete_ready, this
   brings the port state to READY and the link state to ALLOCATING.
4. The link continues allocating and sets buffers on the port. This then
   fails because the last format set was NULL.

Ideally all port states should be managed in one place and the async
port state changes should be kept in the port itself as well but this
will need some more work.

Fixes #3547
2026-06-01 10:34:40 +02:00
Wim Taymans
f22932580f impl-port: add port_suspend()
Move the logic to suspend a port to the port implementation. No
functional change with this.
2026-06-01 10:21:42 +02:00
Wim Taymans
54199d77c6 conf: disable portal.rt for pipewire and pipewire-pulse
Thse should not be portal clients and can go directly to rtkit.

The reason is that there is a locking problem in the portal rt
implementation that cause timeouts for some reason.
2026-06-01 10:00:47 +02:00
hackerman-kl
98ab3d73d4 milan-avb: es-builder: create and flag CRF input streams (fix NULL-server crash on activate) 2026-05-31 18:54:05 +02:00
hackerman-kl
9d08cb87c6 milan-avb: stream: do not wire CRF streams into the PipeWire audio graph 2026-05-31 18:54:05 +02:00