From 43af0645b7d71e8e93e65e772b1de68a1a04bd60 Mon Sep 17 00:00:00 2001 From: Pauli Virtanen Date: Tue, 14 Nov 2023 22:08:23 +0200 Subject: [PATCH] bluez5: set BAP QoS RTN correctly Set QoS RTN according to values supported by server values. --- spa/plugins/bluez5/bap-codec-lc3.c | 2 ++ spa/plugins/bluez5/bluez5-dbus.c | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/spa/plugins/bluez5/bap-codec-lc3.c b/spa/plugins/bluez5/bap-codec-lc3.c index 19e0af6bc..ee6f8a264 100644 --- a/spa/plugins/bluez5/bap-codec-lc3.c +++ b/spa/plugins/bluez5/bap-codec-lc3.c @@ -674,6 +674,8 @@ static int codec_get_qos(const struct media_codec *codec, if (endpoint_qos->latency >= 0x0005 && endpoint_qos->latency <= 0x0FA0) /* Values outside the range are RFU */ qos->latency = endpoint_qos->latency; + if (endpoint_qos->retransmission) + qos->retransmission = endpoint_qos->retransmission; if (endpoint_qos->delay_min) qos->delay = SPA_MAX(qos->delay, endpoint_qos->delay_min); if (endpoint_qos->delay_max) diff --git a/spa/plugins/bluez5/bluez5-dbus.c b/spa/plugins/bluez5/bluez5-dbus.c index 7e9b67f30..ae8ecea04 100644 --- a/spa/plugins/bluez5/bluez5-dbus.c +++ b/spa/plugins/bluez5/bluez5-dbus.c @@ -971,6 +971,11 @@ static DBusHandlerResult endpoint_select_properties(DBusConnection *conn, DBusMe goto error_invalid; } + spa_log_debug(monitor->log, "select qos: interval:%d framing:%d phy:%d sdu:%d " + "rtn:%d latency:%d delay:%d target_latency:%d", + qos.interval, qos.framing, qos.phy, qos.sdu, qos.retransmission, + qos.latency, (int)qos.delay, qos.target_latency); + dbus_message_iter_open_container(&dict, DBUS_TYPE_DICT_ENTRY, NULL, &entry); dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &entry_key); dbus_message_iter_open_container(&entry, DBUS_TYPE_VARIANT, "a{sv}", &variant);