Commit graph

14291 commits

Author SHA1 Message Date
Wim Taymans
c94aff8cae Revert "audio: bump max channels to 128"
This reverts commit c91f75ae2e.

This change causes a subtle ABI change and also breaks the Rust
bindings.
2025-10-20 09:17:26 +02:00
Wim Taymans
fb49759d1f module-echo-cancel: drop samples when source not ready
When we can't dequeue a buffer from the source stream, drop the samples
instead of leaving them queued in the ringbuffer.
2025-10-17 14:51:14 +02:00
Wim Taymans
f70b0892ea doc: swap the name and id of the device.product
Fixes #4935
2025-10-17 12:28:15 +02:00
Wim Taymans
3263e2497e 1.5.81 2025-10-16 10:07:11 +02:00
Pauli Virtanen
453ca31214 doc: update doxygen-awesome.css
Update doxygen-awesome.css to v2.4.1 (1f3620084ff7573) from upstream.

Link: https://github.com/jothepro/doxygen-awesome-css/
2025-10-15 20:39:14 +00:00
Pauli Virtanen
0b78a2d97c ci: bump Fedora version to Fedora 42
This brings newer Doxygen.
2025-10-15 20:39:14 +00:00
Pauli Virtanen
da2cecf074 alsa: acp: don't disable dB if negative max unless range is small
Disabling dB volumes for max_dB < 0 was added in Pulseaudio in 2021,
based on a device which had -128..-127.07 range. However, negative
max_dB is valid value for USB devices, and there are devices that have
it.

Eg. Microsoft LifeChat LX-3000 has

numid=6,iface=MIXER,name='Speaker Playback Volume'
  ; type=INTEGER,access=rw---R--,values=2,min=0,max=151,step=0
  : values=150,150
  | dBminmax-min=-28.37dB,max=-0.06dB

and the dB range seems to be OK. Web search for "The decibel volume
range for element" also gives other hits with seemingly OK looking
ranges.

Don't disable dB volume unless both the max is negative and the range is
suspiciously small. This should still disable it for the device this
check was originally added for.

Link: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/447
Link: 10ac01a206
2025-10-15 21:37:06 +03:00
Wim Taymans
a75cea96fb modules: port modules to timer-queue
Instead of using timerfd, use the context timer-queue to schedule
timeouts. This saves fds and removes some redundant code.

Make the rtp-source timeout and standby code a bit better by using
atomic operations.
2025-10-15 16:57:24 +02:00
Wim Taymans
b220f85790 module-rtp-sap: reorganize generation of SDP
Move the code to recalculate the hash and version into make_sdp. Add a
boolean argument to the make_sdp function. Recalculate the hash and
version when we are making a new SDP and leave the old values if we
are making an SDP to compare against the current one.
2025-10-15 14:08:24 +02:00
Wim Taymans
c40e0d1d98 module-rtp: unset ptp_fd or else we might close it 2025-10-15 14:05:29 +02:00
Wim Taymans
f91aed5eeb impl-link: pass error codes in link error state
Pass the error code when setting the link in the error state.

Add some more debug.
2025-10-15 11:20:01 +02:00
Wim Taymans
9b507d3210 context: add support for rlimit.<resource> = <value>
Add support for rlimit.<resource> = <value> in the context.properties to
adjust the rlimits of the process. A value of -1 sets the max limit.

This can be used to increase the number of file descriptors in a
pipewire process when select() is not used, for example. Other resource
limits might be interesting as well maybe.

Fixes #4047
2025-10-15 09:26:36 +02:00
Wim Taymans
9f2d873760 examples: set exclusive and reliable flags
We need exclusive port use if we negotiated SyncTimeline because there
can only be one consumer of the syncobj.

We also need to enable reliable transport if synctimeline is supported
but the release flag isn't.

Add some more logging to the port when the exclusive and reliable states
changed.

Fixes #4885
2025-10-14 11:56:22 +02:00
Wim Taymans
20d2a331be impl-node: add a NODE_RELIABLE property
Add a PW_KEY_NODE_RELIABLE and PW_KEY_PORT_RELIABLE property. the port
property value is inherited from the parent when not explicitly set.

Setting the property on a port will activate a more reliable tee, that
actually only recycles buffers that were consumed. It will also activate
a mode in stream that gives out new buffers only when the previous one
was recycled and nothing else is queued. This is necessary to avoid
queuing in the stream when the other side is not consuming.

When a link is async but the output node is a driver of the input, we
can avoid async io. This also removes a potential out-of-order buffer
recycling when the node resumes at a different cycle.

See #4885
2025-10-14 11:55:25 +02:00
Pauli Virtanen
c89acd3e1c alsa: acp: fix volume rounding down causing mute
Some ALSA devices have minimum HW volume value that is muted.  ALSA
indicates it with SND_CTL_TLV_DB_GAIN_MUTE = -9999999 dB/100 volume dB.
When rounding down to HW volume, we may get this muted value.

When determining splitting of volumes to mixers and soft volume, we
don't want HW mixers to set volume to muted, unless the target volume is
actually muted.

