Commit graph

49 commits

Author SHA1 Message Date
Ryan C. Gordon
a144a3d025 Committed PulseAudio driver. Thanks, Stephan!
--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%402310
2007-05-13 23:12:46 +00:00
Ryan C. Gordon
79b94d85d1 Removed broken AmigaOS support.
Fixes Bugzilla #337.

--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%402213
2006-10-29 03:58:27 +00:00
Ryan C. Gordon
fce9244441 Fix for buffer overflow in audio code, when feeding a device that needs
resampling.

Fixes Bugzilla #298.

--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%402200
2006-10-27 20:18:24 +00:00
Ryan C. Gordon
4ab10dce94 1.2 backport: Replaced strncmp for SDL_AUDIODRIVER test with strcasecmp.
Fixes Bugzilla #334.

--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%402123
2006-10-01 02:07:09 +00:00
Sam Lantinga
3761c04c87 Fixed bug #137
If SDL_OpenAudio() is passed zero for the desired format
fields, the following environment variables will be used
to fill them in:
	SDL_AUDIO_FREQUENCY
	SDL_AUDIO_FORMAT
	SDL_AUDIO_CHANNELS
	SDL_AUDIO_SAMPLES
If an environment variable is not specified, it will be set
to a reasonable default value.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401753
2006-05-09 08:52:54 +00:00
Sam Lantinga
b4ba6518d6 Fixed bug #215
The current SVN trunk is missing the SDLCALL specifier at numerous locations.

It has to be added for all (possibly user provided) callbacks.

I stumbled over this while creating a makefile for the OpenWatcom compiler for
Win32.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401728
2006-05-07 03:40:06 +00:00
Sam Lantinga
f1b5352fed Good idea, renaming OpenBSD audio to BSD audio.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401571
2006-03-21 09:33:54 +00:00
Sam Lantinga
6d076cbf22 Fixed bug #18
Reordered the audio thread loop so there's no initial wait.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401566
2006-03-21 06:45:47 +00:00
Ryan C. Gordon
c1d67a0d0c Try to fill the hardware audio buffer immediately.
Fixes Bugzilla #18.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401565
2006-03-21 00:56:10 +00:00
Ryan C. Gordon
66d3d81854 Implemented dummy audio driver.
Fixes Bugzilla #161.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401536
2006-03-14 08:53:33 +00:00
Sam Lantinga
c0aec157c6 Cleaning up warnings on MacOS X
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401491
2006-03-09 06:33:21 +00:00
Sam Lantinga
46f459a736 Updated OS/2 build, yay!
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401446
2006-02-26 19:30:21 +00:00
Sam Lantinga
0487d9cfe1 Fixed some preprocessor mangling
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401412
2006-02-21 18:29:39 +00:00
Sam Lantinga
d5f983162e *** empty log message ***
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401410
2006-02-21 09:14:58 +00:00
Sam Lantinga
c36118165e Use consistent identifiers for the various platforms we support.
Make sure every source file includes SDL_config.h, so the proper system
headers are chosen.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401406
2006-02-21 08:46:50 +00:00
Sam Lantinga
1da8cb0143 Use only safe string functions
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401383
2006-02-19 23:46:34 +00:00
Sam Lantinga
d3805eef09 New configure-based build system. Still work in progress, but much improved
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401365
2006-02-16 10:11:48 +00:00
Sam Lantinga
684909fae2 More header massaging... works great on Windows. ;-)
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401362
2006-02-10 06:48:43 +00:00
Sam Lantinga
78516b5663 Configure dynamically generates SDL_config.h
I'm still wrestling with autoheader, but this should work for now...
Fixed lots of build problems with C library support disabled

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401345
2006-02-07 12:11:33 +00:00
Sam Lantinga
5d53175e4d Use SDL_ prefixed versions of C library functions.
FIXME:
Change #include <stdlib.h> to #include "SDL_stdlib.h"
Change #include <string.h> to #include "SDL_string.h"
Make sure nothing else broke because of this...

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401340
2006-02-07 06:59:48 +00:00
Sam Lantinga
6c3f928cd8 It's now possible to build SDL without any C runtime at all on Windows,
using Visual C++ 2005

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401334
2006-02-06 08:28:51 +00:00
Sam Lantinga
eea4857268 Updated copyright information and removed rcs id lines (problematic in branch merges)
I batch edited these files, so please let me know if I've accidentally removed anybody's
credit here.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401315
2006-02-01 06:32:25 +00:00
Sam Lantinga
bdccb5d179 Date: Tue, 13 Dec 2005 13:33:50 +0000
From: "alan buckley"
Subject: Patch to fix audio locking on RISC OS

When threads were not disabled on a RISC OS build
the audio mixer mutex was not created.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401207
2005-12-13 16:40:12 +00:00
Ryan C. Gordon
b08452cb40 OS/2 port!
This was mostly, if not entirely, written by "Doodle" and "Caetano":
    doodle@scenergy.dfmk.hu
    daniel@caetano.eng.br

--ryan.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401193
2005-11-23 07:29:56 +00:00
Sam Lantinga
c52f363aaa Date: Fri, 25 Jun 2004 13:29:15 +0100
From: "alan buckley"
Subject: Modification for RISC OS version of SDL

Ive attached a zip file with the changes to this email, it contains the
following:

The file sdldiff.txt is the output from cvs diff u.  .
The directory thread/riscos contains all the new files to support threading.

