Rockbox mail archiveSubject: Re: DMA Operation???
Re: DMA Operation???
From: George Styles <george_at_ripnet.co.uk>
Date: Fri, 18 Oct 2002 13:42:03 +0100
Thanks for the quick answer :)
i still dont fully understand how this operates. Can you tell me if the
following is a correct description of how it works please?
1. The main mpeg_thread function (in mpeg.c) gets a NEED_DATA event, and
reads in the next chunk of MP3 from the file on disc to the buffer located
at mp3buf+mp3buf_write (top level of current data). This happens every time
the 'large' 1.5meg buffer reaches its low water mark. This is when you see
the red light on the player come on because of disc access.
2. The data is at the same time being DMA'ed from the large buffer straight
to the buffer in the MAS chip??? or is there an intermediate buffer in
'rockbox' code from which the MAS picks up the stream?
im a bit confused here - how does the data get from the large buffer to the
im also not comletely clear about the significience of 0x5FFFEC3 as the DMA
destination address - you say that is where we write the address from where
the DMA reads the data to be sent to the MAS. Doesnt it get the data from
mp3buf + mp3buf_read and write it to 0x5FFFEC3? i assumed that the SAR3 is
the source address for DMA3 and the DAR3 is where it dumps the data???
I take your point about having to frame align my 'beep', you are quite
correct - bit of a challenge that :) i guess we are looking at doing a
little DMA to finish the current frame before the 'beep' dma, followed by
the remaining real MP3 frames, including dealing with track boundaries
maybe this is beyond me :( especially without having all the GDB stuff set
Its a shame MAS just include a 'beep' function in their codec :(
----- Original Message -----
From: "Nielsen Linus (ext)" <Linus.Nielsen_at_elema.siemens.se>
Sent: Friday, October 18, 2002 1:18 PM
Subject: RE: DMA Operation???
> > I am looking at mpeg.c and can see that the MP3 data is DMAed
> > using dma channel 3 from the mp3 buffer to the MAS chip - it seems to
> > go to address 0x5FFFEC3 which I assume is where the MAS's mp3 buffer
> > is located
> That is the register where we write the address from where the DMA reads
> data to be sent to the MAS.
> > question1: is this buffer on the MAS chip circular? by this I
> > mean does the chip start playing from the beginning to the
> > end then back to the start again?
> The data to the MAS is sent via a serial channel. But yes, the large 1.7Mb
> buffer in the dynamic RAM is circular. We do't know anything about the
> internal buffer inside the MAS.
> > question2: How often does that interupt get fired? is it
> > every 64k (about 8s of audio at 64kbs), in which case its
> > not often enough for me to slip a beep in
> That is correct.
> > (what I was thinking was to point the DMA controller to an
> > alternative MP3 buffer containing a short beep, setting a
> > flag to tell it to return to the 'real' buffer next time
> > DEI3 gets fired off.
> > Is this feasable?
> Looks feasible. Two small problems:
> 1. The usage of the bit reservoir will probably introduce unwanted noise
> when you insert a "foreign" frame into the stream.
> 2. You still have to insert the frame at a frame boundary, or you will get
> silence or noise.
> > has neone documented the disc-buffer-mas transfer situation?
> No I haven't. I have begun writing a document describing this, but
> always get higher priority...
Received on 2002-10-18