Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 19:17 04 May 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Picomite I2S possible?

Author Message
atmega8

Guru

Joined: 19/11/2013
Location: Germany
Posts: 712
Posted: 07:03am 07 Apr 2023
Copy link to clipboard 
Print this post

Dear mmbasic friends.
unfortunately I have no idea how to try it.
Would it be possible to control an I2S device like the cheap and popular
MAX98357 directly via mmbasic?
For an MP3 player, or even an Internet radio?

Your thoughts?

THX
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8592
Posted: 07:12am 07 Apr 2023
Copy link to clipboard 
Print this post

The RP2040 can't do real time 44100Hz stereo mp3 decoding and certainly wouldn't be able to decode internet radio in real time. The processor just isn't fast enough.
I2S is apparently possible through using PIO but haven't tried it. The RP2040 doesn't have dedicated I2S H/W
 
atmega8

Guru

Joined: 19/11/2013
Location: Germany
Posts: 712
Posted: 07:31am 07 Apr 2023
Copy link to clipboard 
Print this post

Here some German guy’s who implemented I2S with PIO….
https://www.elektronik-labor.de/Raspberry/Pico13.html

I2S with PIO

Hard stuff for men  
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3662
Posted: 08:35am 07 Apr 2023
Copy link to clipboard 
Print this post

I found some other code but it uses DMA and more cores than are free with MMBasic, so not realistic.

(Can't hack German, sorry.)

Either way, doable, but not with MMBasic there as well, I suspect.

John
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8592
Posted: 08:44am 07 Apr 2023
Copy link to clipboard 
Print this post

As I said above I2S is doable - that is no issue. Decoding, in real time, even the lowest standard for internet radio on a RP2040 is almost certainly not. The code I use for MP3 conversion on the CMM2 and MMX will not run on the RP2040 and that code is about as lightweight as you can get for mp3. AAC decoding has no chance whatsoever.
This is nothing to do with MMbasic. When I tried to get mp3 decoding working I allowed it to use any resource it wanted but still no good - and I have tried now three times.
NB: this is proper mp3 - 44100Hz stereo. There is code out there that can handle 8KHz/16kHz mp3 but that is about as much use as a chocolate teapot
Edited 2023-04-07 18:50 by matherp
 
atmega8

Guru

Joined: 19/11/2013
Location: Germany
Posts: 712
Posted: 10:31am 07 Apr 2023
Copy link to clipboard 
Print this post

When we have amp3 File on an SD card, and send it via I2S to a MAX 98357 Device or similar, then there is no decoding on the RP2040 necessary?
Decoding will happen in this MAX98357 Chip?
Am I right?
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8592
Posted: 11:01am 07 Apr 2023
Copy link to clipboard 
Print this post

  Quote  
Decoding will happen in this MAX98357 Chip?


No. The decoding takes place before the I2S comms
 
LucV

Regular Member

Joined: 19/02/2023
Location: Netherlands
Posts: 62
Posted: 02:01pm 07 Apr 2023
Copy link to clipboard 
Print this post

If it is only playing MP3 files on an SD card why not use the DF-Robot MP3 player card. Easy to interface, small footprint and SD-card on board.

No good for internet radio but excellent as a stand alone mp3 player.
Can get interfaced with the Raspberry Pi Pico.

Available (here in the Netherlands) for about 4 Euro.

DFRobot MP3 player
Luc's tech Blog
 
mozzie
Regular Member

Joined: 15/06/2020
Location: Australia
Posts: 68
Posted: 03:19pm 07 Apr 2023
Copy link to clipboard 
Print this post

G'day, might be a bit off track here...

The VS1053 can do mp3 decoding if you can get the data to it quick enough and provides audio output, have not tried with a Pico but the MM+ can do SD-card to VS1053 for mp3 and almost M4a (audio) using MMbasic to shuffle the data, someone with better programming skills than me and a c-sub should have more success  

Not sure about internet radio with the WebMite? challenge anyone?

Regards,
Lyle
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024