News:

SMF for DIYStompboxes.com!

Main Menu

ESP32-A1S audio dev board

Started by Digital Larry, March 06, 2020, 08:46:35 AM

Previous topic - Next topic

Digital Larry

#40
Yeah I got two sawtooth oscillators running into two sweeping resonant LPFs OK.

Tried adding a phaser2_stereo and getting watchdog errors here as well.  Chatting with the developer on Slack, but he's just one guy.  The more feedback we give him, (possibly) the better chance it can get fixed.

Faust code:

import("stdfaust.lib");
freq1 = nentry("freq1",880,20,10000,0.01) : si.smoo;
freq2 = nentry("freq2",440,20,20000,0.01) : si.smooth(0.99997);
gain = nentry("gain",1,0,1,0.01) : si.smoo;
osc1 = os.sawtooth(freq1)*gain;
osc2 = os.sawtooth(freq2)*gain;
lfo1 = os.osc(5.25) * 400 + 500;
lfo2 = os.osc(3.15) * 800 + 900;
lpf1 = fi.resonlp(lfo1, 0.95, 1.0);
lpf2 = fi.resonlp(lfo2, 0.8, 1.0);
// note, lfos are not used in this patch
process = (osc1),(osc2) :> pf.phaser2_stereo(3, 0.95, 40, 420, 2.8, 2000, 1.5, 1, 0.25,  0);


Flash monitor trace:

gary@Windows10-Pro-STUDIO:~/ESP32-A1S/esp-idf/faustexample/phaser/phaser$ idf.py -p /dev/ttyS4 monitor
Checking Python dependencies...
Python requirements from /home/gary/ESP32-A1S/esp-idf/requirements.txt are satisfied.
Executing action: monitor
Running idf_monitor in directory /home/gary/ESP32-A1S/esp-idf/faustexample/phaser/phaser
Executing "/usr/bin/python /home/gary/ESP32-A1S/esp-idf/tools/idf_monitor.py -p /dev/ttyS4 -b 115200 /home/gary/ESP32-A1S/esp-idf/faustexample/phaser/phaser/build/faustexample-phaser.elf -m '/usr/bin/python' '/home/gary/ESP32-A1S/esp-idf/tools/idf.py' '-p' '/dev/ttyS4'"...
--- idf_monitor on /dev/ttyS4 115200 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
ets Jun  8 2016 00:22:57
rst:0x1 (POWERON_RESET),boot:0x1f (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:6900
load:0x40078000,len:15428
ho 0 tail 12 room 4
load:0x40080400,len:4596
entry 0x400806e8
I (73) boot: Chip Revision: 1
I (73) boot_comm: chip revision: 1, min. bootloader chip revision: 0
I (40) boot: ESP-IDF v4.0-dirty 2nd stage bootloader
I (40) boot: compile time 09:48:34
I (49) boot: Enabling RNG early entropy source...
I (49) boot: SPI Speed      : 40MHz
I (49) boot: SPI Mode       : DIO
I (53) boot: SPI Flash Size : 4MB
I (58) boot: Partition Table:
I (61) boot: ## Label            Usage          Type ST Offset   Length
I (68) boot:  0 nvs              WiFi data        01 02 00009000 00006000
I (76) boot:  1 phy_init         RF data          01 01 0000f000 00001000
I (83) boot:  2 factory          factory app      00 00 00010000 00100000
I (91) boot: End of partition table
I (95) boot_comm: chip revision: 1, min. application chip revision: 0
I (102) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x0ecc8 ( 60616) map
I (133) esp_image: segment 1: paddr=0x0001ecf0 vaddr=0x3ffb0000 size=0x01320 (  4896) load
I (135) esp_image: segment 2: paddr=0x00020018 vaddr=0x400d0018 size=0x23dd4 (146900) map
0x400d0018: _stext at ??:?
I (192) esp_image: segment 3: paddr=0x00043df4 vaddr=0x3ffb1320 size=0x00e38 (  3640) load
I (194) esp_image: segment 4: paddr=0x00044c34 vaddr=0x40080000 size=0x00400 (  1024) load
0x40080000: _WindowOverflow4 at /home/gary/ESP32-A1S/esp-idf/components/freertos/xtensa_vectors.S:1778
I (199) esp_image: segment 5: paddr=0x0004503c vaddr=0x40080400 size=0x0f7cc ( 63436) load
I (244) boot: Loaded app from partition at offset 0x10000
I (245) boot: Disabling RNG early entropy source...
I (245) psram: This chip is ESP32-D0WD
I (251) spiram: Found 64MBit SPI RAM device
I (254) spiram: SPI RAM mode: flash 40m sram 40m
I (259) spiram: PSRAM initialized, cache is in low/high (2-core) mode.
I (267) cpu_start: Pro cpu up.
I (270) cpu_start: Application information:
I (275) cpu_start: Project name:     faustexample-phaser
I (281) cpu_start: App version:      v4.0-dirty
I (286) cpu_start: Compile time:     Mar 15 2020 09:48:50
I (292) cpu_start: ELF file SHA256:  2f7b6d33060bb31a...
I (298) cpu_start: ESP-IDF:          v4.0-dirty
I (304) cpu_start: Starting app cpu, entry point is 0x40081368
0x40081368: call_start_cpu1 at /home/gary/ESP32-A1S/esp-idf/components/esp32/cpu_start.c:272
I (0) cpu_start: App cpu up.
I (1195) spiram: SPI SRAM memory test OK
I (1196) heap_init: Initializing. RAM available for dynamic allocation:
I (1196) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (1202) heap_init: At 3FFB31C0 len 0002CE40 (179 KiB): DRAM
I (1209) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (1215) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (1222) heap_init: At 4008FBCC len 00010434 (65 KiB): IRAM
I (1228) cpu_start: Pro cpu start user code
I (1246) spi_flash: detected chip: generic
I (1247) spi_flash: flash io: dio
I (1256) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (3257) AC101: reset succeed
I (3377) AC101: init done
I (3377) gpio: GPIO[21]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (3377) I2S: DMA Malloc info, datalen=blocksize=64, dma_buf_count=3
I (3377) I2S: DMA Malloc info, datalen=blocksize=64, dma_buf_count=3
I (3387) I2S: APLL: Req RATE: 48000, real rate: 47999.992, BITS: 32, CLKM: 1, BCK_M: 8, MCLK: 24575996.000, SCLK: 3071999.500000, diva: 1, divb: 0
E (8387) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:
E (8387) task_wdt:  - IDLE0 (CPU 0)
E (8387) task_wdt: Tasks currently running:
E (8387) task_wdt: CPU 0: Faust DSP Task
E (8387) task_wdt: CPU 1: IDLE1
E (13387) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:
E (13387) task_wdt:  - IDLE0 (CPU 0)
E (13387) task_wdt: Tasks currently running:
E (13387) task_wdt: CPU 0: Faust DSP Task
E (13387) task_wdt: CPU 1: IDLE1
E (18387) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:
E (18387) task_wdt:  - IDLE0 (CPU 0)
E (18387) task_wdt: Tasks currently running:
E (18387) task_wdt: CPU 0: Faust DSP Task
E (18387) task_wdt: CPU 1: IDLE1
E (23387) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:
E (23387) task_wdt:  - IDLE0 (CPU 0)
E (23387) task_wdt: Tasks currently running:
E (23387) task_wdt: CPU 0: Faust DSP Task
E (23387) task_wdt: CPU 1: IDLE1
E (28387) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:
E (28387) task_wdt:  - IDLE0 (CPU 0)
E (28387) task_wdt: Tasks currently running:
E (28387) task_wdt: CPU 0: Faust DSP Task
E (28387) task_wdt: CPU 1: IDLE1
E (33387) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:
E (33387) task_wdt:  - IDLE0 (CPU 0)
E (33387) task_wdt: Tasks currently running:
E (33387) task_wdt: CPU 0: Faust DSP Task
E (33387) task_wdt: CPU 1: IDLE1
Digital Larry
Want to quickly design your own effects patches for the Spin FV-1 DSP chip?
https://github.com/HolyCityAudio/SpinCAD-Designer

Digital Larry

Spent a bit of time on Slack with a Faust ESP32 library developer.  Apparently my code works OK on his board!  But I keep getting a glitch/timeout (watchdog timer error) the minute I add a phaser block.  So, something is obviously different, just haven't discovered what it is.  I enabled the SPI RAM and tried to find whatever block in the phaser generated C++ code that might need to use it, and tagged it for use as external (per the Faust ESP32 tutorial).  None of it made any difference.

I did google the exact wdt error and got all sorts of information, mostly related to the Arduino IDE set up and how to kick/feed the watchdog timer to prevent this.  I may see if some of that works.

Digital Larry
Want to quickly design your own effects patches for the Spin FV-1 DSP chip?
https://github.com/HolyCityAudio/SpinCAD-Designer

Digital Larry

Quote from: potul on March 15, 2020, 12:38:15 PM
at the moment begin() is called, it returns an error in the console... and the board initialization is not finished and returns a "true" (should be false).
Even with this, the sawtooth example works.... But that's the only thing I could make work using faust. I'm also getting watchdog issues, I will try the memory configuration, as I also see this warning message.

So, it gives this message as soon as InitI2C() gets called.

E (337) i2c: i2c driver install error
Could you do me a favor and paste up a few of the watchdog timer errors you're seeing?  I noticed here that they are 5 seconds apart, corresponding to a couple of the maybe two dozen watchdog related settings in sdkconfig.

Also please run:

grep WDT sdkconfig

and let me know what you get.  Here's mine:


CONFIG_BOOTLOADER_WDT_ENABLE=y
# CONFIG_BOOTLOADER_WDT_DISABLE_IN_USER_CODE is not set
CONFIG_BOOTLOADER_WDT_TIME_MS=9000
CONFIG_ESP_INT_WDT=y
CONFIG_ESP_INT_WDT_TIMEOUT_MS=300
CONFIG_ESP_INT_WDT_CHECK_CPU1=y
CONFIG_ESP_TASK_WDT=y
# CONFIG_ESP_TASK_WDT_PANIC is not set
CONFIG_ESP_TASK_WDT_TIMEOUT_S=5
CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0=y
CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1=y
CONFIG_INT_WDT=y
CONFIG_INT_WDT_TIMEOUT_MS=300
CONFIG_INT_WDT_CHECK_CPU1=y
CONFIG_TASK_WDT=y
# CONFIG_TASK_WDT_PANIC is not set
CONFIG_TASK_WDT_TIMEOUT_S=5
CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0=y
CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU1=y
Digital Larry
Want to quickly design your own effects patches for the Spin FV-1 DSP chip?
https://github.com/HolyCityAudio/SpinCAD-Designer

potul

I'm thinking on reinstalling everything, now that I know how to do it... because I'm getting some weird errors but after doing a lot of install/unisntall something maybe got wrong...


Digital Larry

Practice makes perfect!  I did it about 5 times myself. 
Digital Larry
Want to quickly design your own effects patches for the Spin FV-1 DSP chip?
https://github.com/HolyCityAudio/SpinCAD-Designer

potul

I reinstalled everything, and still getting the I2C driver error. I'm about to give up on this board.

On the other hand, yesterday I was able to install the modified ADF and run a couple of examples (mp3 player) fine, without errors.... So I'm not sure why I get these errors when using the Faust included driver.


Digital Larry

#46
Don't blame you.  I wasn't expecting it to be this hard either.  I'm probably going to continue to interact with the Faust developers, who knows, maybe the answer (to my issues) is "just around the bend".  I also think I'm going to pull out the old Macbook I installed Ubuntu Studio on and develop some Faust apps just to get my Faust chops back up (not that they were ever that great).

Until such time as OSC is supported on the ESP32 Faust port, it's of limited value to me anyway as I need more than a few buttons and pots and blinking lights for a UI.

Out of curiosity, does your ESP32 board have 8 push buttons on the bottom edge or just 6 and then 2 more towards the middle?  There are at least 2 versions of the board out there.  Mine has the 8 buttons in a row.
Digital Larry
Want to quickly design your own effects patches for the Spin FV-1 DSP chip?
https://github.com/HolyCityAudio/SpinCAD-Designer

potul

Mine has 8 in a row.

Quick update.... I just got a small victory one minute ago. I was able to get an audio passthrough working, from line in into headphones out, using Faust.

I had to modify the AC101 driver to ignore the I2C error... for some reason, the board is giving an error, but it gets initialized correclty. So I just ignore it.

I'm trying now to run something else with Faust and see if it works. I will keep you posted.

potul

well... I can't make anything else work..... looks like Faust support is not really there yet.

I think I give up. Going back to my FV-1 projects. Maybe I will retake it in some months when things are more advanced.

dschwartz

With faust it looks it has failed..
But still is a good option for a simple delay isn't it?
----------------------------------------------------------
Tubes are overrated!!

http://www.simplifieramp.com

free electron

I'd try to increase the BS from 8 to say 256. With only 8 samples block the latency is small, but the load on the core will be quite significant. Especially having so many abstracted layers and RTOS running on the MCU. I'm not surprised it starts to trigger the watchdog on any even not too complex operations. The longer the sample block the more efficient the dsp operations are, but at the cost of latency. So one has to find a good compromise.

Digital Larry

Quote from: free electron on March 16, 2020, 02:51:19 PM
I'd try to increase the BS from 8 to say 256. With only 8 samples block the latency is small, but the load on the core will be quite significant. Especially having so many abstracted layers and RTOS running on the MCU. I'm not surprised it starts to trigger the watchdog on any even not too complex operations. The longer the sample block the more efficient the dsp operations are, but at the cost of latency. So one has to find a good compromise.
I'll give that a try.  I haven't worked with RTOS before, so am just coming up to speed on program structure etc.  Looks like we're on lockdown for at least 3 weeks, other than scavenging for toilet paper, don't have to go out for anything for a few days.
Digital Larry
Want to quickly design your own effects patches for the Spin FV-1 DSP chip?
https://github.com/HolyCityAudio/SpinCAD-Designer

Digital Larry

#52
Maybe I'm expecting too much from the ESP32.  The announcement at the Faust site talks about how much faster it is than a Teensy, and then there's a reverb example for Teensy.  I can get small algos to work OK but as I add blocks, I get watchdog timer errors, so I increase the block size, which gave me stack overflow errors (although going from 8 to 256 was OK and let me get the phaser2_demo block running), so I increased the stack size, which gave me i2s errors: 

E (3380) I2S: /home/gary/ESP32-A1S/esp-idf/components/driver/i2s.c:1062 (i2s_driver_install):I2S buffer length at most 1024 and more than 8
Guru Meditation Error: Core  0 panic'ed (LoadProhibited). Exception was unhandled.
===
A guy has made a Eurorack module out of an ESP32 module, but it's not clear exactly how much power it needs.  A sampler doesn't really do a lot of number crunching.  I like working with Faust and want to push certain things as far as they will go, but for my non pedal needs it may be better to just do all this on a spare PC with a USB audio/MIDI interface.
=========
Another suggestion I just got was to set the compiler flag -Os (make menuconfig) which turns off the debug mode of the compiler.  This helped a little bit.

So, I think that the ESP32-A1S is up to some small tasks like running LFOs and wiggling filters around.  The external memory support is still somewhat lacking.  I couldn't get any reverb or delay example to work even with manual tweaking of the generated C++ code.  I might try flanger as I would like an envelope controlled flanger.

This chip is probably OK for a Eurorack CV generator/processor, but as far as audio FX go, I'm not even sure it outdoes an FV-1.  Of course if it can receive MIDI somehow, you can make it do synthy things.  That is not my goal though.

All that said, it is still a work in progress, and it's nice to be able to at least chat with the developers and let them know someone cares about what they are doing!
Digital Larry
Want to quickly design your own effects patches for the Spin FV-1 DSP chip?
https://github.com/HolyCityAudio/SpinCAD-Designer

dschwartz

Oh no..
i got to blinky, and seeing your posts, it looks like it is not a chip for a noob like me  :icon_redface:

Still..it should be not as complicated to use it on non-dsp functions like a  programmable switcher or to control I2S digipots, via BT ?
----------------------------------------------------------
Tubes are overrated!!

http://www.simplifieramp.com

Digital Larry

Quote from: dschwartz on March 18, 2020, 11:03:15 AM
Oh no..
i got to blinky, and seeing your posts, it looks like it is not a chip for a noob like me  :icon_redface:

Still..it should be not as complicated to use it on non-dsp functions like a  programmable switcher or to control I2S digipots, via BT ?
Well, anything takes a bit of learning.  This one can use the Arduino environment and as far as reading pots or wiggling GPIO lines it seems straightforward.

DL
Digital Larry
Want to quickly design your own effects patches for the Spin FV-1 DSP chip?
https://github.com/HolyCityAudio/SpinCAD-Designer

Digital Larry

Update on the ESP32-A1S and Faust.

#1, as they said on the Faust page, it's "in development".  Even though the announcement was made last July, I kinda get the feeling I may be one of the first people to actually be trying it.

#2, as a result of joining the Faust Slack channel, I've been able to interact with a few of the Faust developers and give them some feedback on the ESP32 port.  I even accidentally found a bug which they quickly fixed.

#3, at present, none of the generated code knows about the 8 MB of external RAM, so it tries to allocate any RAM (like for echo/delay blocks) in the internal RAM.  This is limited to about 150 msec which is fine for chorus/flange and slapback but not much else.

#4, I've encountered some other errors, such as watchdog timeout, when the algorithm I put together could not complete in the available time slot.  My example was a couple sawtooth oscillators going into a phaser going into a wah wah.  I don't consider that very much, but it's not easy to tell how close you are to the limits with the generated code.

#5, there is a profiling tool you can get for RTOS development, but it's something like $2500 (cough)

I'm still interested in messing around with the ESP32 because the promise of a stable, low latency "thing" for even certain types of FX appeals to me.  I've also fired up my old Macbook Pro running Ubuntu Studio 19.10 to create Faust apps that I can put in the FX loop of my modeling preamp using a USB audio interface.  So I can still scratch my Faust itch in a relatively less limited environment.

I also have half a mind to try to get the "Univibe" code from musicdsp.org running on it.  This is a circuit simulation approach AFAICT.

https://www.musicdsp.org/en/latest/Effects/277-univox-univibe-emulator.html
Digital Larry
Want to quickly design your own effects patches for the Spin FV-1 DSP chip?
https://github.com/HolyCityAudio/SpinCAD-Designer

dschwartz

Hey Larry
Did you tried this?
https://github.com/hamuro80/blackstomp

This guy has been working a lot with the esp32a1s
----------------------------------------------------------
Tubes are overrated!!

http://www.simplifieramp.com

Digital Larry

Quote from: dschwartz on March 28, 2020, 05:32:32 PM
Hey Larry
Did you tried this?
https://github.com/hamuro80/blackstomp

This guy has been working a lot with the esp32a1s
Interesting, I don't really see any effects code.  I'm not really interested in building a pedal... the board I have has stereo I/O already.  Yes it's just a dev board but that's all I need.
Digital Larry
Want to quickly design your own effects patches for the Spin FV-1 DSP chip?
https://github.com/HolyCityAudio/SpinCAD-Designer

dschwartz

Yes, it's the bare bones, it has the dsp block empty
----------------------------------------------------------
Tubes are overrated!!

http://www.simplifieramp.com

potul

Quote from: dschwartz on March 28, 2020, 05:32:32 PM
Hey Larry
Did you tried this?
https://github.com/hamuro80/blackstomp

This guy has been working a lot with the esp32a1s

thanks for the link. Although it's not solving our Faust issue, it's a good starting point to code some effects in plain C, using the arduino IDE

I will probably use it to recycle some code I built long ago for the dsPIC series...

Mat