Commit graph

64 commits

Author SHA1 Message Date
Sam Lantinga
fa9233eaca indent
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402638
2007-09-10 12:11:40 +00:00
Ryan C. Gordon
c09d2e0f0d Ported PulseAudio target from 1.2 to 1.3 interfaces, and added it to the trunk.
Fixes Bugzilla #439.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402633
2007-08-20 01:02:37 +00:00
Sam Lantinga
1be5906ea3 Removed campatibility behavior for 1.3
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402417
2007-07-05 04:34:48 +00:00
Ryan C. Gordon
409c8b5862 Merged r3138:3139 from branches/SDL-1.2: Don't init audio callback buffer.
(This already had a concession for devices opened via the 1.2 entry points,
 I've changed it to respect the environment variable and do it for all devices
 now.)

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402412
2007-07-05 02:30:10 +00:00
Sam Lantinga
957d8bf377 stupid indent
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402404
2007-07-03 09:55:29 +00:00
Sam Lantinga
ed60e3a7d4 Fixes for compiling with Visual C++ 8.0 Express Edition
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402369
2007-06-19 05:53:56 +00:00
Ryan C. Gordon
7f36032f22 Use SDL_strcmp(), not strcmp().
Thanks, Suzuki Masahiro.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402239
2006-11-29 10:26:32 +00:00
Ryan C. Gordon
2a14d5cdca Fixed building of Windows waveout audio.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402228
2006-11-11 06:48:57 +00:00
Sam Lantinga
05a29201de indent is evil
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402208
2006-10-28 16:48:03 +00:00
Ryan C. Gordon
3c592629bd 1.3 branch version of revision 2878.
Fixes Bugzilla #298.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402201
2006-10-27 20:19:48 +00:00
Ryan C. Gordon
0089ba6cbe Merged SDL-ryan-multiple-audio-device branch r2803:2871 into the trunk.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402195
2006-10-17 09:15:21 +00:00
Ryan C. Gordon
f9b43fac01 Replaced strncmp for SDL_AUDIODRIVER test with strcasecmp.
Fixes Bugzilla #334.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402122
2006-10-01 02:06:37 +00:00
Ryan C. Gordon
bead079669 Reordered the favored audio format list a little.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402040
2006-08-31 20:59:42 +00:00
Ryan C. Gordon
c500e6c0b4 First shot at new audio data types (int32 and float32).
Notable changes:
 - Converters between types are autogenerated. Instead of making multiple
   passes over the data with seperate filters for endianess, size, signedness,
   etc, converting between data types is always one specialized filter. This
   simplifies SDL_BuildAudioCVT(), which otherwise had a million edge cases
   with the new types, and makes the actually conversions more CPU cache
   friendly. Left a stub for adding specific optimized versions of these
   routines (SSE/MMX/Altivec, assembler, etc)
 - Autogenerated converters are built by SDL/src/audio/sdlgenaudiocvt.pl. This
   does not need to be run unless tweaking the code, and thus doesn't need
   integration into the build system.
 - Went through all the drivers and tried to weed out all the "Uint16"
   references that are better specified with the new SDL_AudioFormat typedef.
 - Cleaned out a bunch of hardcoded bitwise magic numbers and replaced them
   with new SDL_AUDIO_* macros.
 - Added initial float32 and int32 support code. Theoretically, existing
   drivers will push these through converters to get the data they want to
   feed to the hardware.

Still TODO:
 - Optimize and debug new converters.
 - Update the CoreAudio backend to accept float32 data directly.
 - Other backends, too?
 - SDL_LoadWAV() needs to be updated to support int32 and float32 .wav files
   (both of which exist and can be generated by 'sox' for testing purposes).
 - Update the mixer to handle new datatypes.
 - Optionally update SDL_sound and SDL_mixer, etc.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402029
2006-08-24 12:10:46 +00:00
Sam Lantinga
d942ec3207 MacOS Classic is no longer supported.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402025
2006-08-10 14:54:23 +00:00
Sam Lantinga
0bd0f1331b Look at environment variables in SDL_VideoInit() and SDL_AudioInit()
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401954
2006-07-15 19:30:18 +00:00
Sam Lantinga
5877021286 More of the Direct3D renderer is implemented, I'm not sure why it's not showing texture copies yet...
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401948
2006-07-14 06:40:53 +00:00
Sam Lantinga
9cbad57c92 Removed libc dependency on Windows again, to fix building with Visual C++ 2005 Express Edition.
Fixed performance problem with testsprite2 on the D3D driver.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401946
2006-07-13 08:13:02 +00:00
Sam Lantinga
0f030a1802 SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401938
2006-07-10 21:04:37 +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