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

Getting started issues with ai esp32 audio kit 2.2 #23

Open
rhaamo opened this issue Mar 8, 2022 · 11 comments
Open

Getting started issues with ai esp32 audio kit 2.2 #23

rhaamo opened this issue Mar 8, 2022 · 11 comments

Comments

@rhaamo
Copy link

rhaamo commented Mar 8, 2022

Hello,

Just got an Ai ESP32 Audio Kit V2.2 and flashed it with latest tarball from the releases but I have some issue.

  • Nothing out of the earphones TRS jack
  • Line in from TRS jack is not handled ?

No matter what board I use in the selector, nothing got out, CSPOT does connect but same, nothing out.

Any ideas to debug thoses issues ?

EDIT, logs when setting to board ai thinker AC101:

I [http] HTTPModule.cpp:50: Body: {"configSchema":{"sda":{"tooltip":"I2C - SDA","type":"number","value":"33","defaultValue":"0"},"ws":{"tooltip":"I2S - WS / LRCLK","t}
I [http] HTTPServer.cpp:296: Publishing event
I (481382) I2S: DMA queue destroyed
I (481392) I2S: APLL expected frequency is 22579200 Hz, real frequency is 22579193 Hz
I (481392) I2S: DMA Malloc info, datalen=blocksize=2048, dma_buf_count=8
I [core] Core.cpp:194: No data
D [core] Core.cpp:198: Free memory: (psram) 3040867, (internal) 41433
I [i2s] I2SDriver.cpp:47: Setting pins 0 27 26 25
I (481422) I2S: I2S0, MCLK output by GPIO0
I [esp32] I2CDriver.cpp:9: Installing I2C driver
I [i2c] I2CDriver.cpp:62: Read / Write failed!
I [i2c] I2CDriver.cpp:34: Write failed!
I [i2c] I2CDriver.cpp:34: Write failed!
I [i2c] I2CDriver.cpp:34: Write failed!
I [i2c] I2CDriver.cpp:34: Write failed!
I [i2c] I2CDriver.cpp:34: Write failed!
I [i2c] I2CDriver.cpp:34: Write failed!
I [i2c] I2CDriver.cpp:34: Write failed!
I [i2c] I2CDriver.cpp:34: Write failed!
I [i2c] I2CDriver.cpp:34: Write failed!
I [i2c] I2CDriver.cpp:34: Write failed!
I [i2c] I2CDriver.cpp:34: Write failed!
I [i2c] I2CDriver.cpp:34: Write failed!
I [i2c] I2CDriver.cpp:34: Write failed!
I [i2c] I2CDriver.cpp:34: Write failed!
I [i2c] I2CDriver.cpp:34: Write failed!
I [i2c] I2CDriver.cpp:34: Write failed!
I [i2c] I2CDriver.cpp:34: Write failed!
I [i2c] I2CDriver.cpp:34: Write failed!
I [i2c] I2CDriver.cpp:34: Write failed!
I [i2c] I2CDriver.cpp:34: Write failed!
I [i2c] I2CDriver.cpp:34: Write failed!
I [i2c] I2CDriver.cpp:34: Write failed!
I [i2c] I2CDriver.cpp:62: Read / Write failed!
I [i2c] I2CDriver.cpp:34: Write failed!
I [i2c] I2CDriver.cpp:62: Read / Write failed!
I [i2c] I2CDriver.cpp:34: Write failed!
I [http] HTTPModule.cpp:64: Posting the event
D [core] Core.cpp:113: Got event
I [http] HTTPModule.cpp:48: Responding to connection
I [http] HTTPModule.cpp:49: Status: 200
I [http] HTTPModule.cpp:50: Body: {"configSchema":{"sda":{"tooltip":"I2C - SDA","type":"number","value":"33","defaultValue":"0"},"ws":{"tooltip":"I2S - WS / LRCLK","t}

same write failed with ES8388 ai tinker board.

According to https://github.com/Ai-Thinker-Open/ESP32-A1S-AudioKit#hardware my A1S has a ES8388

@rhaamo
Copy link
Author

rhaamo commented Mar 8, 2022

Apparently the v2.2 can have I2C on different pins... Ai-Thinker-Open/ESP32-A1S-AudioKit#26 (comment) because of two versions of the ESP32 module...

  • SDA: 18
  • SCL: 23

That does makes the write failed goes away, but still no audio output, wondering if I2S is routed differently, or the headphones are on a different setting than "amp" out ?

EDIT (again), tried with dac_config: model=ES8388,bck=27,ws=25,do=26,sda=33,scl=32,i2c=16
so I guess WS=25, BCK=27, MCLK=0 and DATA/DIN = 26, but no audio
connected a small 8ohm speaker to L or R, no output, even with headphones jack out

@rhaamo
Copy link
Author

rhaamo commented Mar 8, 2022

Got the artifact from the latest master CI build (feat MA12070p driver, after that the builds fails)

Selected the board "AI-Thinker Audio board (A1S ES8388)" again and now it works ? idk what have changed between the two builds but well...

Remain things are:

  • heaphones jack has no output
  • is line-in passthrough supported or planned ?

@feelfreelinux
Copy link
Member

Hi, thanks for trying this out! The A1S chip is honestly a mess - I was able to count 3 different versions of those chips with different DAC (AC101 or ES8388) and even different I2S pinouts. I have looked into the chip you most likely are using, and seems like it requires two extra registers (0x30 and 0x31) to have the volume written to in order to make it work. I have pushed the changes on newest master, will try to fix the build issue.

e26ee70

Line-in support will come soon (currently planning t release along with multiroom and UI redesign). It will route all the audio from the aux in port, apply internal DSP and output on DAC.

Thanks for trying out euphonium btw! Feel free to reach out to me on @feelfreelinux:matrix.org with questions and feedback!

@feelfreelinux
Copy link
Member

Build fail resolved, corrupt cache issue.

The line-in support will come around the time when im able to assemble my board with MA12070P and WM8782 ADC. All part should be easily sourceable :)

@rhaamo
Copy link
Author

rhaamo commented Mar 8, 2022

Ahah yes from what I have gathered in various links it's a mess, and it's even from a genuine board...

I have fetch the latest artifact and I can confirm that the headphones jack works ! But audio volume has no effect.

To plan if possible would be to be able to toggle headphones or amp output (like using both or only one of the two)

Thanks for planning line-in!

@HeikoGr
Copy link
Contributor

HeikoGr commented Mar 10, 2022

The toggle could be done via GPIO_NUM_39 as far as i know (https://github.com/pschatzmann/arduino-audiokit has got it working). it's on my todo, if @feelfreelinux is not faster then me...

@HeikoGr
Copy link
Contributor

HeikoGr commented Mar 10, 2022

i have an ai thinker board v2.2 3478 with ESP32-A1S v2974
Headphone Jack: working (with Volume control)
LineOut: working (with Volume control)

@jwktje
Copy link

jwktje commented May 21, 2022

I have a V2.2 with v2974 but setting volume on the headphone seems to have no effect.
It works fine but the volume is very low. How did you manage to get it to work @HeikoGr ?

@HeikoGr
Copy link
Contributor

HeikoGr commented May 23, 2022

sorry for late reply.
it works for me (same board) - but i compiled euphonium from the latest sources for myself.
did you use a release version?

@nvschilleman
Copy link

i have an ai thinker board v2.2 3478 with ESP32-A1S v2974 Headphone Jack: working (with Volume control) LineOut: working (with Volume control)

Do you mind sharing your binaries? I also have a v2974 board but I do not manage to get this to work? Also, did you change DIP settings on the board?

@HeikoGr
Copy link
Contributor

HeikoGr commented Jul 21, 2022

i think i haven't change the dips, its: on on on off off
you don't need my binary, as feelfreelinux has published release 0.3.0 with the most recent code.
i just tested it succesfully and can control the volume on lineout and headphone.

i only set the preset for the board under: "System configuration" > "Hardware" to "AI-Thinker [...] ES8388" and "apply changes"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants