Skip to content

MP3 (i2s or else) playback on rp2040 #1854

Answered by Stass48
Stass48 asked this question in Q&A
Discussion options

You must be logged in to vote

The code above doesn't work. Here's the working code. You need to solder a jumper on the PCM5102 module (shown in the photo) and power the module from 5 V. To avoid jerks during playback, you need to increase the SPI speed, as shown in the code. Also, use overclocking up to 200 MHz. Under these conditions, MP3 320 kbps Stereo is played.

#include "AudioFileSourceSD.h"
#include "AudioGeneratorMP3.h"
#include "AudioOutputI2S.h"

AudioGeneratorMP3 *mp3;
AudioFileSourceSD *file;
AudioOutputI2S *out;

// SPI0 for internal SD card
const int INT_SD_SCK = 18;
const int INT_SD_MOSI = 19;
const int INT_SD_MISO = 20;
const int INT_SD_CS = 21;

// You may need a fast SD card. Set this as high as it w…

Replies: 2 comments 8 replies

Comment options

You must be logged in to vote
7 replies
@DoomHammer
Comment options

@maxgerhardt
Comment options

@DoomHammer
Comment options

@DoomHammer
Comment options

@DoomHammer
Comment options

Comment options

You must be logged in to vote
1 reply
@Stass48
Comment options

Answer selected by Stass48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #1853 on November 29, 2023 15:59.