1
0
Fork 0
forked from len0rd/rockbox

fix pbe/haas surround dsps: surround_enabled, redo flush functions.

surround_enabled was never true, end up dsp_surround_flush didn't work; Thats why a cracking noise occurs in right channel when moving track positions.

redo pbe/surround flush in a much simpler way suits the current single buffer style.

Change-Id: I394054ddfb164b82c90b3dcf49df4442db87d8d2
This commit is contained in:
Chiwen Chang 2015-01-22 13:24:15 +11:00
parent 5732e3e32d
commit 30784cc262
2 changed files with 11 additions and 26 deletions

View file

@ -79,20 +79,14 @@ static void dsp_pbe_flush(void)
if (pbe_strength == 0)
return; /* Not currently enabled */
pbe_buffer_get_data();
memset(b0[0], 0, B0_DLY * sizeof(int32_t));
memset(b0[1], 0, B0_DLY * sizeof(int32_t));
memset(b2[0], 0, B2_DLY * sizeof(int32_t));
memset(b2[1], 0, B2_DLY * sizeof(int32_t));
memset(b3[0], 0, B3_DLY * sizeof(int32_t));
memset(b3[1], 0, B3_DLY * sizeof(int32_t));
b0_r[0] = 0; b0_w[0] = B0_DLY;
b0_r[1] = 0; b0_w[1] = B0_DLY;
b2_r[0] = 0; b2_w[0] = B2_DLY;
b2_r[1] = 0; b2_w[1] = B2_DLY;
b3_r[0] = 0; b3_w[0] = B3_DLY;
b3_r[1] = 0; b3_w[1] = B3_DLY;
unsigned int total_len = (B0_SIZE + B2_SIZE + B3_SIZE) * 2;
memset(core_get_data(handle),0,sizeof(int32_t) * total_len);
b0_r[0] = 0; b0_w[0] = 0;
b0_r[1] = 0; b0_w[1] = 0;
b2_r[0] = 0; b2_w[0] = 0;
b2_r[1] = 0; b2_w[1] = 0;
b3_r[0] = 0; b3_w[0] = 0;
b3_r[1] = 0; b3_w[1] = 0;
for (int i = 0; i < 5; i++)
filter_flush(&pbe_filter[i]);

View file

@ -96,18 +96,8 @@ static void dsp_surround_flush(void)
if (!surround_enabled)
return;
surround_buffer_get_data();
memset(b0,0,MAX_DLY/8 * sizeof(int32_t));
memset(b2,0,MAX_DLY * sizeof(int32_t));
memset(bb,0,MAX_DLY/4 * sizeof(int32_t));
memset(hh,0,MAX_DLY/2 * sizeof(int32_t));
memset(cl,0,MAX_DLY * sizeof(int32_t));
b0_r = 0;b0_w = dly_size/8 - 1;
b2_r = 0;b2_w = dly_size - 1;
bb_r = 0;bb_w = dly_size/4 - 1;
hh_r = 0;hh_w = dly_size/2 - 1;
cl_r = 0;cl_w = dly_size - 1;
unsigned int total_len = B0_DLY + B2_DLY + BB_DLY + HH_DLY + CL_DLY;
memset(core_get_data(handle),0,sizeof(int32_t) * total_len);
}
static void surround_update_filter(unsigned int fout)
@ -186,6 +176,7 @@ void dsp_surround_enable(int var)
core_free(handle);
handle = -1;
}
surround_enabled = now_enabled;
struct dsp_config *dsp = dsp_get_config(CODEC_IDX_AUDIO);
dsp_proc_enable(dsp, DSP_PROC_SURROUND, now_enabled);