CHANGES
author Sam Lantinga <slouken@libsdl.org>
Sat, 21 Aug 2004 12:27:02 +0000
changeset 245 63b3650714de
parent 240 df2d45dbed91
child 246 9fa5d0f9d042
permissions -rw-r--r--
Here are patches for SDL12 and SDL_mixer for 4 or 6 channel
surround sound on Linux using the Alsa driver. To use them, naturally
you need a sound card that will do 4 or 6 channels and probably also a
recent version of the Alsa drivers and library. Since the only SDL
output driver that knows about surround sound is the Alsa driver,
you���ll want to choose it, using:

export SDL_AUDIODRIVER=alsa

There are no syntactic changes to the programming API. No new
library calls, no differences in arguments.

There are two semantic changes:

(1) For library calls with number of channels as an argument, formerly
you could use only 1 or 2 for the number of channels. Now you
can also use 4 or 6.

(2) The two "left" and "right" arguments to Mix_SetPanning, for the
case of 4 or 6 channels, no longer simply control the volumes of
the left and right channels. Now the "left" argument is converted
to an angle and Mix_SetPosition is called, and the "right" argu-
ment is ignored.

With two exceptions, so far as I know, the modified SDL12 and
SDL_mixer work the same way as the original versions, when opened for
1 or 2 channel output. The two exceptions are bugs which I fixed.
Well, the first, anyway, is a bug for sure. When rate conversions up
or down by a factor of two are applied (in src/audio/SDL_audiocvt.c),
streams with different numbers of channels (that is, mono and stereo)
are treated the same way: either each sample is copied or every other
sample is omitted. This is ok for mono, but for stereo, it is frames
that should be copied or omitted, where by "frame" I mean a portion of
the stream containing one sample for each channel. (In the SDL source,
confusingly, sometimes frames are called "samples".) So for these
rate conversions, stereo streams have to be treated differently, and
they are, in my modified version.

The other problem that might be characterized as a bug arises
when SDL_mixer is passed a multichannel chunk which does not have an
integral number of frames. Due to the way the effect_position code
loops over frames, when the chunk ends with a partial frame, memory
outside the chunk buffer will be accessed. In the case of stereo,
it���s possible that because malloc may give more memory than requested,
this potential problem never actually causes a segment fault. I don���t
know. For 6 channel chunks, I do know, and it does cause segment
faults.


If SDL_mixer is passed defective chunks and this causes a segment
fault, arguably, that���s not a bug in SDL_mixer. Still, whether or not
it counts as a bug, it���s easy to protect against, so why not? I added
code in mixer.c to discard any partial frame at the end of a chunk.

Then what about when SDL or SDL_mixer is opened for 4 or 6 chan-
nel output? What happens with the parts of the current library
designed for stereo? I don���t know whether I���ve covered all the bases,
but I���ve tried:

(1) For playing 2 channel waves, or other cases where SDL knows it has
to match up a 2 channel source with a 4 or 6 channel output, I���ve
added code in SDL_audiocvt.c to make the necessary conversions.

(2) For playing midis using timidity, I���ve converted timidity to do 4
or 6 channel output, upon request.

(3) For playing mods using mikmod, I put ad hoc code in music.c to
convert the stereo output that mikmod produces to 4 or 6 chan-
nels. Obviously it would be better to change the mikmod code to
mix down into 4 or 6 channels, but I have a hard time following
the code in mikmod, so I didn���t do that.

(4) For playing mp3s, I put ad hoc code in smpeg to copy channels in
the case when 4 or 6 channel output is needed.

(5) There seems to be no problem with .ogg files - stereo .oggs can be
up converted as .wavs are.

(6) The effect_position code in SDL_mixer is now generalized to in-
clude the cases of 4 and 6 channel streams.

I���ve done a very limited amount of compatibility testing for some
of the games using SDL I happen to have. For details, see the file
TESTS.

