Set node.target metadata to "-1" instead of deleting it to direct nodes
to the default device.
Deleting the metadata, as done previously, does not work for nodes for
which the client has node.target set.
Handle all node.target behavior in rescan_node.
Make distinction between target nodes set in session manager via
metadata or via restore-stream; priorities are
metadata > client's node.target > restore-stream.
Allow metadata override to also remove the target node setting.
For nodes that have node.target set, when the target is not available,
media-session links them to any available node. If the target node
appears afterward, media-session would not re-link them, leading to
output being directed to wrong place (e.g. pavucontrol input monitor)
even though the intended target or a better fallback is available.
This occurs e.g. when devices are removed and re-added.
Fix this by (i) for reconnectable nodes, reconnect them if target
appears later, and (ii) for non-reconnectable nodes, raise error to the
client if node.target is set but not found (but proceed to fallback if
obj->target_node is set).
Also slightly reorganize policy-node.c:rescan_node for clarity.
Also set the driver on an inactive node when it wants a driver.
Fixes the case where xjadeo does not activate itself but still wants
to poll the transport state of the driver.
See #1491
When XDG_STATE_HOME is unset, we save in $HOME/.local/state/pipewire,
so try to first load the state file from there as well before we
try to fall back to the old XDG_CONFIG_HOME location.
Defaulting to $HOME/.local/state, this is the directory that state
information is to be kept.
As with the configuration loading, where a caller requests an absolute
path, that path will be honored, we only fall back to XDG_STATE_HOME for
relative paths.
This adds a new PIPEWIRE_STATE_DIR environment variable to override this
directory.
If a reconnecting node was linked at least once successfully, and a
re-link ends up not finding any node to link to, don't raise an error.
Instead, just unlink the node, and wait for a suitable sink to appear
later.
This fixes the issue that some Pulseaudio apps have to be restarted
if all devices go away, before they start working.
It also seems like the right thing to do, because if you remove links
manually, this does not cause errors to occur.
When `val` was used, it was always a true-ish since the
address of an array on the stack was assigned to it.
Remove this variable altogether, and use `name` directly.
Only use `name` when it is valid - when `key && value`.
`impl->default_sink` is dynamically allocated, but previously
it was not freed when the containing struct was being destroyed.
Fix that by freeing it in `session_destroy()`.
There's no particular problem to have default.configured to point to a
non-existent device, it will be ignored. This was left over when
default and configured default were made separate things.
default-nodes also doesn't need to track the id of the configured
default, so remove also other stuff that's no longer necessary. It can
simply load the values to metadata on startup, and save them to a file
when they are changed, without needing to understand what the values
mean.
Also fixes commit 7071562334 causing defaults to be forgotten when
nodes are removed.
We only want to call process() from Start when we are not a driver and
not realtime.
When we are a driver, the user will need to call _trigger_process()
to kick things of.
When we are asked to schedule process from the realtime thread, we
need to wait until the RT thread is scheduled.
In all other cases we can call _process() from the mainloop so that
the RT thread has something to collect when it gets scheduled.
When the node is driving, we need to call trigger_process()
otherwise we don't and we simply need to wait for the process() to
be called, triggered by the driver node.
See #1484
It has the DRIVER flag set and sets a PW_KEY_PRIORITY_DRIVER value
to something higher than the source so that it becomes the driver.
Every timeout it does pw_stream_drive() to start the graph, which
will eventually call the process function with a pulled buffer to
display.
The framerate is set to something lower (80ms between frames) to
show the pull effect.
fixes#1484
This method is meant for driver streams when they have data or need
data.
Previously only source (output) streams could drive the graph and
indirectly by doing pw_stream_queue_buffer(). This behaviour is now
deprecated (but will still work) in favour of calling
pw_stream_drive() explicitly.
pw_stream_drive() will call the process function immediately (if
driver) or later (when not a driver) so that the same code paths
can be used when running as a driver or not.
In a similar way, a consumer (input) driver stream can now be
written. It will call pw_stream_drive() when it wants data and the
process function will be called when the data is ready.
See #1484
We need to check the position vs the clock to see if we are currently
driving the graph. We can only call the node ready callback when
we are actually driving the graph.
"restored" describes a state but the only case we actually set this
value if we want to restore our previously saved profile. Rename a
variable to indicate this, makes it easier to understand.
Add module that switches bluez device profile to HFP/HSP if an input
stream (non-monitor, autoconnect) appears, and the current default
output device is bluez one that does not have input route.
When all input streams are gone, switch all changed profiles back.
Pending restore state is saved to session manager state files, in order
to restore it if e.g. devices get disconnected. This usually is not
currently necessary since the bluez5 plugin prefers to connect to A2DP
over HFP, but might matter in future with backchannel-enabled A2DP
codecs.
This test needs an environment set up to load everything correctly,
running it directly results in a segfault. Let's make sure we assert on
a NULL loop to make this look slightly more planned.
Add a new client-node port_set_mix_info event. bump the interface
version to 4 and the event version to 1.
The event is used to send information about the peer object to the
port mixer. This can be used to track what buffers belong to what
peer.
Reevaluate the graph again after we potentially suspend because of a
rate change because links might become unprepared and need to be
prepared again before the node becomes active.
We call setup_alsa_ucm_endpoint() before the
setup_alsa_fallback_endpoint(), but this function always returns
-ENOTSUP. Add a FIXME comment to make this more obvious.
spa_strstartswith() is more immediately understandable.
Coccinelle spatch file:
@@
expression E1, E2;
@@
- strstr(E1, E2) != E1
+ !spa_strstartswith(E1, E2)
@@
expression E1, E2;
@@
- strstr(E1, E2) == E1
+ spa_strstartswith(E1, E2)
Applied to the tree except for alsa/acp/compat.h because it looks like
that header is still mostly as-is from PA.
Add a default.clock.allowed-rates property that lists the possible
rates for the graph.
Add node.rate and node.lock-rate properties to suggest a graph rate
and lock the rate.
Collect the largest clock rate from the nodes and if it is allowed,
try to configure it as the graph rate. Only switch rates when the
driver is IDLE or suspended or when we force a rate.
No alternative samplerates are specified because we first need to
work around a common driver bug (cards with 1 cristal need the same
rate for capture as playback) for this to work.
Rework the quantum and max_quantum handling. Work directly with the
latency fractions and calculate the final quantum size until we know
the samplerate.
The graph will not switch quantums when there is an active node
with the node.lock-quantum property set to true.
It can be used to stop certain jack clients from crashing when the
quantum changes.
Hard rate changes (the default now) makes the graph suspend so that the
driver reopens the device with the new sample rate if possible. This
causes a glitch.
Soft rate changes works as before and just changes the clock rate of
the position area, which makes everything resample things to the new
rate without a glitch.
Sample rate changes can currently still only be triggered by
configuring the settings metadata clock.force-rate
We don't need to follow nodes that we already visited or that are
inactive so skip them early.
Always try to prepare the link otherwise, not only for passive links
because non-passive links might also be paused because of a suspended
driver.
We only ever want to prepare a link between active nodes so add the
check in the _prepare() functions instead. This also makes it skip
the prepare step for inactive nodes when recalculating the graph.
This adds a new top-level documentation entry for pipewire-media-session
with a list of modules (currently only one). Similar setup to the
pipewire modules, it allows us to document all modules in-place.
Leaving sockets in the home directories is bad form, so let's not do
this.
This effectively requires XDG_RUNTIME_DIR to be set for pipewire to
work - it is set correctly on most setups anyway and on custom setups
this needs to be addressed with a custom environment.
Fixes#1443
The target signal is called when the peer nodes are ready and this
node needs to be scheduled. It is the in-process version of the
signal.
Remove our custom version that, just like the default version, schedules
the node implementation but doesn't do any accounting.
Makes pw-top report driver stats for bluetooth devices.
Fixes#1450
Make a new PW_KEY_NODE_WANT_DRIVER to assign the node to a running
driver. (does not work yet)
Use a new variable to hold the ALWAYS_PROCESS setting and also
update want_driver.
This makes things it a bit more future proof.
Virtual sinks and sources implemented with streams need to be grouped
with a driver node to be able to schedule. We don't have a way to let it
use a default driver so add it to the pipewire.dummy driver.
This fixes stalled pipe and other streams streams.
Fixes#1407
We always want to clear the provided blocklist from the properties. The
logic tries to only clear when there was a blocklist but it checks this
by comparing the string pointer to the fallback, which gives a compiler
warning.
`getpwuid_r()` puts the strings pointed to from the returned
passwd struct into the specified buffer. Previously, that
buffer technically didn't live long enough to be usable
in the `snprintf()` call - although in practice this didn't
appear to be a problem. A particular version of GCC 11 generates
the same machine code for this function regardless whether
this patch is applied or not. Still, fix this by moving
the buffer to an outer scope.
module-switch-on-connect sets the configured default sink/source
whenever suitable new sink/sources appear.
This should give the same behavior as Pulseaudio's module.
This module exists mainly to provide a workaround e.g. for desktop
environments such as XFCE, whose mixer applications try to manage the
default devices assuming fully PA-like behavior, breaking default
pipewire output switching.
When we remove a default node, remove it from the properties and trigger
a save of the state so that the configured default is also actually
removed from the state file.
- use meson to check for gettid() function, always use if available
- use syscall fallback on linux, if not
- restrict thr_self() fallback to *only* FreeBSD
- error out if there isn't any gettid impl
When nothing else is specified, add a default node.link-group property
so that all the nodes from this echo-canceler are tagged as being linked
together in some way.
This allows the session manager to follow the relations between the
different streams and avoids linking those related nodes together, which
avoids playing or recording from itself in a loop.
Fixes#1376
The mempools list keeps track of all allocated mempools but is otherwise
not used. Because it is not protected with a lock, concurrent contexts
or thread loops can step on eachother and crash. Remove this for now
until we actually need it and implement it with some sort of lock.
Fixes#1416
This test currently prevents us from running the test suite in valgrind but
it's not a straightforward fix. So in the meantime, skip this test when
running under valgrind.
This allows to get rid of the empty if block in comparison to
channel_map, and makes it clear that the comparison is useless. So in
the next commit we will remove it.
Fixes an LGTM warning:
Empty block without comment
cb6dbd165a made public API incompatible with consumers using
_POSIX_SOURCE, _POSIX_C_SOURCE or _XOPEN_SOURCE: <sys/mount.h>
isn't standalone but depends on BSD-specific types in <sys/types.h>
which are hidden when POSIX compliance is requested.
xdg-desktop-portal-wlr passes -D_POSIX_C_SOURCE=200809L via meson.build
which works for its own code and all other dependencies.
In file included from ../src/core/main.c:7:
In file included from /usr/local/include/pipewire-0.3/pipewire/pipewire.h:35:
In file included from /usr/local/include/pipewire-0.3/pipewire/client.h:35:
In file included from /usr/local/include/pipewire-0.3/pipewire/proxy.h:108:
In file included from /usr/local/include/pipewire-0.3/pipewire/protocol.h:48:
In file included from /usr/local/include/pipewire-0.3/pipewire/utils.h:34:
In file included from /usr/include/sys/mount.h:38:
/usr/include/sys/ucred.h:99:2: error: unknown type name 'u_int'
u_int cr_version; /* structure layout version */
^
In file included from ../src/core/main.c:7:
In file included from /usr/local/include/pipewire-0.3/pipewire/pipewire.h:35:
In file included from /usr/local/include/pipewire-0.3/pipewire/client.h:35:
In file included from /usr/local/include/pipewire-0.3/pipewire/proxy.h:108:
In file included from /usr/local/include/pipewire-0.3/pipewire/protocol.h:48:
In file included from /usr/local/include/pipewire-0.3/pipewire/utils.h:34:
Reported by: Jan Beich <jbeich@FreeBSD.org>
Let the module-rt and module-rtkit provide a new pw_thread_utils
implementation.
The pw_thread_utils interface has many advantages over the old way
of boosting the thread:
1. Does not require to add a source to the loop and do priority
boost in-thread.
2. Works on simple threads without data-loop interface.
3. Allows dropping RT priority as well.
The rtkit implementation requires a bit more work because there is
currently no pthread API to map an pthread to a tid. We make a small
wrapper thread to capture the tid with getpid() to do the mapping
ourselves. This should go when the new API arrives. See also:
(https://sourceware.org/bugzilla/show_bug.cgi?id=27880)
Add a function in data-loop to get the natvive thread and use that
in client_thread_id() so that it returns the pthread of the
data thread instead of the caller thread.
200ms seems a little small, some plugins initialize themselves from the
RT thread and get killed. 2 seconds seem to be a better default.
The important part is that there is a limit so that runaway processes
are killed and don't lock up the system.
Fixes#1344
Add a simple quirks table.
Forces S16 formats for teams sink and source info.
Forces removal of the DONT_MOVE flag for capture streams for firefox.
See #838 and #1363
Mark some structures, arrays static/const at various places.
In some cases this prevents unnecessary initialization
when a function is entered.
All in all, the text segments across all shared
libraries are reduced by about 2 KiB. However,
the total size increases by about 2 KiB as well.
If the number of bytes read is not a multiple of the stride,
then partial samples may be queued. Avoid that by storing the
last partial sample (if any) in a separate buffer,
and only queue full samples.
Previously, the code did not set any error code, leaving res = 0,
when the file existed but it wasn't a pipe. This resulted in no
status code being returned to the client.
`sysname` need not be static since `avahi_string_list_add_pair()`
creates a copy, and no other parts of the code have reference to
`sysname` that would require static lifetime.
Furthermore, do not hardcode the size of the array.
Add a new object.register boolean property.
Make adapter and remote-note only register when object.register
is true.
Make stream and filter not register themselves. They are always
exported to a remote server and thus don't need local
registration.
Fixes#1309
Passing a '-' as the port or node for create-link will omit sending
the property to create-link so we can check if the link factory handles
missing properties too.
See #1365
The node.link-group property marks streams that are internally linked
together in some way. It is used to relate the input and output streams
of some of the module streams.
It is more like how JACK2 does things.
We get FIFO scheduling by default and we don't get killed by RTKit
when doing long operations, which seem to be the case for many
plugins.
The thread name can only be 16 chars. We don't need to strdup the
name but copy and trunc into a fixed buffer.
We can also set the thread name right after we created the thread.
Emit a warning when we can't set the thread name
Several places in the code don't handle reconnecting DBus connections
yet. In those cases, a ref to the DBusConnection handle needs to be
kept, so that there's no use-after-free if it gets freed by spa_dbus
if the connection is broken.
Adjust spa_dbus so that others keeping additional refs is safe.
When a sink is RUNNING but there is nothing linked to the input it must
be the monitor that is keeping it active, report IDLE for the sink in
that case.
When a source is RUNNING but there is nothing linked to the output it
must be the sink part that is keeping it active, report IDLE for the
source.
Fixes#1345
As suggested by George Kiagiadakis, adds calls to summary() function
for each feature that is by default set to auto, so that an overview
of their effective state is printed at the end of meson setup or
meson --reconfigure command.
Currently ordering is a bit messy but tidying it up would detach
the summary() functions from the dependencies they rely on and could
be done later along with meson_options.txt re-ordering so that the
two match as much as possible.
Some distributions set --auto_features=enabled which messes with the
internal logic of the build system when features are used for other
purposes than pure dependency control. The only solution is to either
avoid the value auto or change the type of the option to non-feature.
This commit does the later by replacing -Dmedia-session, -Dwireplumber
and -Dsession-manager with the new -Dsession-managers array and
-Ddefault-session-manager combo options.
Fixes#1333Fixes#1336
Keep track of Latency params on ports. When adding a latency param,
parse and update the port latency info.
Add both input and output latency params on the port, even when only
one changed. Use the stored info to do this.
Implement a default latency handler that simply combines and forwards
the Latency settings on ports.
Add a CUSTOM_LATENCY flag that allows you to bypass the default
handler and implement custom logic.
See #911
First initialize the port and node info, then add the params so that
the param_info flags are updated correctly. Otherwise, adding the
params would make the param readable but the init of the param_info
later would reset it back to 0 and the param would not be visible.
Keep track of the number of updates in the user field and before
emiting the info, flip the serial flag. This makes it possible to
even emit updates when setting an even number of params.
When a user plugs in headphones, they expect to hear an audio through
them. Currently, that usecase might or might not work with pipewire
depending on the user's luck, because pipewire instead uses port
priorities, and those apparently rarely have sane default values.
PulseAudio ignored priorities here, instead it made use of the port
right away. This should better match user expectations (who plugged in
headphones and is expecting to hear sound), so let's do the same in
pipewire.
Fixes: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/1170
Keep separate counters for the ringbuffer and stream read/write
indexes.
The ringbuffer has 32 bits indexes while the pulse server is required
to keep 64 bit read/write indexes.
Also handle invalid seek flags.
Fixes#1331
This is obsolete since the move to doxygen groups and having \memberof blocked
the documentation in the source file from being merged with the header file.
SPA_PLUGIN_DIR is exported in pkgconfig as 'plugindir'
PIPEWIRE_MODULE_DIR is exported as 'moduledir'
PIPEWIRE_CONFIG_DIR is exported only in uninstalled environments
as 'confdatadir' (not making this public due to the possible upcoming
configuration changes in pipewire)
All variables are also exported on the meson dependency objects,
so that subprojects can find them.
Wireplumber can then find them like this:
pipewire_moduledir = pipewire_dep.get_variable(
pkgconfig: 'moduledir', internal: 'moduledir', default_value: '')
... and this works regardless of whether wireplumber is being
configured as a subproject or using the uninstalled pkgconfig files
or using the system installation of pipewire.
This is required in order to run wireplumber tests in the
uninstalled environment with 'meson test'
This allows building wireplumber as part of the pipewire build
and running it in the uninstalled environment instead of media-session.
Building each session manager is individually contolled by the options:
-Dmedia-session=auto/enabled/disabled
-Dwireplumber=auto/enabled/disabled
And controlling which one is used in pipewire.conf is done with:
-Dsession-manager=media-session/wireplumber
Wireplumber's source tree must be in subprojects/wireplumber/
If this is missing, the .wrap file ensures that the latest git
master is downloaded while meson configures the build.
This git tree will not be automatically updated later, you need
to ensure that it is up-to-date on your own.
This allows meson subprojects (or projects using pipewire as a meson
subproject) to be able to use dependency('libpipewire-0.3') and
dependency('libspa-0.2') to find the uninstalled versions of these
libraries directly from the build dir instead of going through pkg-config
pkgconfig.generate() takes a positional argument, which
is the library target for which to generate a pkgconfig file
The previous way of adding the libpipewire target in
the libraries list is deprecated in recent meson
This also brings the advantage that all tools, examples, modules, components
can also be compiled standalone out-of-tree using libpipewire from the system
This allows having the same directory structure for headers as it
is in $prefix/include when installed, so that we can build other
projects using pipewire uninstalled (via the -uninstalled.pc or
by using meson subprojects). Otherwise, external code that reasonably
includes <pipewire/extensions/foo.h> fails to compile.
Write the profiler data to an allocated buffer instead of the stack
so that we can make it a little larger.
Don't try to process the data when the builder had to truncate it
because it didn't fit.
When we don't have enough files to accept the connection, clear the
_IN flag so that we don't try to accept if over and over again.
When a client disconnects, set the flag again so that we try to
accecpt new connections again.
See #1305
We can't recover from truncated control data so return a fatal error
that should stop the client. Truncated control data can happen when
there are no more fds available, for example.
See #1305
This is not too useful while looking at pipeline graphs, etc. We will
likely want to expand this to also include the module id or something to
distinguish multiple echo-cancel instances (which we can currently do
via the factory ID).
Make structure with defaults that holds the defaults as they are loaded
from the config file or initialized with default values.
Copy this structure to a settings version that is used at runtime.
Add a force-quantum and force-rate field in the settings that can be
used to force a quantum and samplerate if != 0.
Retrieve the pointer returned by `calloc()` and free that
instead of freeing the pointer to a member. This has worked
so far because as of yet `api` is the first member of the struct.
Since !737 it is not required of modules to emit the "loaded"
event if they can load immediately, therefore remove the
unnecessary `module_emit_loaded()` call.
Furthermore remove redundant log messages as well.
Modules no longer need to emit the "loaded" event manually
if they can load immediately. In that case, the module loading
code will take care of emitting the event. If they can't,
they must return an async spa result, and emit the "loaded" event
when they see fit.
Fixes#1232
This reverts commit db44fe47ee.
We should not be merging config files at this point. Generating config
files should be done offline and only the result is loaded here.
Use this for the version.h file so we enforce that being used everywhere
instead of accidentaly relying on whatever ends up in config.h.
The generated version.h file is identical.
Properly escape the keys because we're trying to generate
valid JSON.
Always place ',' after items.
Add a flag to add a '\n' before each item.
Don't try to string-encode the value when it's already a string.
Load and parse config files in the following order:
$PIPEWIRE_CONFIG_DIR or /usr/share/pipewire
/etc/pipewire
$XDG_CONFIG_DIR or ~/.config/pipewire
This ensure we always load a working base config and reduce the
chances of failing because of a back user config file.
The user config file now only needs to contain the section that
needs the be changed.
See #207
Override the CORE_NAME using the env variable in the context instead
of pipewire.c. This avoids needing the _add_string() property method.
Remove the properties_add_string() method, there are new improved
plans for property parsing and merging: See #207
Try to keep the full docs out of the headers and into the .c file.
A small short blurb in the header is enough for quick lookups.
Also try to use a regular comment to not confuse the doc system.
If pw_array_ensure_size() is called on an array that has not been initialized
with an extend, assert. Otherwise we get stuck in an infinite loop since
doubling our zero allocation size will never reach "need".
Previously, if the string started with any of the characters in
delimiter, the first returned string would've been an empty string.
This is in contrast with the fact that otherwise `pw_split_walk()`
skips empty fields.
E.g.
"::field1::field2" with ":" as `delimiter`
would have resulted in
* ""
* "field1"
* "field2".
Adjust the function to skip leading runs of characters in `delimiter`
by calling `strspn()` first.
Since `pw_split_walk()` does not skip leading runs of
delimiters, if `module_dir` is an absolute path, then
l = pw_split_strv(module_dir, "/", 0, &n_paths);
will return an array of one element, which is exactly the same
as `module_dir`, `strcmp(l[0], module_dir) == 0`.
If `module_dir` is a relative path, then the returned array
still contains a single element, which is, again, the same
as `module_dir`.
Therefore, omit the the call to `pw_split_strv()` and simply
use `module_dir` as is.
Mostly uses the existing infrastructure, but the webrtc canceller has a
fixed blocksize, so we:
1. Use the canceller blocksize if configured
2. Accumulate output data in a ringbuffer
3. Push out the data in the required chunk size
This aggregates buffers from the capture stream and the sink in the
corresponding process callbacks, and runs processing based on the
desired resampler rate if there is one.
We allow the ringbuffer in which we capture buffers to grow to some
extent, as that seems to be required for playback to occur smoothly.
Whether this is hiding some other underlying problem likely needs
investigation.
Add env variable PIPEWIRE_NO_CONFIG to disable parsing
custom config files.
Add a method to check extra options.
Expose valgrind, no-config and no-color as options.
Just like the real free() we should just ignore a NULL pointer, makes the
caller code easier for those instances where properties are optional.
Patch generated with concinelle with a few manual fixes.
For boolean properties:
- passing in NULL no longer crashes and instead returns false
- passing in a string starting with 1 (e.g. "1xyz") no longer resolves to true
For int-based properties:
- passing in NULL no longer crashes and instead returns 0
- passing in invalid numbers no longer resolves to whatever number prefix
could be parsed (e.g. "123foo" was 123)
When the server or client goes away, detach the client
from the server to avoid potential use-after-free issues
that might occur if the client causes the
unloading of the server it is connected to.
E.g.:
pactl load-module module-protocol-native-tcp port=4713
pactl -s localhost:4713 unload-module module-native-protocol-tcp
See #1240.
If any of those two branches are taken, the connection
cannot make forward progress since no data will be read/sent
from/to the client.
For example, sending just 21 invalid bytes to the server
causes the first 20 bytes (client descriptor) to be read,
then rejected, leaving `client->message == NULL`. But since
polling is level triggered, `on_client_data()` and thus
`do_read()` will continue to be called ceaselessly,
thereby spamming the log and wasting resources.
Check if the port has latency param and only try to set the
latency param when it appears available. This avoids sending unknown
latency params to an old client and erroring out.
RLIMIT_RTTIME is Linux specific, there is no equivalent replacement
for FreeBSD. Save trouble and build module-rt for Linux only, rtkit
WIP fork should be fine on FreeBSD for now.
If `struct pw_map::free_list` is not initialized to `SPA_ID_INVALID`,
then `pw_map_insert()` will try to read `map->items.data[0]` when
inserting the first element, but `data` is a `NULL`
pointer after initialization.
Emitting events using the listener_list can not be done from multiple
threads at the same time. For this reason, make a copy of the events
with the process event and call it explicitly from the data thread.
See #1122
Add support for listening on IPv6 addresses.
The following address formats are supported:
* tcp:[<ipv6-addr>]:<port>,
* tcp:<ipv4-addr>:<port>,
* tcp:<port>, and
* unix:<path>.
The IP addresses are parsed using `inet_pton()`,
only the formats supported by that function
are accepted.
The IPv6 address must be surrounded by square brackets,
they do not mean "optional" here. Specifying only the
port is equivalent to the following two addresses:
* [::]:<port>, and
* 0.0.0.0:<port>.
Address parsing has been made stricter: the port
must always be specified explicitly.
Fixes#1216.
Trigger a recalculation of the port latency when the peer port
latency changed.
This makes the latency update from a port propagate through the
pipeline.
Implement a port recalculate latency method that takes the min
and max latency of all peer ports and sets that as the new port
latency.
When a link is made, let the output and input port recalculate
latencies.
Pass latency param in audioconvert.
When we add a new listener to an object, it will emit the full state
of the object. For this it temporarily sets the change_mask to all
changes. Restore the previous state after this or else we might not
emit the right change_mask for the next listener.
Consider the case where one there are two listeners on an object.
The object emits a change and the first listener wants to enumerate the
changed params. For this is adds a new listener and then triggers the
enumeration. If we set the change_mask to 0 after adding the listener,
the second listener would get a 0 change_mask and fail to update
its state.
This is an attempt of breaking up the documentation, currently spread across
several pages. We're left with a few high-level topics with various things
grouped underneath those.
Further refinement is necessary, but this can now be done in incremental steps
over massive reworks.
This matches the behavior of most applications - check environment variables
first, then fall back to the various built-in options (in our case xdg, /etc/
/usr/share, in that order).
Previously, when `pw_protocol_pulse_new()` returned NULL,
the code would jump to the `error` label, which would
call `impl_free()`. At this point, however, `impl->module_listener`
is not initialized, which would lead to a SIGSEGV when
`spa_hook_remove()` is called from `impl_free()`.
Linking with -latomic has been added to pipewire-jack since
b8c58c74d8
However, this is not the right place to add this dependency, atomic_dep
should be added to pipewire_dep to avoid the following build failure:
/home/giuliobenetti/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/sparc-buildroot-linux-uclibc/9.3.0/../../../../sparc-buildroot-linux-uclibc/bin/ld: src/pipewire/libpipewire-0.3.so.0.326.0.p/filter.c.o: in function `impl_node_process':
filter.c:(.text+0xf28): undefined reference to `__atomic_fetch_add_4'
Indeed, atomic operation such as __atomic_fetch_add is used in libcamera
as well as in ./spa/plugins/libcamera/libcamera_wrapper.cpp,
./spa/include/spa/utils/ringbuffer.h and ./spa/include/spa/graph/graph.h
Fixes:
- http://autobuild.buildroot.org/results/b5305e8e7dd1a5e8bfaba72b06251056ba7d1af1
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Fix a reference counting issue that resulted in
ladspa_handle's refcount being equal to the
sum of the refcounts of its descriptors.
This would result in a memory leak when a descriptor
is loaded more than once from the same handle.
This cannot happen because `ladspa_handle_list` is
not populated by `ladspa_handle_load()`.
The next commit implements exactly that, so
the fix is applied before the change that
would introduce the problem.
Other filter-chain configuration file examples do not prefix
the plugin key with 'ladspa/'. And in the absence of
the LADSPA_PATH environmental variable, this would lead
to "/usr/lib64/ladspa/ladspa/librnnoise_ladspa.so" being used
as the path, which is not correct.
You can only run either pulseaudio *or* the pipewire-pulse daemon at one
time. So make the pipewire-pulse units conflict with their pulseaudio
counterparts to avoid both running at the same time
C code doesn't lend itself well to using classes and pages are best for prose.
A doxygen group is a set of related functions - which is exactly what we have
here, e.g. pw_context.
This patch basically adds the following lines to each header:
\defgroup pw_whatever
\addtogroup pw_whatever
\{
.... function declarations ....
\}
Doxygen is smart enough to merge documentation in the header with
documentation in the correspondin .c file where the function is implemented.
Where both declaration and definition are documented, drop one and rely on the
other. Drop the obvious documentations where not needed, doxygen wants either
none or all parameters documented.