Commit Graph

2604 Commits

Author SHA1 Message Date
George Kiagiadakis
bdc7839ff2 m-settings: rename persistent.settings to settings.persistent
This makes it more consistent with the nomenclature of other settings
2024-01-29 11:55:18 +02:00
George Kiagiadakis
4c94cee54c docs: update multi-instance documentation 2024-01-29 11:55:18 +02:00
George Kiagiadakis
a511c54c5c m-settings: split out the WpSettings instance loading to a new built-in component
When running multi-instance setups or when clients like wpctl want to
access the WpSettings instance, it makes no sense to load the entire
module-settings, which will also create sm-settings metadata instances.
2024-01-29 11:55:18 +02:00
Julian Bouzas
95ae88d3e7 bluez.lua: set the loopback input stream media class to internal
This hides the loopback stream node from applications, making desktop
environments to not show the 'recording from microphone' icon (Eg gnome-panel)
when the bluetooth device is not recording yet.
2024-01-23 11:59:57 -05:00
Robert Rosengren
2e9e3a7564 link/node: Fix docs on state_changed_callback
Docs for state_changed_callback indicates state being emited as pointer,
but implementation emits it as enum value.
2024-01-22 13:45:15 +01:00
Julian Bouzas
874a432c69 autoswitch-bluetooth-profile: remove applications array and use loopback filter
This patch improves the bluetooth profile autoswitch so that it works with any
application that wants to capture from a bluetooth device. To do so, a loopback
source filter is created per connected bluetooth device. If an application wants
to capture audio from such loopback source filter, the profile in the associated
bluetooth device is changed to HSP/HFP. If there isn't any application connected
to the loopback source filter, the profile switches back to A2DP.
2024-01-22 10:15:16 +00:00
Julian Bouzas
68c6fc2a38 filter-utils: always convert to string when checking if target rules match
This fixes the target not being found when setting non-string values in the
JSON matching rules of the 'filter.smart.target' property.
2024-01-22 10:15:16 +00:00
Julian Bouzas
caded6070d linking: remove redundant 'dont_move' parameter
The 'target.dont_move' property is only meant to be used with 'target.object'
metadata property, not smart filters metadata properties. This was probably
left accidentaly unused when designing a solution for #524 involving smart
filters.

Fixes #558
2024-01-19 13:29:02 -05:00
Pauli Virtanen
6f3eb32937 config: update example bluetooth.conf
bluez5.auto-connect is by default disabled. device.profile does not
exist. MIDI nodes also have node.latency-offset-msec
2024-01-14 21:26:06 +02:00
Pauli Virtanen
b932e22849 docs: update Bluetooth docs 2024-01-14 21:23:17 +02:00
George Kiagiadakis
d17c99f63f docs: update locations.rst 2024-01-13 18:49:04 +02:00
Pauli Virtanen
d8a345a30c log: rename back to wp_log_set_level 2024-01-13 16:33:05 +00:00
Pauli Virtanen
82df32b0b0 m-lua-scripting: register/unregister log topics 2024-01-13 16:33:05 +00:00
Pauli Virtanen
35c10181d7 log: forward log level patterns also to libpipewire
Use pw_log_set_level_string to set log topic levels also for libpipewire
topics.
2024-01-13 16:33:05 +00:00
Pauli Virtanen
c746e18350 log: support topic patterns also in config file log.level
Handle log topic patterns also in wp_log_set_global_level, so that they
can be specified everywhere.
2024-01-13 16:33:05 +00:00
Pauli Virtanen
7c28c226b8 log: allow dynamic log levels for WpLogTopic
Change design of WpLogTopic so that it allows for changing their log
levels at runtime.

Add wp_log_topic_register/unregister functions to track lifetime of the
topics.

Auto-register statically defined log topics.

