sensorium / Mozzi

sound synthesis library for Arduino
https://sensorium.github.io/Mozzi/
GNU Lesser General Public License v2.1
1.05k stars 184 forks source link

ESP32 support #58

Closed JacobErnst98 closed 3 years ago

JacobErnst98 commented 5 years ago

Thanks for the ESP8266 Support but the ESP32 is better in every manner.

joknjokn commented 5 years ago

Hi. Do you know how to make it work with ESP32? Or maybe a similar library with ESP32 support? And I agree. ESP32 is dual core and more, so it would be so great to have support for this.

mangtronix commented 5 years ago

Has anyone made progress on this? Thanks.

tfry-git commented 5 years ago

Dear folks. Support for new architectures depends on someone working with those architectures to care enough to invest somewhere between 10 and 20 hours of work. Personally, I do own one ESP32, but I'm using it for a different project, and the ESP32 is a bit too expensive to have a couple, just in case. Yet more importantly, I do not have a personal use for Mozzi on ESP32, currently.

You can either: a) Try to do this yourself. It is not really all that hard. Since Mozzi has been ported to several different architectures, already, you should be able to figure out the basic steps, involved. One of the hardest parts is testing, actually. b) Offer a bounty for this, hoping somebody else will do the work for you.

mangtronix commented 5 years ago

I have basic sound output working on ESP32 using the ESP8266Audio library (https://github.com/earlephilhower/ESP8266Audio). That library is licensed GPL, so I believe it's not possible to integrate with Mozzi because the Mozzi Creative Commons license is not compatible. Is there any possibility of making Mozzi dual license with a GPL compatible license?

zircothc commented 5 years ago

Hello. I ported Mozzi to Arduino Due with a very good result. It was really easy. Now I've ported Mozzi to ESP32 I2S DAC (PT8211) but audio output is a bit dirty. May be timer issue. I'm very busy next days and cannot test it . If somebody want it, library patched files are in zip attached included DUE patch (DueTimer library needed to run). Mozzi_ESP32_and_DUE_files.zip

tobozo commented 5 years ago

looks like another angle https://github.com/bitluni/ULPSoundESP32

mangtronix commented 5 years ago

Maybe he needs that for his application (I didn't watch the video) but I have a hard time believing that sending audio to the DAC via DMA (the usual way on ESP32) isn't the right answer. There's not that much needed for an audio driver... basically you need to set up the I2S and then fill a ring buffer with the audio samples. The samples in the ring buffer can be sent to the DAC in the background, clocked by the DAC itself.

On Thu, Jun 20, 2019 at 3:53 PM tobozo notifications@github.com wrote:

looks like another angle https://github.com/bitluni/ULPSoundESP32

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/sensorium/Mozzi/issues/58?email_source=notifications&email_token=AAAITLWTA3M2RZWMISCETJ3P3ODWFA5CNFSM4F3UG5QKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYFPK7Y#issuecomment-504034687, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAITLVLELLBUJVLACFSEJDP3ODWFANCNFSM4F3UG5QA .

tobozo commented 5 years ago

I've only had acceptable sound using an external DAC or the ULP, the Tetris demo is very convincing

wyan commented 4 years ago

Did anyone manage to do some progress on ESP32 support lately?

mangtronix commented 4 years ago

I got sound output working using this library (https://github.com/earlephilhower/ESP8266Audio), but unfortunately the licenses are not compatible so I can't release the code. In the end it wasn't toooo hard... basically you just send the samples to the audio library and you can cut out a lot of the more esoteric Mozzi code.

wyan commented 4 years ago

Thanks! I'm not as familiar with the internals of Mozzi as I'd like, so I'm not sure I follow you. Perhaps posting a code patch without merging it could be a way to respect both licences? That way it's the end user who's applying the patch and that's ok as long as they are not distributing the code or a product derived from it?

zircothc commented 4 years ago

Did anyone manage to do some progress on ESP32 support lately?

Here you can find patched files to support ESP32 with a very good sound. I'm not using earlephilhower code. https://groups.google.com/forum/#!topic/mozzi-users/qw2nIkcVaZE

tfry-git commented 3 years ago

ESP32 is now supported in the main lib with several output modes.