pipewire/spa/plugins/bluez5
Pauli Virtanen a6dcdfae0c bluez5: iso-io: track and apply corrections to tx latency
Use TX timestamps to get accurate reading of queue length and latency on
kernel + controller side.

This is new kernel BT feature, so requires kernel with the necessary
patches, available currently only in bluetooth-next/master branch.
Enabling Poll Errqueue kernel experimental Bluetooth feature is also
required for this.

Use the latency information to mitigate controller issues where ISO
streams are desynchronized due to tx problems or spontaneously when some
packets that should have been sent are left sitting in the queue, and
transmission is off by a multiple of the ISO interval.  This state is
visible in the latency information, so if we see streams in a group have
persistently different latencies, drop packets to resynchronize them.

Also make corrections if the kernel/controller queues get too long, so
that we don't have too big latency there.

Since BlueZ watches the same socket for errors, and TX timestamps arrive
via the socket error queue, we need to set BT_POLL_ERRQUEUE in addition
to SO_TIMESTAMPING so that BlueZ doesn't think TX timestamps are errors.

Link: https://github.com/bluez/bluez/issues/515
Link: https://lore.kernel.org/linux-bluetooth/cover.1710440392.git.pav@iki.fi/
Link: https://lore.kernel.org/linux-bluetooth/f57e065bb571d633f811610d273711c7047af335.1712499936.git.pav@iki.fi/
2024-04-12 18:50:15 +03:00
..
a2dp-codec-aac.c bluez5: deprioritize AAC-ELD since it's untested 2024-02-01 08:06:06 +00:00
a2dp-codec-aptx.c bluez5: aptx-ll: produce 7.5ms packets 2024-02-05 19:34:47 +02:00
a2dp-codec-caps.h bluez5: support Google's Opus A2DP vendor codec 2024-02-04 12:58:40 +02:00
a2dp-codec-faststream.c pod-builder: move some code around to help gcc 13 2023-04-20 17:52:27 +02:00
a2dp-codec-lc3plus.c treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
a2dp-codec-ldac.c pod-builder: move some code around to help gcc 13 2023-04-20 17:52:27 +02:00
a2dp-codec-opus-g.c bluez5: support Google's Opus A2DP vendor codec 2024-02-04 12:58:40 +02:00
a2dp-codec-opus.c bluez5: disambiguate the two Opus codecs 2024-02-04 12:57:31 +02:00
a2dp-codec-sbc.c bluez5: SBC-XQ does not need its own endpoint 2024-02-04 12:57:31 +02:00
backend-hsphfpd.c spa: move dbus helpers out of bluez plugin 2024-02-05 13:03:20 +00:00
backend-native.c spa: move dbus helpers out of bluez plugin 2024-02-05 13:03:20 +00:00
backend-ofono.c spa: move dbus helpers out of bluez plugin 2024-02-05 13:03:20 +00:00
bap-codec-caps.h bluez5: bap: support ChannelAllocation parameter from BlueZ 2024-01-08 10:09:13 +00:00
bap-codec-lc3.c bluez5: bap: use priority from conf table in PAC selection 2024-04-12 18:31:26 +03:00
bluez-hardware.conf bluez5: add quirk for SoundCore mini2 2024-01-14 13:21:34 +02:00
bluez5-dbus.c bluez5: bap: determine SDU interval from codec frame duration 2024-04-01 19:13:01 +03:00
bluez5-device.c spa: bluez: fix whitespaces 2024-02-05 20:01:21 +01:00
bt-latency.h bluez5: iso-io: track and apply corrections to tx latency 2024-04-12 18:50:15 +03:00
codec-loader.c bluez5: support Google's Opus A2DP vendor codec 2024-02-04 12:58:40 +02:00
codec-loader.h treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
dbus-monitor.c bluez5: fix glib signal disconnect 2023-04-14 20:06:57 +03:00
dbus-monitor.h chore: fix warnings shown by Clang 16 2023-05-09 08:31:56 +00:00
decode-buffer.h bluez5: iso-io: track and apply corrections to tx latency 2024-04-12 18:50:15 +03:00
defs.h bluez5: bap: determine SDU interval from codec frame duration 2024-04-01 19:13:01 +03:00
hci.c spa: bluez: use some more spa_auto* 2023-07-30 13:45:49 +02:00
iso-io.c bluez5: iso-io: track and apply corrections to tx latency 2024-04-12 18:50:15 +03:00
iso-io.h bluez5: iso-io: track and apply corrections to tx latency 2024-04-12 18:50:15 +03:00
media-codecs.c bluez5: aptx-ll: produce 7.5ms packets 2024-02-05 19:34:47 +02:00
media-codecs.h bluez5: bap: determine SDU interval from codec frame duration 2024-04-01 19:13:01 +03:00
media-sink.c bluez5: iso-io: track and apply corrections to tx latency 2024-04-12 18:50:15 +03:00
media-source.c bluez5: iso-io: track and apply corrections to tx latency 2024-04-12 18:50:15 +03:00
meson.build bluez5: support Google's Opus A2DP vendor codec 2024-02-04 12:58:40 +02:00
midi-enum.c spa: export log topic enumerations 2024-01-04 10:02:55 +00:00
midi-node.c spa: export log topic enumerations 2024-01-04 10:02:55 +00:00
midi-parser.c treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
midi-server.c spa: use only static log topics 2024-01-04 10:02:55 +00:00
midi.h spa: bluez: include gio/gunixfdlist.h 2023-02-16 20:55:55 +01:00
modemmanager.c spa: move dbus helpers out of bluez plugin 2024-02-05 13:03:20 +00:00
modemmanager.h spa: bluez: modemmanager: do not use old style declaration 2023-07-03 19:40:31 +02:00
org.bluez.xml bluez5: add GDBus-based object monitor framework 2023-01-24 08:27:56 +00:00
player.c spa: move dbus helpers out of bluez plugin 2024-02-05 13:03:20 +00:00
player.h treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
plugin.c spa: export log topic enumerations 2024-01-04 10:02:55 +00:00
quirks.c spa: Improve JSON error reporting 2024-03-27 15:42:29 +01:00
rate-control.h bluez5: iso-io: track and apply corrections to tx latency 2024-04-12 18:50:15 +03:00
README-MIDI.md bluez5: fixup BLE MIDI selinux README 2023-01-24 08:27:56 +00:00
README-OPUS-A2DP.md bluez5: clarify OPUS-A2DP spec 2022-09-03 19:08:27 +00:00
README-SBC-XQ.md bluez5: add SBC XQ readme 2021-01-07 09:54:16 +01:00
rtp.h Add bluez5 plugins 2018-01-16 15:19:55 +01:00
sco-io.c bluez5: use nonblocking i/o for SCO 2023-03-18 16:08:36 +02:00
sco-sink.c bluez5: sco-sink: more accurate latency values 2024-01-28 18:00:04 +02:00
sco-source.c bluez5: support api.bluez5.internal flag also for sco 2024-01-26 11:58:30 +00:00
test-midi.c bluez5: a few more -Werror=strict-prototypes fixes 2023-01-24 11:14:27 +02:00
upower.c spa: move dbus helpers out of bluez plugin 2024-02-05 13:03:20 +00:00
upower.h treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00