Commit graph

15420 commits

Author SHA1 Message Date
Wim Taymans
98fdedf348 filter-graph: relax LADSPA plugin loading
Make a new library.filter-path for the filter-graph that will filter and
restrict the dlopen filenames (used for the LADSPA plugin only).

By default this is false and so filter-chain can load from absolute
paths without extra checks.

Enable the extra checks for the pulse LADSPA modules and the
audioconvert filter graphs because these allow loading LADSPA plugins
into other processes.

Fixes #5222
2026-05-14 13:23:19 +02:00
Wim Taymans
61431dcbc0 audioconvert: add dither noise even on empty input
When we are asked to add noise bits, don't call the clear function.

Make the passthrough and clear-on-empty flags available with a new flag
field to make it more extensible.

Fixes #5260
2026-05-14 11:19:02 +02:00
Wim Taymans
4f975d0071 treewide: add error checking to spa_json_builder_close
There could have been a write error or allocation error while building
the json file that we can detect in spa_json_builder_close().

Error out instead of silently using a truncated JSON.

Use spa_autofree for the memory to make cleanup easier.
2026-05-13 18:14:44 +02:00
Wim Taymans
6d1c242433 pulse-server: implement more valid_args on modules
If the valid_args is NULL, reject all arguments.
2026-05-13 16:53:40 +02:00
Wim Taymans
5fa87d67a1 protocol-native: unref resource after logging the error 2026-05-13 11:12:17 +02:00
Wim Taymans
b53ec3bceb impl-metadata: check PW_PERM_M permission on subject
To set a metadata on a subject, the subject must be visible (R) and we
must have the M permission on the subject.
2026-05-13 11:08:37 +02:00
Wim Taymans
a74109eef3 settings: clamp the clock rate to avoid 0 division
Setting the rate to 0 could in some cases result in a division by zero,
avoid that by clamping to a min value.
2026-05-13 10:47:52 +02:00
Wim Taymans
e5ff44910e pulse-server: improve module argument checking
Make the module valid_args a structure that includes the argument key,
description and some flags. Use this to enforce mandatory properties
in a more central place.

We should be able to generate the module usage from this as wel later to
have things a bit more structured.
2026-05-13 10:23:47 +02:00
Pauli Virtanen
a5a3eaf2cb ci: bump bluez version to fix failing bluez_tests
Bump bluez to current master to fix bluez_tests failures.
Also bump pytest-bluezenv version to current.
2026-05-12 23:56:27 +03:00
Jonas Holmberg
a7994882b9 channelmix: Convert matrices to float arrays
Convert matrix_orig and matrix to float arrays and use variable size 2d
arrays to access the elements of the matrices. This removes the need for
storing pointers to matrix rows.
2026-05-12 14:47:57 +02:00
Wim Taymans
7cfcb46fbf tests: do channelmix_free after channelmix_init 2026-05-12 13:10:21 +02:00
Wim Taymans
b54bac1862 modules: make and use pw_net_is_multicast 2026-05-12 13:02:21 +02:00
Wim Taymans
6d998a9193 modules: use pw_net_get_ip
Make pw_net_get_ip also accept NULL ip to just get the port and ip
version. Make rtsp-client use pw_net_get_ip.

Make sure we initialize the iovec before logging in all cases.
2026-05-12 12:52:03 +02:00
Wim Taymans
8860dc809d pulse-server: use pw_net_get_ip instead of inet_ntop 2026-05-12 12:14:52 +02:00
Wim Taymans
62846acb3f modules: use pw_net_get_ip 2026-05-12 09:29:19 +02:00
Niklas Carlsson
d02ebb01e1 filter-graph: expand built-in plugins min/max
No need to limit certain parameters to e.g. [-10, 10]. Some use
cases might want to use values outside of the current, somewhat,
restrictive limits.
2026-05-12 07:20:23 +00:00
Wim Taymans
0c193b2b82 modules: invert memcmp logic
memcmp returns 0 when the memory is equal. This function is not used
currently.
2026-05-12 09:18:56 +02:00
Wim Taymans
9843ee858f modules: use sockaddr_storage for socket address
sockaddr_in only works for ipv4, for ipv6, the address will be truncated
and then cause a stack overread in inet_ntop.
2026-05-12 09:15:46 +02:00
Wim Taymans
4366621b78 filter-graph: fix max plugin
It was reading src[1] twice for no good reason. Fixed it like the min
plugin works.
2026-05-11 17:44:59 +02:00
Niklas Carlsson
a9d7023ec3 filter-graph: add min plugin
Output the lowest sample value of a number of inputs.
2026-05-11 15:39:40 +00:00
Niklas Carlsson
ecc85f2959 filter-graph: warn on clamped control values
Print a warning if a control value is clamped instead of silently
failing as the user might want to know if the intended
configuration was not applied successfully, such as filter
parameters.
2026-05-11 15:31:09 +00:00
Wim Taymans
f1b1f2d97b audioconvert: allocate memory dynamically
Instead of working with fixed buffer size, allocate everything
dynamically. This preserves a lot of memory in the normal case.
2026-05-11 17:23:33 +02:00
Wim Taymans
cd654efa6a audioconvert: support Midi control messages as well 2026-05-11 14:02:29 +02:00
Wim Taymans
2e86383aba examples: set diffent Clock and Position on source
Set a different Clock id and Position clock id on the testsrc so that it
knows that it needs to be a follower.
2026-05-11 14:02:29 +02:00
Barnabás Pőcze
5bc76c7d07 ci: disable more jobs if $COVERITY
If the pipeline is running for coverity scan, then only two jobs are needed:

   * container_coverity
   * build_with_coverity

but currently 4 container, 1 build, and 1 deploy jobs are running unnecessarily.

Disable the container jobs by simply extending `.not_coverity`.

The `build_on_fedora_html_docs` and `pages` jobs already extend `not_coverity`,
however, they override the `rules` section, hence it is replaced, so the "not coverity"
condition is lost. Fix that by adding the condition separately. (`build_on_fedora_html_docs`
referencesc the rules of `pages`, so modifying the latter is sufficient.)
2026-05-11 10:05:16 +00:00
Wim Taymans
e286061df4 fix some compilation problems 2026-05-11 11:59:54 +02:00
Wim Taymans
3813f64a27 midifile: fix meta event read 2026-05-11 11:53:36 +02:00
Vladimir Sadovnikov
bb91cfeb9e Add explicit cast to struct spa_event * result of spa_pod_builder_pop 2026-05-11 09:53:18 +00:00
Vladimir Sadovnikov
139767b4b5 Change return type of spa_pod_builder_pop to struct spa_pod * 2026-05-11 09:53:18 +00:00
Barnabás Pőcze
05a1a08a04 ci: build_on_debian: use variable expansion in needs:parallel:matrix
Since gitlab 18.6, a job can refer to a subset of parallel jobs[0],
so make use of it so that build jobs only depend on the container
job for the specific architecture.

[0]: https://docs.gitlab.com/ci/yaml/matrix_expressions/#matrix-expressions-in-needsparallelmatrix
2026-05-11 08:16:15 +00:00
Pauli Virtanen
db5cb6515a ci: use ASan/UBsan in bluetooth tests
Compile with sanitizers for the bluetooth tests, for better backtraces
on failures. Also produce backtraces via gdb.
2026-05-11 08:15:29 +00:00
Pauli Virtanen
ef35aa161b test: improve bluezenv test debug 2026-05-11 08:15:29 +00:00
Pauli Virtanen
1fc7ec2e3f ci: run bluetooth VM tests
The bluetooth VM tests require building BlueZ (specific version is
better than relying on FDO image version) and building pytest-bluezenv.

Build them and cache the results.
2026-05-11 08:15:29 +00:00
Pauli Virtanen
d12367e10e test: add VM-based full-stack bluetooth tests
Add tests that check PipeWire <-> PipeWire bluetooth audio streaming for
A2DP, BAP, HFP.  The tests use Qemu VMs and don't require Bluetooth
support from HW / kernel.

Full VM images are not required; similarly to BlueZ kernel tester these
use (read-only) mount of host filesystem.  A monolithic kernel image
with suitable config is required.  The bluetoothd binary installed on
host is used if found; otherwise tests are skipped.

These test depend on https://github.com/pv/pytest-bluezenv which manages
the VM setup.

To launch:

    python3 -m pip install pytest-bluezenv
    meson devenv -C builddir -w . python3 -m pytest test --kernel-build -v

which also builds a kernel image with required options.
2026-05-11 08:15:29 +00:00
Frédéric Danis
708cb6e2e8 bluez5: bap: Add bluez5.bap-server.ascs-announcement property
BAP/USR/ADV/BV-04-C test requires to advertise Audio Stream Control
Service properties with Targeted Announcement type.
2026-05-11 08:14:14 +00:00
Frédéric Danis
27cdac3cd6 bluez5: bap: Advertise ASCS properties
BAP/USR/ADV/BV-01-C test requires to advertise Audio Stream Control
Service properties with General Announcement type and supported
contexts values for sink and source which should be in sync with
the PACS values.
2026-05-11 08:14:14 +00:00
Vladimir Sadovnikov
5e9ecc3ce5 Fix compilation warning for Clang C++ 2026-05-11 08:13:29 +00:00
Barnabás Pőcze
dae3e92adc ci: make curl fail if response code is not appropriate
Use the `--fail{,-with-body}` options of curl to ensure that it will abort
the job if the resource cannot be fetched/submitted correctly.
2026-05-11 08:11:49 +00:00
Wim Taymans
b72f422f35 rtp: skip header extensions
When the header X bit is set, read the extension size and skip the
extension.
2026-05-11 09:25:31 +02:00
Wim Taymans
08d4e319cf avb: fix stack overflow in MRP parsing
AVB_MRP_VECTOR_GET_NUM_VALUES can be 13 bits and is stored in a
unit16_t. event_len and param_len are however calculated from this and
then truncated to 8 bits (uint8_t) which causes the bounds check to
silently pass and cause an OOB read.

Change the type to uint16_t to avoid overflows.
2026-05-08 18:13:12 +02:00
Wim Taymans
6c0a9b31f6 alsa: write silence in smaller chunks
With large quantum and many channels, the silence buffer can become
quite large (many MB), which can cause a stack overflow.

Use a fixed size silence buffer instead and write in smaller chunks.
2026-05-08 17:43:23 +02:00
Wim Taymans
0ac3cf3c88 alsa: fix warning about sign 2026-05-08 17:39:09 +02:00
Barnabás Pőcze
b9bae7fdcf spa: alsa: pcm: spa_alsa_clear(): clear pointers
Use `spa_clear_ptr()` to ensure that all freed pointers are cleared.
2026-05-08 15:27:54 +00:00
Barnabás Pőcze
c8462edf4b spa: alsa: pcm: log_write(): return early if log level is disabled
If the "debug" log level is not enabled for the "spa.alsa" log topic,
then there is no point in going into the loop and splitting the data
into lines, so skip that.
2026-05-08 15:27:54 +00:00
Barnabás Pőcze
cfe9c7d6ca spa: alsa: pcm: log_write(): don't use strcspn()
Do not use `strcspn()` because it assumes a null terminated string,
but the `fopencookie()` write callback receives a (ptr, length) pair.

So use `memchr()` instead to find the `\n`.
2026-05-08 15:27:54 +00:00
Barnabás Pőcze
bba43d4433 spa: alsa: pcm: log_write(): fix return value
The `fopencookie()` write callback should return the number of consumed
bytes, but it currently only ever returns 0, which signals an error
condition according to the documentation.

Fix that by not overwriting `size`.

Fixes: 73073eb33f ("alsa: redirect alsa output to log file")
2026-05-08 15:27:54 +00:00
Barnabás Pőcze
ff7b996596 treewide: mark fopencookie() vtable const
`fopencookie()` takes the vtable by value, so it can be marked `const`, so do that.
2026-05-08 15:27:54 +00:00
Barnabás Pőcze
8caea521d7 doc: compile tutorial programs
The programs in `doc/examples` are not compiled currently, so let's
compile them if the `docs` and `examples` options don't disallow it.

`tutorial4.c` needs a small modification to avoid `-Wfloat-conversion`.

Additionally, install them if `installed_tests` is not disabled.
2026-05-08 15:20:41 +00:00
Wim Taymans
b5d294eab0 dfffile: handle invalid channels and rate
Missing or malformed headers could cause unspecified channels or rate
that can cause crashes.
2026-05-08 17:12:54 +02:00
Wim Taymans
57770c7e18 midifile: handle some other read errors 2026-05-08 17:07:51 +02:00