GP2X Sound Swapping Channels L<>r


kevcal

Coding " Abduction;Retrieval "
Joined
Jun 14, 2006
Messages
835
Age
57
Location
Southern England
Website
homepage.ntlworld.com
Just finishing cleaning up my first development on the gp2x (well an alpha/beta version release before xmas) and have hit on this problem -

Sound channels swapping - seemingly when the volume is changed.. but I'm not sure.

I know some gp2x audio apps were affected by this.

Anyone know if there's something I can do to find this has happened and/or how to fix it?

I'm guessing the left & right audio data is interleaved somewhere (driver? hardware?) and it loses sync for some reason...?

Kev
 
kevcal said:
Just finishing cleaning up my first development on the gp2x (well an alpha/beta version release before xmas) and have hit on this problem -

Sound channels swapping - seemingly when the volume is changed.. but I'm not sure.

I know some gp2x audio apps were affected by this.

Anyone know if there's something I can do to find this has happened and/or how to fix it?

I'm guessing the left & right audio data is interleaved somewhere (driver? hardware?) and it loses sync for some reason...?

Kev
Are you using libmikmod to play the WAVs? If so, you seem to have to do this:

CODE

sounds.voice = Sample_Play(sounds.sample, 0, 0);
Voice_SetPanning(sounds.voice, PAN_CENTER);
Voice_SetVolume(sounds.voice, 256);



i.e., remember which voice channel was used to play the sample (arbitrary number), and then pass that channel onto Voice_SetPanning, and the command PAN_CENTER to always play sounds on both channels. Otherwise, it can sound like ping-pong..
 
Last edited by a moderator:
Thanks for the reply, but.. I'm using Allegro & DUMB and 'most of the time' it's fine..

Just every now and then the channels swap - which is a bit annoying when you've panned sfx into the right position(!).

My guess is that the L/R interleaved data is dma'ed (a common method in the past) and 'something' is happening to lose a word.
 
Did you try setting the sound mode to mono, see what happens?
 
Will have a look to see if I can do that..

Found the following wrt FW 2.1.1 which is what I have been testing with..:
QUOTE
juanisan:
Mono mp3s play great as I listen to old time radio shows - sounds fantastic. I wish you could scan through a 1 hour mp3 a little faster though. Stereo music on the GP2x drives me NUTS! The channels keep flipping!!! I keep going back to my iRiver for mp3 music. I listen to the same piece of music over and over and the GP2x seems to swap channels at the same point in the music so it must be something in the decoding.

QUOTE
Draconis:
I hope for the next firmware release, they put an option in to reverse left/right sound output. My sound seems to be switched and the only way to fix it is to reverse my headphones.


Interesting that no-one here has noticed this happening.
 
Last edited by a moderator:
Back
Top