GP32 Gp32 Stereo And Mono Sound


slaanesh

Certified Guru
Joined
Nov 9, 2005
Messages
1,995
Age
54
Location
Melbourne, Australia
Website
www.slaanesh.net
Hello all, I have a little problem.

I'm not using and SDK to play sound ie. NOT using GPSDK or Mirko's SDK.
Just banging the hardware directly.

Here's the initialization code:

CODE

unsigned int prescale = calcrate(pclk, rate);
unsigned int mclk = (prescale >> 31);
unsigned int databit = (bits == 16) ? 1 : 0;


rIISCON = (1 << 5) | /* Transmit DMA service request enable */
(0 << 4) | /* Receive DMA service request enable */
(0 << 3) | /* Transmit channel idle command */
(1 << 2) | /* Receive channel idle command */
(1 << 1) | /* IIS prescaler enable */
(0 << 0); /* IIS interface enable (start) */

rIISMOD = (0 << 8) | /* Mode select (0=master,1=slave) */
(2 << 6) | /* Tx/Rx mode (0=none,1=Rx,2=Tx,3=duplex) */
(0 << 5) | /* Active level (0=low for left chan,1=high) */
(0 << 4) | /* Serial i/f format (0=IIs,1=MSB) */
(databit << 3) | /* Serial bits per channel (0=8bit,1=16bit) */
(mclk << 2) | /* Master clock frequency (0=256fs,1=384fs) */
(1 << 0); /* Serial clock freq (0=16fs,1=32fs,2=48fs) */

rIISFIFCON= (1 << 11) | /* Tx fifo mode (0=normal,1=DMA) */
(0 << 10) | /* Rx fifo mode (0=normal,1=DMA) */
(1 << 9) | /* Tx fifo enable */
(0 << 8); /* Rx fifo enable */



How do you set mono sound? Is this possible? It looks like the GP32 IIS always plays a stereo sound stream? Or am I missing something here?

Looking at the xroar code, it starts the sound up in stereo mode and just copies the left channel to be the same as the right. So that "mono" is basically "stereo" but just playing the same thing through both channels.

Any help appreciated.
 
I've been looking at other source codes and this seems to be the case.

GpPcmPlay() must doing some preprocessing to mono audio streams to convert into "stereo" before playing?
 
Back
Top