Commit graph

3526 commits

Author SHA1 Message Date
Jonas Holmberg
e78e97cb99 pipewire-alsa: Propagate errors from eventfd().
Propagate the error if spa_system_eventfd_create() fails. Also copy
errno before calling spa_log_debug() in spa_system_eventfd_create() to
make sure it is not overwritten.
2024-02-19 14:16:26 +00:00
Wim Taymans
2c0bb6ffd2 audioadapter: recheck formats when EnumFormat changes
When the follower has new EnumFormat, make sure we recheck the formats
the next time the node is started.
2024-02-19 15:10:32 +01:00
Wim Taymans
223d016a5e audioadapter: clear buffers when format is reconfigured
Always clear the Buffers when the format is reconfigured because they
depend on the Format.
2024-02-19 15:09:41 +01:00
Wim Taymans
871e6da34a audioconvert: fix debug when -UFASTPATH 2024-02-19 12:43:46 +01:00
Ruben Gonzalez
15bdab89c3 logger: minor performance improvement to avoid syscall done by isatty 2024-02-17 11:42:12 +00:00
Dimitrios Katsaros
a5419ea670 resampler: Only use copy when rate is 1.0
The rate we get from dlls can have a subsample precision. However,
the check for using process_copy is in sample precision. This means
that an adaptive stream will oscillate rather then lock into the
exact rate.
2024-02-16 20:08:18 +00:00
Dimitrios Katsaros
77f6c009c1 resample: use a float phase in update_rate
My making the phase into a float, the resampler can do finer grained
adjustments, which should improve the stability of adaptive
resampling
2024-02-16 20:08:18 +00:00
Wim Taymans
2833ff1272 alsa: split irq and timer wakeup functions
Because it's easy to do and avoids some runtime checks.
2024-02-14 16:25:20 +01:00
Dimitrios Katsaros
8608c03b76 alsa: Reduce jitter in irq based software timestamping
We would timestamp within an unlikely block, which would introduce
additional jitter to current_time, which would have an impact on
the performance of the timer sensitive code.
2024-02-14 15:03:31 +00:00
Wim Taymans
d933984ee6 audioadapter: copy original props
We need to pass the follower props and append our own props
2024-02-13 17:36:01 +01:00
Wim Taymans
9fa559948e acp: also install a local error handler 2024-02-13 17:20:18 +01:00
Wim Taymans
61f1aea01f audioconvert: remove some construct time properties
Remove some verbose and construct time properties.
2024-02-13 16:22:33 +01:00
Wim Taymans
5a37c97f3d alsa: allow setting profile by name 2024-02-13 15:37:10 +01:00
Wim Taymans
513e8fa56f adapter: move adapter.auto-port-config to adapter
Move the handling of the default adapter port config to the adapter
itself.
2024-02-12 17:24:22 +01:00
Wim Taymans
532bc878f4 spa: use errno values in warnings
Propagate the errno values from syscalls and use them in the warning
messages to give info about what is going on.
2024-02-12 10:01:22 +01:00
Dmitry Sharshakov
bb2f793598 node-driver: suggest user to check clock device permissions 2024-02-12 08:14:10 +00:00
Gleb Popov
d2750420c6 Fix build of vulkan/dmabuf_fallback.c 2024-02-10 20:52:25 +03:00
Barnabás Pőcze
84699032be spa: alsa: react to "new" udev action as well
Previously, only "change" and "remove" were considered.
2024-02-09 18:32:53 +01:00
Barnabás Pőcze
ad975c93ee spa: alsa,v4l2: avoid double access check on inotify events
Previously both `impl_on_notify_events()` and `process_{device,card}()`
called `check_access()`. Avoid that by merging `ACTION_ADD` and
`ACTION_DISABLE` into a single `ACTION_CHANGE` and let `process_{device,card}()`
call `check_access()` and decide what to do.
2024-02-09 18:32:53 +01:00
Barnabás Pőcze
0158b5dcb6 spa: v4l2: handle IN_IGNORED events from inotify 2024-02-09 18:32:53 +01:00
Barnabás Pőcze
69f9e75458 spa: alsa,v4l2: avoid double lookup on inotify events
Split up `process_{device,card}()` to have a separate function that does
the lookup based on the udev device, and only use that when there is
no available reference to the actual device/card object.
2024-02-09 18:32:53 +01:00
Barnabás Pőcze
57a5417703 spa: v4l2: use proper log topic in udev monitor 2024-02-09 18:32:53 +01:00
Barnabás Pőcze
5fa34988fa spa: alsa,v4l2: use proper enum for action
An enum provides better debugging experience
and makes the source code easier to grasp.
2024-02-09 18:32:53 +01:00
Barnabás Pőcze
04b8a0c215 spa: alsa: handle IN_IGNORED instead of IN_DELETE_SELF
`IN_IGNORED` event is sent whenever the watch is removed,
which includes when the entity is deleted among other things,
so watch that instead of the more specific `IN_DELETE_SELF`.
2024-02-09 18:32:53 +01:00
Barnabás Pőcze
18cfb808bd spa: alsa,v4l2: simplify inotify read loop exit condition
The removed condition is strictly a subset of the condition
that is checked one line below, so remove it.
2024-02-09 18:32:53 +01:00
Barnabás Pőcze
66c7966b75 spa: v4l2: remove ignored flag
Nothing sets it.
2024-02-09 18:32:53 +01:00
Wim Taymans
858d4e9e1c buffer: add MAPPABLE data flag
Add a MAPPABLE data flag that hints that the fd in the data is mappable
with a simple mmap/munmap. Normally, DmaBuf is not mappable like that
unless explicitly indicated with this flag.

