Commit graph

5302 commits

Author SHA1 Message Date
Wim Taymans
2254c74fb9 use TARGET_OBJECT instead of the deprecated NODE_TARGET
Clarify the docs.
2023-01-10 16:51:47 +01:00
Wim Taymans
a7df07c449 gst: don't set the deprecated path anymore
Just use the target_object property instead which uses the object.serial
is is less prone to races when the object id is recycled.
2023-01-10 16:47:47 +01:00
Wim Taymans
1beddd78d2 tools: clarify the target param
The target param is an object.serial or node.name.
Use TARGET_OBJECT instead of NODE_TARGET.
2023-01-10 16:45:50 +01:00
Wim Taymans
8767e8ed97 pulse-server: handle .monitor master source 2023-01-10 16:22:39 +01:00
Wim Taymans
ff69454eb4 pulse-server: use TARGET_OBJECT
The pulse API uses either the node.name or object.serials so pass this
along in the TARGET_OBJECT instead of the NODE_TARGET now that
wireplumber handles this.
2023-01-10 16:05:55 +01:00
Wim Taymans
624e265fd6 pulse-server: clear the drained state correctly
When we start the drain, we unpause the stream. When we conplete the
drain, we unpause again, which does nothing when the stream was already
unpaused. However, this leaves the drained state on the stream and so
the stream will never be able to play new data.

Trigger a new pw_stream_set_active() with the current stream state to
clear the drained state.

Fixes #2928
2023-01-10 12:49:22 +01:00
Wim Taymans
97aafe2234 fix use_buffers checks
We can set 0 buffers even if there is no format.
Return -ENOSPC when too many buffers are set.
2023-01-10 12:30:25 +01:00
Wim Taymans
9f3237b74e context: keep per node quantum and rate settings
Copy the global quantum and rate limits before applying node specific
settings. Otherwise one node settings will propagate to the defaults
of the next nodes, which can result in impossible or wrong settings.

See #2925
2023-01-09 17:56:04 +01:00
Wim Taymans
ba374a7b47 impl-node: restore running state after reconfigure
Add a reconfigure state on the node that is set when the node was IDLE
or RUNNING when reconfigured.

The node state will be set to the running state as long as the
reconfigure state is active. When the node is running, the reconfigure
state is unset again and the node is allowed to IDLE as usual.

This fixes the case where an IDLE (but not paused node) will be
suspended when a rate change happens but will then not resume
afterwards.

This causes problems with rate changes and nodes that have the suspend
disabled by the session manager. They will be suspened anyway and this
can cause problems for devices that need to keep running to keep the
amplifiers active.

Fixes #2929
2023-01-09 11:49:10 +01:00
Wim Taymans
07633f2146 context: rename a method
Rename suspend_driver -> reconfigure_driver because that is more like
what it does.
2023-01-09 11:49:10 +01:00
Wim Taymans
e099f0598a pw-reserver: improve output a little 2023-01-09 11:49:10 +01:00
Wim Taymans
26496724c6 impl-node: move 2 state variables to private
So that they can be used when making scheduler decisions.
2023-01-09 11:49:10 +01:00
Wim Taymans
0ddf80d470 midifile: error won invalid track size
When the track data would exceed the file size, return an error.
2023-01-09 11:49:10 +01:00
Wim Taymans
6a516b9505 context: fix typo in comment 2023-01-09 11:49:10 +01:00
Robert Mader
602aa7d541 pipewiresrc: Reenable DMABuf support
This was disabled in 15b4c58e as under various circumstances Gstreamer
pipelines would mmap the DMABufs, which can be very slow in various cases.
One typical example of that is screen casting using a dedicated graphics card.

Thus we only want to use DMABufs if the peer element advertises support for
`GST_CAPS_FEATURE_MEMORY_DMABUF`, ensuring no mapping will happen if we
set the format accordingly.

This allows pipewiresrc to be used with DMABufs for fully accelerated
pipelines or in combination with a download element such as `gldownload`[1]
without regressing the commit above. The `gldownload` approach mirrors
what webrtc (Chromium/Firefox) does, but without duplicating the
functionality into pipewiresrc.