I���ve put into a separate archive, Surround-SDL-testfiles.tgz, a
couple of 6 channel wave files for testing and a 6 channel ogg file.
If you have the right hardware and version of Alsa, you should be able
to play the wave files with the Alsa utility aplay (and hear all
channels, except maybe lfe, for chan-id.wav, since it���s rather faint).
Don���t expect aplay to give good sound, though. There���s something
wrong with the current version of aplay.

The canyon.ogg file is to test loading of 6 channel oggs. After
patching and compiling, you can play it with playmus. (My version of
ogg123 will not play it, and I had to patch mplayer to get it to play
6 channel oggs.)

Greg Lee <greg@ling.lll.hawaii.edu>
Thus, July 1, 2004
slouken@240
     1
1.2.6:
slouken@245
     2
Greg Lee - Wed, 14 Jul 2004 05:13:14 -1000
slouken@245
     3
 * Added 4 and 6 channel surround sound output support
slouken@245
     4
 * Added support for RMID format MIDI files
slouken@240
     5
Sam Lantinga - Wed Nov 19 00:23:44 PST 2003
slouken@240
     6
 * Updated libtool support for new mingw32 DLL build process
icculus@239
     7
Ryan C. Gordon - Sun Nov  9 23:34:47 EST 2003
icculus@239
     8
 * Patch from Steven Fuller to fix positioning effect on bigendian systems.
slouken@236
     9
Laurent Ganter - Mon, 6 Oct 2003 11:51:33 +0200
slouken@236
    10
 * Fixed bug with MIDI volume in native Windows playback
slouken@226
    11
Andre Leiradella - Fri, 30 May 2003 16:12:03 -0300
slouken@226
    12
 * Added SDL_RWops support for reading MOD files
slouken@225
    13
Kyle Davenport - Sat, 19 Apr 2003 17:13:31 -0500
slouken@225
    14
 * Added .la files to the development RPM, fixing RPM build on RedHat 8
slouken@225
    15
slouken@205
    16
1.2.5:
slouken@223
    17
Darrell Walisser - Tue Mar  4 09:24:01 PST 2003
slouken@223
    18
 * Worked around MacOS X deadlock between CoreAudio and QuickTime
slouken@217
    19
Darrell Walisser - Fri, 14 Feb 2003 20:56:08 -0500
slouken@217
    20
 * Fixed crash in native midi code with files with more than 32 tracks
slouken@216
    21
Marc Le Douarain - Sat, 15 Feb 2003 14:46:41 +0100
slouken@216
    22
 * Added 8SVX format support to the AIFF loader
slouken@214
    23
Sam Lantinga Wed Feb 12 21:03:57 PST 2003
slouken@214
    24
 * Fixed volume control on WAVE music chunks
slouken@212
    25
Ben Nason - Mon, 10 Feb 2003 11:50:27 -0800
slouken@212
    26
 * Fixed volume control on MOD music chunks
slouken@208
    27
Patrice Mandin - Fri, 31 Jan 2003 15:17:30 +0100
slouken@208
    28
 * Added support for the Atari platform
icculus@202
    29
Ryan C. Gordon - Fri Dec 27 10:14:07 EST 2002
icculus@202
    30
 * Patch from Steven Fuller to fix panning effect with 8-bit sounds.
icculus@204
    31
Ryan C. Gordon - Thu Jan  2 12:31:48 EST 2003
icculus@204
    32
 * Patch from guy on 3DRealms forums to fix native win32 midi volume.
icculus@197
    33
Ryan C. Gordon - Wed Oct 30 07:12:06 EST 2002
icculus@197
    34
 * Small, looping music samples should now be able to fade out correctly.
slouken@194
    35
Sam Lantinga - Sun Oct 20 20:52:24 PDT 2002
slouken@194
    36
 * Added shared library support for MacOS X
slouken@194
    37
Pete Shinners - Wed Oct 16 17:10:08 EDT 2002
slouken@194
    38
 * Correctly report an error when using an unknown filetype
slouken@190
    39
Vaclav Slavik - Sun Sep  8 18:57:38 PDT 2002
slouken@190
    40
 * Added support for loading Ogg Vorbis samples as an audio chunk
slouken@188
    41
