14560 Commits

Author SHA1 Message Date
hackerman-kl
1d485d8bbc milan-avb: get entity-id rom the server, and not from a define 2026-01-11 09:00:36 +01:00
hackerman-kl
2fe254821c module-avb: milan: aecp-aem: introducing GET/SET_SAMPLING_RATE commands 2026-01-09 13:04:19 +00:00
hackerman-kl
f70fc7ea28 milan-avb: using pull and frequency as a union 2026-01-09 13:04:19 +00:00
hackerman-kl
e7f1a8f55d milan-avb: get-set name: removing unused var 2026-01-09 13:03:02 +00:00
hackerman-kl
d3a5b352b2 milan-avb: Make sure to get payload size not the packet size 2026-01-09 09:38:06 +01:00
Timon
aec99d2b6f format: Add support for sample rate of 1.536 Mhz 2026-01-09 01:16:30 +01:00
Wim Taymans
6ed9645465 profiler: keep per node last_profile_time
So that multiple drivers can get updated per interval when
profile.interval.ms is used.

Fixes #5061
2026-01-06 17:24:55 +01:00
Pauli Virtanen
c96e58af01 bluez5: handle BAP device set volume change notifications
Update volume state on device set volume notifications.

When one device sends volume notification, CAP specifies volume on other
devices shall be synchronized too.
2026-01-06 16:14:22 +00:00
Pauli Virtanen
260e8261d5 bluez5: add bluez5.autoswitch-routes option to indicate loopback nodes
When session manager emits loopback nodes for profile autoswitch, we
need to indicate them in the Routes.

Otherwise, the port information in Pulseaudio API doesn't account for
them, and some apps (eg GNOME) misbehave, as the loopback node sometimes
doesn't have valid ports.
2026-01-05 20:43:13 +02:00
Pauli Virtanen
e91a79dab7 spa: alsa: actually set the channel map when use-chmap=true
When using channel maps, the active map should be set using
snd_pcm_set_chmap(). This has to be called when stream is in prepared
state.

Track which of the maps the selected format has set, and set it in
do_prepare().
2026-01-05 15:37:05 +00:00
Torkel Niklasson
bb0efd777f impl-node: Don't suspend when links are busy
When suspend_on_idle is set and we got to idle, there is a chance that
there is work in the work queue that is dependent on formats being set.
In suspend_node, check whether the links have a non-zero busy count before suspending and
return -EBUSY if they do.
2026-01-05 15:36:41 +00:00
Pauli Virtanen
f754741d58 bluez5: handle BAP volume change events
Handle volume changes initiated by remote also for the BAP profiles.
2026-01-05 15:35:17 +00:00
Pauli Virtanen
8a7c71694d bluez5: handle BAP initial HW volumes
Setup initial HW volumes for BAP profiles similarly as done for A2DP.
As Client, retain the remote volumes as initial values, and as Server
use our own default volumes.

Also as A2DP Source, use the remote HW volume as initial value, if
available.

In the Client / A2DP Source modes session manager usually restores its
own volumes overriding what we set here.
2026-01-05 15:35:17 +00:00
Barnabás Pőcze
aa31e814b2 spa: utils: keys: remove api.libcamera.cap.* keys
These keys have not been used for a very long time. Debian code search does
not turn up any users either. There is also no such thing as "libcamera_capability".
These were created based on the `api.v4l2.cap.*` keys, but at the moment they
are not actually applicable to libcamera. So remove them.
2026-01-05 15:34:43 +00:00
Pauli Virtanen
11389d101a bluez5: iso-io: more accurate resync after overrun
Take active rate correction properly into account when dropping data on
overrun resync.

Drop data only for the currently processed stream, after data has been
consumed from it. Make sure the rate correction factor is updated after
this for the next cycle of the stream.

Also fix buffer fill level calculation: the fill level interpolation
should use node rate corr, not clock rate diff, since the calculations
are done in system clock domain. Fix same issue in fractional delay
calculation, and take no resampler prefill into account.

Later, we maybe need some more resampler APIs to avoid such details
leaking in.

Previously, stream could have its old rate correction locked in, and its
fill level would then end up off the target on the next cycle.
2026-01-05 15:34:06 +00:00
Pauli Virtanen
b535534611 bluez5: media-source: do buffering on connection start also with PLC
Also when we are capable of PLC, it's better to buffer audio at start,
to get a buffer level close to the target initially.

Delay ISO overrun handling one cycle after buffering is complete, so
that any resamplers are filled at that point.
2026-01-05 15:34:06 +00:00
Pauli Virtanen
1d7e89e069 bluez5: media-source: improve handling of underrun with PLC
When PLC data was produced due to underrun and decode buffer has reached
target level, drop received audio if we already did PLC for that packet.
It's better to lose some packets than having to resync latency.

