When we get a midi buffer directly from one of our peer ports, we need
to convert it to a jack midi buffer.
Note that this previously returned NULL because of the size check of the
midi buffer, which was likely much smaller than the frames argument.
This fixes midi event recording preview in ardour.
This adds an api.alsa.bind-ctls property to alsa-pcm sink and source
nodes, to bind a property to an ALSA PCM ctl. The property is an array
of ctl names that should be bound.
This can be handy, for example, to bind the Playback/Capture Rate
controls on a USB gadget, in order to track the PCM's state via a node
param.
This is currently wired to be read-only, but it should be easy enough to
make it writable.
Emit error if message construction is not holding appropriate locks or
runs from wrong thread, so that the flush may be running concurrently.
This generally causes corrputed messages to be sent silently, and can be
fairly hard to debug otherwise in client applications.
Use `SPA_CONTAINER_OF()` instead of direct casting as it is
more resilient against future changes that might reorder the
members in `struct spa_debug_log_ctx`.
Because we now always _drop/_prepare_/_start, the snd_pcm_recover()
before that is no longer useful.
Retry snd_pcm_resume() after suspend when -EAGAIN and fall back to
_drop/_prepare/_start when that fails.
Remove group permission on the system manager socket so that restricted
clients cannot use it to get unrestricted access. It is assumed that the
session manager system service (wireplumber) is running as pipewire user
and will get access to the manager socket, while other clients are
members of the pipewire group and will only get access to the normal
socket.
We need to disable the resampler when there is a pitch element. This was
correctly done in setup_matching but not in check_position_config().
See #3628
Modern heterogenous multiprocessor systems rely increasingly on
scheduler hinting for efficiency gains and system optimisation.
This is especially true on embedded systems, where background
tasks such as audio daemons should be consigned to the most
power-efficient core in the system. Left to its own devices, the
Linux Completely Fair Scheduler tends to migrate Pipewire to
more performant cores, even when this is unnecessary.
Luckily, CFS can be told by a task to clamp its utilisation values.
Coupled with energy-aware scheduling, this allows the scheduler to
make better informed decisions about where tasks should be placed,
and what pstate to set for the CPU it is running on.
Enable the user to configure UCLAMP_MIN and UCLAMP_MAX values via
arguments to libpipewire-module-rt.
Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
GCC 14 introduces a new -Walloc-size included in -Wextra which gives:
```
./pipewire-0.3.84/spa/plugins/bluez5/codec-loader.c:176:14: warning: allocation of insufficient size ‘1’ for type ‘struct impl’ with size ‘1032’ [-Walloc-size]
```
The calloc prototype is:
```
void *calloc(size_t nmemb, size_t size);
```
So, just swap the number of members and size arguments to match the prototype, as
we're initialising 1 struct of size `sizeof(struct impl)`. GCC then sees we're not
doing anything wrong.
Signed-off-by: Sam James <sam@gentoo.org>
Hide useless paginated indices.
Rename "Related Pages" -> "Pages".
Fix manpage brief description.
Fix file path name stripping.
Move macro listings after enums, so that they're next to functions.
Remove pwtest from docs, it's not API.
Fixup header styles.
Don't show page sections in left sidebar, it's confusing.
Rename Modules -> API Reference in sidebar.
Indicate visually the sidebar entries are collapsible.
Fix spa_pod_json grouping.
Move tools page to top level.
Fix page ordering.
If the link isn't destroyed, don't allow changing state to
PAUSED for states < PAUSED. For example, if the deactivation
is called during the link being in NEGOTIATING it could then
jump directly to PAUSED and believe it is prepared.
Fixes#3619
This changes the value declared (3 currently versus 0 following this
patch). I have not seen code checking this version number.
Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
PW_VERSION_NODE is 3 while PW_VERSION_NODE_EVENTS is 0, I am unsure if
it could have caused issues. Same thing with PW_VERSION_PORT &
PW_VERSION_PORT_EVENTS.
I have not seen code checking this version number.
Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
do a sync when starting up client and sync when creating a new proxy so
that we get all the proxy updates before the client is opened.
This ensures all ports are enumerated correctly.
Fixes#3618
Support an array for the node.group and node.link-group properties.
This makes it possible to make a node member of multiple groups and
link-groups.
See #3612
When the device has not configured a format, remove the properties that
depend on the format so that they don't limit what we can configure the
device with next.
See #3613
Usually, the max-latency is calculated by the device when it is
configured based on the maximum buffer size and limits the latency
change that can be done.
When we are forcing a rate/quantum and we are going to reconfigure the
device, this limit should not apply because the current buffer settings
and latency are going to change because of the reconfigure.
See #3613
For encoded formats, buffer size is the size of the actual data in the
buffer and may change for each frame depending on the content. Thus,
configuring the buffer pool of the pipewiresrc with the size of the
first buffer may be insufficient for later buffers.
Configure the buffer pool to the maximum size of the first upstream
buffer and assume that the following buffers will be allocated with the
same size as the first buffer.
For encoded formats, p->video_info.size will be 0. If the pipewiresrc
handles an encoded format, the bufferpool will be configured to allocate
buffers of size 0. This will cause errors later when trying to copy the
frames into the pipewire buffers.
Update the bufferpool size only if video_info defines an actual buffer
size.
If the pipewiresink needs to copy the GStreamer buffers to the PipeWire
buffers, because the upstream element didn't use the pipewirepool, the
metadata must be copied, too. Otherwise the pipewire datas will be
filled with the metadata from the buffer during the initialization and
not the currently used buffer.
For example, without copying the metadata the buffer timestamp will be
missing on the pipewire buffers.
In JSON, the colon actually is used for assignment, but in spa_type_info
the colon is used as a separator. To properly parse and pass the
properties to the videotestsrc, the key has to be enclosed by quotation
marks to prevent splitting by the JSON parser.
Commit 9b29bcd4e8 ("conf: set description for test nodes") set the
description only for the minimal.conf and pipewire.conf and skipped the
pipewire-vulkan.conf.
Set the description for pipewire-vulkan.conf, too.
In pw_context_recalc_graph, PipeWire takes the currently configured
clock target duration from the position as target rate. The position is
not set for the videotestsrc since the set_io function is not
implemented. This leads to a segfault when the videotestsrc is
configured and loaded.
Add the same dummy implementation of set_io as in the v4l2-source and
the libcamera-source to prevent the segfault.
Allow PIPEWIRE_REMOTE / PW_KEY_REMOTE_NAME to contain a JSON array of
sockets to try to connect to, in order, instead of just one name.
JSON is restricted to utf-8 encoding. Also, this forces using JSON
syntax for paths that start with '['. This probably will not usually
cause much problem.
In bluez5-dbus.c:impl_init, the info is passed to spa_bt_quirks_create,
which expects info to be non-null. But in this example, info is null, so
it will cause quirk table parse failure. Add an empty dict here to prevent
this error.