Unicast BAP codec switch requires CIG reconfiguration, which cannot be
done if there is an acquired transport.
When doing BAP codec switch, disable nodes of other devices sharing the
same CIG.
To avoid problems with node start/stop, just remove and re-add them.
I'm not aware of any devices that support 48 kHz output in duplex
configuration, so disable that for now.
Doing this properly requires catching errors when on transport Acquire,
and switching to another configuration if the error was due to bad
configuration.
Due to how BAP specification works, it's not necessarily possible to
know whether a configuration was really accepted at earlier stage, and
anyway there's no proper error -> reconfiguration handling currently on
BlueZ side either.
If device supports duplex, show also separate sink-only/source-only
profiles.
Devices don't necessarily support high-quality audio in duplex profile,
so add sink/source only profiles.
This is also a workaround for the current situation that devices may
signal duplex support, but the attempted duplex configuration fails to
work.
Use SelectProperties() DBus API to reconfigure BAP unicast setup.
Add support to spa_bt_ensure_codec() to select whether to configure as
sink/source/duplex.
Simplify codec switching code: determine what switch to perform
immediately in spa_bt_device_ensure_media_codec().
The previous code doing "fallback" switching to various codecs is not
useful, as A2DP generally disconnects on the first failure and all
remote endpoints disappear.
Add iteration over multiple endpoints, for reconfiguring both source and
sink directions at the same time. This is in preparation of supporting
BAP reconfiguration (for A2DP there's usually only one direction
connected at a time).
alsa_write_sync can insert or remove some data from alsa when
resynchronization is needed.
Avail and delay are equal when high precision timestamps are not allowed.
When the high precision timestamps are enabled, the delay is avail
adjusted to current_time.
Signed-off-by: Martin Geier <martin.geier@streamunlimited.com>
Use codecs via media_codec in sco-sink instead of implementing the
encoding in-place.
In future, media-sink could replace sco-source to reduce code
duplication.
Use codecs via media_codec in sco-source instead of implementing the
decoding in-place.
Also slightly adjust media-source decode semantics.
In future, media-source could replace sco-source to reduce code
duplication.
Properties of type Id should have a type of the enum with the possible
values associated with them.
The other types that don't have a fixed enumeration but are usually
mapped to some constant/description with PropInfo should be Int.
Fixes!2399
This allows to connect the SCO link with old HFP AG devices which
doesn't support the codec negotiation.
The audio connection could be done even without an ongoing call.
Now that the stream remembers the latency for us, we can only care
about the other latency.
So, if we get (output) latency on an input port/stream, we add our
own latency and then set it on the output port/stream. We do the
same for input ports.
LOCK the Latency param we get from the peer so that we don't remove it
when we update our own port latency. Also don't remove our port latency
when we get an update from the peer.
This essentially keeps the update/clear of the upstream and downstrem
latencies separate and makes it easier to implement the latency
logic in the pw-stream.
When a filter receives a Latency event on a port, it can simply update
the other port latency and none of the peer latencies are removed.
Even if the latency didn't change, the current pw-stream
implementation will have wiped all Latency params away and we want
to put them back in all cases.
See #4731
libcamera says that cameras should default to manual focus mode. This
means that unless pipewire clients specifically change this control,
users with an autofocus-capable camera are left with an out-of-focus
image. This patch sets the autofocus mode to continuous and enables
auto-exposure (as the default for this is unspecified).
Testing with an imx708 on Raspberry Pi OS on a Raspberry Pi 4, before
this patch the image was generally out of focus in Firefox/webrtc, after
this patch autofocus works correctly.
When a linked node needs to be resynced we actually never clear the
flag or reset the dll. Move the code around so that it still does
the reset of the flag and dll without actually doing the resync in
the ringbuffer when it is a linked node.
When we do_prepare, always reset the dll. We already set the alsa_sync
field but that is only used by followers to resync in some cases.
When reseting the dll, we also reset the next_time and base_time values,
we however need to do this before calculating the error in update_time
when we are the driver in IRQ mode or else we get some crazy error
that distorts the rate estimation.
Because we do the processing of the graph in the playback process
function, only do graph reset and reconfigure from the playback state
change so that we don't have process and state change at the same time
and crash.