Skip to content

Commit e841dce

Browse files
committed
Bootloader and DAC correction
Release configuration.
1 parent 85448f5 commit e841dce

File tree

6 files changed

+23
-17
lines changed

6 files changed

+23
-17
lines changed

binaries/KaRadio32.bin

-151 KB
Binary file not shown.

binaries/KaRadio32_22R1.bin

-151 KB
Binary file not shown.

binaries/bootloader.bin

2.03 KB
Binary file not shown.

components/audio_renderer/audio_renderer.c

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,18 @@ bool init_i2s(/*renderer_config_t *config*/)
527527
{
528528
renderer_config_t *config;
529529
config = renderer_get();
530+
531+
config->bit_depth = I2S_BITS_PER_SAMPLE_16BIT;
532+
config->i2s_num = I2S_NUM_0;
533+
config->sample_rate = 44100;
534+
config->sample_rate_modifier = 1.0;
535+
config->output_mode = get_audio_output_mode();
536+
537+
if(config->output_mode == I2S_MERUS) {
538+
config->bit_depth = I2S_BITS_PER_SAMPLE_32BIT;
539+
}
540+
541+
530542
i2s_mode_t mode = I2S_MODE_MASTER | I2S_MODE_TX;
531543
i2s_comm_format_t comm_fmt = I2S_COMM_FORMAT_I2S | I2S_COMM_FORMAT_I2S_MSB;
532544
i2s_bits_per_sample_t bit_depth = config->bit_depth;
@@ -537,6 +549,7 @@ bool init_i2s(/*renderer_config_t *config*/)
537549

538550
if(config->output_mode == DAC_BUILT_IN)
539551
{
552+
config->bit_depth = I2S_BITS_PER_SAMPLE_16BIT;
540553
mode = mode | I2S_MODE_DAC_BUILT_IN;
541554
comm_fmt = I2S_COMM_FORMAT_I2S_MSB;
542555
}
@@ -552,7 +565,7 @@ bool init_i2s(/*renderer_config_t *config*/)
552565
}
553566

554567
if ((config->output_mode == I2S)||(config->output_mode == I2S_MERUS)
555-
|| (config->output_mode == SPDIF) || (config->output_mode == DAC_BUILT_IN))
568+
|| (config->output_mode == SPDIF) )//|| (config->output_mode == DAC_BUILT_IN))
556569
{
557570
/* don't use audio pll on buggy rev0 chips */
558571
// don't do it for PDM
@@ -581,8 +594,8 @@ bool init_i2s(/*renderer_config_t *config*/)
581594
.dma_buf_count = bc, // number of buffers, 128 max. 16
582595
// .dma_buf_len = bigSram()?256:128, // size of each buffer 128
583596
.dma_buf_len = 512, // size of each buffer 128
584-
.intr_alloc_flags = ESP_INTR_FLAG_LEVEL1, // lowest level 1
585-
// .intr_alloc_flags = 0 , // default
597+
// .intr_alloc_flags = ESP_INTR_FLAG_LEVEL1, // lowest level 1
598+
.intr_alloc_flags = 0 , // default
586599
.tx_desc_auto_clear = true,
587600
.use_apll = use_apll
588601
};
@@ -598,7 +611,7 @@ bool init_i2s(/*renderer_config_t *config*/)
598611
.data_out_num = i2sdata,
599612
.data_in_num = I2S_PIN_NO_CHANGE
600613
};
601-
614+
ESP_LOGD(TAG, "mode:%d, sample_rate:%d, bit_depth:%d, comm:%d, data:%d",mode,sample_rate,bit_depth,comm_fmt,i2sdata);
602615

603616
if (i2s_driver_install(config->i2s_num, &i2s_config, 0, NULL) != ESP_OK)
604617
{
@@ -617,7 +630,7 @@ bool init_i2s(/*renderer_config_t *config*/)
617630
if(config->output_mode == DAC_BUILT_IN)// || (mode & I2S_MODE_PDM))
618631
{
619632
i2s_set_pin(config->i2s_num, NULL);
620-
i2s_set_dac_mode(I2S_DAC_CHANNEL_BOTH_EN);
633+
// i2s_set_dac_mode(I2S_DAC_CHANNEL_BOTH_EN);
621634
}
622635
else {
623636
if ((lrck!=255) && (bclk!=255) && (i2sdata!=255))

main/app_main.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -312,12 +312,6 @@ static renderer_config_t *create_renderer_config()
312312
{
313313
renderer_config_t *renderer_config = calloc(1, sizeof(renderer_config_t));
314314

315-
renderer_config->bit_depth = I2S_BITS_PER_SAMPLE_16BIT;
316-
renderer_config->i2s_num = I2S_NUM_0;
317-
renderer_config->sample_rate = 44100;
318-
renderer_config->sample_rate_modifier = 1.0;
319-
renderer_config->output_mode = audio_output_mode;
320-
321315
if(renderer_config->output_mode == I2S_MERUS) {
322316
renderer_config->bit_depth = I2S_BITS_PER_SAMPLE_32BIT;
323317
}

sdkconfig

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ CONFIG_APP_RETRIEVE_LEN_ELF_SHA=16
2525
#
2626
CONFIG_LOG_BOOTLOADER_LEVEL_NONE=
2727
CONFIG_LOG_BOOTLOADER_LEVEL_ERROR=
28-
CONFIG_LOG_BOOTLOADER_LEVEL_WARN=
28+
CONFIG_LOG_BOOTLOADER_LEVEL_WARN=y
2929
CONFIG_LOG_BOOTLOADER_LEVEL_INFO=
30-
CONFIG_LOG_BOOTLOADER_LEVEL_DEBUG=y
30+
CONFIG_LOG_BOOTLOADER_LEVEL_DEBUG=
3131
CONFIG_LOG_BOOTLOADER_LEVEL_VERBOSE=
32-
CONFIG_LOG_BOOTLOADER_LEVEL=4
32+
CONFIG_LOG_BOOTLOADER_LEVEL=2
3333
CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_8V=
3434
CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_9V=y
3535
CONFIG_BOOTLOADER_FACTORY_RESET=
@@ -125,8 +125,8 @@ CONFIG_PARTITION_TABLE_MD5=y
125125
#
126126
# Compiler options
127127
#
128-
CONFIG_OPTIMIZATION_LEVEL_DEBUG=y
129-
CONFIG_OPTIMIZATION_LEVEL_RELEASE=
128+
CONFIG_OPTIMIZATION_LEVEL_DEBUG=
129+
CONFIG_OPTIMIZATION_LEVEL_RELEASE=y
130130
CONFIG_OPTIMIZATION_ASSERTIONS_ENABLED=y
131131
CONFIG_OPTIMIZATION_ASSERTIONS_SILENT=
132132
CONFIG_OPTIMIZATION_ASSERTIONS_DISABLED=
@@ -736,7 +736,6 @@ CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE=0
736736
CONFIG_FREERTOS_USE_TRACE_FACILITY=
737737
CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS=
738738
CONFIG_FREERTOS_DEBUG_INTERNALS=
739-
CONFIG_FREERTOS_TASK_FUNCTION_WRAPPER=
740739
CONFIG_FREERTOS_CHECK_MUTEX_GIVEN_BY_OWNER=y
741740
CONFIG_FREERTOS_CHECK_PORT_CRITICAL_COMPLIANCE=
742741

0 commit comments

Comments
 (0)