Keep the original type of the object around in the free list so that we
can still look it up.
Make most methods only find the still active object by checking if the
client matches.
Make some methods (jack_port_by_id() for example) also find the removed
objects for as long as they are in the cache and not overwritten.
This make carla and catia work better because they expect to access the
old object after it has been destroyed.
See #1531
xmltoman looks dead and uses XML as well as pulls in a long list of
Perl dependencies. This replaces it with rst2man that has almost no
dependencies beyond Python, which is already required for the Meson
build system.
Naturally rst2man uses reStructuredText and the pages were rewritten
via regex and manual editing to be as close to original XML format
as possible. A few fixes and updates were done too. Most notably a
note was added to indicate that production deployments should not be
starting the session manager via pipewire.conf file.
There's three slight formatting issues/differences:
1. rst2man produces simpler footer.
2. "-f | --foo=value" confuses the parser and it fails to correctly
add argument specific syntax highlighting to assignment value.
3. XML version had inconsistent use of <arg> and <opt> which has
been partially addressed. But different manual pages still have
their differences to what and how is highlighted.
The current _info_update() methods will always reset the change_mask in
the new info structure.
This causes problems if multiple updates are applied to the info before
the rescan in the session manager of pulse-server is excuted. The first
update is cleared and this causes the session manager to sometimes miss
the state changes of nodes and fail to suspend them.
Add a new method to merge with optional reset of the various
introspection info structures. We can use this instead and simply
accumulate all changes until the rescan code has processed all changes.
A list of reasons why DMA-BUFs have to be treated specially. This
should make it clearer why mmaping DMA-BUFs should be avoided and hint
clients on how treat them correctly
Co-authored-by: columbarius <co1umbarius@protonmail.com>
Describing different behaviour for modifier-less and modifier-aware case
and how a EnumFormat with modifier should be fixated. Also adding a Note
about `SPA_PARAM_BUFFERS_blocks`, which is important for multiplane
DMA-BUFS.
When we destroy a node that still has another driver, recalculate the
graph so that the driver has a chance to idle.
This can happen when we add an inactive node to the driver and then
destroy the node, like for jack clients.
The calculation of the elapsed time is actually not a good idea because
it becomes larger and larger and a tiny change in the rate could result
in a large difference that would make things fail quickly.
Until that is fixed, this patch will need to do..
Make sure we always suspend before reconfiguring a device.
Put the node and the device in passthrough mode when requested. Move
back to DSP mode after the node is unlinked.
Parse the exclusive flag of a stream once when the node info changes.
Use a new variable 'passthrough' to remember the current state of
a node and the peer.
Parse non-raw formats as well.
Check if two nodes can passthrough by intersecting the EnumFormat
params. If it is possible, configure the node for passthrough.
Don't try to reconnect nodes in passthrough.
Fail if we can't find a node compatible with passthrough.
See #629
Get the ucm prefix only once, when we open the UCM card and then
use it for all devices using the card.
Construct the device name right before we open it with the ucm prefix
and possibly the AES flags instead of messing with the property.
Just like the latency, move the codecs to the device Route param.
This way, it is easier for the session manager to save and restore
the codecs as part of the Route settings.
If a program using pipewire-alsa calls snd_pcm_close() immediately after
snd_pcm_prepare() without reading or writing any data the client node
may be removed before the session manager can link it, which would
result in the following log warnings:
can't link 35:40 -> 43:48: link-factory: unknown input port 48
error id:25 seq:11467 res:-22 (Invalid argument): link-factory: unknown input port 48
can't link 35:41 -> 43:46: link-factory: unknown input port 46
error id:16 seq:11468 res:-22 (Invalid argument): link-factory: unknown input port 46
Use the param user field to tag changes in the params.
codec changes emits an EnumFormat and Props change.
Accumulate various param changes and emit them together.
We start with setting the visitied flag on the driver. Still follow the
links to other visited nodes because it might make them active. for
example, adding a link between two midi ports should make the midi
driver running so that data flows between the ports.
See #1559
Actually set the right properties on the source and sink.
Not quite right because the pulseaudio ROC has a sink-input or a
playback stream in pipewire.
See #1538
ALSA has problems with creating more than 8 configs per card so cache
the config per card and reuse it.
Fixes problems with no devices after logging out and in again because
ALSA can't create UCM profiles anymore.
See #1553
Make the streams passive so that things can suspend.
Use a differend node.name for the input and output streams so that
autoconnect can actually remember the right target.
Make the media.name and description nicer.
See #1557
Audio with big frame sizes (especially audio with multiple channels) needs more
buffer size than the one calculated with the current formula. This patch uses
the frame size to calculate the buffer size, fixing playback issues for clients
configured in passthrough mode.
When the client adapter is configured in passthrough mode, the stream param
changed event in pipewire-pulse is emitted before the session manager creates
the link, and not after. Therfore, the peer can never be found when replying
create stream, and the pulseaudio application receives a stream error.
This patch delays the create stream reply until the link is added if the peer
cannot be found, fixing the above race conditon to allow passthrough mode to
work with pulseaudio applications.
If you use multiple BT adapters, it's annoying that PW tries to
autoconnect to the device via all available adapters, and you end up
with multiple connections to the same device (which does not necessarily
work).
Avoid this by autoconnecting with only the first adapter that sees the
device.
When we inactivate the stream, clear the draining/drained state.
Otherwise, the stream stays in the drained state and won't call the
process function anymore when we activate it again.
This used to work before because we called the process function from the
Start command, which would queue a buffer and unset the drained flag.
Calling the process function from Start was however not right when the
process function needed to be called from the RT thread or when the
stream is a driver.
Fixes the issue where speaker-test would only play one channel.