Skip to content

Commit acbda31

Browse files
Jeremy WuChromeos LUCI
Jeremy Wu
authored and
Chromeos LUCI
committed
floss: prefer HW-MSBC over SW-LC3 when CRAS prefers offloading
Some complications (see b/316077719) made Corsola a special case that can report SW-LC3 availability offered by the peer and the BT stack, which in fact should be ignored, but wasn't, due to CRAS allowing to bypass its offloading decision when LC3 is supported. BUG=b:347936346 TEST=Verify Pixel Buds Pro HFP works on Corsola TEST=Verify Pixel Buds Pro HFP works on Kukui TEST=Verify Pixel Buds Pro HFP works on Brya Change-Id: I223657c75c5847e3b87150807ff9a40d54e56275 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/adhd/+/5692243 Tested-by: [email protected] <[email protected]> Reviewed-by: Hsinyu Chao <[email protected]> Commit-Queue: Jeremy Wu <[email protected]>
1 parent b6ca32f commit acbda31

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

cras/src/server/cras_hfp_manager.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,15 +131,16 @@ struct cras_hfp* cras_floss_hfp_create(struct fl_media* fm,
131131
hfp->hfp_caps &= ~HFP_CODEC_FORMAT_MSBC;
132132
}
133133

134-
// Currently, SWB is only supported via SW encoding. If CRAS would
135-
// have been using HW encoding but LC3 is available, we will back off to
136-
// the SW encoding backend.
134+
// Currently, SWB is only supported via SW encoding. We shall respect
135+
// the offloading decision from CRAS because the capabilities exposed
136+
// from the BT stack can be wrong for this particular case (on Corsola).
137+
// See b/316077719 for details.
137138
if (cras_floss_hfp_is_codec_format_supported(
138139
hfp, HFP_CODEC_FORMAT_LC3_TRANSPARENT) &&
139140
hfp->sco_pcm_used) {
140-
hfp->sco_pcm_used = false;
141-
syslog(LOG_INFO, "Bypassed offloading to allow LC3");
142-
// TODO: add UMA for this case
141+
syslog(LOG_INFO, "Prefer HW-MSBC over SW-LC3 to respect offload decision");
142+
hfp->hfp_caps |= HFP_CODEC_FORMAT_MSBC;
143+
hfp->hfp_caps &= ~HFP_CODEC_FORMAT_LC3_TRANSPARENT;
143144
}
144145

145146
if (hfp->sco_pcm_used) {

0 commit comments

Comments
 (0)