Commit graph

5221 commits

Author SHA1 Message Date
Wim Taymans
be1d4940a3 protocol-native: initialize fields
Set some of the fields to default values.

Fixes #2852
2022-11-24 09:40:14 +01:00
Wim Taymans
0f79014e18 filter-chain: add some optimized mix functions 2022-11-22 17:59:44 +01:00
Wim Taymans
9d8edef1a0 client-node: guard against NULL resource
When destroying, the resource can be NULL (mix->io should also be
NULL ideally so we can check first).

See #2847
2022-11-21 20:20:16 +01:00
Barnabás Pőcze
67e77d13f6 client-node: set port data before calling _set_mix()
First set some of the port flags and data, especially the owner_data
before calling pw_impl_port_set_mix(), which will use the owner_data
to send the mix_info.

See #2847
2022-11-21 20:15:39 +01:00
Wim Taymans
8e9b136b10 jack: use node.passive to make passive links
Let the node.passive property make passive links. PIPEWIRE_LINK_PASSIVE
overrides the node property.

Add some nice tweaks for qsynth so that it suspends and fades out
nicely by default.
2022-11-21 16:02:30 +01:00
Wim Taymans
ead59e750f stream: get info from Position in Start
When we start, read the Position IO so that we collect the right quantum
etc before calling the process callback. This updates the requested
frames value in the buffer correctly with the current quantum instead of
using 0.

This fixes an issue in pw-cat with midi data. The first buffer has a
requested size of 0 and so the first events won't fit in it and are
discarded.

Fixes #2843
2022-11-21 15:22:33 +01:00
Wim Taymans
0918899bf8 client-node: send the mix_info before Buffer IO
We don't always need to send buffers to a remote port, when the port
is an output port, all the mix ports use the same buffers. This means
that when we add another link to a port, we don't get the mix_info
anymore and then we don't know the peer_id and we don't complete the
link and we don't call the connection_callback.

Instead, send the mix_info right before sending the Buffer Io area. We
always do this for all mix io and after we have sent the buffers so this
is a better place.

Fixes #2841
2022-11-20 19:24:01 +01:00
Wim Taymans
a0adb52124 pulse-server: add a pulse.idle.timeout option
When a client is not sending any data when it should be and causes an
underrun, mark it as idle and record the timestamp.

When a client is idle for pulse.idle.timeout seconds, set the stream
as inactive. When more data is received, set it back to active.

Add a pulse.idle.timeout option to set a global server default or
a per-stream value. Set the server default to 5 seconds. A value of 0
can be used to disable this feature.

With this change, badly behaving clients that are not sending any data
will be paused so that the sinks can suspend to save battery power.

Fixes #2839
2022-11-20 16:20:05 +01:00
Wim Taymans
b1c0662a00 pipewire-pulse: improve parsing of defaults
When we fail to parse a fraction from the config, give a warning and
continue with the default settings.
Print the final parsed value as debug.
2022-11-20 16:19:24 +01:00
Wim Taymans
fc159be9c6 pulse-server: make method to pause/resume stream
Make a method to pause and resume a stream and keep track of the paused
state of the stream. Use this function instead of setting the stream
inactive/active so that we get nice logging for each state change.
2022-11-20 16:19:24 +01:00
Wim Taymans
72912c9589 pulse-tunnel: improve latency property docs
To make it clear it needs to a number only (without ms at the end)
2022-11-17 19:04:46 +01:00
Wim Taymans
3085e312b6 pulse-server: handle server started and stopped events
When a server is started, try to publish the pending services.
When a server is stopped, republish the services.

This makes it possible to load and unload the tcp protocol after loading
the zeroconf publish module and it will do the right thing.
2022-11-17 18:36:47 +01:00
Wim Taymans
a11612bdad pulse-server: add event to the implementation
Add events when a server is started and stopped
2022-11-17 18:31:23 +01:00
Wim Taymans
ab5fe8957b pulse-server: use running servers to publish zeroconf
Loop over the servers and use its family and port to publish the
zeroconf services.

This avoids exposing the services when we don't have any TCP servers
running to accept connections.

