Commit graph

1532 commits

Author SHA1 Message Date
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
George Kiagiadakis
03f14105cf si-audio-adapter: find the device format early and store format-specific flags
* find out if the node supports iec958 or dsd
* use spa_pod_fixate() to get the default format of the node, like p-m-s does
* use _enum_formats_sync() to utilize the param cache, assuming that the node
  always has all features enabled (which is always the case when coming from
  an ObjectManager that was defined in Lua)
* simplify the activation / deactivation procedure
* configure nodes with unpositioned channels early, as if they were devices
2021-10-12 20:00:10 +03:00
George Kiagiadakis
9e5aaccab0 spa-pod: add _fixate() method 2021-10-12 20:00:10 +03:00
Julian Bouzas
f7a6aaab61 default-routes: switch to the route when availability changed 2021-10-12 11:41:51 -04:00
Wim Taymans
51e29b1bca policy-node: add support for passive links
When one of the nodes has node.passive, make a passive link.

Make virtual sinks and sources suspend properly when not in use.
2021-10-11 12:40:44 +02:00
Julian Bouzas
47896503a8 modules: fix default audio format segfault 2021-10-11 03:08:34 -04:00
George Kiagiadakis
1b48e068ce systemd: alias to pipewire-session-manager.service
See #56 and pipewire/pipewire!970
2021-10-08 15:18:12 +03:00
George Kiagiadakis
46898c2212 ci: attempt an update of the ubuntu 20.04 image to fix SSL certificate issues 2021-10-08 11:50:44 +03:00
George Kiagiadakis
043fa7c9d6 release 0.4.3 2021-10-08 11:09:38 +03:00
George Kiagiadakis
0938f9bc84 policy-node: do not try to link monitors in no-dsp mode, as they do not exist
pipewire does not implement monitors in no-dsp mode yet
2021-10-08 11:05:09 +03:00
George Kiagiadakis
914867bd13 policy-node: cleanup target.node metadata when the default sink changes
When the default node changes to become the same as the target.node value
that was set in the metadata, remove this target.node from the metadata
to let the stream follow the default.

Also cleanup the useless target.node == -1 metadata that pipewire-pulse sets
when a stream is moved to the default node

Fixes #65
2021-10-08 01:10:30 +03:00
George Kiagiadakis
8671b495be policy-endpoint-client: decrease log message verbosity 2021-10-08 00:26:41 +03:00