Commit graph

1609 commits

Author SHA1 Message Date
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
George Kiagiadakis
69bd1e51ce default-routes: make the default volume configurable 2021-11-30 19:30:25 +02:00
Wim Taymans
703c35cfd4 access-config: add restricted access permissions
When a pulse client connects with TCP, it is given the 'restricted'
access policy. Assign 'rx' permissions for those clients instead of
blocking forever.

See pipewire#1863
2021-11-29 09:25:18 +01:00
George Kiagiadakis
147f235f54 policy-node: don't crash if device.id is not set on a target 2021-11-26 19:57:17 +02:00
Ashok Sidipotu
52980fb770 policy-node: improve default device selection logic
- skip target device if it does not have active/available
routes

Fixes #74
2021-11-26 14:43:04 +00:00
Pauli Virtanen
95d1423677 wp: fixup tmp_global exposition with removed objects
Consider invalid id as removed marker, similarly as in the preceding for
loop.  This condition should currently not be possible to hit in
practice, but better to clean up.
2021-11-25 16:39:11 +00:00
Pauli Virtanen
9d938c5c82 wp: add an assert to guard against id race conditions arising
The WpGlobalProxy and WpGlobal should be 1-to-1, so check this before
binding proxies from globals.
2021-11-25 16:39:11 +00:00
Julian Bouzas
49f1ead1a7 si-standard-link: always return transition error if activation fails
Avoids having the session item in an invalid state.
2021-11-25 16:06:17 +00:00
Julian Bouzas
9ed6af021f si-audio-adapter: always return task error if set ports format fails
Avoids having the session item in an invalid state.
2021-11-25 16:06:17 +00:00
Julian Bouzas
45d567b488 si-audio-adapter: clean up unneeded code when setting ports format 2021-11-25 16:06:17 +00:00
Wim Taymans
efd2458418 alsa: handle the release-requested signal
Handle the release-requested signal by destroying the device and
then calling release.

Fixes pipewire/pipewire#1846
2021-11-23 13:17:29 +01:00
Wim Taymans
c88fbd20e6 Revert "policy-node: Remove direction check"
This reverts commit b6072f4179.

This is not right because when 2 nodes have the same name, there is
no way to know which one to use. It is better to rely on the
PW_KEY_STREAM_CAPTURE_SINK property when capturing from a monitor.
2021-11-23 11:47:08 +01:00
Peter Hutterer
ee5f3f2f19 lib: don't read hidden files from the config directory
Fixes #104
2021-11-21 07:48:07 +00:00
Wim Taymans
83041b0ce2 policy-node: wait for nodes when we become unlinked
If we were linked before but our node is removed, wait until a new node
becomes available instead of failing.

This fixes an issue where there is only 1 sink available and the card
profile is toggeled between pro and stereo. After the profile is
toggled, the sink is removed and the node would be killed with an error
because there is no fallback sink. The fix is similar to the
pipewire-media-session logic.
2021-11-18 15:23:23 +01:00
Peter Hutterer
5ec2138a72 log: support strings as level selectors in WIREPLUMBER_DEBUG
This allows for WIREPLUMBER_DEBUG="D" which avoids users having to
remember which numerical value the various levels have. The strings to
select are the ones printed by the logger, i.e. UECWMIDT.
2021-11-18 12:17:19 +00:00
Peter Hutterer
21266a5bec lib: correct documentation for wp_iterator_fold/foreach 2021-11-18 12:09:57 +00:00
Peter Hutterer
1121618387 lib: fix some incorrect docs for signals 2021-11-18 12:09:57 +00:00
Peter Hutterer
9208ea051c Fix some typos 2021-11-18 12:09:57 +00:00
Peter Hutterer
f4546a18e8 m-reserve-device: replace the hash table key on new insert
We're using the WpReserveDevice's name as key in the hash table, so we
must update the key as well when we replace an item in the hashtable -
the old device (and its name) will be released.

The side-effect of this is that the *third* device with an identical
name will no longer replace the previous device. This results in the
following sequence:

- dev1 added: name Audio0
  - dev1 requests name owner Audio0
- dev2 added: name Audio0
  - replace dev1 in the hashtable
     - dev1 emits "release" signal
     - dev1 unowns the Audio0 name
  - dev2 requests name owner Audio0
- dev3 added: name Audio0
  - adds to the hashtable because the existing key is now undefined
  - dev3 requests name owner Audio0
     - error, you cannot request ownership for the same name twice

Fixes #93
2021-11-18 12:00:09 +00:00
Peter Hutterer
f7e8bad414 ci: use FDO_CI_CONCURRENT if available to control the job count 2021-11-18 11:51:14 +00:00
Wim Taymans
b6072f4179 policy-node: Remove direction check
Remove the direction check in findDefinedTarget. We already to a
better direction check in canLink().

This fixes the case where a capture stream has the node.target set
to a sink. The directions don't match and the capture stream is not
linked to the monitor ports of the sink. Removing the check triggers
the right logic in canLink() and obs studio can link to monitor
ports again.
2021-11-18 11:46:47 +00:00