Commit graph

14382 commits

Author SHA1 Message Date
Barnabás Pőcze
9a0053a501 spa: bluez: telephony: fix string leaks
`dbus_connection_register_object_path()` does not take ownership of the
path passed to it, so currently the callers `telephony_{ag,call}_register()`
leak a copy of the path string. Fix that by not making an unnecessary copy.

Fixes: b28399ac57 ("bluez5: add telephony D-Bus service implementation")
2025-11-07 12:28:16 +00:00
Barnabás Pőcze
963d10f1ac spa: bluez: mark dbus vtables static 2025-11-07 12:28:16 +00:00
Arun Raghavan
3337af64ca pulse-server: Support clearing default sink/source
The PulseAudio way of doing this is to accept @NONE@ to clear the
default setting, so let's accept that.
2025-11-06 17:23:16 -08:00
Wim Taymans
2374d034d7 1.5.83 2025-11-06 16:29:05 +01:00
Wim Taymans
7a8ecbf41d 1.5.82 2025-11-06 15:26:08 +01:00
Wim Taymans
7bd65cfe93 pulse-server: increase min quantum values
The default values of 128/48000 seem to be too low as a good default.
Bump them to 256/48000.

Fixes #4875
2025-11-06 12:52:48 +01:00
Wim Taymans
eec5eaf8df spa: fix some -Wdeclaration-after-statement errors
Fixes #4960
2025-11-06 12:39:16 +01:00
Wim Taymans
8f6566422f include <sys/types.h> for ssize_t
Fixes #4961
2025-11-06 12:33:54 +01:00
Wim Taymans
f4b3536b9b spa: enforce max values for choice as well
Make sure we don't return more values than expected for the choice
type.

Fixes #4964
2025-11-06 12:25:55 +01:00
Wim Taymans
1191c18641 thread: add thread.reset-on-fork
Add a new thread.reset-on-fork property for the thread creator. when set
to false, it will clear the default SCHED_RESET_ON_FORK flag and new RT
threads will be able to fork and inherit the rt policy and priority.

When creating a thread make sure we set SCHED_RESET_ON_FORK when the
thread.reset-on-fork property is not explicitly false;

module-rt needs to preserve the SCHED_RESET_ON_FORK flag when changing
the policy.

Set thread.reset-on-fork=false explicitly for JACK clients to restore
the JACK behaviour where implementations can fork and inherit the RT
policy and priority by default.

Fixes #4966
2025-11-06 11:55:20 +01:00
lumingzh
1f3bc6eff5 update Chinese translation 2025-11-05 15:19:52 +00:00
Wim Taymans
fc55ceb2f4 impl-port: handle tags like latency
No links on the port will result in a NULL tag and >0 links will always
result in a non-NULL tag (that could be empty).

This makes it easier to see when a port is linked or not.
2025-11-05 11:26:23 +01:00
Wim Taymans
ffb7663f4d Revert "stream: add peer_added and peer_removed signals"
This reverts commit 3eb011c9d1.

Not a good idea, the internal signals are for scheduling peers and so
some peers are simply not signaled when they don't need to be scheduled,
like for async nodes or upstream nodes.
2025-11-04 13:52:35 +01:00
Wim Taymans
d610c84e31 Revert "test: fix test and indentation"
This reverts commit b0fe422b4f.
2025-11-04 13:50:35 +01:00
Wim Taymans
3aa931fdb0 Revert "stream: avoid emitting peer_added/removed for our id"
This reverts commit 78f5df2846.
2025-11-04 13:50:29 +01:00
Wim Taymans
78f5df2846 stream: avoid emitting peer_added/removed for our id
We internally also add ourselves as a peer when we are a driver. Avoid
emitting events for this.
2025-11-04 12:18:33 +01:00
Wim Taymans
b0fe422b4f test: fix test and indentation 2025-11-04 11:47:05 +01:00
Wim Taymans
3eb011c9d1 stream: add peer_added and peer_removed signals
Forward existing impl-node peer_added and peer_removed signals on the
stream.

Because the stream is not on the server, there is no impl_node in the
node target. Add the node id to the peer_added/removed signal and use
that for the stream event argument. Implementations can then look up the
details on the global.
2025-11-04 11:29:52 +01:00
Wim Taymans
41cdd82291 spa: ensure enum always has 2 values
We need at least a default value and the default value as a possible
value.

For enum type in the PropInfo we usually list just the basic type and
then use labels to list alternatives.
2025-11-04 09:23:26 +01:00
Shengjiu Wang
ef7d4a3fc3 avb: fix frame header of listener
The vlan tag has been stripped by the kernel, the header should be
avb_ethernet_header.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2025-11-04 15:22:55 +08:00
Pauli Virtanen
296abbf7ca bluez5: fix wrong use of SPA_POD_CHOICE_ENUM_Int
SPA_POD_CHOICE_ENUM_Int must always take at least 2 values as first one
is default. (Just 1 value no longer works on current master, and it's
anyway incorrect.)

