Search found 49 matches

by shabtronic
Tue Dec 24, 2019 10:27 pm
Forum: ESP-IDF
Topic: questions about mutex and critical sections
Replies: 4
Views: 1677

Re: questions about mutex and critical sections

This is the classic reference book for learning preemptive concurrency

http://greenteapress.com/semaphores/Lit ... phores.pdf

along with "Lock Free Queues".


Have fun!
by shabtronic
Sun Dec 22, 2019 2:00 pm
Forum: ESP-ADF
Topic: applying esp-dsp IIR biquad to pipeline or element ?
Replies: 22
Views: 6693

Re: applying esp-dsp IIR biquad to pipeline or element ?

Awesome you got it working - sucks about the firmware problem tho.

There is a edit option - it's a little pen next to the flag on the top right of anything you post.

Have fun!
by shabtronic
Sat Dec 21, 2019 2:32 pm
Forum: ESP-ADF
Topic: applying esp-dsp IIR biquad to pipeline or element ?
Replies: 22
Views: 6693

Re: applying esp-dsp IIR biquad to pipeline or element ?

this would be the code if your I2S stream is 16bit : elsewhere in code BiQuad MyFilter; MyFilter.CalcCoeffs(4,000,1,1,44100,-1); float MyFloatBuf[1024]; in DSP Function: // convert to floats for (int a=0;a<len/2;a++) MyFloatBuf[a]=(float)((short*)Buf)[a]/32768; // Process Left/Right samples /4 this ...
by shabtronic
Sat Dec 21, 2019 1:54 pm
Forum: ESP-IDF
Topic: How to use PSRAM for static definitions and malloc()?
Replies: 4
Views: 1939

Re: How to use PSRAM for static definitions and malloc()?

I think you can only use the EXT_RAM_ATTR on zero'd var's. I think the reason is - the system would have to copy the init data to spiram - making it more complex under the hood as such.
by shabtronic
Sat Dec 21, 2019 1:51 pm
Forum: ESP-ADF
Topic: applying esp-dsp IIR biquad to pipeline or element ?
Replies: 22
Views: 6693

Re: applying esp-dsp IIR biquad to pipeline or element ?

cool stuff! I noticed on your previous code your doing this: for ( int i = 0; i < len; i++ ) { // do this properly with ESP-DSP maths ? FloatDspBuf = ((float)DspBuf) / (float)32768; } I know it's pseudo code - but it should be /2 because len is in bytes for ( int i = 0; i < len/2; i++ ) { // do this...
by shabtronic
Sat Dec 21, 2019 4:54 am
Forum: ESP-IDF
Topic: How to use PSRAM for static definitions and malloc()?
Replies: 4
Views: 1939

Re: How to use PSRAM for static definitions and malloc()?

Don't know about the static allocation - but spiram malloc is done with

heap_caps_malloc(size, MALLOC_CAP_SPIRAM)
https://docs.espressif.com/projects/es ... l-ram.html

all depends how you've menuconfig'd it!
by shabtronic
Fri Dec 20, 2019 1:47 pm
Forum: ESP-ADF
Topic: applying esp-dsp IIR biquad to pipeline or element ?
Replies: 22
Views: 6693

Re: applying esp-dsp IIR biquad to pipeline or element ?

Here you go - here's my old filter code - it's for PC Vst2. But it gives a great a insight into the coefficient calculations and the Freq response Plotting code. I wouldn't use this - because - you know the IDF and ADF so far for me have been superb - it's fast and quick to get stuff up and running....
by shabtronic
Fri Dec 20, 2019 3:24 am
Forum: ESP-ADF
Topic: applying esp-dsp IIR biquad to pipeline or element ?
Replies: 22
Views: 6693

Re: applying esp-dsp IIR biquad to pipeline or element ?

that's my PC code - VST2 - it's all doubles! u need floats or whatever the DSP lib takes - I assumed float - but I've not looked at it at all :) I'll post my full EQ later - once I've tidied it up - it's not actually mine - came from a blog - in turn came from RBJ's cookbook. But I did add the Z-tra...
by shabtronic
Fri Dec 20, 2019 2:52 am
Forum: ESP-ADF
Topic: MP3 Decoder cpu usage
Replies: 6
Views: 3110

Re: MP3 Decoder cpu usage

And the culprit was - allowing spi-ram/ps-ram to be used recklessly :) Turning off spi-ram gets me much more realistic usage: Since vTaskGetRunTimeStats does actually divide the % by the number of cores - I re modified that function to spit out core % rather than cpu %: CoreID Core % Name Counter 0 ...
by shabtronic
Thu Dec 19, 2019 9:36 pm
Forum: ESP-ADF
Topic: MP3 Decoder cpu usage
Replies: 6
Views: 3110

Re: MP3 Decoder cpu usage

I've now checked this again, and I think my initial interpretation was correct. I modified vTaskGetRunTimeStats to dump out float percentages and sorted the results in a stl vec list and then dumped it out via printf. You can see both cores sum to 50% I'm using ESP Timer as the stats menuconfig sett...

Go to advanced search