Martin Storsj - Tue Jul 16 10:38:12 PDT 2002
slouken@188
    42
 * Fixed to start playing another sample immediately when one finishes
slouken@183
    43
Martin Storsj - Tue May 28 13:08:29 PDT 2002
slouken@183
    44
 * Fixed a volume bug when calling Mix_HaltChannel() on unused channel
icculus@185
    45
Xavier Wielemans - Wed Jun 12 14:28:14 EDT 2002
icculus@185
    46
 * Fixed volume reset bug at end of channel fade.
icculus@187
    47
Ryan C. Gordon - Wed Jun 26 16:30:59 EDT 2002
icculus@187
    48
 * Mix_LoadMUS() will now accept an MP3 by file extension, instead of relying
icculus@187
    49
    entirely on the magic number.
slouken@172
    50
slouken@172
    51
1.2.4:
slouken@180
    52
Sam Lantinga - Mon May 20 09:11:22 PDT 2002
slouken@180
    53
 * Updated the CodeWarrior project files
slouken@177
    54
Sam Lantinga - Sun May 19 13:46:29 PDT 2002
slouken@177
    55
 * Added a function to query the music format: Mix_GetMusicType()
slouken@177
    56
Sam Lantinga - Sat May 18 12:45:16 PDT 2002
slouken@174
    57
 * Added a function to load audio data from memory: Mix_QuickLoad_RAW()
slouken@173
    58
Sam Lantinga - Thu May 16 11:26:46 PDT 2002
slouken@173
    59
 * Cleaned up threading issues in the music playback code
slouken@172
    60
Ryan Gordon - Thu May  2 21:08:48 PDT 2002
slouken@172
    61
 * Fixed deadlock introduced in the last release
slouken@158
    62
slouken@158
    63
1.2.3:
slouken@165
    64
Sam Lantinga - Sat Apr 13 07:49:47 PDT 2002
slouken@165
    65
 * Updated autogen.sh for new versions of automake
slouken@165
    66
 * Specify the SDL API calling convention (C by default)
slouken@164
    67
Ryan Gordon - Sat Apr 13 07:33:37 PDT 2002
slouken@164
    68
 * Fixed recursive audio lock in the mixing function
slouken@163
    69
jean-julien Filatriau - Sat Mar 23 18:05:37 PST 2002
slouken@163
    70
 * Fixed setting invalid volume when querying mixer and music volumes
slouken@161
    71
Guillaume Cottenceau - Wed Feb 13 15:43:20 PST 2002
slouken@161
    72
 * Implemented Ogg Vorbis stream rewinding
slouken@160
    73
Peter Kutak - Wed Feb 13 10:26:57 PST 2002
slouken@160
    74
 * Added native midi support on Linux, using GPL code
slouken@160
    75
	--enable-music-native-midi-gpl
slouken@158
    76
Pete Shinners - Mon Jan 14 11:31:26 PST 2002
slouken@158
    77
 * Added seek support for MP3 files
slouken@158
    78
Ryan Gordon - Mon Jan 14 11:30:44 PST 2002
slouken@158
    79
 * Sample "finished" callbacks are now always called when a sample is stopped.
slouken@154
    80
slouken@154
    81
1.2.2:
slouken@154
    82
Guillaume Cottenceau - Wed Dec 19 08:59:05 PST 2001
slouken@155
    83
 * Added an API for seeking in music files (implemented for MOD and Ogg music)
slouken@154
    84
	Mix_FadeInMusicPos(), Mix_SetMusicPosition()
slouken@154
    85
 * Exposed the mikmod synchro value for music synchronization
slouken@154
    86
	Mix_SetSynchroValue(), Mix_GetSynchroValue()
slouken@88
    87
slouken@88
    88
1.2.1:
slouken@128
    89
Yi-Huang Han - Wed Oct 24 21:55:47 PDT 2001
slouken@128
    90
 * Fixed MOD music volume when looping
slouken@126
    91
David Hedbor - Thu Oct 18 10:01:41 PDT 2001
slouken@126
    92
 * Stop implicit looping, set fade out and other flags on MOD files
slouken@125
    93
Sam Lantinga - Tue Oct 16 11:17:12 PDT 2001
slouken@125
    94
 * The music file type is now determined by extension as well as magic
slouken@113
    95
Ryan C. Gordon - Tue Sep 11 12:05:54 PDT 2001
slouken@113
    96
 * Reworked playwave.c to make it more useful as a mixer testbed
slouken@113
    97
 * Added a realtime sound effect API to SDL_mixer.h
slouken@113
    98
 * Added the following standard sound effects:
slouken@113
    99
	panning, distance attenuation, basic positional audio, stereo reversal
slouken@113
   100
 * Added API for mixer versioning: Mix_Linked_Version() and MIX_VERSION()
slouken@112
   101
Sam Lantinga - Tue Sep 11 11:48:53 PDT 2001
slouken@112
   102
 * Updated MikMod code to version 3.1.9a
slouken@111
   103
Torbjrn Andersson - Tue Sep 11 11:22:29 PDT 2001
slouken@111
   104
 * Added support for loading AIFF audio chunks
slouken@106
   105
Max Horn - Tue Sep  4 20:38:11 PDT 2001
slouken@106
   106
 * Added native MIDI music support on MacOS and MacOS X
slouken@98
   107
Florian Schulze - Sun Aug 19 14:55:37 PDT 2001
slouken@98
   108
 * Added native MIDI music support on Windows
slouken@97
   109
Sam Lantinga - Sun Aug 19 02:20:55 PDT 2001
slouken@97
   110
 * Added Project Builder projects for building MacOS X framework
slouken@96
   111
Darrell Walisser - Sun Aug 19 00:47:22 PDT 2001
slouken@96
   112
 * Fixed compilation problems with mikmod under MacOS X
slouken@95
   113
Torbjrn Andersson - Sun, 19 Aug 2001 16:03:30
slouken@95
   114
 * Fixed AIFF music playing support
slouken@94
   115
Sam Lantinga - Sat Aug 18 04:14:13 PDT 2001
slouken@94
   116
 * Fixed building Ogg Vorbis support on Windows
slouken@92
   117
Ryan C. Gordon - Thu, 7 Jun 2001 13:15:51
slouken@92
   118
 * Added Mix_ChannelFinished() and Mix_GetChunk()
slouken@91
   119
Ryan C. Gordon - Tue, 5 Jun 2001 11:01:51
slouken@91
   120
 * Added VOC sound file support
slouken@89
   121
Guillaume Cottenceau - Thu May 10 11:17:55 PDT 2001
slouken@89
   122
 * Fixed crashes when API used with audio not initialized
slouken@88
   123
Paul Jenner - Sat, 14 Apr 2001 09:20:38 -0700 (PDT)
slouken@88
   124
 * Added support for building RPM directly from tar archive
slouken@81
   125
slouken@81
   126
1.2.0:
slouken@81
   127
Sam Lantinga - Wed Apr  4 12:42:20 PDT 2001
slouken@81
   128
 * Synchronized release version with SDL 1.2.0
slouken@75
   129
slouken@75
   130
1.1.1:
slouken@75
   131
John Hall - Tue Jan  2 13:46:54 PST 2001
slouken@75
   132
 * Added support to playmus for track switching with Ctrl-C
slouken@75
   133
 * Added support to playmus for multiple command line files
slouken@73
   134
slouken@73
   135
1.1.0:
slouken@73
   136
Sam Lantinga - Wed Nov 29 20:47:13 PST 2000
slouken@73
   137
 * Package specifically for SDL 1.1 (no real reason API-wise, but for clarity)
slouken@68
   138
slouken@68
   139
1.0.7:
slouken@71
   140
Sam Lantinga - Tue Nov  7 10:22:09 PST 2000
slouken@71
   141
 * Fixed hang in mikmod re-initialization
slouken@71
   142
Stephane Peter - Oct 17 13:07:32 PST 2000
slouken@71
   143
 * Fixed music fading
slouken@68
   144
