Commit graph

11178 commits

Author SHA1 Message Date
Barnabás Pőcze
aed06dff67 pipewire: thread: include "private.h"
So that the definition of `pw_thread_fill_attr()` is
checked against the declaration.
2023-07-03 19:40:25 +02:00
Barnabás Pőcze
3bb32fb592 pipewire: pw_context_find_export_type(): remove redundant decl
This function is already declared in "context.h".
2023-07-03 19:40:25 +02:00
Barnabás Pőcze
e917dc65a0 pipewire: include "i18n.h"
So that definitions are checked against the declarations.
2023-07-03 19:40:25 +02:00
Barnabás Pőcze
5deb6ccede pipewire: conf: add missing include guard 2023-07-03 19:40:25 +02:00
Wim Taymans
927eb64177 alsa: use get_avail() recover logic
Always use get_avail() and then only fetch the hires timestamp when
enabled to enhance the delay reporting. This way we also recover from
errors from snd_pcm_avail() instead of ignoring them.

This should make the recover after mmap_begin obsolete but we'll leave
that just to be safe.
2023-07-03 17:08:08 +02:00
Wim Taymans
c34a987076 pulse-server: add option to disable fix_ flags
Document the pulse.fix properties.
Add an option to disable handling of the FIX flags when the pulse.fix.
property is set to an invalid value/0.

See #3317
2023-07-03 16:39:32 +02:00
Pauli Virtanen
ff5f6d908b bluez: allow buffers with maxsize < duration*frame_size
Buffer sizes smaller than one cycle are possible, so don't assert that.
Instead, just provide as much samples as fits to the buffer.

If we are driver when this happens, emit a warning (once).  Similarly to
ALSA, as driver we produce only one buffer at cycle start, and no new
buffers in process. If the whole cycle doesn't fit into the buffer,
recording probably will be broken and we want some debug when there will
be a bug report about that.
2023-07-03 13:56:20 +00:00
Wim Taymans
4bb85ef6c9 module-rtp: don't use sap port as src port
We bind to the src addr (the interface addr) and so we need a new unused port.
2023-07-03 12:35:36 +02:00
Wim Taymans
eaaa0cd99e modules: improve some docs 2023-06-30 21:44:49 +02:00
Wim Taymans
c13696aca1 filter-chain: simplify biquads 2023-06-30 17:49:29 +02:00
Wim Taymans
d5d8ebeaac pw-cat: only override properties when not already set
This makes it possible to override any of the properties with -P such as
the graph rate.
2023-06-30 16:24:13 +02:00
Wim Taymans
f612ffe8e4 pulse-server: use the fixed rate for graph rate
We need to use the format rate for calculating the buffer size and
latency but the fixated rate for the graph rate.

