Page 3 of 4

Re: DSP FIR filter component coefficients

Posted: Wed Jan 13, 2021 2:11 pm
by Oscar_T
Hi

I can't compile the program correctly, it gives me the following errors

"
../main/esp-project.c: In function 'FCD_0c101_Ref1__Prv_GetConsole':
../main/esp-project.c:497:25: error: 'FCL_DATA[<unknown>]' is used uninitialized in this function [-Werror=uninitialized]
FCR_RETVAL = FCL_DATA[FCL_BYTE] | (FCL_DATA[FCL_BYTE + 1] << 8);
~~~~~~~~^~~~~~~~~~
../main/esp-project.c:497:47: error: 'FCL_DATA[<unknown>]' is used uninitialized in this function [-Werror=uninitialized]
FCR_RETVAL = FCL_DATA[FCL_BYTE] | (FCL_DATA[FCL_BYTE + 1] << 8);
~~~~~~~~^~~~~~~~~~~~~~
../main/esp-project.c: In function 'FCD_09991_Buff1__Prv_GetConsole':
../main/esp-project.c:1141:25: error: 'FCL_DATA[<unknown>]' is used uninitialized in this function [-Werror=uninitialized]

^
../main/esp-project.c:1141:47: error: 'FCL_DATA[<unknown>]' is used uninitialized in this function [-Werror=uninitialized]

^
../main/esp-project.c: In function 'FCD_0c101_Ref1__Prv_PutPropStr':
../main/esp-project.c:247:16: error: 'FCL_RDSTR[<unknown>]' may be used uninitialized in this function [-Werror=maybe-uninitialized]
if (FCL_RDSTR[FCL_RDIDX] == ',')
~~~~~~~~~^~~~~~~~~~~
../main/esp-project.c: In function 'FCD_0c101_Ref1__Prv_GetPropStr':
../main/esp-project.c:410:16: error: 'FCL_RDSTR[<unknown>]' may be used uninitialized in this function [-Werror=maybe-uninitialized]
if (FCL_RDSTR[FCL_RDIDX] == ',')
~~~~~~~~~^~~~~~~~~~~
../main/esp-project.c:429:16: error: 'FCL_RDSTR[<unknown>]' may be used uninitialized in this function [-Werror=maybe-uninitialized]
if (FCL_RDSTR[FCL_RDIDX] == ',')
~~~~~~~~~^~~~~~~~~~~
../main/esp-project.c: In function 'FCD_09991_Buff1__Prv_PutPropStr':
../main/esp-project.c:884:16: error: 'FCL_RDSTR[<unknown>]' may be used uninitialized in this function [-Werror=maybe-uninitialized]
// } else {
~~~~~~~ ^
../main/esp-project.c: In function 'FCD_09991_Buff1__Prv_GetPropStr':
../main/esp-project.c:1054:16: error: 'FCL_RDSTR[<unknown>]' may be used uninitialized in this function [-Werror=maybe-uninitialized]
// } else {
~~~~~~~ ^
../main/esp-project.c:1073:16: error: 'FCL_RDSTR[<unknown>]' may be used uninitialized in this function [-Werror=maybe-uninitialized]
} else {
~~~~ ^
"
instead if I remove the dsp components everything is ok

Re: DSP FIR filter component coefficients

Posted: Thu Jan 14, 2021 1:34 pm
by Oscar_T
Hi Ben

Did you find out why it can't compile when I insert the dspwavegenerator?

Regards

Re: DSP FIR filter component coefficients

Posted: Fri Jan 15, 2021 10:29 am
by BenR
Hi Oscar,

Yes I've found the cause of the problem now and am on with fixing it.

Edit, should be fixed for you now ;)

Re: DSP FIR filter component coefficients

Posted: Mon Jan 18, 2021 9:49 am
by Oscar_T
Hi Ben

Hi, I would like to dedicate this week to debugging the interface to try to make it work. Now I am able to compile everything correctly but the i2s port does not work. I have a logic analyzer to see what the i2s port is pulling out.

The settings are as follows
FS 48Khz
16 bit
Stereo

I will not select other modes because I have seen anomalous behavior with some configurations so I will focus on this which is still very common the clocks, as mentioned some posts before are ok.

Next to the esp32 I have my dsp with which I can generate the signals and compare them. For example, if with my dsp I generate all 0's on the output signal, actually with the logic analyzer I display all 0's.

Instead with esp32 I set all the buffer to 0 in output I have values ​​other than 0

Re: DSP FIR filter component coefficients

Posted: Mon Jan 18, 2021 11:20 am
by BenR
Hi Oscar,

Brlliant hopefully together we can make this work correctly. Can you post your latest project so I can see exactly what you're doing and I'll have a play here and see if I can make sense of it. My logic analyser can parse I2S data so I'll try with that.

Re: DSP FIR filter component coefficients

Posted: Mon Jan 18, 2021 12:15 pm
by Oscar_T
Hi Ben

I am attaching both the program and an excel table of the logic analyzer

Re: DSP FIR filter component coefficients

Posted: Mon Jan 18, 2021 2:08 pm
by BenR
Thanks Oscar,

Just noticed in your code you are likely leaving AUDIO_BUFFER_1[0] uninitialised and probably overflowing the bounds of the buffer too.

AUDIO_BUFFER_1[a+1] = 0

should instead be.

AUDIO_BUFFER_1[a] = 0

Testing on hardware now to see what I get here.

Re: DSP FIR filter component coefficients

Posted: Mon Jan 18, 2021 2:17 pm
by Oscar_T
Hi Ben

Sorry for the stupid mistake!!! I have compiled again but continue to get values ​​other than 0 on the i2s signal

Re: DSP FIR filter component coefficients

Posted: Mon Jan 18, 2021 2:38 pm
by BenR
Yes there's something certainly up I cansee there is lots of random data appearing, not the data that is being written.

I'll keep playing with it and see if I can find a way to tame it.

Re: DSP FIR filter component coefficients

Posted: Mon Jan 18, 2021 2:56 pm
by Oscar_T
ok

How are these parameters set by the driver?
channel_format = I2S_CHANNEL_FMT_RIGHT_LEFT,
.communication_format = I2S_COMM_FORMAT_I2S | I2S_COMM_FORMAT_I2S_MSB.

Because these parameters must also be set in order to communicate in I2S standard.

I don't know if this rtos based example can help you https://github.com/SuperHouse/esp-open- ... _example.c