And don't override PIPEWIRE_DEBUG, unless WIREPLUMBER_DEBUG is set.
This allows pipewire to use log.level as well to set up its logging.
If WIREPLUMBER_DEBUG is set, though, override PIPEWIRE_DEBUG to prevent
log.level from being used.
This fixes adjusting volume for bluetooth nodes.
Previously, the spa device would request a software volume change
that we did not handle because WpImplNode was not a WpPipewireObject
and there was no way to set the Props param on it.
This allows closures to be properly unrefed when they are no longer
used instead of staying alive until wireplumber exits
Because GClosure has no weak references, we are now sharing the
GPtrArray that holds these references among all the active closures
and each closure is responsible for removing itself from the array
when it is finalized. The lua engine holds a reference to a "store"
object that also has a pointer to the array and when this "store"
is finalized, all closures are invalidated and removed. Even if they
stay alive afterwards, they are only holding a ref to an empty array
The main problem observed is when a link that is owned by a WpLink
is removed from the server because one of the linked nodes is gone.
This would cause the APPEARS_ON_REGISTRY flag to go away but the
WpGlobal would still remain in the globals list...
To fix this, forcibly remove the global from the globals list when
it is removed from the registry, even if it is still owned by some
proxy. The proxy at that point is unable to function anyway, because
we make sure to destroy the pw_proxy by removing FEATURE_BOUND when
the global is removed from the registry.
Additionally, ref global->proxy before removing FEATURE_BOUND to
prevent crashing. If the proxy owns the global and the pw-proxy-destroyed
signal causes whoever owns the proxy to drop his reference, _deactivate()
will crash because no-one will be holding a ref to the proxy.
The assumption about the global id in wp_registry_prepare_new_global()
was not valid because this function may also be called from the proxy
bound event and this may be before the registry has signalled the
removal of an old global with the same id, for instance
We should instead check this at the point where we expose the global.
If the assertion doesn't hold at that point, we are going to leak an
old WpGlobal, so we must ensure it.
Allows checking if the endpoints are still valid before releasing the
acquisition. Sometimes the endpoints are destroyed before the link, and
releasing acquisition is not needed. There is no way to check that with raw
pointers.
This adds WP_SESSION_ITEM_FEATURE_ACTIVE and WP_SESSION_ITEM_FEATURE_EXPORTED
features, so _activate and _export APIs have been removed. Modules and unit
tests have also been updated.
It is inevitable to avoid setting PIPEWIRE_DEBUG, because the
log.level from client.conf will kick in and change the pipewire log
level when the pw_context is created. PIPEWIRE_DEBUG is the only
way to override.
* skip the shebang before loading the file in the interpreter,
as # is not a valid lua comment
* allow loading scripts with a relative path in interactive mode
The advantage is that luaL_tolstring behaves the same as the native lua
tostring() function, while lua_tostring() does not. In particular, boolean
values are converted properly to "true" and "false" now, while they were
not converted with lua_tostring()
Add a unit test too
When we convert from a lua table to a GVariant dictionary, it is not
possible to maintain the hybrid string & integer keys approach that Lua
has for tables, so we convert all keys to strings and a table becomes a{sv}
When we convert back from a{sv} to a table, it is desirable to get back
the integer keys wherever possible.
The use case is to pass "arrays" (i.e. tables with integer keys) from
the configuration files to the lua scripts, without losing the properties
of the "array"