Commit graph

14175 commits

Author SHA1 Message Date
Barnabás Pőcze
b124385fac pipewire: module-rt: remove sched_set_nice()
It has only a single caller, so inline it because
there is not much point in keeping it separate.
2025-07-12 19:55:34 +00:00
Barnabás Pőcze
b71d0224db pipewire: module-rt: remove check for impossible condition
Neither `sched_set_nice()` nor `pw_rtkit_make_high_priority()`
(should) ever return a positive number, so that case is not
possible; remove it.
2025-07-12 19:55:34 +00:00
Barnabás Pőcze
7a336645fb pipewire: module-rt: get_rtkit_priority_range(): return void
This function cannot fail, so make it return `void`.
2025-07-12 19:55:34 +00:00
Barnabás Pőcze
801ac5ced8 pipewire: module-rt: simplify check_rtkit()
The return value is always 0, and the `impl` parameter
is not used, so ues the return value to return the boolean
result instead of an out parameter, and get rid of the
unused argument.
2025-07-12 19:55:34 +00:00
Barnabás Pőcze
10161407ff pipewire: module-rt: move RLIMIT_RTTIME compat definition
Move it next to the other macros.
2025-07-12 19:55:34 +00:00
Barnabás Pőcze
f0579b9b67 pipewire: module-rt: deduplicate log message 2025-07-12 19:55:34 +00:00
Barnabás Pőcze
c4984e33b2 pipewire: module-rt: use spa_autoptr for properties 2025-07-12 19:55:34 +00:00
Barnabás Pőcze
3b4f37ac92 pipewire: module-rt: fix function brace style 2025-07-12 19:55:34 +00:00
Barnabás Pőcze
7eb98a31bb pipewire: module-rt: define SCHED_RESET_ON_FORK if not available
Instead of using a new macro with the `PW_` prefix, simply define
`SCHED_RESET_ON_FORK` to be `0` when it is not defined; as the
prefixed variant can be a bit confusing.
2025-07-12 19:55:34 +00:00
Barnabás Pőcze
279b7ee698 pipewire: module-rt: use "tid" instead of "pid" for thread ids 2025-07-12 19:55:34 +00:00
Barnabás Pőcze
13fe4a5a57 pipewire: module-rt: use sizeof(variable) instead of sizeof(type) 2025-07-12 19:55:34 +00:00
Barnabás Pőcze
ca47d0ef15 spa: vulkan: map VK_INCOMPLETE to ENOSPC
`VK_INCOMPLETE` means "A return array was too small for the result",
so map it to `ENOSPC` since that describes it better than `EBUSY`.
2025-07-12 19:54:14 +00:00
Barnabás Pőcze
72f1719c95 pipewire: thread: check sched_get_priority_*() return value
The function can report errors, so let's propagate them.
2025-07-12 19:53:45 +00:00
Barnabás Pőcze
d17f68c047 pipewire: thread: impl_join(): return negative error code
`pthread_*` functions return a positive error code, but
a negative one is expected, so negate the return value.
2025-07-12 19:53:45 +00:00
Barnabás Pőcze
331bb2f1ed spa: debug: SPA_TYPE_Id is unsigned
The underlying type of `SPA_TYPE_Id` is `uint32_t`, so access
and print it as such.
2025-07-12 19:52:43 +00:00
Barnabás Pőcze
49d9d5e618 spa: param: video: add missing type info for color params
Add the missing type info for:

  * SPA_FORMAT_VIDEO_colorRange
  * SPA_FORMAT_VIDEO_colorMatrix
  * SPA_FORMAT_VIDEO_transferFunction
  * SPA_FORMAT_VIDEO_colorPrimaries
2025-07-12 21:18:23 +02:00
Arun Raghavan
51d4d5ec3c gst: pipewiresrc: Expose cursor position as a ROI meta 2025-07-11 11:57:59 -04:00
Frédéric Danis
067e29543a bluez5: backend-native: Fix call held hangup
Currently it's not possible to hangup a call place on hold, and
request user to swap calls before been able to hangup.
2025-07-11 10:42:03 +02:00
Wim Taymans
74e576c31a filter-graph: don't pass NULL label around
lv2 does not have a label, make sure we pass "" around like befor
because code does not expect this to be NULL.
2025-07-10 18:10:51 +02:00
Wim Taymans
a188f1d29f pod: remove alignment checks
We currently often create pods in a uint8_t buffer, which is not aligned
to 8 and might cause deref and other problems.

