I am implementing a very simple MP3 player on an ARM architecture
using a CF harddisk. To safe power I am reading as much data as
possible in one time from the harddisk, so it will goto standby mode.
What I would like to do is this:
Load as much possible MP3 data from multiple files in a 24MB cyclic buffer.
Start decoding and playing. Playing is done using double buffered DMA.
When 16MB of data is decoded and played, 16MB is read again from
harddisk, overwriting the decoded and played data. During loading of
these 16MB the decoding and playing continues of the 8MB that's still
in the cyclic buffer. This is repeated all the time.
I can't use MAD's SYNC mode for this, because the decoder "hangs" and
at some time the buffer is empty. I don't want to use multi threading,
as I don't have an OS at all. So maybe I have to use ASYNC mode???
Then the decoder directly returns, so I can do some other things like
disk reading while decoding. But I can't find any simple example how
to use ASYNC mode. When the decoder return I need some way to "kick"
the decoder again, so it does a little decoding and then returns
again. I don't know how the messaging system works of MAD in ASYNC
Does someone have a simple example for me?