Commit graph

6266 commits

Author SHA1 Message Date
Wim Taymans
658b624a83 modules: reuse the same code for setting properties
We can reuse the same code for setting input and output stream
properties. This also makes it possible to set the debug.aec.wav-path
on all streams, like the properties say.
2023-12-11 12:00:43 +01:00
Wim Taymans
fbaf4db6b0 modules: add source ip and port in stream props 2023-12-11 10:04:14 +01:00
Wim Taymans
f31d87cfee modules: return -EINVAL on invalid port 2023-12-11 10:03:51 +01:00
Pauli Virtanen
4e2057930f pulse-server: update all params only after enumeration complete
For params that don't emit change events, the param enumeration does not
start core sync, and its enumeration may be incomplete if a previous
core sync completes first.

Fix by always starting a core sync if we are updating params.

This fixes dev_info.active_port being sporadically SPA_ID_INVALID if
there is event pressure, which causes do_set_volume randomly set the
volume on the node instead of setting it on the device.  This can be
triggered e.g. by shaking the volume slider in Pavucontrol with mouse.
2023-12-09 11:23:25 +00:00
Pauli Virtanen
9d779300af context: support letter codes for log.level
Letter codes instead of numbers for log levels are allowed in
PIPEWIRE_DEBUG.

Support them also for log.level in context properties and metadata.

Add a few alias letter codes to harmonize them with what WirePlumber 0.5
supports.
2023-12-09 10:26:26 +00:00
Wim Taymans
9c6d310297 conf: fix comment node.always-driver -> node.always-process
Fixes #3696
2023-12-08 17:20:31 +01:00
Wim Taymans
cfd422854f module-x11-bell: force pulse backend
The libcanberra ALSA backend has some races and causes crashes, we
should try to not use that one.

Fixes #3688
2023-12-05 16:20:40 +01:00
Michael Tretter
6a68c87b19 gst/pipewiresink: remove special case for size 0
There is no need for a special case with size 0. If size is 0, we can
also write the size instead of 0 to the buffer.
2023-12-05 14:44:56 +00:00
Michael Tretter
0bda84bca1 gst/pipewiresink: replace tabs with spaces
Tabs and spaces are mixed for indentation in the pipewiresink. Replace
all tabs with 8 spaces although indentation is 2 spaces, since that
looks like the intended indent.
2023-12-05 14:44:56 +00:00
Michael Tretter
49b971b5b1 gst/pipewirepool: change acquire/release to log messages
The messages are printed for every buffer. Therefore, they should be log
messages. Also add the bufferpool to the message to be able to identify
the bufferpool that handles the buffers.
2023-12-05 14:44:56 +00:00
Michael Tretter
5f916d8a2d gst/pipewirepool: print buffer type as debug message
The buffers are added to the pipewirepool during setup. Therefore, they
should be debug messages. As at it, use the debug helper to print the
string of the buffer type.
2023-12-05 14:44:56 +00:00
Wim Taymans
425c849042 avoid compiler warning 2023-12-04 12:24:24 +01:00
Barnabás Pőcze
539115fc59 pipewire: module-filter-chain: dsp_ops_init(): take cpu_flags
Instead of relying on the caller to initialize `dsp_ops::cpu_flags`,
take it as an argument.
2023-12-02 20:24:33 +00:00
Barnabás Pőcze
75c77b9116 pipewire: module-filter-chain: builtin_plugin: fix filename leak
The `filenames` array must be cleared before the `samples == NULL`
check otherwise the `strdup()`ed strings will be leaked in case
of failure.
2023-12-02 20:24:33 +00:00
Wim Taymans
94f898ddc5 stream: check requested before use
It can be 0 and so we should fill the complete buffer.

Fixes #3683
2023-11-30 11:10:47 +01:00
Wim Taymans
0a7f8128a3 stream: don't confuse frames/samples in docs
See #3683
2023-11-30 11:10:19 +01:00
Wim Taymans
6c772a1843 module-pulse-tunnel: don't block the main thread
Do the pulse context and stream connect async so that we don't have to
block the main thread.

Fixes #3221
2023-11-30 10:42:48 +01:00
Thomas Weißschuh
6ae9698ebc pipewire: mem: try to create non-executable memfds
Executable memfds can be a security issue.