It also avoids exposing the services twice with both IP4 and IP6
addresses.

It also exposes the services with a port that is actually usable, in
case it's not the same as the default port.
2022-11-17 17:07:38 +01:00
Wim Taymans
80983b9fb6 examples: improve console output
Go back up right before we're going to draw so that we're always at
the bottom when we quit because of ctrl-C.
2022-11-17 15:56:39 +01:00
Wim Taymans
945529f029 modules: actually copy the network property to the stream
Fixes #2384
2022-11-17 15:56:39 +01:00
Wim Taymans
88dec1d378 impl-module: turn warning into info
Errors while loading a module does not have to be fatal, it depends on
the config flags. Turn an error into info and log an error only
when needed.
2022-11-15 09:41:48 +01:00
Gleb Popov
525e7aa734 FreeBSD build fixes. 2022-11-14 21:03:22 +03:00
Gleb Popov
018058ea35 Fix copy-paste typo in the warning message. 2022-11-14 20:58:14 +03:00
Gleb Popov
781b7b187a Add a type cast necessary to compile on FreeBSD. 2022-11-14 19:57:08 +03:00
Wim Taymans
b913f1b1a7 add some more debug 2022-11-14 11:23:12 +01:00
Wim Taymans
41d8afa404 pipewire: increase max-rates to 32 2022-11-13 09:40:49 +01:00
Wim Taymans
ea4e5cf364 context: avoid useless graph recalculations
Only recalculate the state of the graph when we actually managed to
suspend a driver node.
2022-11-11 19:41:49 +01:00
Wim Taymans
518ccdf624 jack: add jack.filter-char to specify the filter character 2022-11-10 17:40:25 +01:00
Wim Taymans
b720da771e pulse-server: also advance read pointer in underrun
So that we ask for more data from the client.

Also retested with #2799 that caused this regression.

Fixes #2821
2022-11-10 16:13:33 +01:00
Wim Taymans
e3ece6db54 gst: hide the libcamera device provider 2022-11-10 09:38:46 +01:00
Julian Bouzas
bc2a02c283 echo-cancel: add option to make echo-cancel sink node a monitor
The monitor mode does not create a echo-cancel-playback node, and makes the
echo-cancel-sink node to be a monitor node with media class Stream/Input/Audio
(instead of Audio/Sink).

Some applications get confused when their output stream node is not linked
directly to the actual device node. Having echo-cancel-sink as a monitor node
avoids this problem, allowing those applications to work properly even if echo
cancel is enabled.

This mode is disabled by default. You can enable it by passing the specific
option  (monitor.mode = true) in the args when loading the module in the
pipewire context.modules configuration section.
2022-11-07 17:21:21 +00:00
Wim Taymans
34db6b80c6 context: improve graph rate selection
If a node suggests a graph rate that is not in the list of allowed
rates, find the closest matching rate in the allowed rate instead of
just using the default.

When playing a file with a rate of 352800 and allowed rates of 44100,
48000, 96000 (default rate 48000) this will switch the graph to 96000
instead of the default 48000, which requires less resampling.
2022-11-07 17:58:16 +01:00
Wim Taymans
02add5b3db impl: don't return -ENOENT when no params
We checked above if the param is supported and return -ENOENT already.

When we actually go enumerate the params but don't have any, return 0
and not an error.

Fixes wireplumber#370
2022-11-07 12:36:15 +01:00
Wim Taymans
7631316186 buffer: add option to reverse filter priority
By default, buffer negotiation favours the default property values of
the output node. Make this configurable and reverse this logic when the
output is a driver.

This makes it so that a stream connecting to a source will negotiate
with the preferences of the stream and not the source.

An example is a stream that wants 4 buffers from v4l2-source, because
v4l2-source has a default of 4 buffers, this will always result in 4
buffers, ignoring the preference of the stream.
2022-11-04 15:22:01 +01:00
Wim Taymans
44d743ed95 spa: make all format parsing fields optional
Just like the optional build, make all field parsing optional. This
will leave the fields with their default values if they are not parsed
from the param.

