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.
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.
We can only increment or decrement the busy_count with a valid busy_id.
In complete_ready and complete_paused, the id can be INVALID and if
there was no pending busy_id, it would decrement the busy_count below 0.
This would block the link from progressing its state change.
See #3547
Also add the queued buffers in the converter to the pw_time.queued_buffers
field. This means that queued_buffers + avail_buffers always equal the
total amount of allocated buffers, which makes more sense.
Fixes#3592
Destroy the node and device in the global free event. This way, the
global resources are already destroyed and we have removed their ref to
the spa node before we destroy that.
Fixes#3588
Instead of just following static target match rules to create output streams,
this feature allows the user to dynamically create more output streams
with custom targets using metadata.
Add access.socket option, which sets PW_KEY_ACCESS based only on which
socket the client connected from.
Remove the executable-based permissions and all old options. Add
access.legacy=true option that enables the old default behavior. The
legacy mode cannot be used together with the socket-based access.
Emit warnings if any of the removed old options have been set.
Set pipewire.sec.flatpak=true for Flatpak applications.
The socket-based access ignores PW_KEY_CLIENT_ACCESS and the Flatpak
status when setting PW_KEY_ACCESS. Dealing with them becomes
responsibility of the session manager (or equivalent) which processes
the permission rules.
Make the default access.socket value compatible with the
module-protocol-native default two-socket configuration.
However, if neither access.socket or access.legacy is specified, we will
for now use the legacy mode for backward compatibility.
If no socket configuration specified for a server, create two sockets,
"CORENAME" and "CORENAME-manager" where CORENAME is the value computed
by get_server_name.
We can change the quantum of a node while it is running just fine so
relax the check.
This was copied from the rate change logic, which is avoided while the
node is running.
This fixes a regression in dynamic quantum switching.
Fixes#3574
This reverts commit 6fefd49a8a.
We can't use PRIVATE because mmap docs say that we then might not see
changes in the data anymore from other processes.
Fixes#3575
Add client key PW_KEY_SEC_SOCKET that indicates which socket the client used
to connect to the server.
This can be used by other modules as an access control mechanism.
We only need to resume the SUSPENDED node when it has !pause-on-idle.
So, set the need_resume flag when we suspend in that case.
Clear the flag in the next round and make sure we set the node to
running again. We don't need to clear any flags when the state change
completes anymore with this change.
This also fixes a case where strawberry would fail to configure the
correct sample rate. 44.1KHz would be used (the rate of the probe
stream) because the scheduler was thinking the node was still being
reconfigured because the reconfigure flag was only cleared when going
to the running state (an alsa sink has !pause_on_idle).
See #2929