hci: use 512 khz bit clock with WBS support and 256 without for BCM and SCO over PCM

This commit is contained in:
Matthias Ringwald 2021-02-20 22:10:10 +01:00
parent 4e82176441
commit 1d2bbd54d3
3 changed files with 18 additions and 5 deletions

View File

@ -11,7 +11,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Added
### Fixed
### Changed
HCI: config I2S for BCM Controllers if `ENABLE_SCO_OVER_PCM`
HCI: config I2S for BCM Controllers if `ENABLE_SCO_OVER_PCM`, reduce bit clock to 256/512 kHz
## Release v1.3.1

View File

@ -1676,8 +1676,8 @@ void hfp_bcm_prepare_for_sco(hfp_connection_t * hfp_connection){
}
void hfp_bcm_write_i2spcm_interface_param(hfp_connection_t * hfp_connection){
uint8_t sample_rate = (hfp_connection->negotiated_codec == HFP_CODEC_MSBC) ? 1 : 0;
// i2s enable, master, 8/16 kHz, 2048 kHz
hci_send_cmd(&hci_bcm_write_i2spcm_interface_param, 1, 1, sample_rate, 4);
// i2s enable, master, 8/16 kHz, 512 kHz
hci_send_cmd(&hci_bcm_write_i2spcm_interface_paramhci_bcm_write_i2spcm_interface_param, 1, 1, sample_rate, 2);
}
#endif

View File

@ -1507,14 +1507,26 @@ static void hci_initializing_run(void){
#endif
#ifdef ENABLE_SCO_OVER_PCM
log_info("BCM: Route SCO data via PCM interface");
hci_send_cmd(&hci_bcm_write_sco_pcm_int, 0, 4, 0, 1, 1);
#ifdef ENABLE_BCM_PCM_WBS
// 512 kHz bit clock for 2 channels x 16 bit x 8 kHz
hci_send_cmd(&hci_bcm_write_sco_pcm_int, 0, 2, 0, 1, 1);
#else
// 256 kHz bit clock for 2 channels x 16 bit x 8 kHz
hci_send_cmd(&hci_bcm_write_sco_pcm_int, 0, 1, 0, 1, 1);
#endif
#endif
break;
#ifdef ENABLE_SCO_OVER_PCM
case HCI_INIT_BCM_WRITE_I2SPCM_INTERFACE_PARAM:
hci_stack->substate = HCI_INIT_W4_BCM_WRITE_I2SPCM_INTERFACE_PARAM;
log_info("BCM: Config PCM interface for I2S");
hci_send_cmd(&hci_bcm_write_i2spcm_interface_param, 1, 1, 0, 4);
#ifdef ENABLE_BCM_PCM_WBS
// 512 kHz bit clock for 2 channels x 16 bit x 8 kHz
hci_send_cmd(&hci_bcm_write_i2spcm_interface_param, 1, 1, 0, 2);
#else
// 256 kHz bit clock for 2 channels x 16 bit x 8 kHz
hci_send_cmd(&hci_bcm_write_i2spcm_interface_param, 1, 1, 0, 1);
#endif
break;
#endif
#endif