Commit graph

11699 commits

Author SHA1 Message Date
Wim Taymans
1b09c4a2cc filter-chain: add more math functions
Add clamp, recip, exp, log
2023-10-22 09:41:05 +02:00
Pauli Virtanen
528c7c0f22 bluez5: set BAP Locations/Context endpoint properties
BlueZ now requires endpoints to set Locations/Context, so set them to
some sensible default values. These could in principle be made
configurable later.
2023-10-21 13:38:27 +03:00
Wim Taymans
3eed0fbe9b gst: mark streams async
From the process callback we signal a cond and don't dequeue/queue
a buffer directly.
2023-10-21 09:42:15 +02:00
Wim Taymans
93d5848031 module-echo-cancel: playback and source are async
The playback and source streams don't dequeue/queue buffers from
the process function and so need to be marked async.

Fixes #3593
2023-10-21 09:27:43 +02:00
Wim Taymans
0ff4844d87 filter-chain: remove some debug 2023-10-20 20:39:06 +02:00
Wim Taymans
8a9a4723f2 filter-chain: add linear transform filter
Transforms samples or control with v * mult + add
2023-10-20 20:37:50 +02:00
Wim Taymans
07696d5d57 filter-chain: also handle notify ports as dependencies
The links from the notify ports to other nodes decrement the
dependencies.

See #3596
2023-10-20 17:29:55 +02:00
Wim Taymans
80afa3a296 impl-link: fix log 2023-10-20 16:18:41 +02:00
Wim Taymans
81437f7a77 impl-link: refactor function to update busy_count
This also makes sure the busy_count of a previous busy_id is undone when
setting a new id.

Also logs an error when the busy count goes negative.
2023-10-20 15:11:46 +02:00
Wim Taymans
5a93d77acf impl-link: ensure busy_count and busy_id stay in sync
We can only increment or decrement the busy_count with a valid busy_id.

In complete_ready and complete_paused, the id can be INVALID and if
there was no pending busy_id, it would decrement the busy_count below 0.

This would block the link from progressing its state change.

See #3547
2023-10-20 12:26:41 +02:00
Wim Taymans
3d8c7c40b5 stream: improve queued_buffers reporting
Also add the queued buffers in the converter to the pw_time.queued_buffers
field. This means that queued_buffers + avail_buffers always equal the
total amount of allocated buffers, which makes more sense.

Fixes #3592
2023-10-20 09:57:52 +02:00
Wim Taymans
cb26ea2dfa conf: add missing =
Fixes #3589
2023-10-20 07:52:21 +02:00
Wim Taymans
b92b66cf5b jack: refactor function to get buffer data
Split out the function to get the buffer data.
Don't process mix with invalid id.
Check global_mix and io before processing the mix.
2023-10-19 16:06:14 +02:00
Wim Taymans
6fd7f39dbe 0.3.83 2023-10-19 13:10:50 +02:00
Wim Taymans
6ef8d31f55 jack: only set io in NEED_DATA after complete
Don't set the port io to NEED_DATA in prepare_output because this
might be called when we get the data from an input port that is linked
to out output port.

See #3514
2023-10-19 12:29:00 +02:00
Wim Taymans
13f52f4297 jack: don't require global-mix in prepare_output
We can directly use the port io, which is always available. This ensures
the mix->io status is set to NEED_DATA even when there is no global
mix.

This reverts part of 56786aedc4

See #3514
2023-10-19 12:20:58 +02:00
Wim Taymans
27426e12c5 meson: add FASTPATH again
It got accidentally removed
2023-10-19 11:31:51 +02:00
Wim Taymans
771f71f622 alsa: force the rate and quantum for iec958 formats
See #2284
2023-10-19 10:43:42 +02:00
Wim Taymans
42418bece5 impl: destroy node and device in global free
Destroy the node and device in the global free event. This way, the
global resources are already destroyed and we have removed their ref to
the spa node before we destroy that.

Fixes #3588
2023-10-18 18:51:48 +02:00
Wim Taymans
c9c98312cb alsa: don't limit reads to avail
The ringbuffer can warp around and then there is really more available.
2023-10-18 15:44:07 +02:00
Wim Taymans
db5516ccd8 alsa: limit read to available frames
We calculate the available frames in read_sync but add another
check in read_frames so that we don't attempt to read more frames
than we have available to avoid xruns.
2023-10-18 14:59:40 +02:00
Wim Taymans
a595d3dddb alsa: after a resync, reset the dll
Otherwise we might still be overcompensating for the previous errors and
generate more errors.

Fixes #3584
2023-10-18 14:49:46 +02:00
Wim Taymans
6b8c267e91 alsa: improve headroom calculations
Make a function to recalculate the headroom and call it whenever the
resample state of the node can change.

When we are IRQ based scheduling but need to resample, we are actually
not driving the graph whit IRQ and need to adjust our period size and
headroom as if we are using timers.
2023-10-18 14:45:47 +02:00
Wim Taymans
2e066e6b1e alsa: only use avail_update when woken up with IRQ
When we are following a different clock or resampling, use update
to get more accurate update results.
2023-10-18 14:42:33 +02:00
George Kiagiadakis
8735d07c0a combine-stream: add support for "on-demand" streams
Instead of just following static target match rules to create output streams,
this feature allows the user to dynamically create more output streams
with custom targets using metadata.
2023-10-17 19:38:03 +03:00
Wim Taymans
69d0f586b2 jack: use a separate thread for notify
Some jack clients will take a lock before doing IPC and then will
take the same lock in a notify callback. This prevents the IPC from
progressing and causes a deadlock.

Make a separate thread to dispatch the notify so that we don't block the
IPC in any case.