While on it, also implement dmabuf negotiation according to
https://docs.pipewire.org/page_dma_buf.html with the modifiers
`DRM_FORMAT_MOD_INVALID` and `DRM_FORMAT_MOD_LINEAR` in order to allow
dmabuf negotiation with more modern clients, including Gnome-Shell.

1: for now use something like `glupload ! glcolorconvert ! gldownload` -
   `gldownload` does not support importing DMABufs yet but `glupload` does.
2023-01-08 09:17:19 +00:00
Jan Beich
6d58c73937 module-rt: fix warning when xdg-desktop-portal isn't running
$ pipewire
...
[W][1234.001] mod.rt       | [     module-rt.c:  278 pw_rtkit_check_xdg_portal()] Can't find xdg-portal: (null)
...
2023-01-08 07:29:42 +00:00
Wim Taymans
b2f43e7bad pulse-server: fix echo-cancel _master args
The sink_master and source_master should be set on the capture and
playback streams so use the new properties on module-echo-cancel to do
this.
2023-01-07 15:00:40 +01:00
Wim Taymans
feac9f1c70 module-echo-cancel: add capture and playback props
Add a capture.props and playback.props config section to set properties
for the capture and playback stream.

Fixes #2939
2023-01-07 13:58:30 +01:00
Dmitry Sharshakov
6fb543a514 adapter: support node.channel-names
Allow customizing channel names for nodes
2023-01-06 23:17:33 +03:00
Wim Taymans
4f458b5d9a filter-chain: dynamically allocate the params
Dynamically allocate the offsets and params arrays so that it can
support more than 512 params.

Fixes #2933
2023-01-06 12:41:06 +01:00
Robert Mader
be2757c121 gstpipewireformat: Fully handle SPA_CHOICE_Step
The step value was not used.
2023-01-06 11:16:52 +00:00
Thomas Weißschuh
d4db7e1d9b pw-dump: sort dictionaries
Dictionaries are by default printed in their insertion order.
This is unergonimic when comparing properties created by different
clients, as they may insert them in different orders.
2023-01-06 11:15:17 +00:00
Wim Taymans
6116ef8484 impl-port: clear peer buffers in suspend
When we clear the buffers on an output port when we clear the port
format in suspend, also clear the buffers shared by the peer input
port mixers because else they would reference old stale buffers.

Fixes #2914
2023-01-02 17:24:35 +01:00
Wim Taymans
6b228944f7 impl-port: clear have_buffers when setting 0 buffers 2023-01-02 16:03:36 +01:00
Wim Taymans
860b8fc27f modules: fix rate update
Setting the rate with the PROP_rate would actually result in a rate
adjustment of 1.0f / rate, so do the same here.

See #2891
2022-12-29 12:22:56 +01:00
Barnabás Pőcze
73c5f6e1bf pipewire: module-roc-{sink,source}: port to ROC v0.2.X
Incompatible changes between ROC v0.1.X and v0.2.X require
adjusting the ROC modules' code. The largest change is going
from `roc_address` to `roc_endpoint`. There is also a breaking
change, the removal of `local.ip` parameter from module-roc-sink
as `roc_sender_bind()` has been removed.

The API usage was modelled after https://github.com/roc-streaming/roc-pulse

See #1757
Fixes #2911
2022-12-29 10:13:30 +00:00
Robert Mader
be99aa1eba gst: deviceprodiver: Add fd property / camera portal support
Add a `fd` property to `GstPipeWireDeviceProvider` so it can be used
with fds obtained from e.g. the camera xdg-desktop-portal.

This is needed so apps like Cheese or Camera can easily implement the
camera portal.
2022-12-27 23:43:22 +01:00
Robert Mader
2bc3e0ca10 gst: deviceprodiver: Use GstPipeWireCore and some cleanups
Quoting the commit introducing `GstPipeWireCore`:
```
Make all sources in the same process with the same fd share the
connection to the server. This makes it possible to set the same
fd on multiple sources/sinks and have them all use the same
connection, like when capturing multiple monitors from screencast
with the portal.
```

Do the same for `GstPipeWireDeviceProvider`, so it can share a
connection with device sinks as well. This will be needed for fd based
connections introduced in the next commit.