Replace with just SPA_POD_Int, as there's just one choice.
2025-11-03 22:11:04 +00:00
Arun Raghavan
49a803eaa0 spa: bluez5: Make HFP description slightly more user-friendly
In the unknown form-factor case (which I saw on a set of headphones
here, Creative Zen Hybrid Pro), let's avoid an apocryphal acronym in
favour of a term that might be more familiar to the user.
2025-11-03 13:57:24 -08:00
Bernhard Sulzer
5bca3731a3 module-roc: Add support for multi-channel audio 2025-11-03 15:36:34 +00:00
fuleyi
23f0acfd1d pulse-server: Fix missing subscription events on device port changes
When a device profile changes (e.g., Bluetooth headset switching from
a2dp-sink to headset-head-unit), the active port information changes
but PulseAudio compatibility layer clients don't receive the expected
PA_SUBSCRIPTION_EVENT_SOURCE or PA_SUBSCRIPTION_EVENT_SINK change events.

Root cause:
The collect_device_info() function updates the active_port index from
SPA_PARAM_Route parameters, but doesn't update the corresponding
active_port_name field. When update_device_info() uses memcmp() to
detect changes in the device_info structure, it compares the entire
structure including active_port_name. If the pointer value doesn't
change (even though the actual port changed), no change is detected,
and the change_mask flag (PW_MANAGER_OBJECT_FLAG_SOURCE/SINK) is not
set, preventing subscription events from being sent.

Solution:
After setting active_port in collect_device_info(), look up the
corresponding port name from SPA_PARAM_EnumRoute parameters by
matching both the port index and direction. Initialize active_port_name
to NULL at the start to ensure it's always recalculated.

This fix applies to all device types (Bluetooth, USB, PCI sound cards)
and all profile switching scenarios, ensuring applications using the
PulseAudio compatibility layer receive proper device change notifications.

Tested with:
- Bluetooth headset profile switching (a2dp-sink ↔ headset-head-unit)
- Applications subscribing to PA_SUBSCRIPTION_MASK_SOURCE/SINK events
- Verified no regression in audio initialization
2025-11-03 15:31:15 +00:00
Barnabás Pőcze
fa8b0ba018 pipewiresrc: Fix renegotiation
Some downstream elements trigger re-negotiations when the stream is
running, e.g. due to output window resizing for the below pipeline.

gst-launch-1.0 pipewiresrc ! videoconvert ! video/x-raw ! gtk4paintablesink

This fails due to a side effect introduced by commit 77143e54 with
handle_format_change() setting `is_video` to `false` when param was
NULL. Fix this by explicitly tracking media type and not just video
using a boolean.
2025-11-03 15:27:46 +00:00
Barnabás Pőcze
d3368ee0d5 spa: utils: cleanup: fix __has_attribute() usage
Unknown preprocessor symbols are replaced with 0 in preprocessor
conditionals, so if `__has_attribute()` is not supported, then
the condition will be the following:

  if 0 && 0(__cleanup__)

which is syntactically incorrect.

So split the condition and only check `__has_attribute()` if
it exists.

Fixes: 65d949558b ("spa: utils: add scope based resource cleanup")
Fixes #4962
2025-11-02 19:10:25 +01:00
Demi Marie Obenour
62022ce623 pod: doc: Deprecate unused types
I found no uses of SPA_TYPE_Bitmap outside of the SPA code itself and
the now-removed v0 protocol support.  Wim Taymans confirmed that it has
no uses and is not usable.  Deprecate it so it can hopefully be removed.
2025-10-31 11:06:45 +00:00
Wim Taymans
c63c100c4b pulse: use more specific type when parsing params
We expect a Struct for the classes and a Object for the props so we can
use the right POD type when persing.
2025-10-31 12:04:00 +01:00
Wim Taymans
d89c85d374 doc: improve spa_pod_get_values() docs 2025-10-31 11:51:32 +01:00
Wim Taymans
a60eb4fe64 stream: add some redundant checks
Remove some redundant checks and handle calloc failure.
2025-10-31 11:48:22 +01:00
Wim Taymans
95fb03c8e3 spa: add some more POD tests
Check if the pod size is at least big enough to hold 1 item when getting
array or choice items.

Check that the number of choice values is at least enough to handle the
given choice type. Remove some redundant checks.
2025-10-31 11:39:41 +01:00
Robert Mader
77a5100280 gst: Use gst_util_uint64_scale instead of scale_int
GST_SECOND * t.rate.num can turn into a negative gint, resulting in
assertions like:
_gst_util_uint64_scale_int: assertion 'num >= 0' failed

