Commit graph

1471 commits

Author SHA1 Message Date
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
Pauli Virtanen
24882f37a7 wp: fix pw_log_set usage
pw_log_set resets the log level of the logger to the Pipewire's current
level.  Here, it's instead expected that the level is retained, so call
pw_log_set_level first.

It used to be that pw_init set the log level based on PIPEWIRE_DEBUG
value, but this is now done only when using Pipewire's default logger.
2021-10-04 07:00:28 +00:00
George Kiagiadakis
2a99d6a835 default-access: grant full permissions to flatpak "Manager" apps
Fixes: #59
2021-10-04 09:20:53 +03:00
Julian Bouzas
151ba8425e m-si-audio-adapter: add 'disable.dsp' configuration property
If 'disable.dsp' is set to TRUE, the adapter will always be configured in
passthrough mode. Then, if 2 adapters want to be linked with different formats,
the si-standard-link session item will automatically reconfigure one of the
adapters in convert mode so that the format matches.
2021-09-29 14:03:27 -04:00
Julian Bouzas
133249399a m-si-standard-link: refactor and add support for no DSP mode
We always use the output session item mode and format when configuring adapters,
unless the input session item is a device node and the output session item is
not a device node.
2021-09-29 14:03:27 -04:00
Julian Bouzas
30b1dd7b4c si-adapter: call format task if port param-info is triggered in non DSP mode
This is needed so that the async callback passed to _set_ports_format is called
when changing the adapter's port format and the port has not been removed or
added. Eg: when configuring the adapter in S16 convert mode to S32 convert mode.
2021-09-29 14:03:23 -04:00
Julian Bouzas
334d92b5cb si-adapter: use F32P default format if mode is NULL 2021-09-29 13:38:22 -04:00
Pauli Virtanen
e9b7d02b22 config: bluez: update to match current bluez5 spa module
Update 50-bluez-config.lua from media-session.d/bluez-monitor.conf
2021-09-29 19:18:18 +03:00
George Kiagiadakis
3db3229359 object-manager: guard self in the idle callback using g_cclosure_new_object
The idle callback may be called after the object manager has been
destroyed, or the object manager may be destroyed while emitting
one of the signals from the idle callback, so it needs to be ref'ed
while the callback is running. g_cclosure_new_object ensures that
in both cases the code behaves correctly.
2021-09-28 11:46:46 +03:00
George Kiagiadakis
2bc999594c main: fail to start with a warning if media-session is also running
Related to #56
2021-09-28 11:45:49 +03:00
George Kiagiadakis
a253aa4c49 modules: implement logind module and integrate with bluez monitor
This copies the logic of media-session's logind module and allows
the bluez monitor to be active in only one user session at a time.
This is especially useful to avoid interference between the gdm
session and the actual user session, which momentarily both have
wireplumber running when logging in/out.

Fixes #54
2021-09-27 18:30:32 +03:00
Julian Bouzas
7005c4518f m-portal-permissionstore: try to reconnect on idle if DBus connection is closed
This change also keeps the plugin always activated, regardless of whether the
DBus connection is closed or not, which is useful when the dbus service is
restarted.
2021-09-24 09:31:29 -04:00
Julian Bouzas
450a38da50 scripts: handle dbus service restarts if reserve device is enabled
This destroys the ALSA monitor when the DBus connection is closed, and
re-creates again the monitor when the Dbus connection is connected, so that
device reservation is restarted.
2021-09-24 08:53:50 -04:00
Julian Bouzas
a5a0af5dff m-device-reservation: try to reconnect on idle if DBus connection is closed
This change also keeps the plugin always activated, regardless of whether the
DBus connection is closed or not, which is useful when the dbus service is
restarted.
2021-09-24 08:53:41 -04:00
George Kiagiadakis
f82ca0155c si-audio-adapter: use INPUT direction to configure virtual sources
Virtual sources are actually sinks (null sinks), so they expect to
be configured with INPUT direction

Fixes #57
2021-09-23 19:00:29 +03:00
Julian Bouzas
9dd5c0c758 systemd: add GIO_USE_VFS=local environment variable
Avoids GIO to connect to the session bus. This prevents wireplumber to receive
a SIGTERM signal when the dbus service is restarted.
2021-09-23 09:40:07 -04:00
Peter Hutterer
841a1055fb main: print the type of signal that stopped us
Unfortunately glib's signal handling doesn't pass the signal type to the
handler but it's easy enough to wrap.

