CYD + ESPHome, media player?

Hi there!

I am building a device to control HA through ESP32-2432S028R (a.k.a CYD for “Cheap Yellow Display”). Theoretically, you can connect a speaker to the GPIO26 but i cannot make it work with ESPHome.

Has anyone achieve this?

Thanks in advance!

Esphome’s audio component only works over i2s

Thanks! I’ve tried with i2s_audio component, but i cant find the right code :sweat_smile: Any idea?

You’ll need to give more info. What i2s device are you trying to attach?

Thanks @nickrout

I am using this ESP32-2432S028R board. As you can see, there is a 2P 1.25mm JST connector to connect a speaker. It’s controlled with GPIO 26 (more info here).

I also find this code in the community around CYD, but it does not work.

i2s_audio:
  i2s_lrclk_pin: GPIO25
  i2s_bclk_pin: GPIO26

media_player:
  - platform: i2s_audio
    name: ESPHome I2S Media Player
    dac_type: internal
    mode: stereo

First, GPIO25 it is been already used by the display. To compile the code i modified it this way:

i2s_audio:
  i2s_lrclk_pin:
      number: GPIO25
      allow_other_uses: true
  i2s_bclk_pin: GPIO26

This way i can compile the code, but i just hear noise through the speaker.

I am not sure what’s the right way to use the i2s_audio in this case.

Thanks again!

I’m also trying to get i2s_audio working in this board but only got cracking noises out of the speaker. I tried to remove touch screen code but it did not help. I cannot understand how the same pin could be used with touch screen and speaker.

Has anyone got this working?

@amuse, If It helps, i ended using It as a buzzer.

Are you able to share if you got this working nicely?

I am afraid i didn’t

Thats a shame… While no audio did you manage to get the screen and touch working?

I did!