Barnabás Pőcze
5802826966
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-05-12 21:12:37 +02:00
Wim Taymans
7cfcb46fbf
tests: do channelmix_free after channelmix_init
2026-05-12 13:10:21 +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
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
Wim Taymans
e286061df4
fix some compilation problems
2026-05-11 11:59:54 +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
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
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
Martin Geier
c7f2f0dc73
audioconvert: update rate also for nodes with disabled resampler
...
When the graph rate changes it is possible that the follower node can
renegotiate to the new suggested audioconvert rate without requiring
resampling and so the extra check for the disabled resampler is not
required.
Fixes #4933
2026-05-08 15:56:05 +02:00
Wim Taymans
136fc59765
bluez5: avoid heap overflow in AAC decoder
...
aacDecoder_DecodeFrame expects the number of destination INT_PCM samples,
not bytes. Since INT_PCM is int16_t (2 bytes), passing dst_size in bytes
tells the decoder the buffer is 2x larger than reality.
Note that we don't need to care about the number of channels in this
size, the decoder will do that for us.
2026-05-08 13:01:03 +02:00
Wim Taymans
5b37b9cf99
filter-graph: remove the pipe filter
...
It's a terrible idea, doesn't work so well (locks up the data-loop when
read is blocked) and a security mightmare. If you really need to pipe
samples through some program, do that somewhere else, like from the
command line with pw-cat and pw-record.
2026-05-08 10:16:12 +02:00
Barnabás Pőcze
ddab12a5aa
bluez5: cancel RegisterApplication calls when adapter goes away
...
If an adapter's removal is processed before the pending `RegisterApplication()`
dbus calls return, then those pending calls are not cancelled, and when the
(error) replies arrive, the callbacks will run into use-after-free issues
since they reference the removed adapter.
See #5096
2026-05-08 07:11:52 +00:00
Wim Taymans
85decefbef
filter-graph: move the pipe plugin to separate .so
...
It's quite dangerous to allow it to be loaded dynamically into the
pulse server so block it. The other plugins should be safe to load.
2026-05-07 14:37:44 +02:00
Wim Taymans
143af979ab
filter-graph: error when there are no valid nodes
...
The nodes might have failed to load or there was an empty array or the
array did not contain objects.
2026-05-07 13:30:41 +02:00
Wim Taymans
eadaa2608a
alsa: clear output and log file after doing alsa API
...
Also be a bit more careful when the handles are NULL.
2026-05-06 16:05:30 +02:00
Wim Taymans
91755950dd
spa: improve error handling
...
Use impl_clear to clean up partially allocated handles. Make sure we
only clean up the initialized parts.
2026-05-06 14:20:52 +02:00
Wim Taymans
3e53487c72
bluez5: fix cleanup
...
Clean up the transport listener and the codec_props on error.
Also clean up when the timerfd allocation fails.
2026-05-06 14:03:18 +02:00
Wim Taymans
7254b8288f
alsa: clean up the impl on errors
2026-05-06 13:59:43 +02:00
Wim Taymans
51b635cc98
modules: convert snprintf to strbuf
...
Use spa_strbuf instead of snprintf to handle errors better.
2026-05-06 13:35:09 +02:00
Wim Taymans
b66614063d
avb: use safer strbuf to construct strings
2026-05-06 13:09:03 +02:00
Wim Taymans
8276d615ba
filter-graph: handle fcntl errors better
...
Don't set invalid flags when the F_GETFL failed.
2026-05-06 12:47:44 +02:00
Wim Taymans
fed4d14ab7
vulkan: check for fcntl errors
2026-05-06 12:45:37 +02:00
Wim Taymans
d33466a340
bluez5: fix wrong use of F_GETFL and F_SETFL
...
The pattern is to F_GETFL the flags, then clear the NONBLOCK flag and
then F_SETFL the new flags.
2026-05-06 12:22:39 +02:00
Wim Taymans
195c048d1c
audioconvert: use strbuf to construct the channel names
...
This handles overflow and errors correctly, unlike snprintf which might
return -1 or the size that would have been written if truncated, causing
overwrite later.
2026-05-06 11:57:52 +02:00
Wim Taymans
bceaf1a212
vulkan: handle mmap failure
2026-05-06 11:57:52 +02:00
Wim Taymans
59a5392850
vulkan: fix the open() flags
...
The second argument are the flags, the mode is not needed for
RDONLY. Accidentally works because O_RDONLY is 0 but ignored the
O_CLOEXEC flags.
2026-05-06 11:57:52 +02:00
Barnabás Pőcze
eec372ba9d
bluez5: require RegisterApplication() support
...
The `{Un}Register{Endpoint,Player}()` functions of the `org.bluez.Media1`
interface were deprecated with the introduction of the `{Un}RegisterApplication()`
functions[0][1]. Fallback to the deprecated interfaces has been present for a
long time in pipewire, but those parts in their current form are prone to
use-after-free issues (#5096 ). Instead of fixing them, remove them as they
have been deprecated for a long time. The first version of bluez that supports
the new interfaces is 5.51, released on 2019-09-19 [2].
[0]: https://git.kernel.org/pub/scm/bluetooth/bluez.git/commit/?id=65bd68b907a95b4748df6929383a833ecfb4b660
[1]: https://git.kernel.org/pub/scm/bluetooth/bluez.git/commit/?id=01f8fc2997524d85817adb8176e542bac9d0cdfa
[2]: https://git.kernel.org/pub/scm/bluetooth/bluez.git/commit/?h=5.51&id=6de4bdb957cdc85d89851420ab06ca8e226f8d4e
2026-05-05 18:40:13 +02:00
Pauli Virtanen
31f0300c48
bluez5: fix wrong use of send_with_reply in HFP backends
...
The pattern if (!send_with_reply(...)) leaks DBusPendingCall and is
UAF prone.
Replace these with proper tracking and cancellation of the pending
calls in HFP backends.
2026-05-05 16:20:34 +00:00
Pauli Virtanen
81470db44f
bluez5: lc3plus: add missing #include
2026-05-05 16:20:34 +00:00
Wim Taymans
f57a2e9680
loop: add spa_goto_if_fail and use in loop_enter
...
When we lock and enter the loop but it is not the right thread, unlock
it again after logging an error. Otherwise we might deadlock.
2026-05-05 17:50:39 +02:00
Wim Taymans
c8b9b44d40
alsa: clean up the pitch element on errors
2026-05-05 14:15:13 +02:00
Wim Taymans
dd695ee5a7
modules: handle allocation errors gracefully
2026-05-05 13:10:21 +02:00
Wim Taymans
24f9b9a335
acp: handle channel map allocation errors
2026-05-05 13:09:41 +02:00
Wim Taymans
7bfc820ae8
filter-graph: handle allocation errors and do cleanup
...
Make sure clean up everything on error.
2026-05-05 12:53:10 +02:00
Wim Taymans
9972df2614
convert: use static string for convertname
...
We only use it for debugging and checking if it's the default
converter.
2026-05-05 12:51:55 +02:00
Wim Taymans
06ba2f792d
bluez5: handle fd allocation errors
...
For the timers, only set the data after we allocated the fd because this
is checked to free the fd again later.
2026-05-05 11:37:18 +02:00