Commit graph

1520 commits

Author SHA1 Message Date
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
George Kiagiadakis
e76c67c45c policy: refactor/improve policy-node & session items to fix linking to monitors
* populate most session item properties from create-item.lua to keep
  things more compact and readable
* use a standard naming scheme for the session item properties
* use session item properties instead of node properties in policy-node.lua
* improve policy-node's performance by converting the properties dictionary
  less times for each session item
* refactor some policy logic and make things slighly more readable
* change the accepted values for 'context' in wp_si_linkable_get_ports();
  use "input" and "output" to keep things clear, because the previous use
  of NULL and "reverse" were implying that a node has only one "standard"
  direction, but this is complicated for sinks w/ monitors and duplex nodes
* allow using monitors (which are Audio/Sink nodes in fact) as sources
* treat Audio/Duplex nodes as sinks, like p-m-s does
* respect the "stream.capture.sink" property of streams

Fixes #66
2021-10-08 00:26:41 +03:00
Wim Taymans
fb28b076a1 Revert "wp: fix spa_log_methods version"
This reverts commit 86eecfc7e1.

The logger now correctly calls the old implementation when the new
method is not implemented.
2021-10-07 10:17:15 +02:00
Wim Taymans
7907d39aff scripts: add libcamera monitor 2021-10-06 10:22:36 +02:00
Wim Taymans
a13308bac7 implement route-settings metadata and notification volume
Make a module that creates a route-settings metadata and provides
some helper functions to parse the json fields.

Load the route-settings module in the policy.

Move the Notification settings to the metadata. Listen for metadata
updates and update our state table.

Fixes #51
2021-10-05 15:47:46 +00:00
Wim Taymans
8c82265752 restore-stream: don't include the final : in the key name
Just make the key and let the user of the key add a separator when
needed.
2021-10-05 15:47:46 +00:00
Wim Taymans
65d5f6442b restore-stream: stop when we find the first suitable key 2021-10-05 15:47:46 +00:00
George Kiagiadakis
1c77837c9b m-default-nodes: safeguard timeout callback with g_cclosure_new_object 2021-10-05 17:29:05 +03:00
George Kiagiadakis
5e14c69108 m-default-nodes: lift restrictions on media.class for audio nodes
Previously a default source had to be Audio/Source and a default sink
had to be Audio/Sink. This did not account for:
 - monitor sources (Audio/Sink)
 - duplex nodes (Audio/Duplex)
 - virtual sources (Audio/Source/Virtual)

With this change the restriction is now on the number of input/output
ports, so any Audio/* node with output ports is a valid target to select
as a default source, while any Audio/* node with input ports is a valid
target for a default sink.

Fixes #60
2021-10-05 17:28:42 +03:00
George Kiagiadakis
4f97def376 lib: node: add gobject properties for state & {n,max}-{input,output}-ports 2021-10-05 17:19:52 +03:00
Wim Taymans
6b135af1f1 metadata: fix properties
The spa_dict does not live outside of the scope it is created in
and so no metadata name is passed to the export function.

Use and initialize a variable outside of the scope instead.
2021-10-04 16:32:50 +02:00
Wim Taymans
8e7331a23d default-routes: save and restore iec958Codecs
Similar to the volume and latencyOffset we need parse, save and restore
the configured iec958Codecs on the node.

Pavucontrol will use the device-restore extension to set the configured
iec958Codecs on the Node/Route. This will make the node enumerate
audio/iec958 formats, which can be matched against streams that can
provide this format to configure passthrough.

Fixes #64
2021-10-04 10:11:03 +00:00
Pauli Virtanen
86eecfc7e1 wp: fix spa_log_methods version
Wireplumber implements version 0 of spa_log methods. Fixes logging on
current pipewire.
2021-10-04 07:00:28 +00:00