Commit graph

32 commits

Author SHA1 Message Date
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
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
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
cc39644253 modules: add pid to unique name
So that modules loaded from different processes don't generate the
same node names.
2022-04-01 15:22:48 +02:00
Barnabás Pőcze
45bd8532eb pipewire: use newly added function for deferred module destroy
Use the newly introduced `pw_impl_module_schedule_destroy()`
for deferred module destroy in all modules except
module-example-{sink,source}.
2022-02-18 12:30:53 +01:00
Barnabás Pőcze
4d4c6f20df pipewire: remove work queue checks
Since now `pw_context_get_work_queue()` cannot
fail, the checks can be removed.
2022-02-18 12:30:53 +01:00
Wim Taymans
a72a877515 modules: improve node.name
Make sure the node name is something unique for the capture and playback
part of filter-chain and loopback so that volumes can be remembered
separately.

Fixes #1983
2022-01-21 17:42:29 +01:00
Wim Taymans
c3725d5dde module-loopback: align stream media names to filter-chain 2022-01-03 13:14:29 +01:00
Wim Taymans
81f1a6c511 module-loopback: make unique media name per stream
If not otherwise set, the media.name will be the name used when
pw_stream_new(), which is the same for all loopback streams.
This makes the session manager restore the same volume for all
loopback streams.

Do something more clever and use the node.name + suffix to make
the name unique per stream if no media.name was given.

Fixes #1942
2022-01-03 13:00:15 +01:00
Wim Taymans
db77f6d37d stream: add TRIGGER stream flag
The trigger flag adds an extra dependency on the node so that it does
not automatically get scheduled. A manual scheduling is required with,
for example pw_stream_trigger_process().

This can be used to create an artificial dependency between a sink
stream and a source stream, like when using loopback or filter-chain.
Normally those streams are not linked in the graph but they have an
internal dependency. Without any such dependency, the source part of the
chain will be scheduled first and then the sink part and we get a
cycle of delay (with possible quantum change etc).

With this patch, the sink part will be scheduled first and its process
function will trigger the 'downstream' source stream explicitly. The
sink and source stream will stay in sync and will use the same quantum.
This reduces the latency and glitches because of quantum changes.

Fixes #1873
2021-12-08 20:29:15 +01:00
Wim Taymans
64d6ff4184 modules: flush and reset state in paused
So that we don't end up with previous data when we resume.

See #1660
2021-10-13 18:37:02 +02:00
Peter Hutterer
d8de1cb255 modules: switch to new property helpers 2021-10-13 07:12:00 +00:00
Peter Hutterer
14112fd168 modules: use the new topic-based logging from various pipewire modules 2021-09-28 09:35:39 +02:00
Wim Taymans
abf37f618e modules: ensure node.name and description are set
Most apps need this and some even crash when they are not set.
2021-08-20 09:26:17 +02:00
Wim Taymans
7d9dde0a1d loopback: pass all latency to the other stream
Latency configured on one streams needs to be passed directly to the
other stream.
2021-08-02 11:46:53 +02:00
Wim Taymans
6e44c081b0 modules: silence some useless warnings
Fixes #1423
2021-07-19 18:30:22 +02:00
Wim Taymans
c4971d17c4 keys: add node.link-group property
The node.link-group property marks streams that are internally linked
together in some way. It is used to relate the input and output streams
of some of the module streams.
2021-06-29 13:49:55 +02:00
Peter Hutterer
f181232a61 doc: add the documentation infrastructure for pipewire modules
All empty pages for now but at least this makes them show up in the
documentation.
2021-06-25 08:42:24 +00:00
George Kiagiadakis
59407d2f08 includes: update all references to extensions to point to pipewire/extensions
This also brings the advantage that all tools, examples, modules, components
can also be compiled standalone out-of-tree using libpipewire from the system
2021-06-18 17:54:18 +03:00
Wim Taymans
1f04e911c5 module: handle work queue create errors
Handle NULL when creating a work queue instead of crashing. The
create can fail when we run out of fds.
2021-06-18 16:29:23 +02:00
Peter Hutterer
e0471c6757 pipewire: allow NULL pointers in pw_properties_free()
Just like the real free() we should just ignore a NULL pointer, makes the
caller code easier for those instances where properties are optional.

Patch generated with concinelle with a few manual fixes.
2021-06-02 10:56:46 +00:00
Wim Taymans
06cf1e1c00 module: proxy latency params 2021-05-27 16:07:25 +02:00
Peter Hutterer
7697ed0757 treewide: replace strcmp() == 0 with spa_streq()
This change is only done in source files for now, header files will be done
separately.
2021-05-18 22:10:27 +10:00
Peter Hutterer
2405f0942b spa/buffer: rename SPA_MEMBER to SPA_PTROFF
SPA_MEMBER is misleading, all we're doing here is pointer+offset and a
type-casting the result. Rename to SPA_PTROFF which is more expressive (and
has the same number of characters so we don't need to re-indent).
2021-05-06 09:39:39 +00:00
Andrea Gelmini
36ebbfa71c
Removed duplicated includes
Signed-off-by: Andrea Gelmini <andrea.gelmini@gelma.net>
2021-04-30 18:16:25 +02:00
Wim Taymans
d560628e2a module-loopback: copy name and description
Also copy name and description to streams when speficified globally.
2021-04-23 11:00:47 +02:00
Wim Taymans
330e694e63 module-loopback: handle per stream channels and positions
Make it possible to specify different channels and positions
per stream so that we can do remapping as well.
Make sure we only copy available input channels and set the remaining
channels empty.
2021-04-22 18:38:16 +02:00
Wim Taymans
115be6d5fc module-loopback: cancel pending work items when destroying 2021-04-22 17:24:59 +02:00
Wim Taymans
7d79c71178 module-loopback: parse node.latency 2021-04-22 15:46:09 +02:00
Wim Taymans
93d1c8f31d modules: improve loopback module
Handle error when loading and fix leaks.
Mark streams as virtual if nothing else is specified.
Try to reuse an existing core connection if possible.
unload the module when the core is in error or when it is destroyed.
2021-04-22 15:34:21 +02:00
Wim Taymans
3b021cc4ed modules: add module-loopback
Add a new loopback module that can also create virtual-sink and
virtual-source.
2021-04-22 13:08:20 +02:00