Fixes #3585
2023-10-17 13:05:19 +02:00
Wim Taymans
40cc2f7068 jack: don't wait for mix_set_io
Some jack clients like to lock the process function and so we can't be
sure we will deadlock while we try to wait for the data-loop.

Instead, don't sync with the data-loop when setting the mix-io, it will
happen later when it is possible. Queue a free operation of the memmap
after the mix_set_io if we need to clean up.

See #3585
2023-10-17 13:01:53 +02:00
Pauli Virtanen
f89757e1f6 module-access: add access.socket option + legacy mode, remove other options
Add access.socket option, which sets PW_KEY_ACCESS based only on which
socket the client connected from.

Remove the executable-based permissions and all old options.  Add
access.legacy=true option that enables the old default behavior.  The
legacy mode cannot be used together with the socket-based access.

Emit warnings if any of the removed old options have been set.

Set pipewire.sec.flatpak=true for Flatpak applications.

The socket-based access ignores PW_KEY_CLIENT_ACCESS and the Flatpak
status when setting PW_KEY_ACCESS.  Dealing with them becomes
responsibility of the session manager (or equivalent) which processes
the permission rules.

Make the default access.socket value compatible with the
module-protocol-native default two-socket configuration.

However, if neither access.socket or access.legacy is specified, we will
for now use the legacy mode for backward compatibility.
2023-10-16 22:17:44 +03:00
Pauli Virtanen
3d32291711 module-protocol-native: use two-socket server by default
If no socket configuration specified for a server, create two sockets,
"CORENAME" and "CORENAME-manager" where CORENAME is the value computed
by get_server_name.
2023-10-16 22:17:44 +03:00
Wim Taymans
67c32ec3c2 audioadapter: don't clear format when EnumFormat changes
Don't blindly clear the format when EnumFormat changes. This will
just stop the node without renegotiating.

We should probably find a new best format, check if it changed and
then Stop/configure/Resume the follower with the new format.

This fixes a stall when a node is running and you change the allowed
codecs.
2023-10-16 18:23:49 +02:00
Wim Taymans
19b02003b0 context: relax quantum change conditions
We can change the quantum of a node while it is running just fine so
relax the check.

This was copied from the rate change logic, which is avoided while the
node is running.

This fixes a regression in dynamic quantum switching.

Fixes #3574
2023-10-16 16:29:01 +02:00
Wim Taymans
7ecea07a63 audioconvert: use alternative store to avoid ASAN errors
See #3572
2023-10-16 12:59:41 +02:00
Wim Taymans
16ad067cc9 audioconvert: use spa_write_unaligned
Use a macro to write out unaligned data to avoid ASAN errors.

See #3572
2023-10-16 12:21:33 +02:00
Wim Taymans
7d5b809b19 jack: make option to make input writable 2023-10-16 11:40:03 +02:00
Wim Taymans
d2b6a76798 modules: the combined streams are always async
We never trigger processing from their callbacks in all cases so they
need one extra buffer.
2023-10-16 10:42:39 +02:00
Wim Taymans
840a9487a4 alsa: don't try to link when prepare fails 2023-10-16 10:32:51 +02:00
Wim Taymans
8f2ee0a29c Revert "jack: use a private writable mapping on input"
This reverts commit 6fefd49a8a.

We can't use PRIVATE because mmap docs say that we then might not see
changes in the data anymore from other processes.

Fixes #3575
2023-10-16 09:36:16 +02:00
columbarius
886ca8f004 build: increase required vulkan version
We require VK_EXT_KHR_synchronization_2 to build, which seems to be
added to libvulkan at 2.1.170 [1].

[1] 1d99b835ec
2023-10-15 20:32:57 +00:00
columbarius
6064e5087e build: Restructure vulkan dependency handling and assert headers
vulkan_headers was a workaround for distributions providing pkg-config information
without the headers. Replacing it with a more conventional have_vulkan
and assert header availability if the option vulkan is enabled.
2023-10-15 20:32:57 +00:00
Wim Taymans
82b2515af3 test: avoid left shift on signed values
See #3572
2023-10-15 22:27:44 +02:00
Wim Taymans
2bef057428 audioconvert: avoid unaligned read
See #3572
2023-10-15 22:20:54 +02:00
Wim Taymans
fdc1391b19 audioconvert: avoid unaligned reads using memcpy
See #3572
2023-10-15 22:09:44 +02:00
Wim Taymans
cc109843e5 audioconvert: avoid unaligned writes and left shift of neagtives
See #3572
2023-10-15 21:12:23 +02:00
Wim Taymans
20b336b1d7 audioconvert: avoid unaligned writes
See #3572
2023-10-15 21:03:52 +02:00
Barnabás Pőcze
80572a6fbc audioconvert: don't left shift negative values
See #3572
2023-10-15 21:00:01 +02:00
Wim Taymans
b2c24f3435 audioconvert: fix unaligned writes
Avoid some optimizations that cause unaligned writes.

See #3572
2023-10-15 20:52:54 +02:00
Wim Taymans
bdd577c360 Revert "audioconvert: fix unaligned address"
This reverts commit ae3798abaa.
2023-10-15 20:49:31 +02:00
Wim Taymans
ae3798abaa audioconvert: fix unaligned address
See #3572
2023-10-15 20:40:30 +02:00
Wim Taymans
f3942fca29 audioconvert: fix unaligned writes
Use 16 bits writes for 16 bits samples or else we might be doing
unlaigned writes.

See #3572
2023-10-15 19:10:45 +02:00
Wim Taymans
9e547753ad Try to fix ci 2023-10-15 18:43:06 +02:00