See #3317
2023-06-30 12:34:25 +02:00
Wim Taymans
91ac3acf3d pulse-server: debug the fixed format/rate/channel 2023-06-30 12:34:25 +02:00
Barnabás Pőcze
0e823d8a0f pipewire: core: static assert member order requirement
The pw_proxy member of pw_core must be the first because the
pw_core object is freed via pw_proxy_destroy() -> pw_proxy_unref().
2023-06-29 23:57:49 +02:00
Barnabás Pőcze
4bec3b56d4 pipewire: pw_proxy_init(): take pointer to core
`pw_proxy::core` must be initialized for `pw_proxy_init()`
to succeed, so take it as a parameter instead of relying
on the caller to initialize that field beforehand.
2023-06-29 23:57:49 +02:00
Barnabás Pőcze
e299534929 pipewire: log: do not generate parentheses around variable decls
It causes "warning: unnecessary parentheses in declaration of ..."
warnings in C++.
2023-06-29 23:57:49 +02:00
Barnabás Pőcze
8847b537a4 pipewire: core: remove redundant member
`pw_core::core` was initialized to point to itself, it
wasn't changed, and nothing really used it. And the only
user already had a pointer to the core object. So remove it.
2023-06-29 23:57:49 +02:00
Barnabás Pőcze
2abd3432b8 pulse-server: module-combine-sink: remove redundant member
`module_combine_sink_data::info` member has not been used
since 782e0dfb1f, so remove it.
2023-06-29 23:57:48 +02:00
Barnabás Pőcze
4a555ed6ff spa: bluez: backend-native: fix a memory leak
In `_transport_create()`, if `spa_bt_transport_create()` failed
then `pathfd` would be leaked.
2023-06-29 23:57:48 +02:00
Barnabás Pőcze
2efccb3d01 pipewire: impl-metadata: replace open-coded vasprintf()
Simply use `vasprintf()` instead of manual `vsnprintf()` and `malloc()` calls.
2023-06-29 23:57:48 +02:00
Barnabás Pőcze
3506b7534c pipewire: parse_pw_debug_env(): split in place
There is no need to use `pw_split_strv()` since the string
is owned by the function, it can be split in place, so do that.
2023-06-29 23:57:48 +02:00
Barnabás Pőcze
656d8bbc72 pipewire: parse_pw_debug_env(): simplify empty string check 2023-06-29 23:57:48 +02:00
Wim Taymans
2963e7fd4c alsa: disable htimestamp when it seems to error too much 2023-06-29 16:40:21 +02:00
Wim Taymans
f76191c792 alsa: add option to disable htimestamps
Add api.alsa.htimestamp to disable the use of hires timestamps.
2023-06-29 16:23:39 +02:00
Wim Taymans
3dab0091bb alsa: warn when the htimestamp seems wrong
The htimestamp should be close to the current_time, if it is further
away that the threshold, something is wrong.
2023-06-29 15:56:43 +02:00
Wim Taymans
98f138dbe0 filter-chain: move sofa and lv2 to external modules
dlopen lv2 and sofa plugin modules instead of hardcoding them into the+
filter-chain. This also makes it possible to add more plugin module
types externally.
2023-06-29 14:04:40 +02:00
Wim Taymans
5d177acc53 meson: clean up echo-cancel sources 2023-06-29 12:12:10 +02:00
Wim Taymans
ab8e67e885 filter-chain: improve error reporting 2023-06-28 17:07:14 +02:00
Wim Taymans
b065899859 filter-chain: only reset rate when suspended
Otherwire we can continue with the graph configuration if the rates
still match.
2023-06-28 16:52:11 +02:00
Wim Taymans
f9efc63a04 pulse-server: make sure we have a card_name
Clients crash if the card name is NULL so make sure we generate
a backup name.
2023-06-28 16:18:44 +02:00
Wim Taymans
bddfc8c46e filter-chain: support notify to control links as well
If we can't find data ports to link, try to find notify/control ports
when making a link.

When applying the link, place the output of the notify as the control
data.
2023-06-28 15:15:07 +02:00
Wim Taymans
c671c46b87 module-loopback: recalc delay when starting
So that we can use the graph rate in case we are configured to follow
the graph rate.
2023-06-28 12:36:42 +02:00
Wim Taymans
e3a41b2c49 filter-chain: instantiate graph when starting
Don't instantiate the graph when negotiated but when starting. This
allows us to get to the target graph rate in case the format rate is
supposed to follow the graph rate.

See #2969
2023-06-28 12:36:19 +02:00
Wim Taymans
e03c3311eb filtet-chain: instatiate only once 2023-06-28 11:53:26 +02:00
Wim Taymans
b160a72018 stream: don't emit process when disconnecting
As part of the disconnect, we will flush out pending process calls. Make
sure we don't emit them because they are quite pointless.

Fixes #3314
2023-06-27 15:08:24 +02:00
Wim Taymans
4b32b1fef0 modules: add example filter 2023-06-27 14:02:38 +02:00
Wim Taymans
b32715ba41 alsa: try to recover when mmap_begin fails
In case the get_avail call did not catch the device error, handle the
error and try to recover in the mmap_begin call instead.