Readme.riscos is a new readme file to add.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40956
2004-09-17 13:20:10 +00:00
Sam Lantinga
2c65409ade 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

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40943
2004-08-21 12:27:02 +00:00
Sam Lantinga
0ac2cf1847 CoreAudio driver works on Mac OSX 10.1
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40937
2004-08-21 03:21:44 +00:00
Sam Lantinga
35c8da7adb Audio improvements from Max Horn, including a new CoreAudio driver for MacOSX
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40936
2004-08-21 02:06:30 +00:00
Sam Lantinga
317cf8a35b Simplify code and clean up Valgrind warning
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40809
2004-02-11 07:26:29 +00:00
Sam Lantinga
cb9c2efd17 Updated copyright information for 2004 (Happy New Year!)
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40770
2004-01-04 16:49:27 +00:00
Sam Lantinga
9b315c4c85 Date: Sat, 2 Aug 2003 16:22:51 +0300
From: "Mike Gorchak"
Subject: New patches for QNX6

Here my patches for the SDL/QNX:

QNXSDL.diff - diff to non-QNX related sources:

- updated BUGS file, I think QNX6 is now will be officially supported
- configure.in - added shared library support for QNX, and removed dependency between the ALSA and QNX6.
- SDL_audio.c - added QNX NTO sound bootstrap insted of ALSA's.
- SDL_sysaudio.h - the same.
- SDL_nto_audio.c - the same.
- SDL_video.c - right now, QNX doesn't offer any method to obtain pointers to the OpenGL functions by function name, so they must be hardcoded in library, otherwise OpenGL will not be supported.
- testsprite.c - fixed: do not draw vertical red line if we are in non-double-buffered mode.

sdlqnxph.tar.gz - archive of the ./src/video/photon/* . Too many changes in code to make diffs :) :

+ Added stub for support hide/unhide window event
+ Added full YUV overlays support.
+ Added window maximize support.
+ Added mouse wheel events.
+ Added support for some specific key codes in Unicode mode (like ESC).
+ Added more checks to the all memory allocation code.
+ Added SDL_DOUBLEBUF support in all fullscreen modes.
+ Added fallback to window mode, if desired fullscreen mode is not supported.
+ Added stub support for the GL_LoadLibrary and GL_GetProcAddress functions.
+ Added resizable window support without caption.
! Fixed bug in the Ph_EV_EXPOSE event handler, when rectangles to update is 0 and when width or height of the rectangle is 0.
! Fixed bug in the event handler code. Events has not been passed to the window widget handler.
! Fixed codes for Win keys (Super/Hyper/Menu).
! Fixed memory leak, when deallocation palette.
! Fixed palette emulation code bugs.
! Fixed fullscreen and hwsurface handling.
! Fixed CLOSE button bug. First event was passed to the handler, but second terminated the application. Now all events passed to the application correctly.
- Removed all printfs in code, now SDL_SetError used instead of them.
- Disabled ToggleFullScreen function.

README.QNX - updated README.QNX file. Added much more issues.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40664
2003-08-04 00:52:42 +00:00
Sam Lantinga
311d6a8f61 Added audio and CD-ROM support for OSF/Tru64 (thanks Hayashi!)
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40655
2003-07-22 14:01:21 +00:00
Patrice Mandin
e1695a4b13 Atari MiNT: added more audio drivers
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40645
2003-07-07 19:16:03 +00:00
Sam Lantinga
e8ce0bc197 Added initial support for RISC OS (thanks Peter Naulls!)
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40631
2003-05-29 04:44:13 +00:00
Sam Lantinga
3ee2de057f Added initial support for Dreamcast (thanks HERO!)
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40510
2002-10-05 16:50:56 +00:00
Sam Lantinga
35d6bbe910 Added Atari audio support (thanks Patrice!)
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40399
2002-06-10 20:42:53 +00:00
Sam Lantinga
a55059b4d3 The audio lock and unlock functions are now a part of the driver.
The MacOS audio locking has been implemented, courtesy of Ryan Gordon

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40323
2002-03-30 19:48:56 +00:00
Sam Lantinga
ea5d630479 Updated copyright information for 2002
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40298
2002-03-06 11:23:08 +00:00
Sam Lantinga
a7215581c7 Don't allow multiple audio opens to succeed (until SDL 1.3)
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40263
2002-01-09 16:04:58 +00:00
Sam Lantinga
3ceea60069 Updated the source with the correct e-mail address
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40253
2001-12-14 12:38:15 +00:00
Sam Lantinga
2aca7272f2 Audio subsystem no longer assumes sun audio API on UNIX systems
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40149
2001-08-09 13:09:47 +00:00
Sam Lantinga
1412a1724e Name changed from OBSD to OPENBSD_AUDIO
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40122
2001-07-23 02:58:42 +00:00
Sam Lantinga
acab15a3bd Cleaned up the OpenBSD port, thanks to Peter Valchev
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%4095
2001-07-08 09:00:06 +00:00
Sam Lantinga
98233844c7 Added an audio driver that writes to disk (thanks Ryan!)
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%4069
2001-06-16 01:51:42 +00:00
Sam Lantinga
4baaa1ec99 Oops, typo fix
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%4039
2001-05-26 21:39:01 +00:00
Sam Lantinga
6a24b323f5 Added native OpenBSD audio driver (thanks vedge!)
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%4038
2001-05-26 16:58:37 +00:00
Sam Lantinga
09112109c3 Added detection of Open Sound System on Solaris x86
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%4036
2001-05-23 00:36:17 +00:00
Sam Lantinga
df7866c435 Updated the Amiga OS port of SDL (thanks Gabriele)
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%4022
2001-05-10 20:13:29 +00:00
Sam Lantinga
2f110628a7 Initial revision
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401
2001-04-26 16:45:43 +00:00