When about to underrun when PLC is active, update rate matching before
filling up buffer, so that rate slows down and we do not get stuck in a
continuous underrun where PLC fills data and we drop received packets.
2026-01-05 15:34:06 +00:00
Pauli Virtanen
de34ce606f bluez5: media-source: fix off-by-one cycle in rate matching
The rate matching filter assumes buffer level for cycle j+1 is

    buffer(j+1) = buffer(j) + recv(j) - corr(j+1) * duration

but what we are actually doing is instead

    buffer(j+1) = buffer(j) + recv(j) - corr(j-1) * duration

because the correction factor that is computed is not used for the next
cycle, but the one following that. Although the filter is still stable
in theory the extra lag causes oscillations to be damped less.

Fix by using the computed correction factor for the next cycle, as
there's no reason why we'd like to have more lag in rate matching.

This then changes c(j-1) -> c(j) in the assumptions, which turns out to
fix the situation. Fix the filter derivation to match.  The filter
coefficients stay as they were, and they are actually exactly correct
also for short averaging times.

In practice, it is observed that ISO RX with quantum 4096 converges to
stable rate, whereas previously the matching retained small
oscillations.
2026-01-05 15:34:06 +00:00
Pauli Virtanen
c4812af436 bluez5: decode-buffer: fix buffer level after recovery
The buffer level number includes the current quantum, so it should not
be subtracted. We do this after recovery from glitch, and this throws
rate matching off.

The level after recovery should also include the resampler delay.
2026-01-05 15:34:06 +00:00
Pauli Virtanen
11faea9dbc bluez5: media-source: don't break audio if BAP presentation delay too small
As BAP server, when we can't satisfy BAP presentation delay, just accept
a bigger latency and emit a warning, instead of having broken audio.
Also make sure it works if quantum is forced to a larger value than our
wanted node.latency.

Take other latencies into account when selecting the wanted node.latency
for BAP Server.

Fix up port.params usage vs. user flag, which is not used here.

Reset decode buffer rate matching if we need to PLC due to underrun so
it doesn't get stuck at playback at increased rate if target is too
small.
2026-01-05 15:34:06 +00:00
Pauli Virtanen
ac3ac3382b bluez5: iso-io: delay streaming start until all acquires are complete
For better start synchronization, we should wait until all ISO nodes
that are going to be started finish creating ISO io.

Add a separate ready flag for startup that is set when all Acquire
requests are complete.
2026-01-05 15:34:06 +00:00
Pauli Virtanen
8b36e2d9b7 bluez5: support specifying preferred delays as BAP Server
Add options to control advertised delays supported.

Smaller delay needs smaller node.latency be used, so use 40ms as a
reasonable minimum preferred delay.
2026-01-05 15:34:06 +00:00
Wim Taymans
ae9361bb34 support: return NULL instead of FALSE 2026-01-03 22:54:25 +01:00
Wim Taymans
4a2710c779 dbus: handle errors better
Make sure we don't crash when running out of fds and the loop functions
start to return NULL sources.
2026-01-03 11:24:08 +01:00
Dimitris Papaioannou
1f2a5d99b1 module-eq: Unload filter-chain on destruction
Make the parametric-equalizer module destroy the underlying filter-chain
module on destruction. This makes the EQ nodes get destroyed on unload.
Fixes #5045
2025-12-26 18:53:48 +00:00
Barnabás Pőcze
29bbd79830 gst: deviceprovider: unregister pw_core event hooks
A `pw_core` may be shared between multiple streams, device provider
instances, thus when the reference of the given component to the core
is dropped, the event handlers must be unregistered so as to avoid
use-after-free and similar issues.

Fixes #5030
Fixes: 2bc3e0ca1011a9 ("gst: deviceprodiver: Use GstPipeWireCore and some cleanups")
2025-12-25 14:57:21 +01:00
Wim Taymans
3738c3fc38 tools: only print latency when we print the port
Move the latency print code after where we print the port. That way
we only get the latency when we first print the port.

Avoid -lt from printing latencies for ports without a link.
2025-12-20 18:02:36 +01:00
Robert Rosengren
165bd7b219 pipewiresrc: fix race when node suspended moving from PAUSED to PLAYING
If in PAUSED state, the node can move from idle to suspended resulting
in format cleared and state is no longer negotiated. To avoid returning
not-negotiated error upon basesrc calling create callback, wait for new
format to be provided and negotiated state is back.
2025-12-19 07:15:08 +00:00
Frédéric Danis
e15e50c5ee spa: bluez: backend-native: Prevent HSP/HFP connection in both directions
The HSP and HFP profiles expect that a device function only as an audio
gateway or as an headset, which is the normal behavior for a headset,
a hands-free car unit or a phone.