Make the topic registration threadsafe, in case it is done from
constructors that run in a different thread than main thread.
2024-01-13 16:33:05 +00:00
Sergio Costas
2ec202dfa1 client access: add support for snap permissions
This patch adds to wireplumber code to manage the Snap audio
permissions.

SNAP containers have two main "audio" rules:

 * audio-playback: the applications inside the container can
   send audio samples into a sink
 * audio-record: the applications inside the container can
   get audio samples from a source

Also, old SNAP containers had the "pulseaudio" rule, which just
exposed the pulseaudio socket directly, without limits. This
is similar to the current Flatpak audio permissions.

In the pulseaudio days, an specific pulseaudio module was used
that checked the permissions given to the application and
allowed or forbide access to the pulseaudio operations.
With the change to pipewire, this functionality must be
implemented in pipewire-pulse and wireplumber to guarantee
the sandbox security.

The current code checks for the presence of the pipewire.snap.id
property in a client, in which case it will read the
pipewire.snap.audio.playback and pipewire.snap.audio.record
properties, and allow or deny access to that client to
the nodes with Audio/Sink or Audio/Source media.class
property.

See !567 and pipewire!1779
2024-01-13 16:18:13 +00:00
Julian Bouzas
598b3c83ce filter-utils: handle new 'filter.smart.targetable' property
This property indicates whether the filter can be directly linked with clients
that have a defined target (Eg: pw-play --target <filter-name>) or not. This can
be useful when a client wants to be linked with a filter that is in the middle
of the chain in order to bypass the filters that are placed before the selected
one. If the property is not set, wireplumber will consider the filter not
targetable by default, meaning filters will never by bypassed by clients, and
clients will always be linked with the first filter in the chain.

Fixes #554
2024-01-11 10:54:41 -05:00
Julian Bouzas
cdeac07814 linking: handle defined target properly with smart filters
This patch fixes the policy to not link the client to the default filter if the
client's defined target is found, is not a filter, does not have any other
filters linked with it. In this case, the client is therefore linked to the
actual defined target. On the other hand, if the client's defined target is a
filter, the client is linked to the first filter in the chain that has the same
target as the defined filter's target.
2024-01-11 10:48:27 -05:00
Julian Bouzas
c37f95169d filter-utils: improve get_filter_from_target API to also work with filters 2024-01-11 10:34:13 -05:00
Piotr Drąg
42f4fa92b3 Update POTFILES.in 2024-01-08 10:36:34 +00:00
George Kiagiadakis
c5c5317599 state-routes: use the correct device id when restoring route properties
Fixes: #551
2024-01-08 12:28:21 +02:00
George Kiagiadakis
7bd4032a28 lua: hooks: record the entire 'after' array
Previously we were ignoring the last element in the 'after' arrays
because of a wrong loop limit
2024-01-08 12:28:21 +02:00
George Kiagiadakis
4a3557d8e4 event: add some trace logs to debug sorting hook dependencies 2024-01-08 12:28:21 +02:00
George Kiagiadakis
03098c88bb bt-pinephone.lua: remove useless variable assignments
This is a copy/paste from the code that now lives in apply-routes.lua,
but there is no point since the route here is a real route param and
not a route_info structure.
2024-01-08 12:28:21 +02:00
George Kiagiadakis
0b0595a156 apply-routes.lua: rename variable to make the code easier to understand 2024-01-08 12:28:21 +02:00
George Kiagiadakis
a7d0dacd12 state-routes: fix restoring volumes when a Route is changed manually
When a manual change is applied, the store-or-restore-routes is the only
hook that gets executed for this event. In order to be able to test if a
route was changed, we need to reset all of them to 'active = false',
record the previous value of 'active' and test their difference.

Testing only the 'active' variable (and discarding 'prev_active') sounds
tempting here, but if a route is changed back and forth (from A to B
and back to A), there is nothing to reset the 'active' variable of A
when it gets deactivated and it will appear as previously active on
the second switch.