Fix by adding element_ask_unmuted_dB_vol() that rounds up if the asked
rounding mode resulted to mute.

This fixes mic getting muted at low volume despite ALSA reporting the dB
values correctly.

Fixes #4890
2025-10-14 08:02:23 +00:00
Pauli Virtanen
91702975f7 bluez5: media-sink: cleanup ISO rate matching
Move accounting for pending ISO packet to the reference time.  Make sure
rate matching is reset on start, and reset matching on resync properly.

Allow resync on first cycle, ok since iso_io->now is valid immediately.
2025-10-14 07:59:55 +00:00
Pauli Virtanen
4e3a5d9e6f bluez5: iso-io: initialize stream->size, now when setting cb
Ensure size and now have valid values after exiting
spa_bt_iso_io_set_cb(), so data may be provided already on first cycle.
2025-10-14 07:59:55 +00:00
Pauli Virtanen
4ca1d70979 bluez5: media-sink: fix silence padding for ISO stream resync
Silence padding larger than ISO packet may be needed for resync when
quantum is large. We can't insert silence by adding data to encoding
buffer, as the encoding buffer may be then too small and it may also be
partially filled.

Fix by inserting silence from flush_data() just before buffers would be
consumed.

Fixes ISO stream alignment at playback start.
2025-10-14 07:59:55 +00:00
Pauli Virtanen
8bf8600e59 bluez5: if Acquire results to NoReply, try to clean up with Release
If BlueZ doesn't reply, it may consider the operation still active.
Try to Release the transport to get to a known state.

This can happen if device doesn't respond to operations in reasonable
time and BlueZ doesn't have its own timeout which is the case for BAP
currently (which is a bug there).
2025-10-11 20:52:59 +03:00
Barnabás Pőcze
126d61db1b ci: build_on_debian: set test timeout multiplier
Some tests - for example test-fmt-ops - are compute heavy. Since tests
in non-x86 builds are run inside qemu, they can be significantly slower,
exceeding the default 30 second timeout.

So set the timeout multiplier to 2 to allow for slower execution.
2025-10-10 16:06:16 +00:00
Pauli Virtanen
c65e70fce0 doc: document missing api.acp.* properties 2025-10-10 18:30:26 +03:00
Wim Taymans
4da25df986 filter-graph: accept String param values
We parse the string as a float and if that works, set the value.
2025-10-10 15:03:04 +02:00
Jonas Holmberg
16ce5a2ccf filter-graph: Accept params of type Long
Integer numbers in lua are sent over protocol-native as Longs so make
sure to handle them.
2025-10-10 10:53:03 +00:00
George Kiagiadakis
2aa725e4fe audioconvert: accept prop params that are encoded as Long in the pod 2025-10-10 13:48:10 +03:00
Arun Raghavan
154ab33607 spa: alsa: Add option to use ELD-detected channels 2025-10-10 09:34:43 +00:00
Arun Raghavan
91e2f184e2 spa: alsa: Read and expose channel count and position from ELD
The next step will be to propagate this to the correct node.
2025-10-10 09:34:43 +00:00
Wim Taymans
d268b6e104 examples: add some options to enable features 2025-10-10 10:41:53 +02:00
Wim Taymans
bd6081018f tests: fix warning 2025-10-09 09:29:32 +02:00
Wim Taymans
b7b9e7dc6e tests: fix compilation 2025-10-09 09:22:07 +02:00
Arun Raghavan
a4ec02f9d7 spa: tests: Add an offline AEC benchmark 2025-10-09 00:16:51 +00:00
Barnabás Pőcze
dcdb88d7b7 spa: libcamera: device: adapt to libcamera change
The interface of string typed controls has recently been changed in
libcamera[0], which affects `properties::Model`, so adapt to that change
in such a way that is compatible with both the new and old versions.

[0]: f84522d7cd
2025-10-08 13:23:11 +02:00
Wim Taymans
4fb0a0aeea example: add sync timeline example
Add an example producer and consumer using the SyncTimeline metadata.
The syncobj are just eventfd for the purpose of the example.

Also demonstrate the RELEASE feature when negotiated.

Add some switches to tweak the SyncTimeline and features support.

See #4885
2025-10-08 12:53:30 +02:00
Wim Taymans
7d781e696f profiler: avoid null dereference
Avoid shadowing some variables from the parent block.

The node of a target can be NULL when the target is running in another
instance. We already do some checks for this but make sure we never
deref the NULL pointer.

Fixes #4922
2025-10-06 14:38:38 +02:00
Barnabás Pőcze
e4480cf804 ci: enable ffmpeg in build_on_debian
The dependencies are already installed, but since the ffmpeg related
meson options are set to `disabled`, they were not used.
2025-10-06 12:10:23 +00:00
Barnabás Pőcze
e72962fb42 pw-cat: do not use deprecated FF_PROFILE_*
These macros were deprecated in 2023[0], and are absent in the latest
ffmpeg 8.0[1]. So use the new names.