Just use the 64bit version instead.
2025-10-30 16:46:58 +00:00
Wim Taymans
e9a89822f8 adapter: only recheck formats when convert EnumFormat changed
Instead of always renegotiating a new format and buffers when the
driver changes, only renegotiate when the converter notifies us
of an EnumFormat change. It's possible that changing the driver does
not actually change the result of EnumFormat and then we would simply
renegotiate to the same format and buffers for nothing.

In the audioconvert, check if the target_rate of the new driver has
changed. We keep the last value in our own clock so that we don't
renegotiate when we are removed from a driver (which sets our own
clock as the position). The target rate influences the result of the
EnumFormat params when we are resampling and so we need to emit a
EnumFormat change.
2025-10-30 17:41:24 +01:00
Pauli Virtanen
ece9545695 NEWS: update Bluetooth items
Update changelog for 1.5.81 Bluetooth items.
2025-10-30 13:31:41 +00:00
Wim Taymans
ff0bc22cb1 modules: support audio.layout where we can 2025-10-30 12:29:31 +01:00
Wim Taymans
8ba08f3029 spa: add audio.layout property
Makes it possible to define audio channels and position with a
predefined layout string.

It is easier and less error prone to say "5.1" than to spell out
[ FL FR FC LFE RL RR ].

AUX channels have a special syntax. AUX<N> will make <N> AUX
channels. Easier to say AUX128 than to write an array with the
128 AUX channels.
2025-10-30 12:28:07 +01:00
Wim Taymans
056f257058 spa: fix max_position check 2025-10-30 11:26:32 +01:00
Wim Taymans
7706ca6361 spa: fix Cube layout define 2025-10-30 10:10:10 +01:00
Wim Taymans
9f3c553298 tools: add -t option to the help 2025-10-28 10:29:01 +01:00
Wim Taymans
a813830024 po: update Turkish translation 2025-10-28 08:48:18 +01:00
Wim Taymans
a837dcd40b audioadapter: renegotiate when driver changes
The renegotiated format can depend on the clock rate of the new
driver.

See #4933
2025-10-28 08:32:03 +01:00
Rui Matos
752de866ae spa: node-driver: Expose the clock id as param properties 2025-10-28 07:18:59 +00:00
Rui Matos
ec11859a48 spa: Add predefined properties for clock identifiers 2025-10-28 07:18:59 +00:00
Carlos Rafael Giani
1096d63468 module-rtp-source: implement IGMP recovery for multicast subscription loss
Add IGMP recovery mechanism that monitors RTP packet reception and
triggers multicast group refresh when no packets are received if
a deadline is reached. The deadline is configurable via a new stream
property "igmp.deadline.sec" (in seconds), with the default value
being 30 seconds (and a minimum of 5 seconds).

A timer checks regularly if the deadline was reached. That timer's
interval is set by the igmp.check.interval.sec property (in seconds),
with the default value being 5 seconds (and a minimum of 1 second).

When the deadline is reached, the mechanism performs IGMP leave/rejoin
operations to refresh multicast group membership. This ensures RTP
data continues to be received when network conditions cause IGMP
membership to expire or become stale due to router timeouts or
network issues.
2025-10-27 22:40:22 +01:00
Carlos Rafael Giani
955c9ae837 module-rtp: Get the current stream time in a reusable manner
That way, redundant pw_stream_get_nsec() and clock_gettime()
calls can be avoided.
2025-10-27 22:40:22 +01:00
Carlos Rafael Giani
3e0f4daf60 module-rtp-sap: implement IGMP recovery for multicast subscription loss
Add IGMP recovery mechanism that monitors SAP packet reception and
triggers multicast group refresh when no packets are received if
a deadline is reached. The deadline is set to half of the cleanup
interval, with a minimum of 1 second.

When the deadline is reached, the mechanism performs IGMP leave/rejoin
operations to refresh multicast group membership. This ensures SAP
announcements continue to be received when network conditions cause
IGMP membership to expire or become stale due to router timeouts or
network issues.
2025-10-27 22:40:22 +01:00
Carlos Rafael Giani
5d21e12658 module-rtp-source: Use make_socket() error value instead of errno
make_socket() already returns the negative errno.
2025-10-27 22:14:09 +01:00
Carlos Rafael Giani
f1ffd5e5e8 module-rtp-source: Read cleanup.sec property from stream properties
This allows for setting the cleanup.sec value in the create-stream
block in the module-rtp-sap configuration.
2025-10-27 22:14:09 +01:00
Carlos Rafael Giani
80e7302a05 module-rtp-sap: Add retry code for when start_sap() fails due to ENODEV 2025-10-27 22:14:09 +01:00
Carlos Rafael Giani
b57bd00be0 module-rtp-sap: Improve names for clearer code 2025-10-27 22:14:09 +01:00