bluez5: quirks for headset without a2dp duplex codecs

See #1756 (another headset with non-working, probably faststream duplex)
This commit is contained in:
Pauli Virtanen 2021-11-07 15:57:28 +02:00 committed by Wim Taymans
parent fc12e5bed0
commit 2329a4d323
4 changed files with 12 additions and 0 deletions

View file

@ -70,6 +70,7 @@ struct spa_bt_quirks {
int force_hw_volume;
int force_sbc_xq;
int force_faststream;
int force_a2dp_duplex;
char *device_rules;
char *adapter_rules;
@ -86,6 +87,7 @@ static enum spa_bt_feature parse_feature(const char *str)
{ "hw-volume-mic", SPA_BT_FEATURE_HW_VOLUME_MIC },
{ "sbc-xq", SPA_BT_FEATURE_SBC_XQ },
{ "faststream", SPA_BT_FEATURE_FASTSTREAM },
{ "a2dp-duplex", SPA_BT_FEATURE_A2DP_DUPLEX },
};
size_t i;
for (i = 0; i < SPA_N_ELEMENTS(feature_keys); ++i) {
@ -251,6 +253,7 @@ struct spa_bt_quirks *spa_bt_quirks_create(const struct spa_dict *info, struct s
this->force_msbc = parse_force_flag(info, "bluez5.enable-msbc");
this->force_hw_volume = parse_force_flag(info, "bluez5.enable-hw-volume");
this->force_faststream = parse_force_flag(info, "bluez5.enable-faststream");
this->force_a2dp_duplex = parse_force_flag(info, "bluez5.enable-a2dp-duplex");
if ((str = spa_dict_lookup(info, "bluez5.hardware-database")) != NULL) {
spa_log_debug(this->log, "loading session manager provided data");
@ -395,5 +398,8 @@ int spa_bt_quirks_get_features(const struct spa_bt_quirks *this,
if (this->force_faststream != -1)
SPA_FLAG_UPDATE(*features, SPA_BT_FEATURE_FASTSTREAM, this->force_faststream);
if (this->force_a2dp_duplex != -1)
SPA_FLAG_UPDATE(*features, SPA_BT_FEATURE_A2DP_DUPLEX, this->force_a2dp_duplex);
return 0;
}