Commit graph

1543 commits

Author SHA1 Message Date
Peter Hutterer
083e10a75d wp-uninstalled: fix a few shellcheck complaints 2021-10-26 13:06:46 +10:00
George Kiagiadakis
51713d309a policy-{node,endpoint-device}: do not hold reference to si_link in closure
This may keep the link alive for longer than expected
2021-10-23 11:02:13 +03:00
Julian Bouzas
04f77a5fbc policy-endpoint-client.lua: refactor based on policy-node.lua 2021-10-21 14:03:15 -04:00
Julian Bouzas
a03995c212 policy-endpoint-device.lua: refactor based on policy-node.lua 2021-10-21 14:03:15 -04:00
Julian Bouzas
72b3be9e83 m-si-audio-endpoint: use an internal audio adapter session item
Avoids code duplication with si-audio-adapter.
2021-10-21 14:03:10 -04:00
Julian Bouzas
5c1035bab4 m-si-audio-adapter: add no-format configuration property
Makes format finding optional when configuring item.
2021-10-21 13:04:33 -04:00
Julian Bouzas
44a0c55e3d m-si-audio-endpoint: do not use virtual media class for null sink nodes
The PulseAudio layer does not recognize virtual media classes.
2021-10-20 12:50:33 -04:00
Julian Bouzas
6624eaaf3e m-si-audio-adapter: remove unused audio utilities 2021-10-20 07:41:21 +00:00
George Kiagiadakis
eff97aed6e file-monitor-api: allow watching files too, not just directories 2021-10-19 17:16:37 +03:00
George Kiagiadakis
f8ced47a1a policy-node: enforce the direction of the target when linking by node name
When node.target is set to contain a node's name, it is possible to run
into the situation where you have a sink and a source with the same name
(typically the case with module-loopback) and the sink has monitor ports,
so wireplumber may link the stream to the monitor of the sink instead of the
capture ports of the source

With this policy, if a stream really wants to link to the monitor of the sink,
it has to have the "stream.capture.sink" property set or specify the
target by id.
2021-10-19 13:04:58 +03:00
Ashok Sidipotu
e2e3c5a69c wp-factory: enumerate pw_factory objects
pw_factory objects allow permissions to be set on its clients,
wp-factory exposes this funtionality to wireplumber clients.
2021-10-19 05:46:46 +00:00
Julian Bouzas
ea229779a8 si-audio-adapter: make sure formats is valid before iterating 2021-10-18 14:33:01 -04:00
George Kiagiadakis
1bdb8c2fb3 policy-node: don't rescan in the timeout callback if the si was already destroyed 2021-10-18 13:33:07 +03:00
George Kiagiadakis
634f73eb2d policy-node: don't hold a reference to the session item in the timeout callback
... it causes the si to be kept around even after the node is destroyed
2021-10-18 13:30:20 +03:00
George Kiagiadakis
6e67000d5e si-standard-link: fix crash after returning a link error
If one link fails, the activation transition will return, but then
other links will continue to call the callback and try to access
the now invalid activation transition. With this change, the callback
is bound to the lifetime of the transition and will stop being called
after the transition returns

Fixes #76
2021-10-16 09:51:00 +03:00
George Kiagiadakis
9e11aa5b8b release 0.4.4 2021-10-15 16:54:42 +03:00
Enrean Rean
477fc744de meson: add support for compiling module-logind with elogind
Closes #71
2021-10-15 13:36:30 +00:00
George Kiagiadakis
4ab119778a policy-node: when node.target is specified, wait a bit for the target to be available
There is a chance of race condition here in case the client knows which target
it wants to link to, but wireplumber has not yet "seen" this target because
it is getting prepared asynchronously

This may stall for up to 2 seconds clients that start streams with an invalid
node.target property, but then they will be re-routed to the default node
2021-10-15 15:10:41 +03:00
George Kiagiadakis
2a21e005e0 policy-node: avoid searching for existing links if there is no reason
If the item was not already handled or if there is no target,
we don't need to search for existing links... we will not find any

Also, don't remove links or schedule rescan if the node is not eligible
for reconnection... we will delete the node below instead
2021-10-15 15:10:28 +03:00
George Kiagiadakis
b27eccb9f0 policy-node: improve debug messages 2021-10-15 15:06:34 +03:00
George Kiagiadakis
5c23000c54 wplua: handle re-entrancy in _wplua_closure_marshal
* First of all, do not clear the stack... it's not necessary to do
  so and it causes trouble if this function is called from within
  itself, as it clears the stack of the previous context
* Then, do not stop/restart the garbage collector unless this is
  the base call

