Reading mp3 file via UART ?

Go To Last Post
12 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Guys,
How to read mp3 file via uart on avr ( I use ATMEGA128) ?
Any ideas or concerns will be appreciated,
thanks

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Why would an MP3 file be any different than any other data transfer? You send a byte; then another byte; ... Rinse and repeat.

Or are you referring to an MP3 player? Can you sustain a data rate over UART to get a smooth playback? What exploration have you done on that? jesper's YAMPP? Elm-Chan?

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I guess a 128K bps MP3 file could be sent over a 230K bps serial connection. The faster the avr clock the better. Should use a 20MHz model rather than a 16MHz model. Less percent cpu used in the interrupt handler.

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Write bytes to the uart in the source machine in the file's natural order.

Read them from the uart in the destination machine and save them to some memory in natural order.

Done with "reading mp3 file via uart". That says nothing, of course, about how you use it on the destination machine.

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

No help on the other forums? So you tried here again.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Silly question but once you have read your MP3 data over UART what do you plan to do with it? You weren't thinking that the AVR could play it were you? It can't unless you add external silicon support such as one of the MP3 playing DSP's from VLSI:

http://www.vlsi.fi/en/products.html

Realtime decode of MP3 takes about a minimum of 50MIPS, more if the encoding rate is high. An AVR peaks at about 32MIPS (Xmega).

(and, of course "MIPS" is a variable thing - one instruction on a RISC AVR is not necessarily as "powerful" as an instruction on a processor with wider data paths, cache, pipelines, FP unit and so on)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have VS1003...so after reading I will send the file to this chip to decode...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,
Welcome to microcontroller programming.

The original message is unclear. A file is a named collection of bytes. Bytes are what a UART sends from one computer to another. So, yes, a UART can send and receive MP3 files.

But and it's a Spinal Tap sized big but...

UARTs are designed for sending small messages and slow data streams between computers and peripherals like printers. It would take hours to send a standard pop tune MP3 between two computers using a UART.

May I inquire? Are you trying to build a do-it-yourself MP3 player? And, per chance, use this activity as an educational project to learn how to 'do' microprocessors?

If yes, allow me to suggest just buying an eBay cheap MP3 player. You can explore its various signals and systems while actually using it. Or at least until it breaks from something like an accidental short due to 'circuit-bending' blind wire poking.

MP3 players are complex. Chances are good that it will be an expensive lesson to start learning experiences with really simple projects. In that area, allow me to suggest making a TDA5767 FM radio from a break-out-board module instead of an MP3 player. It has a much-greater chance of being a successful and useful project to learn AVRs.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

May I inquire? Are you trying to build a do-it-yourself MP3 player?

He said he DOES have a VS1003 so surely the answer to that question is obvious?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

We're still not clear on where the file is stored, who sends it via uart, who receives it and how it gets to the mp3 chip.

Success will depend on the required datarate either burst or sustained, buffering, flow control and error management. Answer those questions and you'll be able to determine if it has a chance of flying.

If the intention is to build a remote mp3 player, then it can be done cheaply with a $20 router and $3 sound dongle.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'd imagine that driving a VS1003 could be an interesting project but I would do it from high bandwidth storage. Only introduce the UART bandwidth bottle-neck when the basics are working.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A brief google suggests you'll need to run the serial very fast (>250kbps) so that suggests you'd be getting close to the bleeding edge. Ethernet would be easier.