Skip to content

Commit da4fab6

Browse files
authoredMay 21, 2024
more consistent usage of variables, really use apll rx setting (arendst#21459)
1 parent 3b4035b commit da4fab6

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed
 

‎tasmota/tasmota_xdrv_driver/xdrv_42_0_i2s_0_config_idf51.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ typedef struct{
109109
bool left_align = true; // B12 - left alignment
110110
bool big_endian = false; // B13 - big endian
111111
bool bit_order_lsb = false; // B14 - lsb first
112-
uint16_t dma_frame_num = 512; // B015/16 - DMA buffer size in samples, 512 should be okay up to ~32000 bps
112+
uint16_t dma_frame_num = 576; // B015/16 - DMA buffer size in samples, 576 should be okay up to ~32000 bps
113113
uint8_t dma_desc_num = 3; // B17 - number of DMA buffers, maybe increased with smaller buffers
114114
uint8_t spare[3]; // B018-20 - padding
115115
} rx;

‎tasmota/tasmota_xdrv_driver/xdrv_42_0_i2s_3_lib_idf51.ino

+6-4
Original file line numberDiff line numberDiff line change
@@ -638,10 +638,10 @@ bool TasmotaI2S::startI2SChannel(bool tx, bool rx) {
638638
case I2S_MODE_STD:
639639
{
640640
i2s_std_slot_config_t _slot_cfg = {
641-
.data_bit_width = (i2s_data_bit_width_t)bps,
641+
.data_bit_width = rx_data_bit_width,
642642
.slot_bit_width = (i2s_slot_bit_width_t)audio_i2s.Settings->rx.slot_bit_width,
643-
.slot_mode = (i2s_slot_mode_t)channels,
644-
.slot_mask = (i2s_std_slot_mask_t)audio_i2s.Settings->rx.slot_mask,
643+
.slot_mode = rx_slot_mode,
644+
.slot_mask = (i2s_std_slot_mask_t)_rx_slot_mask,
645645
.ws_width = audio_i2s.Settings->rx.ws_width,
646646
.ws_pol = audio_i2s.Settings->rx.ws_pol,
647647
.bit_shift = audio_i2s.Settings->rx.bit_shift,
@@ -669,7 +669,9 @@ bool TasmotaI2S::startI2SChannel(bool tx, bool rx) {
669669
},
670670
},
671671
};
672-
672+
if(audio_i2s.Settings->rx.apll == 1){
673+
rx_std_cfg.clk_cfg.clk_src = I2S_CLK_SRC_APLL;
674+
}
673675
err = i2s_channel_init_std_mode(_rx_handle, &rx_std_cfg);
674676
AddLog(LOG_LEVEL_DEBUG, "I2S: RX i2s_channel_init_std_mode with err:%i", err);
675677
AddLog(LOG_LEVEL_DEBUG, "I2S: RX channel in standard mode with %u bit width on %i channel(s) initialized", bps, rx_slot_mode);

0 commit comments

Comments
 (0)