Ray Kelm - Fri, 04 Aug 2000 20:58:00 -0400
slouken@68
   145
 * Added support for cross-compiling Windows DLL from Linux
slouken@59
   146
slouken@59
   147
1.0.6:
slouken@63
   148
Sam Lantinga - Sun Jul  2 14:16:44 PDT 2000
slouken@63
   149
 * Added support for the Ogg Vorbis music format: http://www.vorbis.org/
slouken@62
   150
Darrell Walisser - Wed Jun 28 11:59:40 PDT 2000
slouken@62
   151
 * Added Codewarrior projects for MacOS
slouken@62
   152
Sam Lantinga - Mon Jun 26 12:01:11 PDT 2000
slouken@62
   153
 * Fixed symbol aliasing problem with "channel"
slouken@59
   154
Matt - Wed, 12 Apr 2000 15:36:13 -0700
slouken@59
   155
 * Added SDL_RWops support for mikmod loading (not hooked into music.c yet)
slouken@52
   156
slouken@52
   157
1.0.5:
slouken@52
   158
Paul Furber - Fri Mar  3 14:58:50 PST 2000
slouken@52
   159
 * Fixed MP3 detection with compilers that use signed char datatypes
slouken@41
   160
slouken@41
   161
1.0.4:
slouken@47
   162
Sam Lantinga - Thu Feb 10 19:42:03 PST 2000
slouken@47
   163
 * Ported the base mixer and mikmod libraries to MacOS
slouken@47
   164
Markus Oberhumer - Wed Feb  2 13:16:17 PST 2000
slouken@47
   165
 * Fixed problem with short looping sounds
slouken@47
   166
Sam Lantinga - Tue Feb  1 13:25:44 PST 2000
slouken@47
   167
 * Added Visual C++ project file
slouken@47
   168
Markus Oberhumer - Tue Feb  1 13:23:11 PST 2000
slouken@47
   169
 * Cleaned up code for compiling with Visual C++
slouken@47
   170
 * Don't hang in Mix_HaltMusic() if the music is paused
slouken@47
   171
Sam Lantinga - Fri Jan 28 08:54:56 PST 2000
slouken@47
   172
 * Fixed looping WAVE chunks that are not aligned on sample boundaries
slouken@36
   173
slouken@36
   174
1.0.3:
slouken@47
   175
Sam Lantinga - Mon Jan 17 19:48:09 PST 2000
slouken@47
   176
 * Changed the name of the library from "mixer" to "SDL_mixer"
slouken@47
   177
 * Instead of including "mixer.h", include "SDL_mixer.h",
slouken@47
   178
 * Instead of linking with libmixer.a, link with libSDL_mixer.a
slouken@34
   179
slouken@35
   180
1.0.2:
slouken@47
   181
Sam Lantinga - Fri Jan 14 11:06:56 PST 2000
slouken@47
   182
 * Made the CHANGELOG entries Y2K compliant. :)
slouken@42
   183
MFX -	Updated the mikmod support to MikMod 3.1.8
slouken@42
   184
MFX -	Added Mix_HookMusicFinished() API function
slouken@27
   185
slouken@27
   186
1.0.1:
slouken@27
   187
SOL -	Added a post-mixing callback
slouken@27
   188
SP  -	A few music-related bugfixes
slouken@0
   189
slouken@0
   190
1.0.0:
slouken@0
   191
SOL -   Added autoconf support
slouken@0
   192
SP  -   Added MP3 support using SMPEG
megastep@5
   193
SP  -   Added fading in/out of music and samples
megastep@7
   194
SP  -   Added dynamic allocation of channels
megastep@7
   195
SP  -   Added channel grouping functions
megastep@7
   196
SP  -   Added expiration delay for samples
slouken@0
   197
slouken@0
   198
Initial Key:
slouken@0
   199
SOL - Sam Lantinga (hercules@lokigames.com)
slouken@0
   200
SP  - Stephane Peter (megastep@lokigames.com)
slouken@42
   201
MFX - Markus Oberhumer (markus.oberhumer@jk.uni-linz.ac.at)