Commit graph

15529 commits

Author SHA1 Message Date
Carlos Rafael Giani
943bce9c85 node-driver: Add sync.force-tracking property
This property is useful for forcing tracking behavior even if the clock
can directly be used by timerfd.

This can be useful in cases where the clock is for example the realtime
clock and can shift and change during playback unexpectedly. The node
driver can handle this without a DLL. But, in some cases, graphs can
experience a more stable behavior if the DLL is used and it manages
the readjustment to the updated time.

This is also useful for testing and debugging the DLL's behavior.
2026-06-11 20:34:22 +02:00
Martin Geier
0a8ddba3e9 node-driver: report discontinuity flag when resyncing position
module-rtp-sink is sending data timestampted with clock provided from
a driver. When driver jumps (for example due ptp master change) rtp sink
has to jumps too. Rtp sink is checking for difference between expected and
actual position and is big enough the jump is done. As resync value in
driver is not equal to diff between positions, sink could ends with
not precise timestamps up to 1 quantum.
Emit discont flag when driver jumps, so sink can be reinitialized without
its own heuristic.
2026-06-11 20:34:21 +02:00
Carlos Rafael Giani
0550537ce0 node-driver: Increase DLL speed by using SPA_DLL_BW_MAX
This allows the DLL to react faster to clock pace changes.
2026-06-11 20:34:17 +02:00
Carlos Rafael Giani
3ce1f6e454 node-driver: Reinitialize DLL if error is too large
If the error is very large (after a big discontinuity in the timestamps
for example), the DLL has a hard time compensating, and a full restart
of the DLL without the old measurement history is more appropriate to
get the synchronization back on track faster and with fewer oscillations.
2026-06-11 20:34:12 +02:00
Carlos Rafael Giani
cc1cc27c34 node-driver: Factor on_timeout execution delay into current_time 2026-06-11 20:34:07 +02:00
Julian Bouzas
3a9ffbb56d alsa: acp: emit route param updates when card properties change
When jack state changes cause port properties to be updated, mark EnumRoute and
Route params as changed and call emit_info() so that the device re-emits the
route parameters with the updated port properties.
2026-06-11 11:08:44 -04: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
Wim Taymans
25203c5293 acp: avoid segfault when removing a card
Fixes #5255
2026-06-09 09:23:10 +02:00
Wim Taymans
64d3ed4710 acp: make hard and soft volume limit
Make a hard volume limit property that is configured with the config and
can never be changed.

Make a soft volume limit property that can be changed at runtime.

The used volume limit is a combination of the soft and hard limit.
2026-06-08 17:09:06 +02:00
Wim Taymans
1a534cd907 acp: add min and max volume properties
This way, the min/max volume can be updated and saved in the same way as
the volume is updated.

Also add support for this in audioconvert channelmix.
2026-06-08 16:47:13 +02:00
Wim Taymans
fb74ab9054 alsa: add volume limits
Add 3 levels of volume limits.

1. Add api.acp.min-volume and api.acp.max-valume on the ACP devices that
   is applied to all noded from this device
2. Add api.acp.device.<node-name>.min-volume and
   api.acp.device.<node-name>.max-volume that is applied to all nodes
   from the device with the given node-name.
3. Add api.acp.port.<port-name>.min-volume and
   api.acp.port.<port-name>.max-volume that is applied to all ports
   from the device with the given port-name.

The volume settings on an ALSA nodes can either go through the device on
the Routes (ports) to control the hardware mixer volumes and then the
remainder is performed on the nodes in software by the channel mixer.

We need to set the limits on the channel mixer when the hardware mixer
does not have routes.

This is not an easy way to set the volume limits but it provides a
static configuration option to enforce the limits. An easier
configuration option will also make it easier to change/bypass the
limits, which these options can guard against.

See #5266, #4323, #1517
2026-06-08 10:46:56 +02:00
Wim Taymans
1272f77eb5 alsa: fix warning
warning: the address of ‘dev_id’ will always evaluate as ‘true’ [-Waddress]
2026-06-06 21:24:47 +02:00
Arun Raghavan
cb327e5762 spa: alsa: Detect ports for HDMI AC3 profiles
Because the a52 plugin (being an ioplug) does not proxy snd_pcm_info for
its slave PCM, we need a different way to figure out the card associated
with the device. It turns out we do have access to the card index
already in the caller, so let's pass that index down as a fallback.

This is done as a fallback rather than replacing the existing lookup in
case there are situations where they might be mismatched. We could
possibly just replace the existing lookup, but the cost seems low enough
to not merit the risk of changing this.
2026-06-05 19:05:47 -07:00
Arun Raghavan
bb634fb0f9 spa: alsa: Use some #defines instead of raw strings
Makes it easier to find instances where these keys are used.
2026-06-05 12:10:08 -07: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
Barnabás Pőcze
797dbd3d40 spa: param: spa_{param_dict,tag}_info_parse(): update size as well
In both functions the loop can break early, meaning that the true number
of valid items is `n`, and that should be reflected in the updated `*dict`.
2026-06-04 21:35:44 +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
d05905f871 alsa: avoid rounding down period_size
Only try to round down the period_size to the lowest power of 2 when we
are resampling and scaling the period_size to match.

In all other cases, we should honour the requested quantum duration.

Fixes #5302
2026-06-04 16:54:37 +02:00
Arun Raghavan
cecdbc034f spa: aec: Fix a spurious warning while parsing args 2026-06-03 09:39:32 -07: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