Commit graph

6048 commits

Author SHA1 Message Date
Wim Taymans
e7a9dcfacc impl-node: improve profile reporting
Handle the update of the activation status before calling resume_node()
because we can call this when starting a cycle or when completing
a node.

Only set the AWAKE status and time in process_node when not exported or
not driving. For an exported driving driver, the server will have
already updated the values before it triggered our last process and then
completed the graph. If we update again in the client, the server will
read wrong values.

Because there is not really a way yet to get the finish time of the remote
driver the awake and finish times are too early. We might be able to fix
this later by making the stats at the start of the cycle from the
previous values.

Keep 2 extra variables to record the driver start and previos driver
start values. This way we can measure the period. This used to be done
with a little hack, using the finish_time of the driver, which was set
previously in resume_node().

For exported driving nodes, the TRIGGERED time is set in the remote-node
before it writes the eventfd to trigger the node_ready event. For
non-exported nodes, we need to set this ourselves.

For non-driver nodes that trigger node_ready, mean that they did an
async resume of the node. This means the node is finished and we can set
the finish_time accordingly.
2023-04-26 16:46:13 +02:00
Wim Taymans
4df2982ba1 impl-node: refactor gettime 2023-04-26 16:43:01 +02:00
Wim Taymans
5e6dc48013 impl-node: initialize the driving state correctly
A new node is driving only when it is a driver.
2023-04-26 16:37:01 +02:00
Wim Taymans
5303fced50 client-node: pass the ready status in the activation state
Pass the ready status to the client-node using the state array.

Don't just SPA_STATUS_HAVE_DATA on the server side but use the value
from the client.

This avoids some potential extra work when a driver sink pulls in data
with the NEED_DATA ready callback but then the server performs the
actions (tee) as if it were SPA_STATUS_HAVE_DATA.
2023-04-26 15:56:29 +02:00
Wim Taymans
989f597860 client-node: update the driving node status
Look at the clock and position to see if we are selected as the driver
or not.
2023-04-26 15:47:41 +02:00
Wim Taymans
a544c5d4ad impl-node: don't move rate/quantum when moving drivers
When we move a node from one driver to another, don't move the rate
and quantum because this tricks the new driver into thinking it's
already in the correct rate and it will skip doing a complete rate
switch.

This causes some nodes to fail to switch to the new rate, like in this
scenario:

1. mpv (node.always-process = true) appears and is added to the dummy
   driver with rate/quantum of 48000/512
2. mpv is linked to an equalizer, linked to a sink, nodes are moved
   to the new sink, target rate/quantum is copied to the new sink.
3. sink and followers are started in 48000/512, all is good. The sink
   is now configured in 48000/512.
4. mpv is stopped, sinks and eq (input, not output) suspend
5. mpv appears again with 44100/512 and is added to dummy driver, which
   is then configured in 44100/512
6. mpv is linked again to eq, nodes are moved, the sink rate/quantum
   is copied and the sink thinks it's in 44100/512
7. sink and followes are started but no rate switch is happening because
   rate/quantum was copied in step 6. Some followers are not suspended
   and don't apply the rate change correctly (eq output).

By eliminating the rate/quantum copy when moving drivers, the sink will
correctly perform the rate change on all nodes.

Fixes #3159
2023-04-25 10:13:02 +02:00
Wim Taymans
12bc69a469 raop-sink: only set volume when connected
Only attempt to set the volume when connected. Apply the current
volume after connecting.

Based on patch by Tycho Haemers

Fixes #3175
2023-04-22 11:16:55 +02:00
Wim Taymans
68664adcd4 filter-chain: improve debug 2023-04-21 18:25:01 +02:00
Wim Taymans
64aae9d551 module-echo-cancel: set rec/source/play_info fields correctly
In the fallback case we need to set them all to the same format as
the playback.
2023-04-21 18:23:53 +02:00
Wim Taymans
b9cf2638b3 client-node: remove hardcoded limit for io areas
When we run out of io_areas, just allocate another memblock and continue
with the new block.
2023-04-21 15:45:25 +02:00
Wim Taymans
76c793128b jack: Add jack.max-client-ports config option
Limit the amount of ports per client to 768 and add a
jack.max-client-ports option to configure this.
2023-04-21 15:42:57 +02:00
Wim Taymans
bf18ba839f protocol-native: add some more debug 2023-04-21 15:07:29 +02:00
Wim Taymans
e75fc459b3 jack: add jack.show-midi option
Add an option to show of hide MIDI ports, true by default.

Add jack.show-midi to config
2023-04-21 15:07:26 +02:00
Wim Taymans
0333ddff45 pod-builder: move some code around to help gcc 13
Make sure to pop the frame before returning errors to stop gcc13
from complaining with -Wdangling-pointer

Fixes #3171
2023-04-20 17:52:27 +02:00
Wim Taymans
181cbc5c99 pw-config: fix include for isatty 2023-04-20 10:40:47 +02:00
Wim Taymans
e90e948166 man: add pw-config man page 2023-04-20 10:24:29 +02:00
Wim Taymans
2d388c6908 properties: add color support for dumping properties 2023-04-20 10:02:08 +02:00
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