Commit graph

11589 commits

Author SHA1 Message Date
Jonas Holmberg
0163d4d440 systemd: Limit system manager socket permissions
Remove group permission on the system manager socket so that restricted
clients cannot use it to get unrestricted access. It is assumed that the
session manager system service (wireplumber) is running as pipewire user
and will get access to the manager socket, while other clients are
members of the pipewire group and will only get access to the normal
socket.
2023-11-06 15:02:10 +00:00
Wim Taymans
35b115fd6c context: stop scanning on feedback links
If we have a feedback link around a driver, stop scanning for
runnable nodes or else we will be looping forever.

Fixes #3621
2023-11-06 15:56:36 +01:00
Wim Taymans
032955fffe alsa: disable resample when pitch element is available
We need to disable the resampler when there is a pitch element. This was
correctly done in setup_matching but not in check_position_config().

See #3628
2023-11-06 15:09:35 +01:00
James Calligeros
70d2b0eeb4
module-rt: enable setting UCLAMP_MIN and UCLAMP_MAX values
Modern heterogenous multiprocessor systems rely increasingly on
scheduler hinting for efficiency gains and system optimisation.
This is especially true on embedded systems, where background
tasks such as audio daemons should be consigned to the most
power-efficient core in the system. Left to its own devices, the
Linux Completely Fair Scheduler tends to migrate Pipewire to
more performant cores, even when this is unnecessary.

Luckily, CFS can be told by a task to clamp its utilisation values.
Coupled with energy-aware scheduling, this allows the scheduler to
make better informed decisions about where tasks should be placed,
and what pstate to set for the CPU it is running on.

Enable the user to configure UCLAMP_MIN and UCLAMP_MAX values via
arguments to libpipewire-module-rt.

Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
2023-11-06 18:43:46 +10:00
Sam James
0e35750fde
spa: bluez: fix -Walloc-size
GCC 14 introduces a new -Walloc-size included in -Wextra which gives:
```
./pipewire-0.3.84/spa/plugins/bluez5/codec-loader.c:176:14: warning: allocation of insufficient size ‘1’ for type ‘struct impl’ with size ‘1032’ [-Walloc-size]
```

The calloc prototype is:
```
void *calloc(size_t nmemb, size_t size);
```

So, just swap the number of members and size arguments to match the prototype, as
we're initialising 1 struct of size `sizeof(struct impl)`. GCC then sees we're not
doing anything wrong.

Signed-off-by: Sam James <sam@gentoo.org>
2023-11-05 21:36:49 +00:00
Pauli Virtanen
33db334765 doc: link \page and \group by \see 2023-11-04 15:22:18 +02:00
Pauli Virtanen
c77fdb4864 doc: hide useless indices in doxygen output etc. fixes
Hide useless paginated indices.
Rename "Related Pages" -> "Pages".
Fix manpage brief description.
Fix file path name stripping.
Move macro listings after enums, so that they're next to functions.
Remove pwtest from docs, it's not API.
Fixup header styles.
2023-11-04 15:22:01 +02:00
Pauli Virtanen
27afa39d5d doc: use b->requested in tutorial4 2023-11-04 14:50:45 +02:00
Pauli Virtanen
49668a9b26 doc: fixup some Doxygen autogen issues
Don't show page sections in left sidebar, it's confusing.
Rename Modules -> API Reference in sidebar.
Indicate visually the sidebar entries are collapsible.
Fix spa_pod_json grouping.
Move tools page to top level.
Fix page ordering.
2023-11-04 09:45:55 +00:00
Wim Taymans
dae0ccacfc spa: explicitly mention that volumes are linear
See #3623
2023-11-04 09:51:14 +01:00
Wim Taymans
90e4ee94ec context: limit recursion in run_nodes
Limit the amount of recursion in run_nodes() for now until we find out
why it keeps on recursing.

See #3621
2023-11-03 15:40:41 +01:00
jdavidsson
baac9aa549 impl-link: reset state to INIT if not destroyed
If the link isn't destroyed, don't allow changing state to
PAUSED for states < PAUSED. For example, if the deactivation
is called during the link being in NEGOTIATING it could then
jump directly to PAUSED and believe it is prepared.

