Not all devices report their A2DP delay. In those cases, use a fallback
value of 150ms by default.
Make the delay adjustable with a SPA_Prop, and expose it as a part of
the route. Implement the corresponding parts in media-session.
Make a system:capture_N or system:playback_M name for each port
and use this also in find_node when the node is a default node.
This makes it possible to
jack_connect system:capture_1 system:playback_1
and make it link the default source to defaukt sink.
Fixes#446
Keep track of the subelement we're iterating in the result index upper
bits. Use enum_sync to iterate each param and switch to the next
element when we run out of params.
See !468
In BT_DEFER_SETUP mode, when a connection is accepted, the listening
socket is unblocked but the effective connection setup happens only on
first receive, allowing to configure the accepted socket.
First read from the accepted socket is non-blocking and returns a zero
length buffer.
When something else changes the volume of our stream, store the new
value in our volume/mute state so that we always have an up-to-date
value when we compare our volume to the desired volume.
See #721
The Pro Audio profile exposes all devices and subdevices with maximum
channel count and no channel layout. It also have no hardware volume
and is more suited for Pro Audio usage.
See #731#704#57
This is important for cross-platform build frameworks such as Yocto
where the build configurations must be deterministic. In this case, if
some other build dependency pulled in SDL2, then the meson.build logic
would suddenly enable extra features that would not have been built
otherwise. By allowing for explicitely enabling/disabling SDL2 and sndfile
depending bits, this problem is fixed.
When duplicate objects are created, the new object has missed its
registry_global event, and is missing its proxy.
In this case, bind a proxy for the new object.
sm_object may be owned by either (i) monitors, created via
sm_media_session_create/export*, or (ii) registry, via
registry_global+bind_object. However, registry adds the objects to its
globals list when their proxy appears, even if it does not own them.
Only owner should call sm_object_destroy which unrefs obj->handle,
because the sm_object structure is stored inside the handle's user_data
and becomes invalid afterward.
The sm_object_destroy call removes the object from the registry globals
map, so if monitor calls first, there is no problem. However, sometimes
the registry wins the race.
Previously, registry did sm_object_destroy regardless of whether it owns
the object or not, possibly causing the monitor's sm_object_destroy to
refer to freed memory. This could cause segfaults, e.g.
CARD=XX:XX:XX:XX:XX:XX
bluetootctl connect $CARD
while true; do pactl set-card-profile bluez_card.$CARD a2dp-sink; pactl set-card-profile bluez_card.$CARD off; done
leads to a race between bluez5_remove_node and registry_global_remove,
and problems appear when the latter wins. (As usual, if it doesn't
segfault, a heisenbug appears instead.)
Fix this by keeping track who owns the objects, and having registry
destroy the objects only if it owns them. Otherwise, it just removes
them from its lists.
Also call pw_proxy_unref unconditionally in sm_object_destroy, so its
asserts catch refcounting errors (although now there shouldn't be any).
***
Another problem is conflict between bound_proxy and register_global,
which generates duplicate objects with the same id. We resolve this by
keeping the object not owned by the registry and discarding the other
one.
This fixes a memory leak, and possible consistency problems in session
modules (due to session_create events for different objects with same
id; now there will be paired session_remove ones in between).
This allows running the script from outside the PipeWire source
tree, which is convenient for developing other applications for
use with PipeWire.
Fixes#720