Place the methods on the interface so that we can call them.
Rename create to init because that is what it does.
Add support for listener and events so that we can signal property
changes later.
Move all backends to dynamic libaries loaded with spa_plugin_loader so
new backends not needs changes in pipewire or pipewire dependency to
external code
Change-Id: I702ce047598d0c318d6dc6ac8248062a5c12f643
In some cases it is possible for `pw_context_conf_section_for_each()`
to not set `res` at all, which leads to an indeterminate value being returned.
Fix that by setting `res` to 0 initially.
module-combine-sink should become loaded only after its input stream,
and all explicitly specified output sink stream nodes appear. Since
output sinks may appear on the manager after a delay, wait for them only
up to a timeout, and fail load after that.
Fail load if there are errors in input stream, or in an explicitly
specified output.
This is needed for Zoom sound sharing to work. Pulseaudio additionally
fails the module load if streams fail to connect, but we do not do that
here at the moment.
Operations sync manager, so use that.
On Pulseaudio, module unload is async procedure. However, this race
condition may be hard to hit in practice, whereas on pipewire-pulse it's
not hard. E.g. Zoom appears to assume that modules are unloaded
synchronously.
Sync client's manager, before returning from module load, also for async
module loads. This is because the module load may have its own core, so
even though it has made changes on server, the client manager might not
see them yet.
Fix this by syncing client->manager before operation return.
In context.exec after forking, if execvp returns we have to exit since
we're in the child process.
To avoid zombies, either SIGCHLD need to be handled/ignored, or
double-fork to create orphan processes. This is in library code, so it
seems best to just double-fork.
Add a module for a fallback dummy sink, which appears dynamically when
no other sinks are present.
Enable it for pipewire-pulse, because Pulseaudio will also show
dynamically a dummy sink.
Emit a warning when the listener was not removed now that most places
are fixed. Not removing a listener might fail to call the removed
callback and leave things in a broken state.
When a client forgets to remove a hook, report them leaked in
the debug log. This is not a problem because we don't usually
add our own removed hook for proxies.
The problem is that we can't forcibly remove them with _clean()
from _destroy() because the hooks might be emitting the removed event
or the object listener. We could try to remove them in the final
unref but it seems some apps free their data before that and then
we unref invalid memory.
As soon as a JACK app is started, the automatic quantum change is
disabled. This means no pulse/alsa app can change the quantum.
The only way to change the quantum is with node.force-quantum or
with the settings metadata.
This means only a JACK buffersize change (usually controlled from the
JACK app, such as in ardour) or a metadata change (from the command
line) can modify things. Both of those are usually caused by a user
action.
For JACK apps where the quantum is allowed to change automatically,
explicit rules need to be placed in the config.
If a node (or metadata) forces a quantum, remove any nodes that
requested a lock-quantum so that we can change the quantum to the new
forced one.
This makes it possible to run jack clients with node.lock-quantum while
still allowing them to change the quantum qith node.force-quantum.
Make all tools output to stdout (pw-mon mostly) so that we can pipe the
output around.
Send errors to stderr.
fprintf(stdout, ...) -> printf(...)
setlinebuf for stdout so that pipe works better.
See #2110
Skip spaces before the key. When the previous key ends with a ' or when
there are 2 spaces between keys, the key includes the whitespace
otherwise.
See #2086
For the modules that we load internally, place a pulse.module.id
property on the nodes.
If there is no module.id property on nodes, try to use the
pulse.module.id when introspecting. We should not remap those to
serial numbers.
Fixes#2101
When loading a module, remap the pulseaudio properties to pipewire ones
for consistency.
move the media-roles to remap, because it's more about remapping between
pa and pw.
Fixes#2076
Since meson 0.59.0, a feature object has an `allowed()`
method which returns true when the feature is set to
'enabled' or 'auto'.
Utilize that instead of the previously used
not feature.disabled()
Most feature checks already use #ifdef, and do not care about
the value of the macro. Convert all feature checks to do that,
and simplify the meson build scripts by replacing
if cond
cdata.set('X', 1)
endif
with
cdata.set('X', cond)