Fixes #73
2021-10-15 15:04:46 +03:00
George Kiagiadakis
7e0eeb485c restore-stream.lua: do not remove target.node manually
This is now done by the metadata implementation.
Doing this manually causes assertion failures, because then the
target.node is removed before policy-node "unhandles" the associated
session item and it tries to re-link it to the default source/sink
2021-10-15 14:37:49 +03:00
George Kiagiadakis
bc0b43ac4d wp-uninstalled.sh: print the build directory to avoid confusion
Now that the build directory is found automatically, if it so
happens that you have more than one build dir in your tree,
'make run' may not run the version that you expect...
2021-10-15 14:00:42 +03:00
George Kiagiadakis
7de841fa96 Makefile: run valgrind with better arguments & environment 2021-10-15 14:00:05 +03:00
George Kiagiadakis
07ada05e25 Makefile: use the build dir found by wp-uninstalled to run wireplumber from 2021-10-15 13:55:22 +03:00
George Kiagiadakis
c444ebaae1 meson: replace deprecated dep.get_pkgconfig_variable() with dep.get_variable() 2021-10-15 12:12:20 +03:00
George Kiagiadakis
ca8d31141e meson: bump requirement to 0.56 to use meson.project_{source,build}_root() 2021-10-15 12:06:48 +03:00
Peter Hutterer
4c5bf21a96 wp-uninstalled: error with usage information if no command is given 2021-10-15 08:14:03 +00:00
Peter Hutterer
c2b06feef2 wp-uninstalled: exit with status code 1, not -1
-1 usually wraps around to 255, let's use the more universal 1.
2021-10-15 08:14:03 +00:00
Peter Hutterer
7970e4c75b wp-uninstalled: try to find the build directory
Search for the first build.ninja file and only if that fails default to
the current build/.
2021-10-15 08:14:03 +00:00
Peter Hutterer
52aaf96179 wp-uninstalled: build this script with the meson dirs filled in
./builddir/wp-uninstalled.sh can now be called without a -b argument,
it'll automatically set the full paths. This is useful when building as
a subproject.

meson has a limitation: the configure_file() object is just a file
wrapper object. Wrap this into a custom_target() whose return value has
a full_path() method. This way, pipewire can use
wireplumber_uninstalled.full_path() without having to build the
directory structure itself.
2021-10-15 08:14:03 +00:00
Peter Hutterer
e9b1ab41ee wp-uninstalled: rename SCRIPT_DIR to SOURCEDIR
As suggested in !237
2021-10-15 08:14:03 +00:00
Peter Hutterer
e308fd56a0 meson: give the wireplumber binary a variable name
This allows it to be accessed from pipewire when WP is built as a
subproject.
2021-10-15 08:14:03 +00:00
Pauli Virtanen
fbb66cc290 wp: implement topics in SPA log interface
Implement SPA log topic API, showing log topics as GLIB_DOMAIN,
and enabling based on WIREPLUMBER_DEBUG.
2021-10-14 23:40:59 +03:00
George Kiagiadakis
3fa4165513 object-manager: downgrade proxy activation failure message
there is no point in showing this message, unless we are debugging...
it's pretty common when clients create & destroy objects very quickly
2021-10-14 22:49:02 +03:00
George Kiagiadakis
11f9433929 si-audio-adapter: skip reconfiguring if the same mode & format are requested 2021-10-14 18:31:54 +03:00
Wim Taymans
486288363b si-standard-link: fix aux channels links
AUX channels can link to any other channel but when AUX channels are
linked, they must match exactly.

Fixes some issues with split devices with aux channels.
2021-10-14 16:28:51 +02:00
George Kiagiadakis
90d6e6042e si-standard-link: do not crash if an output port has no input port to link to
... and also do not link multiple output ports to the same input port
2021-10-14 17:16:50 +03:00
George Kiagiadakis
1db706990c si-standard-link: refactor linking logic to correctly link unpositioned nodes
"unpositioned" nodes don't have a specific channel layout
(ex the Pro Audio profile); in that case, we should not try to copy this
undefined layout to the peer node, we need to configure both in their
preferred layout and do a best-effort linking of ports.
2021-10-14 16:38:49 +03:00
Ashok Sidipotu
784c405c31 wp: support loading optional modules
-some modules will not be available during runtime, due to
  external dependencies.
 -these modules can now be marked optional.
 -loading of these optional modules will be attempted and if
  they are not available, wp will recover and will not be
  terminated.
2021-10-14 06:27:53 +00:00
Nicolai Syvertsen
27a6970de5 lua/api: fix impl_module_new arg parse 2021-10-13 17:25:51 +00:00
Wim Taymans
4585ee08c9 si-audio-adapter: parse the rate optionally
We can use spa_format_audio_raw_parse() because we need to parse
the samplerate here optionally.

Many virtual sinks will not set a rate, which makes parsing fail and
the node will end up with the default channels/positions, which is
most likely wrong.

Fixes channel positions for virtual sinks.
2021-10-13 16:41:31 +02:00
George Kiagiadakis
d26aeeb192 policy-node: accept TRUE as a valid boolean property value
when coming from a gstreamer element's stream-properties property,
the boolean values use capitals:

 gst-launch-1.0 ... ! pipewiresink stream-properties="p,foo=true"
 pw-cli info <node>
   -> "foo" = "TRUE"
2021-10-13 13:17:52 +03:00
George Kiagiadakis
c6e2f2de87 si-audio-adapter: ensure the node is suspended before changing PortConfig 2021-10-13 13:17:29 +03:00
George Kiagiadakis
5dcd06c339 policy-node: implement encoded audio passthrough
* also respect node.exclusive
* also send error to clients if a target node was not found
  or if it is not possible to link to it
* also allow dont-reconnect nodes to be handled normally
  the first time they appear, until they are linked once
2021-10-13 12:48:03 +03:00
George Kiagiadakis
52c4839a8c spa-pod: accept NULL object/struct/pod in a property field
This is what the original SPA_POD_BUILDER_COLLECT() does as well
2021-10-13 11:51:22 +03:00
George Kiagiadakis
30407f9930 lua/api: add bindings for client:send_error() 2021-10-13 11:18:51 +03:00
George Kiagiadakis
5ce2dd3e66 lua/pod: add bindings for fixate() and filter() 2021-10-13 11:18:14 +03:00
George Kiagiadakis
9dca92c698 spa-pod: add _filter() method 2021-10-13 11:10:32 +03:00
George Kiagiadakis
079139f01d client: add _send_error() method 2021-10-13 11:09:11 +03:00