Commit graph

1629 commits

Author SHA1 Message Date
Ashok Sidipotu
2e23d82779 policy-endpoint-client.lua: fix record with endpoints
The Role traversal of config data to take notice of the
media class as well so that source and sink roles dont
overstep on each other and pick up unexpected endpoints.
2022-01-11 15:31:40 +05:30
Ashok Sidipotu
99dfa7d38a config: update the endpoints config
-Sync endpoints config from AGL.
-Add a capture endpoint.
2022-01-11 15:30:30 +05:30
Julian Bouzas
bc76cb7d74
spa-pod: fix different architecture errors for boolean values 2022-01-09 10:22:47 +02:00
Julian Bouzas
bee9827ae3 policy-node: find best linkable if default one cannot be linked
Fixes issue with echo cancellation pipewire module.
2022-01-08 15:14:44 +00:00
Julian Bouzas
afe71d7e48 policy-node: schedule a rescan without timeout if defined target is not found
Fixes #146
2022-01-08 06:48:16 +00:00
Julian Bouzas
23fc4d21a9 policy-node: fix typo when finding best target 2022-01-07 10:12:04 -05:00
George Kiagiadakis
9a733293d7 release 0.4.6 2022-01-06 18:11:51 +02:00
Julian Bouzas
0d008dce75 m-default-nodes-api: don't return stream node if default node name matches
Stream nodes can never be default nodes, so we skip them in case they have the
same name as the actual default node.

Fixes #130
2022-01-06 06:50:32 +00:00
George Kiagiadakis
3f3c9802d6 create-item: downgrade warning to message
This is expected to be printed if a stream opens and closes
very quickly, like in the case of pipewire-alsa opening the device
for querying formats and then closing it immediately.
2022-01-05 18:13:41 +02:00
George Kiagiadakis
1c85139640 bump pipewire dep to 0.3.43
we now need it for spa_json_parse_stringn()
2022-01-05 18:13:10 +02:00
Julian Bouzas
a1423a4b1f m-device-activation: reset iterator when finding best and default profiles
Avoids possible issue when finding best profile when default is not found.
2022-01-05 08:54:12 -05:00
Corentin Noël
b6dd422dd2 si-audio-adapter: Reference WpTransition before passing it as callback data
Make sure to always have a valid WpTransition when used in the finish callback.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
2022-01-05 10:28:33 +01:00
Julian Bouzas
6adccbe33d policy-node: always use the default linkable if default nodes module is loaded
If the default nodes module is loaded, and the default node is not found, it
means that there is no valid target for that session item. We only need to
manually find a default target if the default nodes module is not loaded.
2022-01-05 08:57:33 +00:00
Julian Bouzas
f7dfb90db6 module-default-nodes-api: sync with core before emitting changed signal
This makes sure pipewire is not doing anything while emitting changed signal.
2022-01-05 08:57:33 +00:00
Julian Bouzas
8bbbba23ff m-default-nodes: don't reevaluate nodes if they are not ready
This makes sure nodes are ready before finding the default node, avoiding audio
glitch in wrong device if profile was also changed while changing the default
node (can happen with Gnome Sound Settings).

Since nodes are destroyed and recreated again when a device profile changes, the
only way to make sure device nodes are ready is to check the profile classes
structure, which tell us how many total nodes the device has, and then check
that those nodes exist for that device. A rescan is triggered whenever devices,
nodes or ports changed.

This patch also improves the logic when finding default nodes, allowing virtual
sources to be set as default sources.

Fixes #85 and #130
2022-01-05 08:57:33 +00:00
Julian Bouzas
76a61e43a5 m-default-nodes: set effective node metadata to NULL if node is not found
There might not be any node at all, so we need to clear the efective node
metadata.
2022-01-05 08:57:33 +00:00
Jonas Holmberg
e1602c10c5 policy-node.lua: Fix nil value indexing
Fixes the warning:

[string "policy-node.lua"]:117: attempt to index a nil value (field '?')
stack traceback:
  [string "policy-node.lua"]:117: in function <[string "policy-node.lua"]:109>
2022-01-05 07:04:09 +00:00
George Kiagiadakis
dc50f95910 config: add commented-out "session.suspend-timeout-seconds" option in alsa config
For the sake of discovering this more easily
2022-01-05 08:28:52 +02:00
George Kiagiadakis
03c2a3dfbd suspend-node: use a 5sec timeout by default, to be inline with the docs 2022-01-05 08:28:52 +02:00
George Kiagiadakis
74bac56aed docs: update documented versions of dependencies 2022-01-05 08:28:52 +02:00
George Kiagiadakis
a65f17d6fa docs: update the "running" instructions 2022-01-05 08:28:52 +02:00
George Kiagiadakis
1da5d11317 docs: split up and enrich configuration docs
* Add information about multiple instances
* Document better how the lua config files work
* Document how lua config files get merged from different places
* Copy over additional documentation for ALSA from pw-media-session
* Fix rst syntax issues
2022-01-05 08:28:52 +02:00
Wim Taymans
4896ad0680 json: improve json parsing
spa_json_get_string() will never write more than maxlen.
Use spa_json_parse_stringn() to perform destination length checking.
2022-01-04 16:36:15 +01:00
Wim Taymans
071ad0e43f config: add property for audio.allowed-rates 2022-01-03 16:05:17 +01:00
George Kiagiadakis
64841f5ada config: enable RT on the data thread for bluetooth nodes
Closes #132
2022-01-03 13:36:49 +02:00
George Kiagiadakis
e04acbd2a0 docs: remove protected annotations from functions to show them in the docs 2021-12-22 17:09:20 +02:00
Julian Bouzas
a59dc92928 policy: use a scheduleRescan function to avoid unneeded rescans 2021-12-22 16:52:16 +02:00
Julian Bouzas
c6445ed3db create-item: don't register item if failed to activate
Related to #128
2021-12-22 16:27:07 +02:00
George Kiagiadakis
f3f063760c si-std-link: handle node destroy events while linking is in progress
This should solve issues with stale objects lying around, printing
warnings and in some cases also crashing things

