Commit graph

1480 commits

Author SHA1 Message Date
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
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