We should either align the buffer we write into or maybe make the
builder add some padding before the buffer to align it. We have to be
careful with that when we assume the buffer start is the beginning of
the pod..

Fixes #4794
2025-07-10 16:56:26 +02:00
Wim Taymans
20a4aa8cf9 modules: remove v0 protocol support 2025-07-10 16:26:01 +02:00
Pauli Virtanen
ae7a893ce9 bluez5: aac: fix for A2DP v1.4 using rfa bits for more channels
A2DP v1.4 uses the rfa bits for adding 5.1 and 7.1 configurations.
Clear those bits properly when sending configuration, in case remote
device sets them.
2025-07-10 14:12:15 +00:00
Robert Mader
7e202a3844 spa: libcamera: add colorimetry support
Libcamera equivalent to 41b831d0f ("spa: v4l2: add colorimetry support")
2025-07-10 14:11:41 +00:00
Demi Marie Obenour
c54fdb76f8 protocol-native: check for NULL strings
SPA_POD_String allows NULL strings, so check for them.
2025-07-10 14:08:56 +00:00
Demi Marie Obenour
adb3a55703 protocl-native: v0: Fix integer overflow to buffer overflow
Too many dict items could cause an integer overflow leading to a
stack-based buffer overflow.
2025-07-10 14:08:15 +00:00
Demi Marie Obenour
9a66938283 pulse: don't ignore return value
If a function can fail don't pretend it succeeded.
2025-07-10 14:06:05 +00:00
Demi Marie Obenour
3c3ead2784 gst: whitespace fix
No functional change.
2025-07-10 14:05:23 +00:00
Demi Marie Obenour
32b8e5f500 src: use correct format string for uint32_t
<inttypes.h> provides the correct and portable format string to be used.
2025-07-10 14:03:44 +00:00
Demi Marie Obenour
b3bf5be1f6 *: Avoid macros that use casts where possible
Use direct field access when the type is known, instead of a macro that
includes a cast.

These were missed in e4fcbef89a.
2025-07-10 14:02:55 +00:00
Barnabás Pőcze
5cf84fa3fe spa: debug: pod: print custom properties with more detail
Previously, custom object properties were printed as "unknown",
and the offset (wrt. `SPA_PROP_START_CUSTOM`) was not displayed.
A custom property is distinct from an "unknown" one. Being able
to quickly differentiate the two is useful. Furthermore, knowing
the custom property id (i.e. the actual numeric id minus
`SPA_PROP_START_CUSTOM`) is also very helpful.

To address the above, print a custom property (i.e. anything with
an id at least `SPA_PROP_START_CUSTOM`) as follows:

  Spa:Pod:Object:Param:Props:Custom:123

where the last component is the custom property id.
2025-07-10 14:01:50 +00:00
Barnabás Pőcze
4a92ec35a6 spa: debug: pod: use the appropriate format specifiers
Use the appropriate format specifiers wrt. the signedness of the type,
as well as use the `PRI*N` macros for the `[u]intN_t` types.
2025-07-10 14:01:50 +00:00
Wim Taymans
b4f97c62c6 filter-graph: support more complicated labels
If we see a container as the label, copy the whole container and use
that as the label.

The label is used to construct a plugin description.
2025-07-10 13:47:29 +02:00
Wim Taymans
5ca74996f0 filter-graph: allow setting a fixed rate
It's possible to make the filter streams resample to a specific rate
before running the graph.
2025-07-10 13:47:23 +02:00
Arun Raghavan
eec1ac20b7 spa: aec: webrtc: Expose echo canceller mobile_mode
Significantly better CPU performance in lieu of canceller quality. Not
implemented for 0.x series, as there's a lot more to enable there (such
as routing modes), and I am hoping to drop support for those versions
before too long.
2025-07-09 13:02:18 -04:00
Arun Raghavan
477674740e spa: aec: webrtc: Drop outdated comment
The Intelligibility enhancer was removed, so the FIXMEs are irrelevant.
2025-07-09 12:48:24 -04:00
Arun Raghavan
a328e0ae28 spa: audioconvert: Avoid reading past filter-graph param name end
Ensure we have at least a `.` after `audioconvert.filter-graph`, so we
don't try to read past the end if it does not exist.

