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

#100
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


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

pruttelherrie

#101
Right, thanks for the pointers. I'll have a look in the generated code.

Quote from: Digital Larry on May 24, 2020, 11:22:43 AMin 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.

pruttelherrie

#102
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.

pruttelherrie

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

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

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

Quote from: Pentatonic 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.
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
Want to quickly design your own effects patches for the Spin FV-1 DSP chip?
https://github.com/HolyCityAudio/SpinCAD-Designer

Pentatonic

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

Quote from: potul 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
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():

// 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:

    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

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
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: Pentatonic 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:
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
Want to quickly design your own effects patches for the Spin FV-1 DSP chip?
https://github.com/HolyCityAudio/SpinCAD-Designer

pruttelherrie

Quote from: Digital Larry on May 27, 2020, 02:47:22 PM
I had 3 or 4 simultaneous involuntary bodily functions!

That's EXACTLY what happened!  :icon_biggrin:

Pentatonic

#112
Good day.

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




Digital Larry

Quote from: Pentatonic on May 28, 2020, 10:54:24 AM
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
Want to quickly design your own effects patches for the Spin FV-1 DSP chip?
https://github.com/HolyCityAudio/SpinCAD-Designer

pruttelherrie

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

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 :)