mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-03-26 07:58:03 -04:00
bluez5: bap: add manual retransmissions config option
Retransmissions setting is provided via the QoS configuration preset. This should enable a manual way to set the retransmissions. Note, that this value will be only a proposal for the controller, which in the end decides which value makes sense regarding scheduling etc.
This commit is contained in:
parent
7dd2c60b12
commit
abb11b7f11
1 changed files with 21 additions and 3 deletions
|
|
@ -191,12 +191,15 @@ struct spa_bt_metadata {
|
||||||
struct spa_bt_bis {
|
struct spa_bt_bis {
|
||||||
struct spa_list link;
|
struct spa_list link;
|
||||||
char qos_preset[255];
|
char qos_preset[255];
|
||||||
|
int retransmissions;
|
||||||
|
int retransmissions_set;
|
||||||
int channel_allocation;
|
int channel_allocation;
|
||||||
struct spa_list metadata_list;
|
struct spa_list metadata_list;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define BROADCAST_CODE_LEN 16
|
#define BROADCAST_CODE_LEN 16
|
||||||
#define BD_ADDR_STR_LEN 17
|
#define BD_ADDR_STR_LEN 17
|
||||||
|
#define NUM_BCAST_RETRANSMISSIONS_MAX 254
|
||||||
|
|
||||||
struct spa_bt_big {
|
struct spa_bt_big {
|
||||||
struct spa_list link;
|
struct spa_list link;
|
||||||
|
|
@ -6173,6 +6176,7 @@ static void configure_bis(struct spa_bt_monitor *monitor,
|
||||||
uint8_t caps [CC_MAX_LEN];
|
uint8_t caps [CC_MAX_LEN];
|
||||||
uint8_t metadata [METADATA_MAX_LEN];
|
uint8_t metadata [METADATA_MAX_LEN];
|
||||||
uint8_t caps_size, metadata_size = 0;
|
uint8_t caps_size, metadata_size = 0;
|
||||||
|
uint8_t retransmissions;
|
||||||
struct bap_codec_qos qos;
|
struct bap_codec_qos qos;
|
||||||
struct spa_bt_metadata *metadata_entry;
|
struct spa_bt_metadata *metadata_entry;
|
||||||
struct spa_dict settings;
|
struct spa_dict settings;
|
||||||
|
|
@ -6216,6 +6220,11 @@ static void configure_bis(struct spa_bt_monitor *monitor,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (bis->retransmissions_set)
|
||||||
|
retransmissions = (uint8_t) bis->retransmissions;
|
||||||
|
else
|
||||||
|
retransmissions = qos.retransmission;
|
||||||
|
|
||||||
msg = dbus_message_new_method_call(BLUEZ_SERVICE,
|
msg = dbus_message_new_method_call(BLUEZ_SERVICE,
|
||||||
object_path,
|
object_path,
|
||||||
interface_name,
|
interface_name,
|
||||||
|
|
@ -6259,7 +6268,7 @@ static void configure_bis(struct spa_bt_monitor *monitor,
|
||||||
append_basic_variant_dict_entry(&qos_dict, "Framing", DBUS_TYPE_BYTE, "y", &qos.framing);
|
append_basic_variant_dict_entry(&qos_dict, "Framing", DBUS_TYPE_BYTE, "y", &qos.framing);
|
||||||
append_basic_variant_dict_entry(&qos_dict, "PHY", DBUS_TYPE_BYTE, "y", &qos.phy);
|
append_basic_variant_dict_entry(&qos_dict, "PHY", DBUS_TYPE_BYTE, "y", &qos.phy);
|
||||||
append_basic_variant_dict_entry(&qos_dict, "SDU", DBUS_TYPE_UINT16, "q", &qos.sdu);
|
append_basic_variant_dict_entry(&qos_dict, "SDU", DBUS_TYPE_UINT16, "q", &qos.sdu);
|
||||||
append_basic_variant_dict_entry(&qos_dict, "Retransmissions", DBUS_TYPE_BYTE, "y", &qos.retransmission);
|
append_basic_variant_dict_entry(&qos_dict, "Retransmissions", DBUS_TYPE_BYTE, "y", &retransmissions);
|
||||||
append_basic_variant_dict_entry(&qos_dict, "Latency", DBUS_TYPE_UINT16, "q", &qos.latency);
|
append_basic_variant_dict_entry(&qos_dict, "Latency", DBUS_TYPE_UINT16, "q", &qos.latency);
|
||||||
append_basic_variant_dict_entry(&qos_dict, "PresentationDelay", DBUS_TYPE_UINT32, "u", &qos.delay);
|
append_basic_variant_dict_entry(&qos_dict, "PresentationDelay", DBUS_TYPE_UINT32, "u", &qos.delay);
|
||||||
|
|
||||||
|
|
@ -7110,6 +7119,15 @@ static void parse_broadcast_source_config(struct spa_bt_monitor *monitor, const
|
||||||
if (spa_json_get_string(&it[1], bis_entry->qos_preset, sizeof(bis_entry->qos_preset)) <= 0)
|
if (spa_json_get_string(&it[1], bis_entry->qos_preset, sizeof(bis_entry->qos_preset)) <= 0)
|
||||||
goto parse_failed;
|
goto parse_failed;
|
||||||
spa_log_debug(monitor->log, "bis_entry->qos_preset %s", bis_entry->qos_preset);
|
spa_log_debug(monitor->log, "bis_entry->qos_preset %s", bis_entry->qos_preset);
|
||||||
|
} else if (spa_streq(bis_key, "retransmissions")) {
|
||||||
|
if (spa_json_get_int(&it[2], &bis_entry->retransmissions) <= 0)
|
||||||
|
goto parse_failed;
|
||||||
|
if (bis_entry->retransmissions > NUM_BCAST_RETRANSMISSIONS_MAX)
|
||||||
|
goto parse_failed;
|
||||||
|
if (bis_entry->retransmissions < 0)
|
||||||
|
goto parse_failed;
|
||||||
|
bis_entry->retransmissions_set = 1;
|
||||||
|
spa_log_debug(monitor->log, "bis_entry->retransmissions %d", bis_entry->retransmissions);
|
||||||
} else if (spa_streq(bis_key, "audio_channel_allocation")) {
|
} else if (spa_streq(bis_key, "audio_channel_allocation")) {
|
||||||
if (spa_json_get_int(&it[1], &bis_entry->channel_allocation) <= 0)
|
if (spa_json_get_int(&it[1], &bis_entry->channel_allocation) <= 0)
|
||||||
goto parse_failed;
|
goto parse_failed;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue