We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 262

Summary: MP3 playback too fast when using more than 2 channels
Product: SDL_mixer Reporter: joda.bot <joda>
Component: miscAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: unspecified   
Hardware: x86   
OS: Windows (XP)   
Bug Depends on: 96    
Bug Blocks:    

Description joda.bot 2006-06-24 19:43:09 UTC
hi

OS: Windows 2000
Soundcard: SB Live Value with 4 Channels

The MP3 playback (using SMPEG) is too fast when using more than 2 sound channels on windows. I don't hear any surround sound with SDL release 1.2.10. There might be some bugs in the code calling SDL.

I'm using SDL_mixer 1.2.7 with SDL 1.2.10. There was a problem compiling SDL_mixer against SDL 1.2.10 (using MinGW). 

Compile time error: already defined int8_t when SDL_mixer includes <stdint.h>.

Orignal code:
#else
typedef signed char int8_t;
typedef unsigned char uint8_t;
typedef signed short int16_t;
typedef unsigned short uint16_t;
typedef signed int int32_t;
typedef unsigned int uint32_t;
typedef signed long long int64_t;
typedef unsigned long long uint64_t;
#ifndef _SIZE_T_DEFINED_
#define _SIZE_T_DEFINED_
typedef unsigned int size_t;
#endif
typedef unsigned int uintptr_t;
#endif /* _MSC_VER */


Fix: Just include <stdint.h>
#else
#include <stdint.h>
#ifndef _SIZE_T_DEFINED_
#define _SIZE_T_DEFINED_
typedef unsigned int size_t;
#endif
#endif /* _MSC_VER */

Perhaps you can spot an error in the code:
https://svn.sourceforge.net/svnroot/armagetronad/armagetronad/branches/0.3.0/armagetronad/src/engine/sound/sdl_mixer/

The code was not written by me, but one of my fellow Armagetron Advanced developers.

Download Alpha Test Canditate:
http://beta.armagetronad.net/fetch.php/0.3%252F20060624%252Farmagetronad-0.3.0_alpha5009.win32.exe

Steps:
1) Set System Settings->Sound->Channels to 4 or 6
2) Restart game to activate 4 or 6 channel sound
3) Set System Settings->Sound->Custom Playlist: [path to some .m3u list]
   Note: The .m3u has to be outside the game directory and should contain an mp3.
4) Set System Settings->Sound->Use Playlist: Custom
5) Restart game to activate 4 or 6 channel sound
6) Bind "next track" in System Settings->Misc Settings->Global Keybindings
   "next track" to some key
7) Start a local game: Game->Local Game
8) press next track

Note: The last time I tried to start it with the "waveout" driver the game just crashed with 4 channels, so you probably need dsound driver (or even 4 channels).

Hope you can help out. I noticed that you applied some fixes to SVN. Are some of the problems already fixed ?
Comment 1 Sam Lantinga 2006-06-25 13:18:49 UTC
The compiling bug is fixed in subversion, thanks!

SMPEG doesn't support 4/6 channel sound, you'd have to write a patch for that and send it to icculus@icculus.org.

I don't have a surround sound setup, so I can't really test any of the surround sound code myself.
Comment 2 joda.bot 2006-06-26 02:48:37 UTC
A simple patch already exists.
See ftp://ling.lll.hawaii.edu/pub/greg/Surround-SDL.tgz aka Bug 96 :)