From 08a78038ba366a6a2a2df8fea05d5123880fdff2 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Sun, 24 Sep 2023 18:30:35 +0200 Subject: [PATCH] hfp: skip hci_bcm_write_i2spcm_interface_param if HAVE_BCM_PCM_NBS_16KHZ Custom firmware can up/downsample NBS to 16 kHz which uses fixed 16 khz sample rate --- doc/manual/docs-template/how_to.md | 6 ++++++ src/classic/hfp.c | 2 ++ 2 files changed, 8 insertions(+) diff --git a/doc/manual/docs-template/how_to.md b/doc/manual/docs-template/how_to.md index be1b5d5e7..554022e60 100644 --- a/doc/manual/docs-template/how_to.md +++ b/doc/manual/docs-template/how_to.md @@ -72,6 +72,12 @@ POSIX platform properties: +Chipset properties: + +| \#define | Description | +|------------------------|-------------------------------------------------------| +| HAVE_BCM_PCM_NBS_16KHZ | NBS is up/downsampled, use 16 kHz sample rate for NBS | + ### ENABLE_* directives {#sec:enableDirectives} BTstack properties: diff --git a/src/classic/hfp.c b/src/classic/hfp.c index eae2a1650..acdb51e65 100644 --- a/src/classic/hfp.c +++ b/src/classic/hfp.c @@ -2198,7 +2198,9 @@ void hfp_prepare_for_sco(hfp_connection_t * hfp_connection){ #endif #ifdef ENABLE_BCM_PCM_WBS +#ifndef HAVE_BCM_PCM_NBS_16KHZ hfp_connection->bcm_send_write_i2spcm_interface_param = true; +#endif if (hfp_connection->negotiated_codec == HFP_CODEC_MSBC){ hfp_connection->bcm_send_enable_wbs = true; }