We can then remove our custom functions and use the generic ones in
various places.
2022-11-03 13:13:07 +01:00
Wim Taymans
74447acedb Add some more format checks
The format parse functions don't really check if the parsed values
make any sense so we need to to this ourselves.
2022-11-03 13:10:32 +01:00
Wim Taymans
c30d743198 pw-top: initialize info struct with 0
So that we don't accidentally print uninitialized values.
2022-11-03 13:08:48 +01:00
Wim Taymans
e3a4797063 pw-top: support MJPG and H264 formats 2022-11-02 17:14:40 +01:00
Wim Taymans
3e4da8e8e4 filter-chain: emit en error when graph fails 2022-11-02 12:58:37 +01:00
Wim Taymans
f6e76f8356 filter-chain: add more default LADSPA search paths
Add /usr/lib/ladspa and LIBDIR to the default search path as well.
2022-11-02 12:57:16 +01:00
Wim Taymans
8ab70d02dc stream: guard against node destroy 2022-11-02 12:56:45 +01:00
Wim Taymans
ef8114ff0c filter-chain: improve some error messages 2022-11-02 12:42:31 +01:00
Wim Taymans
6bb73124aa filter-chain: improve some float handling
Avoid some double to float conversions.
Use fmin and fmax.
2022-11-02 12:41:20 +01:00
Wim Taymans
f801dc0886 pulse-server: keep read index in sync
Keep the ringbuffer and read_index variable in sync or else we might ask
for more data than maxlength and cause an overflow.

Fixes #2799
2022-11-02 11:43:30 +01:00
Wim Taymans
c5f7d3a728 param: improve pw_param
Add a sequence number to pw_param.
Add param_info to param_update to filter out the params of the latest
sequence number.

This can be used to track params from a certain sequence number. Update
node, port and device.
2022-10-30 14:57:04 +01:00
Ashok Sidipotu
f383956b7b module-pipe-tunnel: Update the description of the module. 2022-10-28 07:07:43 +00:00
Ashok Sidipotu
315b2d1ad5 module-pipe-tunnel: Initialize the target.node property
Initialize the PW_KEY_TARGET_OBJECT property on the stream node based on the
user config.
2022-10-28 07:07:43 +00:00
Wim Taymans
e6fd5888ee param: add a new user seq field in the param-info
Add a new seq field in the param-info struct. Users can use this
field to keep track of pending param updates.

Store the latest seq number of the param update in the seq field. Remove
all params that don't match the sequence number because they are too
old. This avoids duplicate old params in pw-dump output.

Rework the pulseaudio manager with this same method.
2022-10-27 20:10:33 +02:00
Wim Taymans
a989230cb5 introspect: update the info more carefully
Only change the fields we care about and leave the other ones
untouched in the created info.
2022-10-27 20:09:25 +02:00
Wim Taymans
d2aa240767 introspect: handle NULL result from info updates 2022-10-27 20:06:54 +02:00
Wim Taymans
552d4516b6 params: count params per id from 0
Only increment the index when we find the requirested param, this
makes the params go from index 0 to the last instead of starting at some
random index. The random index is not really a problem but it is also
no so nice.
2022-10-27 19:20:40 +02:00
Wim Taymans
f0328a1f8d protocol-native: improve logging
Add an end marker in the log for the message.
Log the output messages with the right log topic.
2022-10-27 18:04:14 +02:00
Wim Taymans
d247db8d26 pw-top: improve output
Show the node state in the S column
Use the node state to show or hide info, this will only show info for
active nodes.
Do redraw updates when something important changes
Update man page
2022-10-25 16:24:03 +02:00
Christoffer Gydenius
b35983eb7e module-echo-cancel: aec-plugin parameters
Make it possible for a aec-plugin to provide props/params
through module-echo-cancel and make it possible for a
aec-plugin to listen and react to these props/params getting updated.

Add method enum_props() that is used under setup_streams() to
get props from aec_plugin.
Add get_params() and set_params() for updating and getting
aec-plugin params under the input/output_param_changed calls
and getting params under setup_streams().
2022-10-24 16:58:00 +02:00