-
-
Notifications
You must be signed in to change notification settings - Fork 242
It's not working
The examples have been tested, but there can still be many reasons why you might fail.
Make sure that you use an actual version of the Arduino core for your processor. In Arduino you can check the version in the Tools -> Board Manager. For the ESP32 the current version is 2.0.13 and if you are still using 1.0.6 you are several years behind!
Also make sure that you use the latest version of all libraries!
Quite often, total beginners start with the most complicated sketch and they wonder what to do if something is not working!
I only can discourage you to do this: You need to get to know the board and the individual components first. The best way is to start with the easiest sketch possible and test the input and the output and each processing step separately: Only then you can be sure that things will work, if you put them together!
So if something is not working, take one step back and figure out how you can find the root cause of your problem. The most frequent errors are:
-
Microcontrollers have only a limited amount of RAM: Verify that you are not running out of available RAM! You can try to use a processor with more RAM or with PSRAM.
-
If your sketch does not fit into the available program memory of an ESP32 you just forgot to set a proper partition scheme in the Arduino Tools menu!
-
Audio processing is all about providing the audio data fast enough, so make sure that you don't have any processing steps that prevent this. Otherwise try to isolate the audio in it's separate task.
- You forgot to change the log level to Warning or Error
- You introduced some delays which causes the audio to underflow. You are pulling your own leg if you add print statements in the loop...
-
Wiring of the components does not correspond with the pins defined in the software.
-
You are using resources (pins, SPI, Wire) that is already used by the audio processing. E.g. the AudioKit uses SPI to communicate to the SD driver and Wire to setup the audio codec chip.
-
the SD is not working because of the above or an improper formatting or you did not install the right library or you just use a file that does not exist.
-
Wifi does not connect e.g. because of a wrong ssid, password or insufficient available RAM
-
Your own sketch is inconsistent and you update variables that are not used
-
You forgot to set up the audio component correctly
You can change the log level to Info or even Debug, to see in detail what the application is doing. Sometimes it can also be a bug in the library, that might have been corrected already, so try to use the latest version. Try to proof first that the basic functionality is working w/o my library!
To test the output I suggest that you start with a sine generator that sends the output to the audio sink. Here you can experiment by
- changing the audio sink
- change the audio parameters: sample_rate, channels, bits_per_sample
- change the i2s format
- etc
Please note that if you change the bits_per_sample to 32, you also need to change the relevant template parameters from <int16_t> to <int32_t> or bad things will happen!
To test the input I suggest that you start with a sketch that visualizes the audio waves: check if you get valid audio or just noise and get to know the parameters! I recommend to record a sine wave e.g. from here and to display it on the Serial Monitor: you should see a sine wave there as well!
If you are unsure how sound wave should look like, you can find a picture in the introduction. You can also try out the built in WAV server, so you can listen to the sound on your PC.
Some microphones produce noise on one channel using 16 bits, that can be filtered out. But here again you need to look at the data to figure out on which channel you have the problem, and after applying the filter if it has been resolved! Above all check the available WIKI documentation and look at the already answered issues/discussions.
There are plenty of resources on the internet that teach you how to
- analyze the exception trace: Additional Info
- work with SD Cards and to read and write files
- use Wifi
And often there are also example sketches in Arduino that let you test the functionality.
If you are stuck: Google is your friend!