Commit graph

8761 commits

Author SHA1 Message Date
Antonio Larrosa
3a18da7cc3 pw-link: Support creating links for all ports from a node to another
This allows to call pw-link with output and input nodes instead of
ports and pw-link will connect all output ports from the first node
to all input ports in the second node by port-id.

Note that the number of ports in each node isn't checked before
starting, so the ports will be connected until there's no matching
port to connect (i.e. if the output node has 2 output ports and
the input node has 5 ports, then only the first two ports will be
connected).
2022-04-22 17:29:52 +00:00
Wim Taymans
368dd51d04 modules: update docs 2022-04-22 17:29:40 +02:00
Wim Taymans
553bb3f5ed modules: update docs 2022-04-22 17:08:45 +02:00
Wim Taymans
8807aa1dcd module: add docs 2022-04-22 16:51:27 +02:00
Wim Taymans
de4b021b34 modules: add docs 2022-04-22 16:44:15 +02:00
Wim Taymans
89010410eb modules: add more docs 2022-04-22 16:08:26 +02:00
Wim Taymans
e3b17581f2 modules: more docs 2022-04-22 15:18:24 +02:00
Wim Taymans
faf674a327 pulse-server: use config.ext for streams
Use the module config.ext to load extra stream properties and rules.
2022-04-22 14:54:27 +02:00
Wim Taymans
2402904e1e conf: support config section extensions
Add support for loading an additional config section when the config.ext
property was set.

This makes it possible to have per module config of stream.properties
and rules sections.

One use case is when there are multiple module-protocol-pulse modules
loaded where each module will use a different set of *.properties
and *.rules from the config. Each module will have a config.ext
property in the args with the suffix of the section that is loaded.
2022-04-22 14:50:39 +02:00
Wim Taymans
59461113ba context: make dict const
The match rules operate on a const struct spa_dict.
2022-04-22 13:10:08 +02:00
Wim Taymans
fcc6f7fc7c module-filter-chain: some more docs 2022-04-22 11:33:04 +02:00
Wim Taymans
932bbe4de6 module-filter-chain: add support for double params 2022-04-22 11:04:09 +02:00
Wim Taymans
ad178b8b5c module-filter-chain: add docs 2022-04-22 11:03:51 +02:00
Wim Taymans
61d318125e move PIPEWIRE_PROPS to stream and filter
Make all streams and filters handle PIPEWIRE_PROPS.
The order for applying stream/filter properties is:

1) application provided properties.
2) generic config.
3) match rules.
4) environment variables (PIPEWIRE_PROPS, ...) from generic to
   more specific.
5) defaults.
2022-04-22 09:37:21 +02:00
Wim Taymans
5a023c8c84 alsa: fix argument type for Long
Fixes #2271
2022-04-21 22:13:16 +02:00
Wim Taymans
10af59bdc2 modules: update docs 2022-04-21 20:22:45 +02:00
Wim Taymans
75f4fca1d7 module-loopback: add docs 2022-04-21 20:12:26 +02:00
Antonio Larrosa
36060e375d Support creating links for all ports from a node to another
This commit allows to specify the port-ids as "*" in
create-link in order to connect all output ports from the
first node to all input ports from the second node (in
port-id order). For example, executing something like:

`create-link my-virtual-device * alsa_output.usb-headset *`
2022-04-21 17:06:46 +00:00
Wim Taymans
da6ab064d2 stream: add stream.rules and filter.rules 2022-04-21 16:28:08 +02:00
Wim Taymans
d63deb140c conf: fix typo 2022-04-21 13:15:12 +02:00
Wim Taymans
d1207422e0 make NODE_WANT_DRIVER=true the default
So that all nodes attach to some driver to be scheduled.

For the virtual sink/sources this is a normal thing and we can remove
the custom settings.

For normal stream, this now makes it possible to link pw-play directly
to pw-record and have it transport data.

Fixes #1761
2022-04-21 10:14:53 +02:00
Wim Taymans
9a5fbd26df filter-chain: make sink-eq stereo to avoid confusion 2022-04-21 09:39:04 +02:00
Wim Taymans
fed6f6d834 filter-chain: increase max gain for biquads 2022-04-21 09:38:35 +02:00
Wim Taymans
01a7d6709b modules: don't unload on stream errors
It's possible that the stream is sent an error when the session manager
can't link the node (because, for example, the sink/source is not
available yet). We should not stop but just log this error.

When the session manager actively kills the stream (when it is
reconnected while the DONT_RECONNECT flag is true) we will end up in the
UNCONNECTED state and that's when we can unload the module.
2022-04-21 09:02:02 +02:00
Wim Taymans
f205a09ade module: handle error and unconnected states
Unload the module on error/unconnected
2022-04-20 19:33:18 +02:00
Wim Taymans
26471ff2da module-loopback: unload the module on stream unconnect
When one of the streams is unconnected, unload the module. This is
what happens when the node was set as dont_reconnect with a node
target.

Fixes #1754
2022-04-20 19:25:42 +02:00
Wim Taymans
e353999028 channelmix: use average for center and LFE
Stops the LFE from clipping.
2022-04-20 16:09:39 +02:00
Wim Taymans
f6dbd75e61 context: rework node states some more
Make collect_nodes return a list of all nodes that are in some way
linked to the node and need to be scheduled as a group.
Move all the collected nodes to a driver, a fallback driver or away
from a driver.