[0]: 8238bc0b5e
[1]: 8224327698
2025-10-06 12:10:23 +00:00
Wim Taymans
e9aef9196f examples: add example MemFd sink
Add an example of a filter sink that requires MemFd memory on the
input port. Show that it gets automatically mapped and that it contains
MemFd memory.

Fixes #4918
2025-10-06 13:37:59 +02:00
Wim Taymans
5ccaf29793 stream: only mmap buffers when not already mapped
Don't just blindly mmap the buffer but only when the data pointer
is NULL. If it was mapped already by the peer or the adapter or the
buffer allocation, we don't want to mmap it again and override the buffer
data pointer.

Also mmap with the permissions on the data. There is not much point in
limiting the permissions for an input port (to read only). We could do
this but then we would not be allowed to modify the existing data
pointer. The problem is that when the stream mmaps the data as READ only
and set the data pointer, if it is then handed to the mixer, it would
assume it is mapped with the permissions and then segfault when it
tries to write to the memory. It's just better to only mmap when the
data is NULL.
2025-10-06 13:17:00 +02:00
Wim Taymans
e7bc261830 filter: don't lock the Buffers param
It should be possible to override the Buffers params in the filter.
2025-10-06 13:16:32 +02:00
Wim Taymans
984b2d296e context: only make active nodes runnable
Only try to make active nodes runnable. This can happen when the node is
destroyed.

Avoids a -EIO error when destroying nodes from pavucontrol.
2025-10-06 11:48:40 +02:00
Wim Taymans
b66d49702f examples: avoid mmap in the example
We don't need to do this ourselves, the MAP_BUFFERS port flag already
makes sure this is done for use.

We used to have to do this here to ensure the mixer could find the data
pointer and not error out. Now that the mixer can MMAP, this can go.

See #4918
2025-10-06 11:17:08 +02:00
Wim Taymans
af3ad7bf9f buffers: improve allocation
There are really 2 options for the buffer allocation:

1. allocate the buffers skeleton and meta/chunk/data in malloc memory.
   This is when the PW_BUFFERS_FLAG_SHARED is unset.
2. allocate buffers skeleton in alloc memory and the meta/chunk/data
   in shared memory when the PW_BUFFERS_FLAG_SHARED is set.

Optionally the data can be left unallocated in both cases when the
PW_BUFFERS_FLAG_NO_MEM is set. In this case we also need to pass the
SPA_BUFFER_ALLOC_FLAG_NO_DATA flag to allocator or else it will set the
data pointers to 0 sized memory in the skeleton.

If we use SHARED and we allocated memory, we can also set the MemFd and
mapoffset into our shared mem. We can do this even if the data_type is
MemPtr.

We can decide on the datatype to use earlier, based on the negotiated
flags. In the MemFd case, make sure the buffer data is page aligned in
that case to make things easier. Also force everything in SHARED mem
when the data is in SHARED mem. We also don't need to
PW_BUFFERS_FLAG_SHARED_MEM because we work with the negotiated flags
now to decide if SHARED mem is needed or not.

With this change, a node port could provide a MemFd data_type mask in
the Buffers param and this would negotiate shared mem with the mixer.
Previously, it would only ever allocate malloc memory.

See #4918
2025-10-06 10:58:19 +02:00
Wim Taymans
1a54b9e66f impl-port: handle errors from the mixer use_buffers
Also handle errors when we fail to set mixer buffers on the output port
of the mixer.
2025-10-06 10:38:08 +02:00
Wim Taymans
aede3d049c buffer: update comment, we have flags now 2025-10-06 10:31:52 +02:00
Gabriel Golfetti
df2f36ad8f Add support for mappable buffers in mixer-dsp 2025-10-04 10:04:50 +00:00
Wim Taymans
fe78e80614 tools: fix compilation after removal of field 2025-10-02 16:39:18 +02:00
Wim Taymans
0b0226322f examples: add DSP sink example
Add example of ALLOC_BUFFERS on the input port.

See #4918
2025-10-02 16:26:27 +02:00
Wim Taymans
4161fa3071 impl-port: also honour CAN_ALLOC flag between mixer/node
When we have a mixer node and we need to negotiate buffers between the
mixer and the node, take the CAN_ALLOC flag into account.

This is for input ports, which can have a mixer. If you make a filter
with a CAN_ALLOC input port, it will now not already contain buffer
data.

See #4918
2025-10-02 16:26:27 +02:00
Wim Taymans
1fdde582c0 buffers: add some more comments to the flags 2025-10-02 16:26:27 +02:00
Carlos Rafael Giani
83ee3021e9 spa: Remove channel field from spa_audio_info_mpegh structure
A fixed channel count makes no sense with an entity based 3D audio format
like MPEG-H, because MPEG-H decoders do not simply decode; they
"spatialize" the entities, meaning that said entities are decoded and
rendered accordingto the needs of the target playback system and its
channel count.
2025-10-02 12:12:53 +02:00
Carlos Rafael Giani
52041e888c meson.build: Make libswscale a requirement only if videoconvert is enabled 2025-10-02 12:05:07 +02:00