Related to: #551
2024-01-08 12:21:27 +02:00
Julian Bouzas
d60747f40f docs: remove obsolete tags 2024-01-05 09:34:35 -05:00
Julian Bouzas
4ac7dc831e event-dispatcher: fix ingroup documentation 2024-01-05 09:34:35 -05:00
Willow Barraco
cdd472713d docs-policy: add filter.smart = true 2024-01-05 10:11:00 +01:00
George Kiagiadakis
4c82e59163 0.4.81 2024-01-04 20:33:29 +02:00
George Kiagiadakis
eb2d6efcd4 state: add save_after_timeout() method to replace all custom timeout code
This was a common pattern that we had in many places, so it makes sense
to consolidate it.
2024-01-04 16:38:33 +02:00
George Kiagiadakis
7fa16292c3 common-utils: remove the simple serializer functions that were used for state files 2024-01-04 10:38:23 +02:00
George Kiagiadakis
38b6eec456 state-routes: use json to store info in the state file 2024-01-04 10:27:02 +02:00
George Kiagiadakis
5d41ef2311 scripts: s/putils/lutils/g ("policy" utils -> "linking" utils) 2024-01-03 11:10:56 +02:00
George Kiagiadakis
994f1c1f4a Merge branch 'master' into next 2024-01-03 10:47:16 +02:00
Ferdinand Bachmann
3a40a8795b wpctl: resolve device id and route device internally 2023-12-27 19:36:56 +01:00
Ferdinand Bachmann
f01177d08a wpctl: add set-route subcommand 2023-12-25 23:06:32 +01:00
Pauli Virtanen
88c59ff9c6 docs: explain runtime logging controls 2023-12-24 17:59:59 +02:00
Pauli Virtanen
43e190e3b4 wpctl: add set-log-level command
Add command for changing log level for Pipewire or Wireplumber daemons
at runtime.

It can be done with pw-metadata, but make it easier so that the user
doesn't need to look up Wireplumber client ids.
2023-12-24 17:59:59 +02:00
Pauli Virtanen
6037a6af94 m-log-settings: add module for changing log level at runtime
Pipewire server uses the global "settings" metadata for adjusting its
own log level.

Make it a convention that clients may watch "log.level" in this metadata
with their client id as subject, for setting their own log level
dynamically.

Watch the global "settings" metadata for "log.level" changes for our id.
On changes, set our log level accordingly.
2023-12-24 17:59:59 +02:00
Pauli Virtanen
4e17edb1ac wp: make wp_log_set_global_level public API
Applications may want to change WP log level at runtime.

Also change it to return error stataus instead of printing warnings on
error.
2023-12-24 17:58:30 +02:00
George Kiagiadakis
c2d125b0da Merge branch 'master' into next 2023-12-23 18:34:00 +02:00
George Kiagiadakis
f3f89b8fc1 docs: shuffle files to have the same logical hierarchy as on the generated doc
Also:
 - rename some files to remove redundant information from the filenames
 - rename many labels to match the filename and its place in the hierarchy
 - move lua_api under the scripting section
2023-12-23 12:36:27 +02:00
George Kiagiadakis
7dfc346a7b script docs: rewrite all csv-table to list-table for better source readability 2023-12-23 11:32:56 +02:00
George Kiagiadakis
6afdadc549 docs: update understanding_wireplumber.rst, merging changes from !535 2023-12-21 13:26:44 +02:00
George Kiagiadakis
59972b6e4f systemd: change the template services to load different profiles instead of conf files 2023-12-21 11:28:50 +02:00
George Kiagiadakis
0037733545 daemon: add cmdline option to load custom profile and report error if not found 2023-12-18 17:58:09 +02:00
George Kiagiadakis
c0b212bb0e scripts: common-utils: do not crash if the defaults table is nil
Fixes #542, #544
2023-12-18 10:56:30 +02:00
George Kiagiadakis
b58c94816a docs: update configuration.rst 2023-12-15 21:14:24 +02:00