This fixes some cases where nodes were moved quickly between drivers,
causing a lot of activation messages to be sent and fds to be dupped.
Nodes should now only move when needed with minimal amount of
changes to their state.

See #2309
2022-04-20 13:11:14 +02:00
Wim Taymans
cc7aadde8a connection: debug when we close fd
Also handle DUP failure.
2022-04-20 12:13:41 +02:00
Wim Taymans
a112446dab contect: also remove the original node passive state
When we have a non-driver node, also remove the passive state when
we find active links to another node.

Fixes #2309
2022-04-20 10:44:50 +02:00
Wim Taymans
e21efd40bb context: make sure we clear the visited flag
Do a separate pass to clear the visited flag of the nodes because
collect_nodes might set them after we cleared them.
2022-04-20 10:43:57 +02:00
Wim Taymans
d0886a16a2 resample: limit buffer input size to input maxsize
And not the output buffer maxsize.
2022-04-19 19:58:41 +02:00
Wim Taymans
df98c748b4 man: update pw-top man page 2022-04-19 19:50:08 +02:00
Wim Taymans
32b2377de3 pw-cat: don't start drain on 0 request size
When the stream requests a 0 size buffer, don't start the drain but
simply queue a 0 size buffer.

Sometimes, switching quantums and drivers might request a 0 buffer
async and this should not cause a drain operation.
2022-04-19 18:29:47 +02:00
Wim Taymans
96286fb8b1 resample: use a -1 buffer size to drain
Use the special -1 buffer size to start the drain so that we can
also handle 0 buffer sizes.
2022-04-19 18:28:59 +02:00
Wim Taymans
cbef4a601f pw-top: improve error output
Print +++ when the node was signal/awake but not awake/finish.
Print --- otherwise.
2022-04-19 17:49:46 +02:00
Wim Taymans
ee2b20a55c pw-top: handle invalid timings
Handle invalid signal, awake and finish timings by placing
*** instead of huge numbers.
2022-04-19 17:35:51 +02:00
Wim Taymans
7b225708e9 test: getopt_long returns an int
./spa/plugins/alsa/test-timer.c: In function ‘main’:
../spa/plugins/alsa/test-timer.c:224:79: warning: comparison is always true due to limited range of data type [-Wtype-limits]
  224 |         while ((c = getopt_long(argc, argv, "hD:f:r:c:", long_options, NULL)) != -1) {
      |
2022-04-19 16:48:27 +02:00
Wim Taymans
1dcc81b260 man: improve pw-top man page 2022-04-19 15:20:10 +02:00
Wim Taymans
e3ff445d4b pw-top: clear errors when idle 2022-04-19 12:26:20 +02:00
Wim Taymans
be11da540a pw-top: clear measurements when idle 2022-04-19 12:23:48 +02:00
Wim Taymans
ae8c6f827b pw-top: remove nodes from driver when idle
When we detect that no new profiler info has arrived for a node, assume
it was removed from the driver.

This avoids having idle nodes seemingly attached to an idle driver
when there is no activity.
2022-04-19 12:06:53 +02:00
Wim Taymans
26db2f1ec9 module-pulse-tunnel: clear ringbuffer on cork 2022-04-19 10:51:45 +02:00
Wim Taymans
182b3c8798 context: rework state calculations
We can only call collect_nodes() once because it sets the visited state
to true.
So, move the unassigned nodes to the fallback driver but when they are
passive (nothing is linked), move them back to the NULL driver.

This fixes a case where when the fallback driver changes, only some
nodes are moved to the new driver (because the other ones were already
visited in the collect_nodes() check before).
2022-04-19 10:39:38 +02:00
Wim Taymans
4cc0082634 module-pulse-tunnel: move some info log to debug 2022-04-19 09:58:18 +02:00
Wim Taymans
cdbdcd6771 module-pulse-tunnel: improve error recovery
Track the end-to-end latency of the stream and use that to drive
the resampler.
Hard reset the ringbuffer when under/overflow happens so that we
can recover quickly.

See #2230
2022-04-19 09:41:28 +02:00
Wim Taymans
c73c852413 pulse-tunnel: improve debug 2022-04-18 16:48:10 +02:00
Wim Taymans
ae194b6fe7 context: don't move passive nodes to fallback driver
Don't move passive nodes to the fallback driver when !always_process.

When we have a fallback driver, check if the node we want to add to it
is not a passive node (by doing collect_nodes), if it's passive and
doesn't always need to be processed, remove it from the driver.

This fixes the issue where nodes that are maked as want_driver are
unconditionally moved to the fallback driver (and activated) even if
there is nothing linked to them (passive).

Fixes #2309
2022-04-18 16:40:40 +02:00
Wim Taymans
1809a84562 context: ignore inactive nodes some more
Don't try to follow inactive node links.
Don't assign inactive nodes to a fallback driver.
2022-04-18 15:27:09 +02:00
Wim Taymans
0b96b87331 thread: implement some properties
Make helper method to parse thread properties and add 2 new properties
to control name and stack-size of the thread.
Use properties when creating threads with the default utils.
Use the default thread utils instead of pthread_create so that the
properties are used.
2022-04-18 13:02:27 +02:00