See #3315
2023-06-27 13:25:47 +02:00
Wim Taymans
39165a8471 modules: add ASYNC flag
Add ASYNC flags for the streams that don't dequeue/queue in the realtime
process function so that an extra buffer is allocated.
2023-06-27 13:11:13 +02:00
Wim Taymans
1466982c60 stream: add ASYNC flag
Add ASYNC flag that sets SPA_NODE_FLAG_ASYNC.

This ensure we allocate at least 2 buffers. We need 2 buffers at least
because we don't dequeue/queue a buffer in the process function when
async and we run out of buffers if we have only 1 buffer.
2023-06-27 13:11:13 +02:00
Guido Günther
88bb0bd7cc alsa: Allow to augment ucm port properties
Since UCM doesn't perform the path lookups of alsa-mixer all UCM devices
fall back to the card's properties for e.g. icons and hence usually show
the `audio-card` icon for all ports giving a confusing UI to users as
all ports show the same icon.

As ucm names are pretty standard augment some common port names with
icons.
2023-06-26 19:39:31 +00:00
Niklāvs Koļesņikovs
e4cc63a6dc src/modules/meson: ensure Opus libs were actually found, too
The old way fails, if a distro has the header but not the library,
which can happen on at least Gentoo with multilib deployments,
where the shared header is present but non-native libraries might not.

This could still fail, if a distro had some but not all libraries for
some architectures but hopefully no one did that. In that case, a compile
test would likely be required via cc.check_header() instead but let's try
the faster fix first.

Reported-by: Sam James <sam@gentoo.org>
Thanks-to: Barnabás Pőcze <pobrn@protonmail.com>
Thanks-to: Xavier Claessens <xavier.claessens@collabora.com>
Signed-off-by: Niklāvs Koļesņikovs <89q1r14hd@relay.firefox.com>
2023-06-26 15:21:49 +00:00
Niklāvs Koļesņikovs
15ddbfd037 spa/plugins/bluez5/meson: removed some unneeded redefines
As far as I can tell, the code in question was not doing anything there
and was also breaking the new code elsewhere, so it was put on the
chopping block. Don't mind the squirming tentacles.

Signed-off-by: Niklāvs Koļesņikovs <89q1r14hd@relay.firefox.com>
2023-06-26 15:21:49 +00:00
Wim Taymans
4df753d0d7 context: avoid segfault when no fallback driver
In some cases, there might not be a fallback driver. Handle this without
segfaulting.
2023-06-26 16:11:33 +02:00
Dorinda Bassey
98ac13a03e cleanup unused variables
added cleanup of unused variables to resolve build warnings in pipewire-rs

Signed-off-by: Dorinda Bassey <dbassey@redhat.com>
2023-06-26 10:51:09 +00:00
Wim Taymans
0156d63109 audioconvert: don't negottiate rate when resample is disabled
This will leave the negotiated rate 0 when parsed and instructs the
stream to follow the graph rate.
2023-06-26 11:23:29 +02:00
Wim Taymans
4cc22d60d2 0.3.72 2023-06-26 09:42:21 +02:00
Carlos Rafael Giani
d20fc2a8ec alsa-compress-offload-sink: Fix format renegotation
The have_format flag was not being properly processed, leading to
incorrect behavior when the format param was enumerated.
2023-06-24 16:54:15 +02:00
Arun Raghavan
de2d7a583b alsa: Actually write out pitch elem value during initial reset
Without this, we were assuming our inital rate of 1.0 was also what was
applied to the feedback endpoint, but that was not actually true.
2023-06-23 16:45:36 +00:00
Wim Taymans
5a30d82d7e impl-port: avoid doing port calls when destroying
When we are destroying a port, don't try to clear io and format, the
port is already gone.
2023-06-23 15:05:39 +02:00
Wim Taymans
5578afa7de stream: don't call process when we have no buffers 2023-06-23 11:43:05 +02:00