Related to #48
2021-09-23 20:15:51 +10:00
Julian Bouzas
711d1ee686 spa-pod: add support for custom Id properties
Allows creating and parsing Pod Objects with custom properties.
2021-09-21 12:29:54 -04:00
Julian Bouzas
7c03da82e7 si-audio-endpoint: don't build DSP format in _set_ports_format
Allows any format to be set, which is needed for non DSP modes.
2021-09-20 12:53:34 -04:00
Julian Bouzas
eff435c7f1 si-audio-adapter: don't build DSP format in _set_ports_format
Allows any format to be set, which is needed for non DSP modes.
2021-09-20 12:32:43 -04:00
Ashok Sidipotu
33d4e61b97 alsa-monitor: add check for nill monitor 2021-09-20 10:43:33 +05:30
Julian Bouzas
f0e587ef0e metadata: use pw_impl_metadata for WpImplMetadata 2021-09-17 09:08:48 -04:00
Niklāvs Koļesņikovs
05334c1ec7
lib/wp/device: demote missing SPA warning to message
Warnings can be scary, so best not to scare users with what's likely
intentional omission of a particular SPA plugin (currently V4L & BlueZ).
2021-09-15 13:54:07 +03:00
Niklāvs Koļesņikovs
3b41df35a8
v4l: add basic check for nil monitor
If PipeWire is built without V4L support, then

`monitor = SpaDevice("api.v4l2.enum.udev", config.properties or {})`

will result in a nil monitor. This commit adds a basic sanity check
to avoid further using the nil variable.

Thanks-to: Pascal Flöschel (initial bug report)
Thanks-to: George Kiagiadakis <george.kiagiadakis@collabora.com>
Bug: https://bugs.gentoo.org/813043
2021-09-15 13:54:03 +03:00
Niklāvs Koļesņikovs
32d96189b8
bluez: add basic check for nil monitor
If PipeWire is built without Bluetooth support, then

`monitor = SpaDevice("api.bluez5.enum.dbus", monitor_props)`

will result in a nil monitor. This commit adds a basic sanity check
to avoid further using the nil variable.

Thanks-to: Pascal Flöschel (initial bug report)
Thanks-to: George Kiagiadakis <george.kiagiadakis@collabora.com>
Bug: https://bugs.gentoo.org/813043
2021-09-15 13:52:29 +03:00
George Kiagiadakis
2a5f9c51f2 lua/api: fix object constructors to fail gracefully 2021-09-15 12:51:47 +03:00
Sam James
3b24c419b4 meson: Build tests conditionally
It's useful downstream to be able to control building
tests, as there's not much use building them if we're
not going to run them.

Signed-off-by: Sam James <sam@gentoo.org>
2021-09-15 07:05:17 +00:00
Julian Bouzas
640b6b217c policy-node: schedule pending rescan if old link is not active
Removing a link before it finished activating can lead to race conditions. If
the link is not active, we should schedule a pending rescan to make sure the
old link is only removed when active. This should fix the proxy activation
failed warnings.
2021-09-14 13:48:22 -04:00
Julian Bouzas
910273cba7 policy-node: don't try to link to the same link-group
Avoids linking streams to a node of the same link-group because that
would be a circular link.
2021-09-14 08:44:10 -04:00
Julian Bouzas
8f19c00b3e policy-node: re-evaluate all nodes when changed
This is needed so that client nodes can be moved to new default device nodes
when they are added if wireplumber is already running.
2021-09-14 08:43:21 -04:00
Björn Daase
f769e2ea36 50-alsa-config.lua: Add missing commas
Be consistent with all other files and add commas at the end of sections.
2021-09-10 08:53:34 +00:00
George Kiagiadakis
fc7fc50c6f release 0.4.2 2021-08-19 18:05:43 +03:00
George Kiagiadakis
c8f75b5f2c docs: lua proxies: add since markers for new methods 2021-08-19 17:58:57 +03:00
George Kiagiadakis
cef9b00daf docs: impl-module: add since markers and improve the Lua doc appearence 2021-08-19 17:58:07 +03:00
George Kiagiadakis
8949e98d1f remove wpipc
This component has been split out to form a separate project,
moved to https://git.automotivelinux.org/src/pipewire-ic-ipc/
2021-08-19 16:53:28 +03:00
George Kiagiadakis
e6f2dc17ff tests: file-monitor: also remove the 'foo' file at the end of the test 2021-08-19 10:44:31 +03:00
George Kiagiadakis
daa4da5ffc tests: state: remove the "escaped" state file at the end of the test 2021-08-19 10:39:49 +03:00
George Kiagiadakis
07b4a13315 tests: use .local/state instead of .local/.state for the state dir 2021-08-19 10:39:14 +03:00
George Kiagiadakis
c3d48e57d4 systemd: remove AssertPathExists from the templated units
The config files can now be in multiple places, so there is no
good way to check if a file exists before starting wireplumber.
2021-08-19 10:33:55 +03:00
George Kiagiadakis
efc2039795 meson: install configuration in $prefix/share 2021-08-19 10:31:27 +03:00
George Kiagiadakis
3cd9384805 wp: make wp_get_xdg_state_dir() private
It's not used elsewhere, so there is no good reason yet to expose it.
Besides, I expect that GLib will likely add a method in the future
to return the XDG_STATE_HOME (which is relatively new in the xdg spec)
2021-08-19 10:06:37 +03:00
George Kiagiadakis
27ed36c2da wp: make the config file lookup methods more generic
* Make the flags public and give them nicer names
* Pass down the flags from the caller, so the caller can now explicitly
  ask for looking into specific directories