The kernel warns about them like the following:
pipewire: memfd_create() called without MFD_EXEC or MFD_NOEXEC_SEAL set

Explicitly create all memfds a non-executable as they are not meant to
be executed, similar to the other possible backing filetypes.
2023-11-29 17:59:14 +00:00
Pauli Virtanen
08a4590070 module-access: recognize "allowed" as legacy alias for "unrestricted"
Previously, it was an alias for "unrestricted" so support that still if
access.legacy=true.
2023-11-29 18:44:49 +02:00
Dmitry Sharshakov
ac3bdeba4e aes67: bump PTP0 driver priority
As reported in #3217, PTP driver has to have the highest priority for packets to arrive in time

Everything connected to AES67 should be clocked by the Grandmaster clock
2023-11-29 15:40:32 +00:00
Wim Taymans
1a83ce0908 module-loopback: improve channel remapping support
Convert capture and playback streams to any global channel position that
has been set. This can then be used to implement an upmix sink and add
such an example config.
2023-11-29 16:07:54 +01:00
Wim Taymans
088d741cda stream: notify caller of partial set_param success
When we get a Format update during a Format set_param, return > 0 to the
caller so that it knows we modified the param to something else.

This can be used to fixate or deny updates to Format params in the
stream and have the adapter adapt to this.
2023-11-29 15:06:05 +01:00
Wim Taymans
b9e5dde4ac client-node: keep target fd up to date
Keep the target and source fd in sync when we get the new fd from the
server in remote-node.

This makes it possible to refactor some things and only schedule nodes
by triggering the target.
2023-11-28 16:23:00 +01:00
Pauli Virtanen
b12119da28 pw-reserve: require valid name + check rd_reserve_new errors
Empty name in rd_device_new triggers assert inside DBus, so bail out
before that.
2023-11-28 10:26:43 +00:00
Pauli Virtanen
422c270a74 meson.build: fix compile with -Dexamples=disabled 2023-11-28 10:18:25 +00:00
Wim Taymans
a336aabe43 stream: pass properties to context_new
Whe  using pw_*_new_simple(), pass the properties to the automatically
created context as well so that we can configure it.

This makes it possible to, for example, load the client-rf.conf using the
simple API as well.
2023-11-24 10:12:49 +01:00
Barnabás Pőcze
d88def09bd pipewire: module-roc-{sink,source}: add rudimentary ROC_INTERFACE_AUDIO_CONTROL support 2023-11-23 17:21:39 +01:00
Barnabás Pőcze
b19d0ffbc3 pipewire: module-roc-source: use SPA_NSEC_PER_MSEC instead of hard-coding 2023-11-23 15:12:50 +01:00
Barnabás Pőcze
b5e898ee83 pipewire: module-roc-{sink,source}: do not remove from argument property list
The property list is destroyed and not kept around, not passed
to any other component, so this is unnecessary work.
2023-11-23 15:12:50 +01:00
Barnabás Pőcze
68c0a13694 pipewire: module-roc-{sink,source}: pass 0 to pw_properties_get_uint32()
There is no reason to use `data->rate` as the default value
since it will be zero, so just pass 0 explicitly.
2023-11-23 15:12:50 +01:00
Barnabás Pőcze
0a3bd825cd pipewire: module-roc-{sink,source}: remove props member
The `props` member was not used at all, so get rid of it.
2023-11-23 15:12:47 +01:00
Barnabás Pőcze
6d8a31a3e4 pipewire: module-roc-{sink,source}: deduplicate protocol selection 2023-11-23 14:12:35 +01:00
Barnabás Pőcze
333fd8d2ae pipewire: module-roc-{sink,source}: port to ROC v0.3.X
ROC 0.3 introduced breaking changes, so adjust the code.
Also set the minimum supported ROC version to 0.3.0.

Fixes #3667
2023-11-23 14:12:35 +01:00
Barnabás Pőcze
5d62bf5c06 pipewire: daemon: do not set G_LOG_DOMAIN
GLib has not been used for logging for a long time,
so setting this macro has no effect and is unnecessary,
so remove it.
2023-11-23 11:57:45 +00:00
Wim Taymans
c4cd8fa73d impl-client: don't log warning when updating ignored keys
If a client tries to update an ignored key, don't log a warning. Only
log a warning when one of the security properties changed.

