ItsyBitsy RP2040 vs Feather RP2040 audiomixer | MP3Decoder

Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
JohnBottle
 
Posts: 23
Joined: Sat Apr 09, 2022 2:32 pm

ItsyBitsy RP2040 vs Feather RP2040 audiomixer | MP3Decoder

Post by JohnBottle »

Is there any reason why the ItsyBitsy RP2040 would not be as good as the Feather RP2040 regarding mp3 decoding and playback using audiomixer??

I've been trying for hours - using parts of the code found here:

https://learn.adafruit.com/walkmp3rson- ... alkmp3rson

I set the buffer_size=32768 - which finally let the mp3 files play:

Code: Select all

mixer = audiomixer.Mixer(voice_count=2, sample_rate=44100, channel_count=1,bits_per_sample=16, samples_signed=True, buffer_size=32768)
But they are so crackly, and always a loud "pop" when first playing.

If I use MP3Decoder on it's own, like this:

Code: Select all

a = AudioOut(board.A0)
mymp3 = MP3Decoder(open("sound.mp3", "rb"))
a.play(mymp3)
There is a loud pop on first, play, but it sounds ok.

As soon as I try and use audiomixer, the sound becomes crackly...

Code: Select all

a = AudioOut(board.A0)

mixer = audiomixer.Mixer(voice_count=2, sample_rate=44100, channel_count=1,bits_per_sample=16, samples_signed=True, buffer_size=32768)


ffile1 = MP3Decoder(open("sound.mp3", "rb"))
ffile2 = MP3Decoder(open("sound2.mp3", "rb"))

a.play(mixer)

mixer.voice[0].level = 0.5
mixer.voice[1].level = 0.5

mixer.voice[0].play(ffile1, loop=True)
mixer.voice[1].play(ffile2, loop=True)
Is this a limitation of the ItsyBitsy vs Feather??? Something to do with??

Code: Select all

from audiopwmio import PWMAudioOut as AudioOut # For ItsyBitsy 
from audioio import AudioOut # For Feather?
For playing mutltiple mp3 files with mixer, and good quality audio, what is best (lowest-cost) adafruit chip with 8mb of Flash like ItsyBitsy. Why does feather only have 2mb?

Thanks for help!

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: ItsyBitsy RP2040 vs Feather RP2040 audiomixer | MP3Decoder

Post by mikeysklar »

Are you using the example sound files from the walkmp3rson project? If the encoding were a little off that would create a conflict with the mixer settings.

https://learn.adafruit.com/walkmp3rson- ... le-3126952

The mixer voice is at 0.5 in your code and only 0.15 in the example code. Lowering that might help.

Code: Select all

 mixer.voice[0].level = 0.15
The popping should stay surprised as long as the mixer is holding a I2S line. The buffer should be covering up the additional noise caused by activity on the SPI / I2C bus. You can play with the buffersize.

The RP2040 with 8MB is the best chip for this kind of playback today.

Locked
Please be positive and constructive with your questions and comments.

Return to “Itsy Bitsy Boards”