Espressif IDF + ADF + ESP32 Audio Kit (AIThinker) - Page 1
Forum section: electronics / general

author: paulca
author_rank: Super Contributor
timestamp: October 26, 2022, 10:28:26 am
content: First I tried to use the ADF directly in Windows. Knowing that was a bit optimistic I went back to try and basic IDF framework first. Still on Windows it was the usual nightmare setting up the whole GNU/CMake environment and paths etc.Took an hour out to clear some disk space, found 105Gb of docker log files and used the space to create a new Linux VM. 4 or 5 commands later and I had a working Espressif IDF environment. Hello World and Blinky flashed perfectly.I was very encouraged.That all ended when I started to try and use the ADF (Audio Dev FW) with the AI-Thinker specific peripherals. It was then that I discovered that the IDF/ADF eco-system is a bit 'wild west'. There is a lot of code shift, but things like documentation and examples are left to fend for themselves. So most of the examples don't work, don't compile or have other issues.Of course with cheap chinese dev boards there are always catches. It turns out there are multiple versions of the ESP32-A1S MCU module it uses. Some have an AC101 codec chip, some have the ES8288 codec. I have V2.2 the older one which is meant to have the older AC101 version, but all I could get was CODEC Init Failed. I used about 3 different board definition articles on WWW and still failed. Then I stumbled on a picture of the modules and while mine was soldered to a board and I could not see the backside pin lablels, it did have a label in the corner of the antenna PCB extension. That denotes it as the newer module with the ES8388... installed on a V2.2 board.So after creating a board defintion and merging the two approaches together and I did get the "BT Sink" example to compile and run, after fixing the BT mode from BLE only to classic with A2DP.The downside is... the codec just makes modulated hissing noises. Connecting the phone BT audio to it works, I can hear the noise gate popping off and on and the tonality of the noise changes with the audio output.This suggests it's working, but has the wrong parameters or sample freq/clock etc. for that DSP. It's likely I am using a config struct based on the AC101 with the ES8288. However I have looked through 3 different examples for both AC101 and ES8288 and it appears the config lines are identical, just a standard 44.1k x2 x16.The Espressif IDF code base is a beast, but when you look into the supported functionality available you can see why. They have HAL drivers and code in there for everything including the kitchen sink. As to how much of it works without some TLC is another story. I can see me, like most people, forking the repo so I can maintain my own "make it work for me" changes and merge the incoming changes. It may also come to the expesnive (disk space) option of having several different versions checked out. Certainly I know that different modules and different libraries are only supported on some IDF versions and not others.Lots of fun.Anyone else been down the Espressif route? Any thoughts, opinions? I mean, is it really worth it over, say the Arduino framework version? Would it be better to stick to the arduino frameworks and only venture to the Espressif libs/code when I really need it?As a brand of MCU they do have a large chunk of the IoT Wifi/BT MCU market cornered. I'm even suspicious that is why STM did not go with Wifi on their new line. Probably not wanting to come into direct conflict with the ESP32 market and focus efforts else where.With them moving to RISC 5 and at least most of their documentation ported to English, it could be a fairly bright future for the next 5 years or so. So I don't think it's investing time into a failing eco-system... if only it were more tidy and releases a little more polished and tested.

author: paulca
author_rank: Super Contributor
timestamp: October 26, 2022, 10:32:12 am
content: As a side point. I don't have high hopes for the ESP32-1AS for audio. I have seen a lot of posts about noise, particularly when using Wifi and BT.I suppose putting the codec chip under the RF can, right beside the MCU, BT and Wifi radios is not such a good idea.I did get a dedicated DAC and ADC to play with, so if it turns out the A1S internal codec is pants, I have options, which actually simplify things.