Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ESP32 port #301

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Fix ESP32 port #301

wants to merge 9 commits into from

Conversation

tomcombriat
Copy link
Collaborator

@tomcombriat tomcombriat commented Jan 6, 2025

Note:

I have done everything using the ESP-IDF documentation (https://docs.espressif.com/projects/esp-idf/en/v5.4/esp32/index.html) but not the Arduino-esp32 one (https://docs.espressif.com/projects/arduino-esp32/en/latest/api/i2s.html).

Work in progress Done (?)

The goal is to change the port for the ESP32 to the new version of the API (v.5). Below the state of the work.

Note: only tested on ESP32-WROOM-32D (which have a native DAC) and ESP32-S3 (which does not).


EXTERNAL_TIMED

Fixed

Can be tested with, as a config:

#include<MozziConfigValues.h>
#define MOZZI_AUDIO_MODE MOZZI_OUTPUT_EXTERNAL_TIMED 
#define MOZZI_AUDIO_BITS 8 

and as an audioOutput():

void audioOutput(const AudioOutput f) // f is a structure containing both channels
{
  dacWrite(25,f.l()+MOZZI_AUDIO_BIAS);
}

INTERNAL_DAC

Compiles and run (does not panic) but no sound Fixed (see below)

Still resists me… I tried to switch to a DMA written DAC as per the docs but still got some error message from the ESP… If anyone has an idea… Worst case, something like the dacWrite used in the example above could do the job, but that's not really satisfying…

Note: espressif/arduino-esp32#10851

Mozzi runs, updateControl is called, i2s writing function is called…

Edit: I think I'll do the workaround described for the timed_output using dacWrite in the near future, and will change when espressif gives some feedback (or I find the problem myself…)
I did the workaround above. Works well but probably not the most efficient. Will probably evolves but that works.

Default mode for ESP32

NATIVE_I2S

Fixed

Default config to plain format (different than before) to be coherent with the others I2S ports (especially RP2040). Mode can be further changed to LSBJ (PT8211) and lines phases can also be edited.
Works in MONO and STEREO for the PT8211 (do not have the DAC to test plain, or at least not in super close reach).

PWM

New addition, mainly to support the ESP32 chips that do not have a DAC on-board. A bit fancier than a analogWrite but not much. Default mode automatic selection is not yet implemented (and this is not tested on other boards yet…). This will fix #278 .
Default pins are 15 and 16.

Default mode for all other boards (ESP32-XX)

This comment was marked as outdated.

This comment was marked as outdated.

This comment was marked as outdated.

Repository owner deleted a comment from github-actions bot Jan 14, 2025
@tomcombriat tomcombriat self-assigned this Jan 14, 2025

This comment was marked as outdated.

Config of I2S for ESP32

Updated documentation on ESP32

This comment was marked as outdated.

This comment was marked as outdated.

This comment was marked as outdated.

@amiel
Copy link

amiel commented Jan 20, 2025

Thank you so much for working on this!!!!!! I am using MOZZI_OUTPUT_I2S_DAC with a PT8211 in a side project and will test this out when I get a chance, although it won't be a for a few weeks.

Copy link

Memory usage change @ 1070453

Board flash % RAM for global variables %
STMicroelectronics:stm32:GenF1:pnum=BLUEPILL_F103C8 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:avr:mega 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:avr:uno 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed_giga:giga 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:renesas_uno:minima 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:adafruit_circuitplayground_m0 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
esp8266:esp8266:huzzah N/A N/A N/A N/A
rp2040:rp2040:rpipico 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
teensy:avr:teensy36 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
teensy:avr:teensy41 N/A N/A N/A N/A
Click for full report table
Board examples/01.Basics/Control_Gain
flash
% examples/01.Basics/Control_Gain
RAM for global variables
% examples/01.Basics/Sinewave
flash
% examples/01.Basics/Sinewave
RAM for global variables
% examples/01.Basics/Sinewave_HIFI
flash
% examples/01.Basics/Sinewave_HIFI
RAM for global variables
% examples/01.Basics/Skeleton
flash
% examples/01.Basics/Skeleton
RAM for global variables
% examples/01.Basics/Skeleton_Multi
flash
% examples/01.Basics/Skeleton_Multi
RAM for global variables
% examples/01.Basics/Table_Resolution
flash
% examples/01.Basics/Table_Resolution
RAM for global variables
% examples/01.Basics/Vibrato
flash
% examples/01.Basics/Vibrato
RAM for global variables
% examples/01.Basics/Vibrato_Midi_Note
flash
% examples/01.Basics/Vibrato_Midi_Note
RAM for global variables
% examples/02.Control/Control_Echo_Theremin
flash
% examples/02.Control/Control_Echo_Theremin
RAM for global variables
% examples/02.Control/Control_Oscil_Wash
flash
% examples/02.Control/Control_Oscil_Wash
RAM for global variables
% examples/02.Control/Control_Tremelo
flash
% examples/02.Control/Control_Tremelo
RAM for global variables
% examples/02.Control/EventDelay
flash
% examples/02.Control/EventDelay
RAM for global variables
% examples/02.Control/Line_Gliss
flash
% examples/02.Control/Line_Gliss
RAM for global variables
% examples/02.Control/Line_Gliss_Double_32k_HIFI
flash
% examples/02.Control/Line_Gliss_Double_32k_HIFI
RAM for global variables
% examples/02.Control/Metronome_SampleHuffman
flash
% examples/02.Control/Metronome_SampleHuffman
RAM for global variables
% examples/02.Control/Stop_Start
flash
% examples/02.Control/Stop_Start
RAM for global variables
% examples/06.Synthesis/AMsynth
flash
% examples/06.Synthesis/AMsynth
RAM for global variables
% examples/06.Synthesis/AMsynth_HIFI
flash
% examples/06.Synthesis/AMsynth_HIFI
RAM for global variables
% examples/06.Synthesis/Brown_Noise_Realtime
flash
% examples/06.Synthesis/Brown_Noise_Realtime
RAM for global variables
% examples/06.Synthesis/Detuned_Beats_Wash
flash
% examples/06.Synthesis/Detuned_Beats_Wash
RAM for global variables
% examples/06.Synthesis/Difference_Tone
flash
% examples/06.Synthesis/Difference_Tone
RAM for global variables
% examples/06.Synthesis/Difference_Tone_FixMath
flash
% examples/06.Synthesis/Difference_Tone_FixMath
RAM for global variables
% examples/06.Synthesis/FMsynth
flash
% examples/06.Synthesis/FMsynth
RAM for global variables
% examples/06.Synthesis/FMsynth_32k_HIFI
flash
% examples/06.Synthesis/FMsynth_32k_HIFI
RAM for global variables
% examples/06.Synthesis/FMsynth_FixMath
flash
% examples/06.Synthesis/FMsynth_FixMath
RAM for global variables
% examples/06.Synthesis/NonAlias_MetaOscil
flash
% examples/06.Synthesis/NonAlias_MetaOscil
RAM for global variables
% examples/06.Synthesis/PDresonant
flash
% examples/06.Synthesis/PDresonant
RAM for global variables
% examples/06.Synthesis/PWM_Phasing
flash
% examples/06.Synthesis/PWM_Phasing
RAM for global variables
% examples/06.Synthesis/SelfModulator
flash
% examples/06.Synthesis/SelfModulator
RAM for global variables
% examples/06.Synthesis/WaveFolder
flash
% examples/06.Synthesis/WaveFolder
RAM for global variables
% examples/06.Synthesis/WavePacket_Double
flash
% examples/06.Synthesis/WavePacket_Double
RAM for global variables
% examples/06.Synthesis/WavePacket_Sample
flash
% examples/06.Synthesis/WavePacket_Sample
RAM for global variables
% examples/06.Synthesis/WavePacket_Single
flash
% examples/06.Synthesis/WavePacket_Single
RAM for global variables
% examples/06.Synthesis/Waveshaper
flash
% examples/06.Synthesis/Waveshaper
RAM for global variables
%
STMicroelectronics:stm32:GenF1:pnum=BLUEPILL_F103C8 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:avr:mega 0 0.0 0 0.0 0 0.0 0 0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 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
esp8266:esp8266:huzzah N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A
rp2040:rp2040:rpipico 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
teensy:avr:teensy36 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
teensy:avr:teensy41 N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A
Click for full report CSV
Board,examples/01.Basics/Control_Gain<br>flash,%,examples/01.Basics/Control_Gain<br>RAM for global variables,%,examples/01.Basics/Sinewave<br>flash,%,examples/01.Basics/Sinewave<br>RAM for global variables,%,examples/01.Basics/Sinewave_HIFI<br>flash,%,examples/01.Basics/Sinewave_HIFI<br>RAM for global variables,%,examples/01.Basics/Skeleton<br>flash,%,examples/01.Basics/Skeleton<br>RAM for global variables,%,examples/01.Basics/Skeleton_Multi<br>flash,%,examples/01.Basics/Skeleton_Multi<br>RAM for global variables,%,examples/01.Basics/Table_Resolution<br>flash,%,examples/01.Basics/Table_Resolution<br>RAM for global variables,%,examples/01.Basics/Vibrato<br>flash,%,examples/01.Basics/Vibrato<br>RAM for global variables,%,examples/01.Basics/Vibrato_Midi_Note<br>flash,%,examples/01.Basics/Vibrato_Midi_Note<br>RAM for global variables,%,examples/02.Control/Control_Echo_Theremin<br>flash,%,examples/02.Control/Control_Echo_Theremin<br>RAM for global variables,%,examples/02.Control/Control_Oscil_Wash<br>flash,%,examples/02.Control/Control_Oscil_Wash<br>RAM for global variables,%,examples/02.Control/Control_Tremelo<br>flash,%,examples/02.Control/Control_Tremelo<br>RAM for global variables,%,examples/02.Control/EventDelay<br>flash,%,examples/02.Control/EventDelay<br>RAM for global variables,%,examples/02.Control/Line_Gliss<br>flash,%,examples/02.Control/Line_Gliss<br>RAM for global variables,%,examples/02.Control/Line_Gliss_Double_32k_HIFI<br>flash,%,examples/02.Control/Line_Gliss_Double_32k_HIFI<br>RAM for global variables,%,examples/02.Control/Metronome_SampleHuffman<br>flash,%,examples/02.Control/Metronome_SampleHuffman<br>RAM for global variables,%,examples/02.Control/Stop_Start<br>flash,%,examples/02.Control/Stop_Start<br>RAM for global variables,%,examples/06.Synthesis/AMsynth<br>flash,%,examples/06.Synthesis/AMsynth<br>RAM for global variables,%,examples/06.Synthesis/AMsynth_HIFI<br>flash,%,examples/06.Synthesis/AMsynth_HIFI<br>RAM for global variables,%,examples/06.Synthesis/Brown_Noise_Realtime<br>flash,%,examples/06.Synthesis/Brown_Noise_Realtime<br>RAM for global variables,%,examples/06.Synthesis/Detuned_Beats_Wash<br>flash,%,examples/06.Synthesis/Detuned_Beats_Wash<br>RAM for global variables,%,examples/06.Synthesis/Difference_Tone<br>flash,%,examples/06.Synthesis/Difference_Tone<br>RAM for global variables,%,examples/06.Synthesis/Difference_Tone_FixMath<br>flash,%,examples/06.Synthesis/Difference_Tone_FixMath<br>RAM for global variables,%,examples/06.Synthesis/FMsynth<br>flash,%,examples/06.Synthesis/FMsynth<br>RAM for global variables,%,examples/06.Synthesis/FMsynth_32k_HIFI<br>flash,%,examples/06.Synthesis/FMsynth_32k_HIFI<br>RAM for global variables,%,examples/06.Synthesis/FMsynth_FixMath<br>flash,%,examples/06.Synthesis/FMsynth_FixMath<br>RAM for global variables,%,examples/06.Synthesis/NonAlias_MetaOscil<br>flash,%,examples/06.Synthesis/NonAlias_MetaOscil<br>RAM for global variables,%,examples/06.Synthesis/PDresonant<br>flash,%,examples/06.Synthesis/PDresonant<br>RAM for global variables,%,examples/06.Synthesis/PWM_Phasing<br>flash,%,examples/06.Synthesis/PWM_Phasing<br>RAM for global variables,%,examples/06.Synthesis/SelfModulator<br>flash,%,examples/06.Synthesis/SelfModulator<br>RAM for global variables,%,examples/06.Synthesis/WaveFolder<br>flash,%,examples/06.Synthesis/WaveFolder<br>RAM for global variables,%,examples/06.Synthesis/WavePacket_Double<br>flash,%,examples/06.Synthesis/WavePacket_Double<br>RAM for global variables,%,examples/06.Synthesis/WavePacket_Sample<br>flash,%,examples/06.Synthesis/WavePacket_Sample<br>RAM for global variables,%,examples/06.Synthesis/WavePacket_Single<br>flash,%,examples/06.Synthesis/WavePacket_Single<br>RAM for global variables,%,examples/06.Synthesis/Waveshaper<br>flash,%,examples/06.Synthesis/Waveshaper<br>RAM for global variables,%
STMicroelectronics:stm32:GenF1:pnum=BLUEPILL_F103C8,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0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,N/A,N/A,N/A

@tomcombriat
Copy link
Collaborator Author

tomcombriat commented Jan 20, 2025

Alright, sorry for the delay since the original issues (but I did not used to own an ESP32 ;) but this should update the ESP32 port to the new API.

Seems to work well here (tested on both an ESP32 and ESP32-S3) but testing is always welcome, so mentioning thereafter people that might be concerned: @sensorium , @kicetwigs , @thomasfredericks , @MatteoHMarangoni , @1183747933 , @dietervandoren , @amiel .

Documentation is done (I think) but will only be published once merged.

@tomcombriat tomcombriat marked this pull request as ready for review January 20, 2025 20:32
@amiel
Copy link

amiel commented Jan 20, 2025

Thank you so much!!!!!

As of yesterday, this was working well for me using an esp32 (just plain original esp32) with:

#define MOZZI_AUDIO_MODE MOZZI_OUTPUT_I2S_DAC
// and one custom pin
#define MOZZI_I2S_PIN_WS 25

I'm using headphones with the PT8211, which is not recommended, so it's hard to say if the sound is good.

I will test again tomorrow with the latest changes.

@tomcombriat
Copy link
Collaborator Author

tomcombriat commented Jan 20, 2025

@amiel Thanks for this! Really appreciate some feedback! I think, for a PT8211, you should also have (and 25 should be the default for WS):

#define MOZZI_I2S_FORMAT MOZZI_I2S_FORMAT_LSBJ

@amiel
Copy link

amiel commented Jan 20, 2025

Ohhhh.Thank you, I'll try that out!

@amiel
Copy link

amiel commented Jan 20, 2025

Have you ever used a MAX98357A? That was my initial attempt and I never got it to sound right (but the PT8211 worked out-of-the-box with mozzi 1). I'm wondering if maybe I just needed to do something like MOZZI_I2S_FORMAT_LSBJ.

@tomcombriat
Copy link
Collaborator Author

tomcombriat commented Jan 20, 2025

@amiel

That was my initial attempt and I never got it to sound right (but the PT8211 worked out-of-the-box with mozzi 1)

Was that with an ESP32?

There are two (at least…) formats to I2S: standard, and LSBJ (and variants on each -_-), PT8211 is LSBJ but most DAC are on the standard. If I got the previous port okay, the I2S was configured for LSBJ and not modifiable to the other format which would explain what you observed. In order to keep coherency with the other I2S ports (especially RP2040) I changed the default format to plain (which should work with the MAX):

the MAX98357A follows standard I2S timing by allowing a delay of one BCLK cycle after the LRCLK transition before the beginning of a new data word

I have not tested though (I kind of remember now that I might have one around…) and the signals on the scope look a lot like standard I2S.

@amiel
Copy link

amiel commented Jan 21, 2025

Yes, it was with an ESP32.

the I2S was configured for LSBJ and not modifiable to the other format which would explain what you observed.

This is really good to know. I will try the MAX98357A again, as I would prefer to use that for my project anyway. I'll let you know how it goes if that would be helpful.

@amiel
Copy link

amiel commented Jan 21, 2025

FYI: This is working perfectly with the MAX98357A (no LSBJ). Thank you so much!

@tomcombriat
Copy link
Collaborator Author

@amiel Thanks for the feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment