Skip to content

embedded-kiddie/CYD_MP3Player

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CYD MP3 Music Player

MP3 music player for Cheap Yellow Display

Library & Sketches

CYD_Audio is an ESP32 I2S audio library by Piotr Zapart, written for PlatformIO.

The version included here has been modified for Arduino IDE so that it can be installed into the libraries folder in your Arduino sketchbook folder.

This is a simple sketch that demonstrates how to use the CYD_Audio library. It plays a specified audio file stored on the SD card.

CYD28_audio.[ch] defines helper functions for creating an instance of the CYD_Audio class on Core 1, making it easy to create a GUI loop that runs on Core 0.

This example creates a task named audioplay on core 0 with a predefined set of commands, and allows core 1 to send messages to it to control playback, volume adjustment, etc.

This sketch is an example of applying the CYD_Audio wrapper class named MP3Player to scan the audio files on the SD card, create a playlist, and control continuous playback in a set order.

CYD MP3 Music Player

This version features a rich LVGL GUI that allows you to play and manage audio files, add favorites, and shuffle playback.

The MP3Player class has been extended to meet the requirements of UI components.

Hardware modification

Although CYD has a speaker terminal, the sound quality is quite poor, so if you want to listen to music properly, you will need to improve the hardware.

Use Internal DAC and Onboard Amplifier

The circuitry around the onboard audio amplifier (SB8002B) requires to adjust the amplifier gain by changing the associated resistors.

ILI9341/ST7789 and amplifier IC SC8002B schematics

ILI9341 vs ST7789

The following links are good resources to help you solve this problem.

Even when I changed the resistors of ST7789 to the same as ILI9341, the high frequencies were crushed and the sound became rough, making it unsuitable for listening to the music, so I ended up doing the following:

ILI9341 modification

Decrease the resistance value of R9

Decrease the resistance value of R9

ST7789 modification

Replace resistors R8 and R9
Resister Before modification After modification
R7 0 Ω 0 Ω
R8 0 Ω 22 KΩ
R9 68 KΩ 10 KΩ

440 Hz/sine wave sound test

Oscilloscope observation results

ILI9341 vs ST7789

ILI9341 vs ST7789

The results show that the audio amplifier IC SC8002B is not suitable for music playback.

Use External DAC and Amplifier

The links below explain how to connect external DAC modules.

In this case, please define the symbol USE_I2S_DAC and each pin appropriately in audioTask() in CYD28_audio.cpp.

void audioTask(void *parameter)
{
    // if using the I2S mod, RGB led is removed, I2S pinout defined in platformio.ini file
#ifdef USE_I2S_DAC
    audio.begin();
    audio.setPinout(I2S_BCK_PIN, I2S_LRCLK_PIN, I2S_DIN_PIN);
#else
    audio.begin(true, I2S_DAC_CHANNEL_LEFT_EN);
#endif
...
}

Special Thanks

About

MP3 music player using internal DAC for Cheap Yellow Display

Resources

License

Stars

Watchers

Forks

Packages

No packages published