Further more it allows some cleanups.

1: 70652d1a37
2022-12-27 23:36:36 +01:00
columbarius
9f1311a2e0 examples: only use memfd_create when defined
See #987
2022-12-20 10:42:28 +01:00
Julian Picht
8c0a94c9d8 module/roc-*: fix position of comment 2022-12-19 12:47:47 +01:00
Julian Picht
b47e799c9a module/roc-*: implement audio.rate 2022-12-19 12:25:33 +01:00
Wim Taymans
846dbce7f1 doc: update after PIPEWIRE_DEBUG changes 2022-12-16 18:29:19 +01:00
Wim Taymans
f4f316b951 filter-chain: move fft to dsp_ops 2022-12-16 11:30:18 +01:00
Wim Taymans
b6b6efff42 convolver: use normal float for complex float array 2022-12-16 10:51:19 +01:00
Wim Taymans
538b6ce35e filter-chain: use dsp sum/copy/clear functions 2022-12-16 10:22:01 +01:00
Wim Taymans
0f2f113bdc filter-chain: add optimized sum function 2022-12-16 10:19:20 +01:00
Wim Taymans
cd38d7b53b filter-chain: move functions to separate struct
So that it's easier to copy them.
2022-12-16 09:37:45 +01:00
Wim Taymans
fa10849139 filter-chain: pass dsp_ops around
Initialize dsp_ops in the filter-chain and pass it around.
2022-12-16 09:28:00 +01:00
Wim Taymans
f7c49bbdde pulse-server: add channel-map in echo-cancel module 2022-12-15 13:12:47 +01:00
Wim Taymans
5f30ccae50 pipewire: remove redundant code
The generic code can now also handle the single character debug
specification.
2022-12-14 18:54:50 +01:00
Wim Taymans
9b3b6e2401 pipewire: support global log level in PIPEWIRE_DEBUG
Add support for PIPEWIRE_DEBUG=3,foo.bar:5 to set a global log level in
addition to specific topics.

Previously it would have to be done with *:3,foo.bar:5, which would not
really set a global level but all topics to the custom level of 3.
2022-12-14 18:00:54 +01:00
Wim Taymans
72bee99f87 pulse-server: add category for connection debug
Use a new conn. topic to debug the messages. These are disabled by
default.
2022-12-14 16:40:58 +01:00
Wim Taymans
34973eac89 pipewire: fix pw_debug_is_category_enabled()
The function was broken since the log topics were added.

Use the logger to init a topic with the given name and check if
there was a custom level for the topic.
2022-12-14 16:20:23 +01:00
Dylan Aïssi
cbc75dc98d pw-mon: recognize -N and -C as valid options 2022-12-14 11:07:42 +01:00
Wim Taymans
144df8675f audioconvert: enable channelmix.mix-lfe by default
It seems OK and SDL also seems to mix LFE by default so what could
possibly go wrong.

Fixes #2425
2022-12-13 16:29:46 +01:00
Wim Taymans
61750813ff filter-chain: move buffer resample to separate function
Fix the error paths.
Rename some variables around to make things clearer.
2022-12-13 12:18:46 +01:00
Dmitry Sharshakov
28af79be79 filter-chain: convolver: flush, add resampler quality option
Robustness fix: don't truncate IR, free the resampler state after use.
2022-12-13 10:09:55 +00:00
Dmitry Sharshakov
7950d3ff0d filter-chain: convolver: resample IR
Ensure correct filtering when node rate does not match filter rate
2022-12-13 10:09:55 +00:00
Wim Taymans
b5c21c1fbc pipewire: use dlclose unless PIPEWIRE_DLCLOSE is set to false
Always dlclose the libraries but use PIPEWIRE_DLCLOSE to override this
behaviour.

Fixes #2786
2022-12-12 17:11:04 +01:00
Wim Taymans
b29200ee82 pulse-server: add a pulse.cmd section
Add a new config section that can contain a set of commands to run after
starting.

There is only load-module available now but it can be used to remove the
dependency on pactl when starting the server.
2022-12-12 16:46:16 +01:00