pipewire/spa/plugins/bluez5
Pauli Virtanen de34ce606f bluez5: media-source: fix off-by-one cycle in rate matching
The rate matching filter assumes buffer level for cycle j+1 is

    buffer(j+1) = buffer(j) + recv(j) - corr(j+1) * duration

but what we are actually doing is instead

    buffer(j+1) = buffer(j) + recv(j) - corr(j-1) * duration

because the correction factor that is computed is not used for the next
cycle, but the one following that. Although the filter is still stable
in theory the extra lag causes oscillations to be damped less.

Fix by using the computed correction factor for the next cycle, as
there's no reason why we'd like to have more lag in rate matching.

This then changes c(j-1) -> c(j) in the assumptions, which turns out to
fix the situation. Fix the filter derivation to match.  The filter
coefficients stay as they were, and they are actually exactly correct
also for short averaging times.

In practice, it is observed that ISO RX with quantum 4096 converges to
stable rate, whereas previously the matching retained small
oscillations.
2026-01-05 15:34:06 +00:00
..
g722 bluez5: asha-codec-g722: Drop the dependency on FFmpeg 2025-02-13 19:55:18 +05:30
a2dp-codec-aac.c bluez5: add codec_data for codec-private configuration data 2025-11-21 08:33:14 +00:00
a2dp-codec-aptx.c bluez5: add codec_data for codec-private configuration data 2025-11-21 08:33:14 +00:00
a2dp-codec-caps.h bluez5: aac: fix for A2DP v1.4 using rfa bits for more channels 2025-07-10 14:12:15 +00:00
a2dp-codec-faststream.c bluez5: add codec_data for codec-private configuration data 2025-11-21 08:33:14 +00:00
a2dp-codec-lc3plus.c bluez5: add codec_data for codec-private configuration data 2025-11-21 08:33:14 +00:00
a2dp-codec-ldac.c bluez5: add codec_data for codec-private configuration data 2025-11-21 08:33:14 +00:00
a2dp-codec-opus-g.c bluez5: add codec_data for codec-private configuration data 2025-11-21 08:33:14 +00:00
a2dp-codec-opus.c bluez5: add codec_data for codec-private configuration data 2025-11-21 08:33:14 +00:00
a2dp-codec-sbc.c bluez5: add codec_data for codec-private configuration data 2025-11-21 08:33:14 +00:00
asha-codec-g722.c bluez5: replace codec->bap/asha flags with codec->kind enum 2025-06-13 17:51:16 +00:00
backend-hsphfpd.c bluez5: indicate codec support status for ofono/hsphfpd 2025-06-13 17:51:16 +00:00
backend-native.c spa: bluez: backend-native: Prevent HSP/HFP connection in both directions 2025-12-19 07:12:46 +00:00
backend-ofono.c bluez5: indicate codec support status for ofono/hsphfpd 2025-06-13 17:51:16 +00:00
bap-codec-caps.h bluez5: parse and enable configuration of TMAP / GMAP features 2025-12-06 11:23:48 +00:00
bap-codec-lc3.c bluez5: set some BAP Context metadata value on streams 2025-11-21 08:33:14 +00:00
bluez-hardware.conf bluez5: add quirk for Phonak hearing aids 2024-10-13 11:50:04 +03:00
bluez5-dbus.c bluez5: iso-io: delay streaming start until all acquires are complete 2026-01-05 15:34:06 +00:00
bluez5-device.c spa: bluez: device: Add SPA_PROP_params to disable dummy call state 2025-12-09 16:08:31 +01:00
bt-latency.h bluez5: fix compilation and warnings 2025-07-12 19:57:22 +00:00
codec-loader.c bluez5: support LC3-24kHz HFP codec available on some Apple devices 2025-06-13 22:15:29 +00: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: media-source: fix off-by-one cycle in rate matching 2026-01-05 15:34:06 +00:00
defs.h spa: bluez: device: Add SPA_PROP_params to disable dummy call state 2025-12-09 16:08:31 +01:00
hci.c spa: bluez: use some more spa_auto* 2023-07-30 13:45:49 +02:00
hfp-codec-caps.h bluez5: remove HFP codec id from transports 2025-06-13 17:51:16 +00:00
hfp-codec-cvsd.c bluez5: fix wrong use of SPA_POD_CHOICE_ENUM_Int 2025-11-03 22:11:04 +00:00
hfp-codec-lc3-a127.c bluez5: fix wrong use of SPA_POD_CHOICE_ENUM_Int 2025-11-03 22:11:04 +00:00
hfp-codec-lc3-swb.c bluez5: fix wrong use of SPA_POD_CHOICE_ENUM_Int 2025-11-03 22:11:04 +00:00
hfp-codec-msbc.c bluez5: fix wrong use of SPA_POD_CHOICE_ENUM_Int 2025-11-03 22:11:04 +00:00
hfp-h2.h bluez5: add HFP codecs in the media codec API 2025-06-13 17:51:16 +00:00
iso-io.c bluez5: iso-io: delay streaming start until all acquires are complete 2026-01-05 15:34:06 +00:00
iso-io.h bluez5: iso-io: delay streaming start until all acquires are complete 2026-01-05 15:34:06 +00:00
media-codecs.c bluez5: add codec_data for codec-private configuration data 2025-11-21 08:33:14 +00:00
media-codecs.h bluez5: set some BAP Context metadata value on streams 2025-11-21 08:33:14 +00:00
media-sink.c Don't use SPA_AUDIO_MAX_CHANNELS directly 2025-10-21 09:43:06 +02:00
media-source.c bluez5: media-source: fix off-by-one cycle in rate matching 2026-01-05 15:34:06 +00:00
meson.build bluez5: add PLC for MSBC using spandsp 2025-07-12 19:59:33 +00:00
midi-enum.c *: unify config.h handling 2025-05-30 10:24:13 +00:00
midi-node.c control: improve UMP to Midi conversiom 2025-08-19 18:33:59 +02:00
midi-parser.c treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
midi-server.c bluez5: fix some coverity issues 2025-06-14 14:34:55 +03:00
midi.h spa: bluez: include gio/gunixfdlist.h 2023-02-16 20:55:55 +01:00
modemmanager.c spa: bluez: modemmanager: Add support for memory dialing for PTS tests 2025-12-15 08:56:03 +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: bluez: mark dbus vtables static 2025-11-07 12:28:16 +00:00
player.h treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
plc.h bluez5: add PLC for MSBC using spandsp 2025-07-12 19:59:33 +00:00
plugin.c spa: export log topic enumerations 2024-01-04 10:02:55 +00:00
quirks.c bluez5: reduce quirks logspam 2024-11-04 21:41:24 +02:00
rate-control.h bluez5: media-source: fix off-by-one cycle in rate matching 2026-01-05 15:34:06 +00: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
README-Telephony.md bluez5: telephony: implement asynchronous D-Bus calls 2025-08-01 15:39:06 +00:00
rtp.h Add bluez5 plugins 2018-01-16 15:19:55 +01:00
sco-io.c bluez5: sco-io: send keepalive TX data if sink is not feeding it 2025-09-29 14:15:46 +00:00
telephony.c spa: bluez: telephony: reject double registration 2025-11-07 12:28:16 +00:00
telephony.h bluez5: telephony: implement asynchronous D-Bus calls 2025-08-01 15:39:06 +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