In case of a desktop, it can perform both functionalities, but there's
no interest to get them at the same time as the bidirectional audio
is already supported.
2025-12-19 07:12:46 +00:00
Frédéric Danis
f468529084 spa: bluez: backend-native: Fix audio connection policy for HSP/HFP 2025-12-19 07:12:46 +00:00
Arun Raghavan
385161b12a pulse-server: Add a message to enable/disable mono mixdown
WirePlumber recently added a mechanism to force mono mixdown on audio
outputs, which is a useful feature for accessibility. Let's also expose
that setting via libpulse for existing audio settings UIs to be able to
use.
2025-12-18 16:35:35 -08:00
Martin Geier
8c7890eb52 spa: fix missing member initialization
Signed-off-by: Martin Geier <martin.geier@streamunlimited.com>
2025-12-18 16:53:54 +01:00
Arun Raghavan
e2262617aa spa: alsa: Fix off-by-one check in ELD channel position parsing 2025-12-17 11:08:44 -08:00
Jonas Holmberg
12b2e5d67c audiotestsrc: Operate as follower too
Don't start the timer but fill buffers when following another driver.
2025-12-16 13:15:00 +01:00
Arun Raghavan
ee42b18226 spa: alsa: Guard against mismatched LPCM channel count in ELD parsing
With wonky EDID states, we want to make sure we don't overflow the
available positions.
2025-12-15 12:47:49 -08:00
Frédéric Danis
d89d1668dc spa: bluez: backend-native: Add support for AT+BLDN for PTS tests
This allows to fake Last Dial Number call by calling the first memory.

This allows to pass PTS tests HFP/AG/OCL/BV-01-C and HFP/AG/OCL/BV-02-C.
2025-12-15 08:56:03 +00:00
Frédéric Danis
9a48bbaa36 spa: bluez: modemmanager: Add support for memory dialing for PTS tests
This add a new property to to allow to fake memory dialing for PTS tests
HFP/AG/OCM/BV-01-C and HFP/AG/OCM/BV-02-C.
2025-12-15 08:56:03 +00:00
Frédéric Danis
04cf29f7cd doc: Add property documentation for bluez5.disable-dummy-call 2025-12-15 08:56:03 +00:00
Wim Taymans
bb564d5eb6 avb: fix compilation 2025-12-15 09:27:10 +01:00
Janne Grunau
f03021edd1 stream: Fix pw_time.delay calculation for rate.num > 1
Pipewire uses a rate of 256/7680 with the integrated camera of Apple
silicon Macbooks. To calculate pw_time.delay correctly in this case it
has to be divided by time->rate.num. Without this division the delay
contribution of the `((latency->min_ns + latency->max_ns) / 2)` term
ends up as 255 which are 8.5 seconds.
pipewiresrc reports the delay as latency in the gstreamer pipeline which
results in rendering a frame every 8.5 seconds.
I suspect the non-normalized rate of 256/7680 is another bug in
pipewire. The rate for an UVC webcam is reported as 1/30. Both
Video4Linux2 devices report a discrete frame interval of 0.033s (30fps).

Fixes #4957
2025-12-15 08:22:07 +00:00
Mason Remaley
c7ebc66e64 Adds explanation to reduce chance of regressing the fix 2025-12-15 08:20:24 +00:00
Mason Remaley
a6f8e209ac These two functions were marked as static, but referened by the SSE41 implementation in a separate file
I'm not 100% sure if this was breaking SSE41 builds on the official build system (I'm building Pipewire
with a different process), but I suspect it was, because you can't combine these into a single translation
unit to sidestep it without including multiple copies of resample-native-impl.h which isn't desirable.
2025-12-15 08:20:24 +00:00
hackerman-kl
6f1938d501 milan-avb: milan: adding set/get clock-source for a clock-domain 2025-12-15 08:18:30 +00:00
hackerman-kl
bb1ef8ea5e module-avb: milan: introducing full entity model for mlian v1.2 2025-12-15 08:17:50 +00:00
hackerman-kl
b22e442b10 module-avb: milan: adding get/set for configuration 2025-12-15 08:17:50 +00:00
Tyler
43bf1b8f7c module-rt: warn if setting niceness fails with rtlimit 2025-12-11 16:38:00 -08:00
hackerman-kl
ba8c6154a0 milan-avb: silent gcc warning as the variable will be used 2025-12-11 08:13:20 +01:00
Wim Taymans
548f26882f avb: fix compilation 2025-12-10 11:33:06 +01:00
hackerman-kl
63abd4e71c milan-avb: cmds-get-set-name: fix unused variable warning 2025-12-10 07:11:16 +01:00
hackerman-kl
c2ada3175e module-avb: aecp-aem: SET/GET STREAM_FORMAT answer implemented.
In the current state the GET/SET stream format can handle the commands
response however, yet, it does not take care of checking that:

 * A bound input stream cannot have it set, should reply accordingly
 * A STREAMING_STREAM output stream cannot have it set, should reply
   accordingly.
2025-12-10 07:07:24 +01:00