Fixes #3619
2023-11-03 10:01:48 +01:00
Théo Lebrun
38157a8937 pw-top: fix version constant used for pw_node_events
This changes the value declared (3 currently versus 0 following this
patch). I have not seen code checking this version number.

Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
2023-11-02 12:42:50 +01:00
Théo Lebrun
0e44f5ef97 jack: fix PW_VERSION_* constant used with pw_*_events structs
PW_VERSION_NODE is 3 while PW_VERSION_NODE_EVENTS is 0, I am unsure if
it could have caused issues. Same thing with PW_VERSION_PORT &
PW_VERSION_PORT_EVENTS.

I have not seen code checking this version number.

Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
2023-11-02 12:42:30 +01:00
Wim Taymans
cf46c4f5af 0.3.84 2023-11-02 11:13:40 +01:00
Wim Taymans
bdb7f3adc8 gst: don't stop streaming when paused
We pause when we are unlinked, don't stop the streaming thread because
then we won't be able to resume when we are linked again.

Fixes #3620
2023-11-02 10:06:03 +01:00
Wim Taymans
b8a8e00a80 jack: do sync when starting client
do a sync when starting up client and sync when creating a new proxy so
that we get all the proxy updates before the client is opened.

This ensures all ports are enumerated correctly.

Fixes #3618
2023-11-01 18:42:12 +01:00
Wim Taymans
353efbd790 context: fix indentation 2023-10-31 11:33:23 +01:00
Wim Taymans
98d44d9757 impl-node: support multiple link-group and group
Support an array for the node.group and node.link-group properties.
This makes it possible to make a node member of multiple groups and
link-groups.

See #3612
2023-10-31 10:58:49 +01:00
Wim Taymans
72fa74ff57 utils: add some utility functions for working with strv
Add function to parse strv from relaxed json syntax.
Add some functions to find a string or the first common string.
2023-10-31 10:57:25 +01:00
Wim Taymans
9cdb3607e1 alsa: remove device properties when closed
When the device has not configured a format, remove the properties that
depend on the format so that they don't limit what we can configure the
device with next.

See #3613
2023-10-30 11:20:52 +01:00
Wim Taymans
2ff62641b9 context: when forcing rate/quantum don't limit latency
Usually, the max-latency is calculated by the device when it is
configured based on the maximum buffer size and limits the latency
change that can be done.

When we are forcing a rate/quantum and we are going to reconfigure the
device, this limit should not apply because the current buffer settings
and latency are going to change because of the reconfigure.

See #3613
2023-10-30 11:18:55 +01:00
Michael Tretter
e4def0ce18 pipewiresink: use maximum size of buffers to configure pool
For encoded formats, buffer size is the size of the actual data in the
buffer and may change for each frame depending on the content. Thus,
configuring the buffer pool of the pipewiresrc with the size of the
first buffer may be insufficient for later buffers.

Configure the buffer pool to the maximum size of the first upstream
buffer and assume that the following buffers will be allocated with the
same size as the first buffer.
2023-10-27 18:01:37 +02:00
Michael Tretter
efa08e9892 gst: update buffer size only if format defines a size
For encoded formats, p->video_info.size will be 0. If the pipewiresrc
handles an encoded format, the bufferpool will be configured to allocate
buffers of size 0. This will cause errors later when trying to copy the
frames into the pipewire buffers.

Update the bufferpool size only if video_info defines an actual buffer
size.
2023-10-27 18:01:37 +02:00
Michael Tretter
bd15e5275b pipewiresink: copy metadata into pipewirepool buffers
If the pipewiresink needs to copy the GStreamer buffers to the PipeWire
buffers, because the upstream element didn't use the pipewirepool, the
metadata must be copied, too. Otherwise the pipewire datas will be
filled with the metadata from the buffer during the initialization and
not the currently used buffer.

For example, without copying the metadata the buffer timestamp will be
missing on the pipewire buffers.
2023-10-27 18:00:51 +02:00
Michael Tretter
9a72766ae8 pipewiresink: fix type of SPA_META
The SPA_PARAM_META_type must be configured as a SPA_POD_Id, not as
SPA_POD_Int. Otherwise, PipeWire won't allocate the metas.
2023-10-27 17:44:32 +02:00
Michael Tretter
109567ed3d conf: fix videotestsrc example configuration
In JSON, the colon actually is used for assignment, but in spa_type_info
the colon is used as a separator. To properly parse and pass the
properties to the videotestsrc, the key has to be enclosed by quotation
marks to prevent splitting by the JSON parser.
2023-10-26 16:35:30 +02:00
Michael Tretter
63865307d9 conf: set description for test nodes
Commit 9b29bcd4e8 ("conf: set description for test nodes") set the
description only for the minimal.conf and pipewire.conf and skipped the
pipewire-vulkan.conf.

Set the description for pipewire-vulkan.conf, too.
2023-10-26 16:33:49 +02:00
Michael Tretter
e3fb4301eb videotestsrc: implement impl_node_set_io to fix segfault while loading
In pw_context_recalc_graph, PipeWire takes the currently configured
clock target duration from the position as target rate. The position is
not set for the videotestsrc since the set_io function is not
implemented. This leads to a segfault when the videotestsrc is
configured and loaded.

Add the same dummy implementation of set_io as in the v4l2-source and
the libcamera-source to prevent the segfault.
2023-10-26 15:54:10 +02:00
Pauli Virtanen
b7e863b8cf bluez5: fix logic error in device set leader selection
Fix device set node sometimes not being emitted.

When leader changed it marked no-one as leader, do that in less buggy
way.
2023-10-24 19:45:03 +03:00
Pauli Virtanen
d121d273f0 bluez5: add more debug for device sets 2023-10-24 19:40:44 +03:00
Wim Taymans
733cf7835e jack: add jack_set_sample_rate() extension 2023-10-24 11:08:49 +02:00
Arun Raghavan
5617fa0501 module-rtp-sap/sink: try to bind sockets to an explicit interface 2023-10-24 07:17:21 +00:00
Pauli Virtanen
963ea1f57c tools: make pw-dump/mon/top try to connect to the default manager socket
These tools are used for debugging, and should default to connecting to
the manager socket if present.
2023-10-24 07:08:07 +00:00
Pauli Virtanen
9eaf1184c2 module-protocol-native: multiple names to try in PW_KEY_REMOTE_NAME
Allow PIPEWIRE_REMOTE / PW_KEY_REMOTE_NAME to contain a JSON array of
sockets to try to connect to, in order, instead of just one name.

JSON is restricted to utf-8 encoding. Also, this forces using JSON
syntax for paths that start with '['. This probably will not usually
cause much problem.
2023-10-24 07:08:07 +00:00
Wim Taymans
970a837670 filter-chain: add mult and sine plugin
mult is to multiple samples, sine to generate a sine wave. This can be
used to make a tremolo effect.
2023-10-23 11:14:51 +02:00
Wim Taymans
920beea3eb alsa: guard agaist NULL areas
snd_pcm_ioplug_mmap_areas() can fail and return NULL

Fixes #3600
2023-10-22 17:27:27 +02:00
t123yh
7fa64a8b71 example: fix invalid free() operation in bluez-session
obj->handle should not be directly freed; instead, it should be
freed using "pw_unload_spa_handle", otherwise there will be
segmentation fault.
2023-10-22 14:48:44 +00:00
t123yh
8848923d82 examples: add props to bluez-session to prevent quirk parse error
In bluez5-dbus.c:impl_init, the info is passed to spa_bt_quirks_create,
which expects info to be non-null. But in this example, info is null, so
it will cause quirk table parse failure. Add an empty dict here to prevent
this error.
2023-10-22 14:48:44 +00:00
Wim Taymans
69134f8d3e filter-chain: add linear operation to dsp 2023-10-22 10:50:03 +02:00
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