fix noise issue

This commit is contained in:
Steven Dan
2026-04-17 14:49:00 +08:00
parent f1f65d2d69
commit c900a7d004
4 changed files with 11 additions and 2 deletions

View File

@@ -3,6 +3,7 @@
#else #else
#define DEBUG_PRINT_ENABLE 0 #define DEBUG_PRINT_ENABLE 0
#endif #endif
//#define DISABLE_REBOOT 1
#include <xs1.h> #include <xs1.h>
#include <assert.h> #include <assert.h>
@@ -521,7 +522,6 @@ void button_task(chanend c_hidSendData, chanend cc_mic_level, chanend c_uac_vol,
} }
#endif #endif
g_windows_detect_done = 1;
#if defined(UAC1_MODE) #if defined(UAC1_MODE)
if (saved_mode == 255) { if (saved_mode == 255) {
@@ -791,6 +791,7 @@ void button_task(chanend c_hidSendData, chanend cc_mic_level, chanend c_uac_vol,
tmr :> time; /* Input the time */ tmr :> time; /* Input the time */
time += TIMER_PERIOD; /* Increment the time */ time += TIMER_PERIOD; /* Increment the time */
g_windows_detect_done = 1;
while (1) { while (1) {
select select
{ {

View File

@@ -38,7 +38,7 @@ void dsp_main (chanend_t c_data) {
int mic_output[I2S_CHANS_ADC]; int mic_output[I2S_CHANS_ADC];
int count = 0; int count = 0;
unsigned ch[1] = {2}; unsigned ch[1] = {2};
unsigned current_sample_freq = 0; unsigned current_sample_freq = 48000;
while (1) { while (1) {
unsigned sample_freq = (unsigned)chan_in_word(c_data); unsigned sample_freq = (unsigned)chan_in_word(c_data);
chan_in_buf_word (c_data , play_input, 2); chan_in_buf_word (c_data , play_input, 2);

View File

@@ -151,8 +151,15 @@ void dsp_core0(void)
time2 = get_reference_time(); time2 = get_reference_time();
debug_printf("EQ Flash storage initialized time %lu\n", time2 - time); debug_printf("EQ Flash storage initialized time %lu\n", time2 - time);
eq_flash_initialized = 1; eq_flash_initialized = 1;
init_eq_data(48000);
clear_ring_buffer(0);
clear_ring_buffer(1);
clear_ring_buffer(2);
clear_ring_buffer(3);
} }
while (1) while (1)
{ {
if(is_ring_buffer_empty(0) && is_ring_buffer_empty(1)) if(is_ring_buffer_empty(0) && is_ring_buffer_empty(1))

View File

@@ -724,6 +724,7 @@ int main()
on tile[AUDIO_IO_TILE]: on tile[AUDIO_IO_TILE]:
{ {
set_core_high_priority_on();
/* Audio I/O task, includes mixing etc */ /* Audio I/O task, includes mixing etc */
usb_audio_io( usb_audio_io(
#if (NUM_USB_CHAN_OUT > 0) || (NUM_USB_CHAN_IN > 0) #if (NUM_USB_CHAN_OUT > 0) || (NUM_USB_CHAN_IN > 0)