Set the MAPPABLE flag on the DmaBuf from v4l2 and libcamera fd.

When asked, mmap the buffer memory in all cases when the MAPPABLE
flag is set.

This solves the case where v4l2 has exported DmaBuf and is streaming to
node A and then node B links but doesn't get automatically mmaped
memory.

Fixes #3840
2024-02-08 18:09:08 +01:00
Wim Taymans
1de71d96c6 v4l2: include config.h to check for udev 2024-02-06 22:41:54 +01:00
Wim Taymans
b4c7973d49 meson: fix build with missing libudev-devel 2024-02-06 11:49:40 +01:00
Wim Taymans
eb33145691 loop: fix clang compilation 2024-02-05 23:16:36 +01:00
Barnabás Pőcze
0b87144d26 spa: bluez: fix whitespaces 2024-02-05 20:01:21 +01:00
Barnabás Pőcze
a834da988c spa: support: add missing static 2024-02-05 20:01:21 +01:00
Wim Taymans
e7e6742200 loop: sleep and retry when the invoke queue is full
When the invoke ringbuffer is full, sleep a little and try again.
Add an option to set the retty timeout, setting this to 0 restores
the old behaviour of returning -EPIPE.

Most callers don't check the return values and might assume the invoke
call is queued or executed, which could cause crashes or leaks.

When the queue overruns, it's better to log a warning and hope that the
problem is resolved soon. We might abort or return the error to the
caller later if we want to break the retry loop.

See !1887
2024-02-05 19:44:02 +01:00
Pauli Virtanen
83050e647b bluez5: aptx-ll: produce 7.5ms packets
Put a bit more samples to packets to make it more robust.  The 7.5ms
interval may also fit better with other BT devices.
2024-02-05 19:34:47 +02:00
Barnabás Pőcze
4aa2e44796 spa: move dbus helpers out of bluez plugin
The file is moved into a new "include-private" directory. This is done
because otherwise adjustments would have to be made to the list of installed
headers, the way include tests currently work and which files are
used for generating documentation.
2024-02-05 13:03:20 +00:00
Pauli Virtanen
ddf3be0a39 bluez5: lc3: clean up some sanity checks
Fix some sanity checks and add mtu check.  Don't use
spa_return_val_if_fail here as it can spam stderr.

The buffer size check in codec_encode can't be hit.
2024-02-05 08:59:18 +00:00
Pauli Virtanen
61c585c8e6 bluez5: support Google's Opus A2DP vendor codec 2024-02-04 12:58:40 +02:00
Pauli Virtanen
ff0305dada bluez5: disambiguate the two Opus codecs 2024-02-04 12:57:31 +02:00
Pauli Virtanen
0c434e4821 bluez5: reset A2DP codec shared endpoint status on disconnect 2024-02-04 12:57:31 +02:00
Pauli Virtanen
45385b2b66 bluez5: SBC-XQ does not need its own endpoint
The endpoint caps are identical for SBC and SBC-XQ, so they can share
the same endpoint.

This reduces the number of registered endpoints by one.
2024-02-04 12:57:31 +02:00
columbarius
bcf3cdc159 vulkan: Update logging in compute plugins
Use SPA_LOG_TOPIC_DEFAULT to name the log messages
2024-02-04 09:27:56 +00:00
columbarius
a1615fe6a3 vulkan: Add vulkan-blit-dsp-filter 2024-02-04 09:27:56 +00:00
columbarius
3e3a13c567 vulkan: Add vulkan-blit-filter 2024-02-04 09:27:56 +00:00
columbarius
c845338d81 vulkan: Add blit utils 2024-02-04 09:27:56 +00:00
columbarius
2b2e53ad90 vulkan: Return early in use_buffers
This fixes accesing a buffer in [1] when none is provided.

[1] 3f80bc2e70
2024-02-04 09:27:56 +00:00
Pauli Virtanen
805e5cf9c1 bluez5: show only codec profiles also for HFP/HSP
Don't show a "codecless" profile for HFP, similarly as we do for A2DP.

Simplify codec handling: for HFP/A2DP there's at most one transport for
each profile, so no need to check it has right codec.  There's also no
need for "fallback profile", we always just emit nodes for the transport
we find.
2024-02-03 16:10:12 +00:00
Pauli Virtanen
597116bb23 bluez5: backend-native: ensure we no transports are leaked
Make sure we don't leak transport even if remote sends invalid command
sequences.
2024-02-03 16:10:12 +00:00
Pauli Virtanen
f142c0a5b0 bluez5: ensure transport->codec is set also for HSP 2024-02-03 16:10:12 +00:00
Wim Taymans
0b67c10a9c alsa: always reevaluate matching when driver changed
Always reevaluate the rate matching even when we did not change the
follower state.

It is possible that we were a follower from some node with the same
clock and now become a follower of a node with a different clock. The
follower state doesn't change but we need to activate the rate matching
logic in that case.

Fixes rate matching in pro audio (playback) when capture and playback
are moved to another driver.
2024-02-01 11:07:18 +01:00
Pauli Virtanen
db7b764bf2 bluez5: deprioritize AAC-ELD since it's untested
The AAC-ELD support was not properly tested on devices.  In theory it
should be OK, but it's untested.

Bump it down in priority so it won't be selected by default.
Also log info on FDK-AAC AAC-ELD support status.
2024-02-01 08:06:06 +00:00