Porting SDL audio callback program to embedded system |
I figured it out |
bazz
|
It is very implementation specific, but I figured out the answer I needed, for the Samsung S3C44B0X SoC. I'm leaving it here in case anyone stumbles onto this topic.. but in my case, there was an IIS (Inter-IC Sound) bus interface that I used, which DMA'd a memory buffer of samples at a specified sample rate to an external DAC 'codec' chip. That in turn was connected to the speakers and headphones.
The DAC codec chip takes a clock that is sub divided from the master clock, in my case the clock rate for 32,000 Hz sample rate was 8.192 MHz.. and I needed to make sure my master clock was a multiple of that number since I only had whole number clock divisors. So all I head to do was fill the buffer and then DMA would take care of the rest.. Right now I'm using 2 buffers as a 'flip' method, one to play, one to fill, but I'm interested in making a more of a circular buffer that will work with the preferred DMA size so that I can better optimize how much I can fill. |
|||||||||||
|