Commit graph

11533 commits

Author SHA1 Message Date
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
Pauli Virtanen
44a166c288 bluez5: use bigger fallback SCO mtu if kernel doesn't tell us
Use bigger fallback maximum MTU, when kernel fails to tell us, which
shouldn't happen but apparently can. We choose the packet size based on
incoming data, so these values aren't usually needed so we can just bump
them.

Also report errors as necessary.
2023-10-15 16:31:17 +00:00
Pauli Virtanen
ca0e886159 spa: support: allow spa_log_xxx(NULL, ...) again with UBSan
Calling the spa_log_xxx macros with NULL log used to be allowed,
and it's used in some tests.

Write the NULL check in a way the compiler can understand and make UBSan
a happy UBSan.
2023-10-15 16:20:17 +00:00
Pauli Virtanen
960ca82552 spa: deduplicate test-helper.h 2023-10-15 16:20:17 +00:00
Barnabás Pőcze
c47df433f7 ci: set some ASan and UBSan options
This is needed in part for UBSan to make tests actually
fail on encountering undefined behaviour.
2023-10-15 16:19:30 +00:00
Hector Martin
fd969dab28 alsa: Ignore PCM devices with udev env ACP_IGNORE
When checking that a card has all of its PCM devices available, ignore
any specific device with the ACP_IGNORE udev environment variable. This
mirrors how we ignore whole cards, but specifically allows non-PipeWire
software to own specific PCM devices.

Note that this does not actually stop PipeWire from using those
subdevices right now, we assume UCM configs take care of that. This
should probably be implemented later to ensure PipeWire always stays
away from them, but for now this fixes the issue where it refuses to
probe the entire card.

Fixes: #3570

Signed-off-by: Hector Martin <marcan@marcan.st>
2023-10-14 14:14:10 +09:00
Wim Taymans
6fefd49a8a jack: use a private writable mapping on input
See #3571
2023-10-14 12:23:39 +02:00
Wim Taymans
c94d5d9d34 audioconvert: improve allocation
Don't try to allocate each time port buffers are set but only once
before we start procesing.

Also allocate enough temp buffers are there are ports. This saves us
quite a bit of memory in the normal case.
2023-10-13 18:05:42 +02:00
Wim Taymans
11320cf203 tweak number of buffers
In most cases we can use just 1 buffer.

The alsa-pcm-source needs at least 2 buffers so increment the min
limit.
2023-10-13 14:00:29 +02:00
Wim Taymans
9163c419df audioadapter: alloc at least 2 buffers when async
When the follower is async, alloc at least 2 buffers.
2023-10-13 13:59:34 +02:00
Wim Taymans
8e95f1a575 module-ffado: remove hardcoded quantum_limit 2023-10-13 13:46:20 +02:00
Wim Taymans
4bb3e292c5 netjack2: remove hardcoded buffer size 2023-10-13 13:40:22 +02:00
Wim Taymans
01857b616c filter-chain: remove some hardcoded limits
Use the quantum_limit instead of a hardcoded value.
2023-10-13 13:32:12 +02:00
Wim Taymans
ac51fbfd1e buffer: remove some hardcoded buffer size limits
Use the quantum_limit as the max buffer size instead of the hardcoded
8192 value.
2023-10-13 13:07:48 +02:00
Wim Taymans
6eb17393bf jack: remove fixed buffer size limit
Use the quantum_limit as the max buffer frames and allocate the ports
with the right samples at the end.
2023-10-13 13:04:28 +02:00
Wim Taymans
8a9117567c 0.3.82 2023-10-13 10:08:20 +02:00
Wim Taymans
bafa890aef jack: schedule all jack clients in the same group
Always group the jack clients together to avoid them using different
drivers (and transport/timing).

See #3562
2023-10-13 09:43:00 +02:00