* Rename the methods
* Remove and inline the wp_get_xdg_config_dir() method, since it's only
  used internally
* Refactor the lookup dirs ordering to get both WIREPLUMBER_*_DIR env
  variables to replace all the other directories. Previously, we were looking
  for scripts in WIREPLUMBER_DATA_DIR, but we were also looking in /etc at
  the same time (with precedence, even), which could result in unexpected
  behaviour. Now, if a WIREPLUMBER environment variable is specified,
  we only look in there.
2021-08-19 10:06:37 +03:00
Arun Raghavan
129b44bb0c doc: Add WpImplModule docs for the C and Lua API 2021-08-18 16:04:39 +00:00
Arun Raghavan
ef29018c55 m-lua-scripting: Add WpImplModule bindings 2021-08-18 16:04:39 +00:00
Julian Bouzas
7abd3728e7 build: fix volatile compatible-pointer-types warnings
Happens when compiling with GCC 11
2021-08-18 09:17:05 -04:00
George Kiagiadakis
b9b722c125 properties: adjust documentation for the recent WpPropertiesItem changes 2021-08-11 20:25:16 +03:00
Arun Raghavan
032aa8edf2 wp: Add a WpImplModule for loading modules in WirePlumber context 2021-08-10 11:33:01 -04:00
Marvin Schmidt
da8fc024f5 build: Allow to specify which system lua to use
On Exherbo we allow to install different Lua ABIs in parallel and
users can choose per-package which Lua ABI to use, e.g.

  media/wireplumber LUA_ABIS: -* 5.3

However, wireplumber's build system doesn't provide a way of explicitly
requesting a specific version, which makes the build non-deterministic,
since you get a different result if you install today with Lua 5.3
installed and reinstall tomorrow after installing Lua 5.4.

To fix this, I introduced a `system-lua-version` option that allows to
specify an explicit Lua version to check for and build against:

> $ meson .. -Dsystem-lua=true -Dsystem-lua-version=5.4
> The Meson build system
> Version: 0.58.0
> Source dir: /mnt/development/scm/freedesktop/wireplumber
> Build dir: /mnt/development/scm/freedesktop/wireplumber/build/reconfigure
> Build type: native build
> Project name: wireplumber
> Project version: 0.4.1
> [...]
> Run-time dependency lua-5.4 found: YES 5.4.3
> [...]
> Build targets in project: 56
>
> wireplumber 0.4.1
>
>     Lua version                    : 5.4.3 (system)
>     systemd conf data              : YES

If the specified version isn't found, the build will fail loudly:

> $ meson .. -Dsystem-lua=true -Dsystem-lua-version=5.5
> [...]
> Found CMake: /usr/host/bin/cmake (3.20.5)
> Run-time dependency lua-5.5 found: NO (tried pkgconfig and cmake)
> Run-time dependency lua5.5 found: NO (tried pkgconfig and cmake)
>
> ../meson.build:50:6: ERROR: Problem encountered: Specified Lua version "5.5" not found
2021-08-10 11:55:19 +03:00
Julian Bouzas
8c9da58d76 src: scripts: add alsa-mini.lua monitor 2021-08-10 11:50:51 +03:00
Julian Bouzas
9b8a876662 m-lua-scripting: add GLib access Lua API 2021-08-10 11:50:51 +03:00