Commit graph

6281 commits

Author SHA1 Message Date
Wim Taymans
dd21ebf6b8 module-rtp: just log generic sendmsg error debug log 2023-04-19 21:34:39 +02:00
Robert Mader
004206db37 gst/pipewiresrc: Let GstBaseSrc handle pseudo-live calculations
Let's avoid doing timestamp math as much as possible and let `GstBaseSrc`
do it for us instead.

This bring the source more in line with others in Gstreamer and
may help to avoid bugs and share concepts or code.
2023-04-19 19:22:24 +00:00
Wim Taymans
d1aeb8144b tools: add pw-config
Add a tool to debug how config files are loaded and merged.
2023-04-19 18:06:22 +02:00
Wim Taymans
543965a8c3 properties: add some more features to properties serialize
Add an option to put {} around the properties.

Add option to skip the keys and put [] around the properties.

Add option to recursively serialize properties.
2023-04-19 17:58:11 +02:00
Wim Taymans
048ba15f7f conf: expose some internal methods
Most of the config methods are usable without the context as well so
expose them.
2023-04-19 17:29:17 +02:00
Wim Taymans
52a3717693 conf: always fail when loading specified config name
When a config name was given and it fails to load, don't fall back to
client.conf but return the error. Only load client.conf when nothing
else was specified.
2023-04-19 12:47:18 +02:00
Wim Taymans
74b1b63c3d module-raop: implement remote volume
Intercept the volume property changes and trigger a set_parameter
with the volume property to control the remote volume.

Fixes #2061
2023-04-18 11:30:57 +02:00
Wim Taymans
bbf0ed063e pulse-tunnel: proxy volume/mute
Intercept the stream volume/mute and set it as the remove volume/mute.

Listen for remote volume/mute changes and set this as the local stream
volume. Make sure the adapter is using 1.0 software volume but reports
the real channelVolume of the remote stream.
2023-04-17 17:53:23 +02:00
Wim Taymans
680f12e437 stream: expose pw_stream_set_param()
Add a new pw_stream_set_param() method to configure a param on the
adapter.

This can be used to override the volume param for the adapter, for
example.
2023-04-17 16:21:34 +02:00
Wim Taymans
dad87fb3a8 module-x11-bell: move error to info
Make the XOpenDiplay call failure print an info message instead of a
warning. We usually ignore this error in the config file. Add a
suggestion for how to fix this issue in the info log.

Fixes #2918
2023-04-17 11:11:01 +02:00
Wim Taymans
aacd458b92 conf: shortcut failure
As soon as we find a failed match, break the loop so that we don't check
uselessly the other properties but that we proceeed to the next set of
properties to match.
2023-04-17 10:34:38 +02:00
Wim Taymans
27bc60aeab pipewire.conf: add condition for exec and modules
Add a condition to load the session manager and pipewire-pulse. This
makes it possible to disable the exec based on a context.properties
override.

Add a condition to load the access module. This makes it possible to
disable the default access behaviour and override with a custom one.

Fixes #3160
2023-04-17 10:34:21 +02:00
Wim Taymans
647c55dba9 filter-chain: improve error reporting
Log en error message when config section is missing or doesn't have
an object.
Log warning when ignoring an unknown key.
2023-04-16 20:35:12 +02:00
Wim Taymans
381be87e37 filter-chain: config is only required for bq_raw
Fixes #3161
2023-04-16 18:38:52 +02:00
Wim Taymans
f318edb699 metadata: add support for initial metadata
Add a metadata.values property that is used to fill the metadata store
with initial values.

Fixes #3076
2023-04-14 15:07:26 +02:00
Wim Taymans
ccd118368e pw-metadata: add -l option to list available metadata 2023-04-14 15:06:55 +02:00
Wim Taymans
6394eb1b18 metadata: return pw_metadata from factory create
That is what the factory return value says.
2023-04-14 12:50:07 +02:00
Wim Taymans
c968259348 module-rtp: silence some debug 2023-04-14 12:17:43 +02:00
Wim Taymans
a275e825c7 context: improve state calculations
Always make peers of non-passive links runnable, even if we already
visited the peer node. This makes non-passive links between drivers set the
drivers to runnable. (midi-bridge, source to sink). It also makes nodes
collected from the (link-)group runnable when they are linked together.