Also document in the param name that an index is expected.
2025-07-09 15:20:09 +00:00
Arun Raghavan
8f429ac04b spa: aec: webrtc: Actually enable echo cancellation for 2.0 2025-07-09 08:54:36 -04:00
Wim Taymans
e8dbd328d8 doc: fix a typo 2025-07-09 14:13:56 +02:00
Wim Taymans
241147968e doc: add FOSDEM talk 2025-07-09 14:13:34 +02:00
Jonas Holmberg
85ff73d690 echo-cancel: reset buffers when deactivating
Reset buffers when deactivating to avoid having old data in the
ringbuffers, which also adds latency when activated again.

Clear sink_ready and capture_ready when resetting buffers to avoid
calling process() before there is new data to process.
2025-07-09 10:20:51 +02:00
Wim Taymans
0efd0258a7 filter-graph: rename the plugin files
Move the plugin prefix to the front like everywhere else and this also
makes it easier to spot the plugins when listing the directory.
2025-07-08 16:18:13 +02:00
Robert Mader
9debb4b814 gst: pipewireformat: Validate fourcc before converting to string
gst_video_dma_drm_fourcc_to_string() asserts when called with
DRM_FORMAT_INVALID.
2025-07-08 11:38:28 +00:00
Frédéric Danis
80d44e8f39 bluez5: backend-native: Fix incorrect dial number management
When dialing an incorrect phone number some phones (e.g. iOS 18.5)
replies with OK but never send +CIEV updates, so there's no way to
know that the dial is not in progress and the call object should be
removed.

This change waits for +CIEV event to create the call object.
2025-07-08 11:37:45 +00:00
Albert Sjolund
2581575bd1 gst: fix leak in sink_update_params
buffer_pool_get_config returns a copy of the config structure, but it is
never freed in this function. Add a gst_structure_free to fix the leak
2025-07-08 13:07:44 +02:00
Wim Taymans
d3eb06ab74 pod: improve array copy function
Make a new function to also returnt he child size and type.

Make a new function that accepts the array item size. Check that the
array item size and destination item size match before memcpy the array
contents. This avoids overflowing the target array with a malformed
array pod.
2025-07-08 10:11:11 +02:00
Wim Taymans
ce2f9eebb4 pod: avoid checking size or alignment
For the embedded children, they will always be aligned. We can also
avoid the max size checks for children because this is already checked
for the parent and with the remaining size check.

For arrays and choice we simply don't get any elements in the array when
the sizes are too large.
2025-07-08 10:06:51 +02:00
Wim Taymans
289b33281f pod: check size before getting pod contents
Before accessing the pod contents, check if the size is at least what we
expect it to be or else we might read out of bounds.
2025-07-07 19:40:24 +02:00
Julien Massot
8aa836d588 alsa-pcm: add support for api.alsa.dll-bandwidth-max
In USB Audio Class 2 (UAC2) setups, pitch control is handled by
feedback endpoints. The host adjusts its data rate accordingly.

When pitch control is active (pitch_elem), applying the default
delay-locked loop (DLL) bandwidth can lead to instability and
oscillations around the target rate.

This patch adds a new parameter, api.alsa.dll-bandwidth-max, to
configure the maximum DLL bandwidth. It introduces a new field
in the ALSA state to store this value.

By default, it uses SPA_DLL_BW_MAX, but when pitch control is in
use, setting it to a lower value (e.g. 0.02) helps ensure better
stability, based on empirical testing.
2025-07-07 10:40:11 +00:00
Wim Taymans
deb7dddbef test: format float values with .
Depending on the locale, the decimal separator can be , or .
We need it to be . in all cases or else the checks for the expected
value might fail.
2025-07-07 12:09:55 +02:00
Wim Taymans
5f4b4b02f9 pod: remove the ALIGNED from the pod struct
We don't really want to do this here otherwise structs that include a
pod will be padded so that an array of those structs will be aligned.

This makes a test case fail where we have a struct with a choice_body
followed by 3 uint32_t enum values. The size with and without the
aligned attribute is different.
2025-07-07 12:07:05 +02:00