Related to #128, #78
2021-12-22 16:12:04 +02:00
George Kiagiadakis
a965196ae2 registry: ensure in-progress activations are aborted when a global is removed
If a global is removed while an activation transition is in progress
and it happens that this activation transition was triggered by an
object manager, it is theoretically possible that this object manager
will then add this proxy after the transition completes, since
the transition is holding a ref on the proxy and therefore it will
not be destroyed. This ensures that the transitions are stopped on time
and the ref is dropped.

Because of this change, it is now also necessary to destroy the pw_proxy
on WpProxy's dispose() function, because if a proxy is removed before
it is bound, the registry aborts the activation but wp_proxy_deactivate()
is not destroying the proxy, since FEATURE_BOUND is not active.
In dispose() we can guarantee that the pw_proxy is destroyed.
2021-12-22 12:51:37 +02:00
George Kiagiadakis
a2921d78db pipewire-obj-mixin: guard against proxy being destroyed while syncing to core 2021-12-21 20:06:07 +02:00
George Kiagiadakis
57d60c383c core: add wp_core_sync_closure()
A variant of wp_core_sync() that can be used with a GClosure
2021-12-21 20:03:58 +02:00
George Kiagiadakis
bc3d9da5f8 object-manager: doc: add note about the installed signal 2021-12-21 12:51:10 +02:00
George Kiagiadakis
5412ca972f log: guard against NULL messages
if for any reason the message field is NULL, replace it with the string
"(null)" and keep going... this avoids crashing the journald logger

Fixes #124
2021-12-20 17:54:14 +02:00
Barnabás Pőcze
0ff9ea9f33 meson.build: add devenv
meson devenv provides a convenient way of running the application
without installing it by overriding certain environment variables.
meson automatically overrides PATH and LD_LIBRARY_PATH, thus
there is no need to manually set those.

Running `meson devenv -C <builddir>` opens a new shell in the
build directory with the environment variables set up.
2021-12-20 10:06:36 +00:00
Julian Bouzas
f8d60fcecd m-device-activation: reevaluate current profile if params changed
This also uses the same reevaluation logic as pipewire-media-session.

Fixes #98 and #118
2021-12-20 09:54:05 +00:00
Julian Bouzas
4997e2eb19 m-default-profile: only store the default profile if the save flag is present
Also refactors module to use params-changed signal.
2021-12-20 09:54:05 +00:00
Julian Bouzas
86d85584b2 m-mixer-api: unset iterator value before breaking or returning from loop 2021-12-20 09:54:05 +00:00
Julian Bouzas
c61ab61ece pipewire-object-mixin: enable feature info when event info is fully processed 2021-12-20 09:54:05 +00:00
Julian Bouzas
4679a4ed71 metadata: unset iterator value before breaking or returning from loop 2021-12-20 09:54:05 +00:00
Barnabás Pőcze
6d7ae691b3 pipewire-object-mixin: use 64-bit type for change_mask
All core `pw_*_info` structures have a 64-bit change mask.
However, the `change_mask` in the session manager extension
info structures is only 32-bit. The differing sizes can cause
problems, especially on big endian architectures at the moment.

See #49
2021-12-15 10:58:37 +01:00
Julian Bouzas
664998c3de meson: set minimum pipewire version to 0.3.41 2021-12-13 08:37:07 -05:00
Julian Bouzas
2af63b20df si-standard-link: return transition error once even if multiple links failed 2021-12-13 08:37:07 -05:00
Julian Bouzas
844100360c proxy: abort activation if error or destroyed
This fixes a race condition that can happen when a proxy requests a new feature
(for example WP_NODE_FEATURE_PORTS) and PipeWire destroys the proxy before the
activation finishes. This race condition was causing the current activation
transition of a proxy to never finish, creating a memory leak because the
transition holds a strong reference of the proxy. Appart from this, since the
activation never finishes, WirePlumber could wait forever and not respond to
other requests.

This also removes the wp_proxy_watch_bind_error() API for subclasses as it is
not needed anymore.
2021-12-13 08:37:07 -05:00
Julian Bouzas
93c0b48bd9 object: add new _abort_activation API
Allows aborting an object activation by returning a transition error for all
pending transitions.
2021-12-13 08:37:01 -05:00
Julian Bouzas
7483f3573f docs: update daemon configuration to match new config files
Fixes #68
2021-12-10 07:20:34 -05:00
Julian Bouzas
22fd4292ab default-routes.lua: reevaluate current profile only for its own routes
Only check the current active profile when some routes changed that are part of
the profile. If some other route changed, just ignore it.
2021-12-07 14:20:31 -05:00
iczero
a452250b47 scripts: also look in $XDG_CONFIG_HOME/scripts 2021-12-06 14:47:49 +00:00
Julian Bouzas
e3a161273d m-device-activation: set best profile if default is not available 2021-12-06 12:10:41 +00:00
Torkel Niklasson
be7b95cd3c policy-node.lua: Fix si_link activation failure handling
If si_link fails to activate, we got an error saying
"attempt to index a nil value". This fixes the nil value problem
and also changes the warning to an info, since some of our badly
behaved apps can cause this and we don't see any problems resulting
from it.
2021-12-02 15:07:11 +01:00