To calculate the runnable state of the other nodes, only start from
non-driver runnable nodes (like we already did when following links).

This makes a link from echo-cancel-source to echo-cancel-sink activate
the echo-canceler chain instead of staying idle.
2023-04-14 12:01:03 +02:00
Wim Taymans
0962555291 gst: implement renegotiation
If the stream format changes, set the basesrc caps again before pushing
a new buffer.

See #3147
2023-04-14 10:42:01 +02:00
Wim Taymans
b84083a1bb pulse-server: improve echo-cancel aec_args parsing
Actually convert the aec_args argument to something that the
echo-canceler will understand. Add the beamforming and mic-geometry
and target_direction properties.
2023-04-13 17:38:26 +02:00
Wim Taymans
94a1531ec5 thread-loop: remove callbacks in destroy
Make sure the pw_loop doesn't call our callbacks anymore after we are
destroyed.

See #3150
2023-04-12 16:46:39 +02:00
Robert Mader
5fc782b893 pipewireclock: Disable clock_reset() for now
This was introduced in 4faa28fd96 in order to correctly map the time
from the stream. From d52df30c88 on, however, the clock switched to
monotonic time, which does not need the extra-offset.

Disable `clock_reset()` for now but leave it in place so we can easily
reenable it once we use the stream time again.

This fixes video recording in Cheese and similar apps.

Closes https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/3149
2023-04-12 10:13:54 +00:00
Wim Taymans
bd04af6cc9 context: handle non-passive driver links to itself
A non-passive link between the driver and itself should make the driver
active as well.

This makes the midi-bridge running when linking its ports. It also activates
a sink when its monitor ports are connected to its playback ports.

Fixes #3153
2023-04-12 12:05:47 +02:00
Wim Taymans
2a5c23c811 module-echo-cancel: support different channels per stream
Make the channels configurable for capture, source, playback and
sink streams. The playback and sink stream need to have the same number
of channels but the layout can be different.

Use init2 of the echo-cancel plugin when available to pass this info
around. The echo-canceler will then further adjust the settings to make
things work.
2023-04-11 16:55:48 +02:00
Wim Taymans
8748c77451 context: make driver runnable when we add a runnable node
Explicitly make the driver runnable when we add a runnable node to it.

We have to do this because the runnable node might not be directly linked
to this driver.

In the case of the echo-canceler, for example, a playback stream
can be linked to the sink before the echo canceled virtual sink.
All echo-cancel nodes are added to a source driver, which would not be
activated because there is no direct path from the playback stream
to the source river.

Fixes #3145
2023-04-11 16:31:44 +02:00
Wim Taymans
f64c21ed81 filter-chain: fix bq_raw activate
The raw biquad takes its values from the config and then updates the
control ports with them in activate. At runtime, the changes to the
ports are applied to the biquad.

Other biquads take values from the config ports in activate.
2023-04-07 16:45:28 +02:00
Wim Taymans
880c1b0bd6 module-filter-chain: add raw biquad
Add bq_raw that allows access to the raw biquad filter values.

Fixes #3139
2023-04-06 18:28:49 +02:00
Wim Taymans
148569279b pulse-server: add enable_opus support in rtp-send 2023-04-06 12:10:46 +02:00
Wim Taymans
0520db8d5f module-sap: add opus to sap receiver 2023-04-06 12:10:25 +02:00
Wim Taymans
e5cf9ba1fd modules: update docs 2023-04-06 11:49:25 +02:00
Wim Taymans
7f7821c3f2 module-raop: handle 0 timing_port
When the timing_port is 0, just don't send out an initial timing packet.

When we receive a timing packet, reply to the same address/port that the
timing packet was sent from.

Fixes #3133
2023-04-04 17:55:02 +02:00
Wim Taymans
e0a09ccf31 private: don't block context related problems, just emit a warning 2023-04-04 16:20:10 +02:00
Wim Taymans
74831aa967 support: add support for checking loop context
Add check for running the the loop context and thread.

Add checks in filter and stream to avoid doing things when not run from
the context main-loop because this can crash things when doing IPC from
concurrent threads.
2023-04-04 16:19:41 +02:00
Wim Taymans
a6497839bb stream: move some code around
So that we don't have to call public API internally. We might want to
add some checks there later that don't need to happen when called
internally.
2023-04-04 16:16:47 +02:00
Wim Taymans
f2be2923e6 thread: use pthread_equal to compare thread ids 2023-04-04 12:43:25 +02:00
Wim Taymans
edbfd180d0 thread-loop: only restore recurse on error
Only restore the previous recurse state when we fail to unlock.
2023-04-04 12:20:56 +02:00
Wim Taymans
aa2ea737c7 thread-loop: add some additional check
Check for errors from pthread_ functions and log an error.
Check the recursion count to check if locks were correctly taken.
2023-04-04 11:34:03 +02:00
Wim Taymans
796a0d2cfe thread-loop: small cleanup
Use named fields for the event, prefix function.
2023-04-04 11:12:13 +02:00
Wim Taymans
8b1902c825 echo-cancel: reset buffers in suspend
Or else some stay samples from the previous run might be played when
resuming.
2023-04-04 10:17:44 +02:00
Wim Taymans
9664787cff context: Only activate runnable nodes
Rework the runnable state calculation. It works in 2 steps now:

1. Collect all nodes linked to a driver in some way. Mark nodes that
   are reachable with a non-passive link as runnable.
2, Go through all runnable nodes and set all linked nodes to the
   runnable state as well, up to the driver.

Step 2 is new. Previously if there was just one runnable node, *all*
nodes would be set to runnable. With the addition of step 2, some nodes
might remain idle when they are not used.

This has the effect that virtual sinks without inputs stay idle when
the driver is otherwise running. Grouped nodes (like the RTP session)
will now also only run the linked nodes.
2023-04-04 10:17:44 +02:00
Wim Taymans
35d2bce24b context: also follow link-groups
Nodes from the same link-group also need to be linked together to the
same driver.
2023-04-03 16:59:17 +02:00
Wim Taymans
147674c5dd Revert "context: handle link-group nodes"
This reverts commit 2bfe772bb4.

This does not take into account nodes recursively becomming runnable and
so does not set the runnable state on all nodes correctly, like for
combine-stream.

Revert for now, it probably requires a new algorithm to make this work.

See #3128
2023-04-03 10:25:58 +02:00
Wim Taymans
0873c6942a stream: don't crash when _set_control is given 0 values 2023-03-31 11:28:55 +02:00
Wim Taymans
bed961a4b2 keys: update comment 2023-03-31 10:33:20 +02:00
Wim Taymans
9485b2819a impl-node: add support for node.force-rate=0
If you set node.force-rate=0, the rate will be forced to the node.rate
denominator.

This makes it possible to autiomatically make the graph switch to the
native rate of the stream by setting this as the default property on
streams.

See #3026
2023-03-31 10:30:36 +02:00
Wim Taymans
7372a078b4 context: don't try to restore rate on !runnable nodes
There is no point in trying to restore a node to the default rate when
it's not going to run.

This avoids loops when rate switching from one forced rate to another.
2023-03-31 10:14:36 +02:00
Wim Taymans
917d865ea8 stream: invoke RequestProcess in the main loop
pw_stream_trigger_process() can be called from any thread but the
RequestProcess event always needs to be scheduled in the main-loop.
2023-03-30 16:39:32 +02:00
Wim Taymans
d3bd687bc2 buffers: add new ASYNC flag
Make sure we allocate at least 2 buffers when we are dealing with an
ASYNC node. This ensures that an adapter without a converter will at
least negotiate to 2 buffers when the follower stream is async (such as
is the case with pw-cat).
2023-03-30 15:03:29 +02:00
Wim Taymans
a163f29a43 improve logging 2023-03-30 15:03:21 +02:00