Retrieve the connecting client's supplementary group list via
SO_PEERGROUPS and store it as the "pipewire.sec.gids" property.
This allows access-control policies in wireplumber to match on
all groups and not just the primary.
A passive port is not automatically activated anymore by an active peer
node, it now needs the "follow" mode to follow the state of the peer without
activating it.
Keep the flag dont_inhibit_auto_suspend around and use it do decide when
to send suspend messages to the client.
We don't always want to send suspend messages when the stream state changes
because that could happen because the stream was, for example, relinked.
The intention of the suspend message is mostly for monitor streams that
use the dont-inhibit flag and want to follow the suspend state of the
sink.
See #5273
Instead of just setting the port state directly, go through the
port_update_state() function. This will make suspend_node() also
emit the port state change event to the links. This then causes
the link to reset to INIT, which cancels pending complete_ready work
items and prevents them from changing the port to READY without a
valid format.
One possible situation where this could happen is when a suspend
happens while the port was waiting for a set_param(Format) reply from
the client-node.
See #3547
This is meant to workaround a particular SoF firmware crash that requires the
device to be closed and re-opened to recover. This works in combination
with a WirePlumber monitor function that will destroy the node after
it enters this error state and will re-create it.
Add coverage for channel pressure, system common messages (F1, F2, F3),
system realtime, MIDI 1.0 program change and channel pressure decoding,
sysex continue status, and roundtrip tests for program change, channel
pressure, song position, and system realtime.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fix spa_ump_to_midi() MIDI 2.0 pitch bend (0xE0) to extract both LSB
and MSB from the 32-bit value in word 2, giving full 14-bit resolution.
Previously the LSB came from a reserved field and was always zero.
Mask the program number with 0x7f for consistency with bank byte
masking.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fix spa_ump_to_midi() MIDI 2.0 channel pressure (0xD0) to emit the
status byte before the data byte. The fallthrough from default caused
the status to be missing, producing 1 byte instead of 2.
Mask bank MSB and LSB with 0x7f in MIDI 2.0 program change conversion
to ensure valid MIDI 1.0 data bytes.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fix spa_ump_from_midi() to correctly encode short sysex messages as
Complete (0x0) instead of Start (0x1) when the entire message fits in
one UMP packet. Handle bare F7 termination when no data bytes follow.
Support 0xF7 as a sysex continuation marker and optional trailing 0xF0
as a continuation boundary.
Add unit tests for UMP/MIDI conversion covering note on, program change,
sysex complete/multi-packet/continue, system realtime, F7 continuation,
bare F7 end/complete/orphan, and trailing F0 scenarios.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This is not strictly required because our control events have a size and
don't need the 0xf0 trailing byte to find the boundary.
It also makes it easier to just use the midifile events directly without
having to add the 0xf0.
Pass the max size of the buffer to the fill function.
Use this for writing midi events in the buffer. We can use the total
buffer size for midi events.
The n_frames is to limit the amount of midi events *in time*, not in
bytes.
When writing sysex, bypass the encoder and simply place the sysex
message in the seq queue. Make sure strip off the 0xf7 and 0xf0
continuation bytes.
When reading sysex, bypass the decoder and append/prepend the
continuation bytes.
This way, we can make the decoder buffer size back to something small
(large enough for one simple midi event) and we can handle arbitrary
sysex message lengths.
Setting the volume control ports with a volume param also initializes
the controls. This ensures the controls are not restored to their
default value when the graph is activated.
Fixes#5192
Keep the last relation between the sequence number and the timestamp
(ringbuffer position).
When a retransmission is requested for a given sequence number use the
relation to calculate the corresponding timestamp and retransmit the
packet from the ringbuffer again.
See #5276
The close in the error path will never be called because the fd has been
stolen and will be -1.
Also make sure that when we free the source that we set it to NULL or
else the destroy function will try to free it again.
When the close argument is true, loop_add_io is supposed to close the fd
even when an error occurs.
This makes it possible to have spa_steal_fd() work even in the case
of errors.
Make a new library.filter-path for the filter-graph that will filter and
restrict the dlopen filenames (used for the LADSPA plugin only).
By default this is false and so filter-chain can load from absolute
paths without extra checks.
Enable the extra checks for the pulse LADSPA modules and the
audioconvert filter graphs because these allow loading LADSPA plugins
into other processes.
Fixes#5222
When we are asked to add noise bits, don't call the clear function.
Make the passthrough and clear-on-empty flags available with a new flag
field to make it more extensible.
Fixes#5260
There could have been a write error or allocation error while building
the json file that we can detect in spa_json_builder_close().
Error out instead of silently using a truncated JSON.
Use spa_autofree for the memory to make cleanup easier.