This is what we used to do before commit
0dfa05117b

It fixes a warning when a stream disconnects and reconnects because
the serial.id changed.
2023-11-23 12:29:55 +01:00
Arun Raghavan
63bb128948 rtp-stream: Set rtp.ptime on senders not receivers
The pw_stream direction is inverted from what we want (input => sender).
2023-11-23 01:28:20 -05:00
Barnabás Pőcze
aa681365c3 pipewire: module-filter-chain: fix buffer memory leaks
`impl::{silence_data,discard_data}` were not freed either
in case of an initialization error or graceful shutdown.
2023-11-23 05:50:17 +00:00
Barnabás Pőcze
2738bb4cb7 pipewire: remove pw_in_valgrind()
This function is very much orthogonal in function to the usual
features provided by pipewire, and there does not seem to be any
3rd party users based on Debian Code Search and GitHub.
So let's remove it before any 3rd party users start depending on
pipewire for their valgrind detection.
2023-11-22 23:05:03 +01:00
Barnabás Pőcze
3deaa2b0df pipewire: impl-module: respect PIPEWIRE_DLCLOSE
Commit b5c21c1fbc ("pipewire: use dlclose unless PIPEWIRE_DLCLOSE is set to false")
introduced the PIPEWIRE_DLCLOSE environmental variable to
force/prevent the dlclose()ing of shared objects. However,
native pipewire modules were not adjusted to respect its value,
and instead have been still using `pw_in_valgrind()` to
determine whether or not they should be unloaded.

Fix that by adding a private `pw_should_dlclose()` function
and using that in impl-module.c:pw_impl_module_destroy().
2023-11-22 22:58:00 +01:00
Wim Taymans
de954655bc modules: fix doc 2023-11-22 17:48:05 +01:00
Wim Taymans
bb82ddb601 Fix a warning
../src/modules/module-rt.c:615:21: warning: suggest parentheses around
assignment used as truth value [-Wparentheses]
2023-11-22 16:17:08 +01:00
Jonas Holmberg
72323dcaf3 module-rt: Protect setrlimit() with mutex
Make sure threads initializing the module doesn't get/set RLIMIT_RTTIME
simultaneously.
2023-11-22 13:56:15 +00:00
Wim Taymans
0c857f5455 pulse-server: add stream/device state in dev_info
Also include and update the state of the device/stream in
collect_device_info so that we can compare it against the previous value
and emit a change event.

Fixes #3660
2023-11-20 11:39:31 +01:00
Pauli Virtanen
90bd9adb6b pulse-server: rename combine sinks option
Let's call it "sinks" in the docs, but keep the Pulseaudio name for
backward compat.
2023-11-20 08:41:13 +00:00
Pauli Virtanen
fdcb02ed75 modules: add Module Name section to the module reference docs 2023-11-20 08:41:13 +00:00
Pauli Virtanen
843e733479 doc: add documentation for pipewire-pulse modules
Add (minimal) reference documentation for each pipewire-pulse module.

Add some preprocessing to substitute @pulse_module_options@ in docs from
PW_KEY_MODULE_USAGE so the module options don't need to be repeated.

Produce Doxygen docs + generate manpages pipewire-pulse-modules.7,
pipewire-pulse-module-*.7
2023-11-20 08:41:13 +00:00
Wim Taymans
0ae797ea28 client-node: handle port_buffers errors better
First check if all of the new buffers are ok before attemping to replace
our exising ones with the new ones. Else we might end up copying some
of the new buffers and cleaning them up twice later.
2023-11-20 09:36:02 +01:00
Pauli Virtanen
eca773fc12 modules: strip "PipeWire Module:" from Doxygen page name
Make them appear nicer in the output.
2023-11-19 16:39:15 +00:00
Pauli Virtanen
7f5f88c04a client-node: store mix in pw_map so that they are not copied
struct mix contain pointers to themselves (see do_port_use_buffers) and
cannot be copied by value, so they should not be stored in pw_array.

Store them in pw_map instead.
2023-11-19 18:03:36 +02:00
Wim Taymans
44bfeaac6e client-node: close fds in port_buffers() error case
When port_buffers are configured on a destroyed or invalid port, close
the fds or else we leak them.
2023-11-17 15:22:56 +01:00