Author Topic: ESP32-A1S audio dev board  (Read 6300 times)

Digital Larry

Re: ESP32-A1S audio dev board
« Reply #100 on: May 24, 2020, 11:22:43 AM »
Obviously we are using two different development environments, but I'll offer what I can.

a) In addition to initializing the AC101, you have to turn up the "headphone volume" mixer channel.  See:

https://github.com/HolyCityAudio/ESP32/blob/master/faust/basicEcho/main/main.cpp

Code: [Select]
    AC101.SetVolumeHeadphone(63);

b) Weird that using the "PinnedToCore" option doesn't work !  No idea there.  The Faust generated C++ code does a lot of things on its own without needing to be specified, although the way I set up my own environment, I do allow and in some cases need to edit the generated C++ code before building the whole project.

Generally speaking, if I was getting watchdog errors, I'd still be getting processed sound, but it would sound like it was going through a shredder, and not in a good way (if there is one).

c) Check the AC101 code generated by Faust here: https://github.com/HolyCityAudio/ESP32/blob/master/faust/basicEcho/main/AC101.cpp

d) You might want to scan through the generated DSP C++ code here.  There are no explicit calls about the WDT at all in this, but look for "task", might be interesting.  https://github.com/HolyCityAudio/ESP32/blob/master/faust/basicEcho/main/basicEcho.cpp

Yes, I suppose it needs to be said that in addition to the DSP which is your main concern, there's no getting around having to learn some of the details of freeRTOS as well.
« Last Edit: May 24, 2020, 11:37:25 AM by Digital Larry »
Digital Larry
DSP tinkerer and former transistor twister

pruttelherrie

Re: ESP32-A1S audio dev board
« Reply #101 on: May 24, 2020, 02:07:26 PM »
Right, thanks for the pointers. I'll have a look in the generated code.

in addition to the DSP which is your main concern, there's no getting around having to learn some of the details of freeRTOS as well.

True, but once we get this sorted out everybody can enjoy the GUI to create algorithms.
« Last Edit: May 24, 2020, 02:09:14 PM by pruttelherrie »

pruttelherrie

Re: ESP32-A1S audio dev board
« Reply #102 on: May 25, 2020, 04:19:00 PM »
Update: I'm getting there. Some really useful info about the WDT from the famous sprite_tm (who used to live just a few kilometers from me) here: https://esp32.com/viewtopic.php?f=2&t=809&p=10191&hilit=esp_task_wdt_feed#p10191

I rewrote the AC101.cpp to match the existing structure of the Teensy Audio Lib, then I had to do some debugging on the initialisation, including the setHeadphonesVolume() ;)

After that it turned out the i2s_input and i2s_output routines were not completely compatible with the AC101 (incoming int buffer -> float workingbuffer and the other way around) but after fixing that I do have output in the pass-through example!
Problem is that there's a whine and a lot of distortion on a clean signal, so I'm still doing something wrong with the input and output conversions. It turns out Teensy Audio Library works with  signals from -1 ... +1, didn't know that. [edit] I should rephrase that: the esp32-audio-lib works with signals from -1...+1.

Will keep you posted.
« Last Edit: May 25, 2020, 04:24:33 PM by pruttelherrie »

pruttelherrie

Re: ESP32-A1S audio dev board
« Reply #103 on: May 26, 2020, 04:50:42 PM »
Ok, got it working. The pass-through example at least. Took a lot of fiddling with the AC101 register setup to get rid of the whine/distortion and then some programming back and forth to use the AudioStream structures but now I cleaned it up and it still works.

Next I got to figure out this GitHub thing so I can share it.

potul

Re: ESP32-A1S audio dev board
« Reply #104 on: May 27, 2020, 02:33:48 AM »
This is really good news..... I have my board sitting on the table next to my other projects waiting for someting interesting to come... This is promising. Keep us posted

Pentatonic

Re: ESP32-A1S audio dev board
« Reply #105 on: May 27, 2020, 09:55:25 AM »
Good day everyone.

I tried the repo above.  It looks like line-in does not working
Is the sample above working on your board? Btw I am using A1S board.


Digital Larry

Re: ESP32-A1S audio dev board
« Reply #106 on: May 27, 2020, 10:57:16 AM »
Good day everyone.

I tried the repo above.  It looks like line-in does not working
Is the sample above working on your board? Btw I am using A1S board.
Please indicate which repo you are talking about?  In all cases, I tested with line in and headphone out. 

That includes everything at: https://github.com/HolyCityAudio/ESP32
(so far, anyway).

I am using the rev 2 of this board:
https://www.electronics-lab.com/esp32-a1s-wi-fibt-audio-development-kit/

I think it is the rev 2 anyway.  It has 8 buttons along the lower edge instead of the 6 shown.
Digital Larry
DSP tinkerer and former transistor twister

Pentatonic

Re: ESP32-A1S audio dev board
« Reply #107 on: May 27, 2020, 12:59:12 PM »
Thanks for quick response.  :icon_wink: I tried to compile and flash basicEcho example from your repo. But it seems line-in does not work. But when I generate simple white noise from faust and modify mydsp class to check if output is working. Not sure why line-in not working. :icon_neutral:

pruttelherrie

Re: ESP32-A1S audio dev board
« Reply #108 on: May 27, 2020, 01:06:33 PM »
This is really good news..... I have my board sitting on the table next to my other projects waiting for someting interesting to come... This is promising. Keep us posted
I got a delay working, with hardcoded delay time, mix level and feedback level, just using the GUI.  Copy/paste the GUI-export and set the time, mix and feedback in the code. The effect_delay block uses the external memory of the ESP32-A1S for all audio memory.

GUI:


Exported code, to be copied to main.cpp before setup():
Code: [Select]
// GUItool: begin automatically generated code
AudioInputI2S            i2s1;           //xy=131,258
AudioMixer4              mixer2;         //xy=311,165
AudioEffectDelay         delay1;         //xy=397,377
AudioAmplifier           amp2;           //xy=481,33
AudioAmplifier           amp1;           //xy=568,408
AudioMixer4              mixer1;         //xy=633,254
AudioOutputI2S           i2s2;           //xy=1026,368
AudioConnection          patchCord1(i2s1, 1, mixer1, 0);
AudioConnection          patchCord2(i2s1, 1, mixer2, 1);
AudioConnection          patchCord3(mixer2, delay1);
AudioConnection          patchCord4(delay1, 7, amp1, 0);
AudioConnection          patchCord5(amp2, 0, mixer2, 0);
AudioConnection          patchCord6(amp1, 0, mixer1, 1);
AudioConnection          patchCord7(mixer1, 0, i2s2, 1);
AudioConnection          patchCord8(mixer1, amp2);
// GUItool: end automatically generated code

And then in setup() call something like this:
Code: [Select]
    AudioMemory(400);
    delay1.delay(7,667);
    amp1.gain(0.5);
    amp2.gain(0.5);

From here on next steps are:
* Implement more blocks (only a subset of blocks is implemented at the moment)
* Add code for interaction, like pots, OSC, web...

As I said before, I use:
* VSCode
* PlatformIO
* Arduino framework (within PlatformIO)

If you're using the same (or willing to use), drop me a PM and I'll share what I have so far.

Digital Larry

Re: ESP32-A1S audio dev board
« Reply #109 on: May 27, 2020, 02:47:22 PM »
Makes me remember the first time I made a patch with SpinCAD and it actually worked.  I had 3 or 4 simultaneous involuntary bodily functions!  It was then that I realized that world domination was within my grasp.  Good thing I just wanted to make sound effects!  Good work man!   8) :icon_biggrin: :icon_idea: :icon_mrgreen: :icon_surprised:
Digital Larry
DSP tinkerer and former transistor twister

Digital Larry

Re: ESP32-A1S audio dev board
« Reply #110 on: May 27, 2020, 02:58:23 PM »
Thanks for quick response.  :icon_wink: I tried to compile and flash basicEcho example from your repo. But it seems line-in does not work. But when I generate simple white noise from faust and modify mydsp class to check if output is working. Not sure why line-in not working. :icon_neutral:
Well, one step at a time.  I started with the sawtooth oscillator examples.  Also, the patches are supposed to be stereo > mono input and mono < stereo output.  I am using mono eurorack patch cables for I/O and the tip conductor does not map to the default mono input.  Is your board the rev 1 or rev 2?
Digital Larry
DSP tinkerer and former transistor twister

pruttelherrie

Re: ESP32-A1S audio dev board
« Reply #111 on: May 27, 2020, 04:07:05 PM »
I had 3 or 4 simultaneous involuntary bodily functions!

That's EXACTLY what happened!  :icon_biggrin:

Pentatonic

Re: ESP32-A1S audio dev board
« Reply #112 on: May 28, 2020, 10:54:24 AM »
Good day.

This is my board. Any idea why line-in does not work?



« Last Edit: May 28, 2020, 11:16:37 AM by Pentatonic »

Digital Larry

Re: ESP32-A1S audio dev board
« Reply #113 on: May 28, 2020, 02:02:12 PM »
Good day.

This is my board. Any idea why line-in does not work?

No idea, that is exactly my board.

I've uploaded the ELF files to my Github repo for each project (under the build folder), so if you like, you can upload exactly the code I have here, eliminating any possible variation in compiling/development environment.

https://github.com/HolyCityAudio/ESP32/tree/master/faust
Digital Larry
DSP tinkerer and former transistor twister

pruttelherrie

Re: ESP32-A1S audio dev board
« Reply #114 on: June 09, 2020, 03:40:28 PM »
Hey guys, a short update.
I pushed my stuff on github: https://github.com/pruttelherrie/ESP32-A1S-Teensy-Audio

Two examples included, a delay in SPIMEM with a lowpass on the delayline and changing parameters over OSC!

Using the Teensy Audio lib is a bit of a mixed business: blocks are connected in the GUI, but for control and parameter-setting you still need to code. There's a wavegenerator that can also do LFO's but most blocks don't accept the output (yet ;)


pruttelherrie

Re: ESP32-A1S audio dev board
« Reply #115 on: July 06, 2020, 04:10:18 AM »
Just another note: during dicking around I found that receiving OSC messages over WiFi made noticeable 'chirping' sounds in the output. One might want to implement PLAY and EDIT modes or something like that, and disable WiFi in PLAY mode. Seems smart anyway, unless you want some joker in the audience to have the night of his life :)