update limiter
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
// Enable BOS descriptor only when DFU is enabled since the only capability we advertise is the MSOS desc with DFU interface enumerating as WinUSB.
|
||||
// Enumerating with 0 capabilities doesn't seem to be allowed
|
||||
#if (XUA_DFU_EN)
|
||||
#define _XUA_ENABLE_BOS_DESC (0) //alexy 20250822
|
||||
#define _XUA_ENABLE_BOS_DESC (1) //alexy 20250822
|
||||
#else
|
||||
#define _XUA_ENABLE_BOS_DESC (0)
|
||||
#endif
|
||||
|
||||
@@ -46,7 +46,7 @@ set(SW_USB_AUDIO_FLAGS ${EXTRA_BUILD_FLAGS} -O3
|
||||
-D${TARGET_BOARD}
|
||||
-DBCD_DEVICE_J=1
|
||||
-DBCD_DEVICE_M=0
|
||||
-DBCD_DEVICE_N=3
|
||||
-DBCD_DEVICE_N=4
|
||||
-D${CODEC_IC}
|
||||
-DWINDOWS_OS_DESCRIPTOR_SUPPORT
|
||||
-DDEBUG_PRINT_ENABLE=0)
|
||||
@@ -101,6 +101,7 @@ set(APP_COMPILER_FLAGS_ex3d_stereo_2k ${SW_USB_AUDIO_FLAGS} -DI2S_CHANS_DAC=2
|
||||
-DNUM_EX3D_CHAN_OUT=2
|
||||
-DINPUT_VOLUME_CONTROL=1
|
||||
-DOUTPUT_VOLUME_CONTROL=1
|
||||
-DXUA_DFU_EN=1
|
||||
-DSTEREO_2K
|
||||
-DHID_CONTROLS=1)
|
||||
|
||||
@@ -121,6 +122,7 @@ set(APP_COMPILER_FLAGS_ex3d_stereo_8k ${SW_USB_AUDIO_FLAGS} -DI2S_CHANS_DAC=2
|
||||
-DSTREAM_FORMAT_INPUT_2_RESOLUTION_BITS=16
|
||||
-DSTREAM_FORMAT_INPUT_3_RESOLUTION_BITS=16
|
||||
-DNUM_EX3D_CHAN_OUT=2
|
||||
-DXUA_DFU_EN=1
|
||||
-DINPUT_VOLUME_CONTROL=1
|
||||
-DOUTPUT_VOLUME_CONTROL=1
|
||||
-DSTEREO_8K
|
||||
@@ -141,6 +143,7 @@ set(APP_COMPILER_FLAGS_ex3d_71_game ${SW_USB_AUDIO_FLAGS} -DI2S_CHANS_DAC=2
|
||||
-DMIN_VOLUME=0xE000
|
||||
-DINPUT_VOLUME_CONTROL=1
|
||||
-DOUTPUT_VOLUME_CONTROL=1
|
||||
-DXUA_DFU_EN=1
|
||||
-DSPATIAL_GAME
|
||||
-DHID_CONTROLS=1)
|
||||
|
||||
@@ -169,9 +172,10 @@ set(APP_COMPILER_FLAGS_ex3d_71_movie ${SW_USB_AUDIO_FLAGS} -DI2S_CHANS_DAC=2
|
||||
-DEQ_EN=1
|
||||
-llib_ex3d_movie
|
||||
-DNUM_USB_CHAN_OUT=8
|
||||
-DNUM_USB_CHAN_IN=0
|
||||
-DNUM_USB_CHAN_IN=2
|
||||
-DNUM_EX3D_CHAN_OUT=2
|
||||
-DMIN_VOLUME=0xE000
|
||||
-DXUA_DFU_EN=1
|
||||
-DSPATIAL_MOVIE
|
||||
-DHID_CONTROLS=1)
|
||||
|
||||
|
||||
@@ -37,6 +37,7 @@ extern unsigned g_host_os; // 1 -> Windows, 2 -> Others
|
||||
extern void device_reboot(void);
|
||||
unsigned g_windows_detect_done = 0;
|
||||
unsigned g_ex3d_key_verified = 0;
|
||||
int32_t sys_vol = 0;
|
||||
enum { OS_WIN = 1, OS_OTHERS = 2 };
|
||||
|
||||
extern unsigned g_uac_vol;
|
||||
@@ -207,8 +208,8 @@ void UserBufferManagement(unsigned sampsFromUsbToAudio[], unsigned sampsFromAudi
|
||||
};
|
||||
|
||||
buffer_exchange(uc_eq_data, sampsFromUsbToAudio);
|
||||
// sampsFromAudioToUsb[0] = sampsFromUsbToAudio[0];
|
||||
// sampsFromAudioToUsb[1] = sampsFromUsbToAudio[1];
|
||||
sampsFromAudioToUsb[0] =sampsFromUsbToAudio[0];
|
||||
sampsFromAudioToUsb[1] = sampsFromUsbToAudio[1];
|
||||
}
|
||||
|
||||
#if (HID_CONTROLS == 1)
|
||||
@@ -515,10 +516,16 @@ void hid_receive_task_in_c(unsigned char * RcvData, unsigned * SendData)
|
||||
debug_printf("Set CMD_LMT_THRESHOLD : %d\r\n", threshold);
|
||||
if((-35 <= threshold) && (threshold <= 0)) {
|
||||
Ex3dLimiterThreshold = threshold;
|
||||
EX3DAudio_SetLimiterThreshold(Ex3dLimiterThreshold);
|
||||
} else {
|
||||
pSendBuf[idx] = 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
threshold = Ex3dLimiterThreshold + (sys_vol + Ex3dOnGain + Ex3dExpandGain);
|
||||
|
||||
if((-35 <= threshold) && (threshold <= 0)) {
|
||||
EX3DAudio_SetLimiterThreshold(threshold);
|
||||
}
|
||||
|
||||
} else { // Get
|
||||
debug_printf("Get CMD_LMT_THRESHOLD : %d\r\n", Ex3dLimiterThreshold);
|
||||
memcpy(&pSendBuf[idx], &Ex3dLimiterThreshold, 4);
|
||||
@@ -726,7 +733,7 @@ void hid_button_task(chanend_t cc_mic_level, chanend_t c_hidRcvData, chanend_t c
|
||||
static uint8_t is_mute_t1 = 0;
|
||||
static uint8_t mute_tmr;
|
||||
uint8_t tmp = 0;
|
||||
int32_t sys_vol = 0;
|
||||
|
||||
static uint8_t is_stable = 1;
|
||||
static uint8_t press_hold_cnt = 0;
|
||||
// 改动原因:添加LED闪烁相关变量,用于保存原始LED状态
|
||||
@@ -894,6 +901,13 @@ void hid_button_task(chanend_t cc_mic_level, chanend_t c_hidRcvData, chanend_t c
|
||||
// Ex3dExpandGain
|
||||
// Ex3dReduceGain
|
||||
// Ex3dReduceGain = Ex3dLimiterThreshold - (sys_vol + Ex3dOnGain + Ex3dExpandGain)
|
||||
int32_t threshold = Ex3dLimiterThreshold + (sys_vol + Ex3dOnGain + Ex3dExpandGain);
|
||||
|
||||
if((-35 <= threshold) && (threshold <= 0)) {
|
||||
EX3DAudio_SetLimiterThreshold(threshold);
|
||||
debug_printf("Set CMD_LMT_THRESHOLD : %d\r\n", threshold);
|
||||
}
|
||||
|
||||
debug_printf("sys_vol:%d\n", sys_vol);
|
||||
debug_printf("on gain:%d\n", Ex3dOnGain);
|
||||
debug_printf("limiter Th:%f\n", Ex3dLimiterThreshold);
|
||||
|
||||
Reference in New Issue
Block a user