Commit Graph

299 Commits

Author SHA1 Message Date
Ryan C. Gordon
be72893582 Since we're not using the CoreAudio HAL now, we don't need to use EnableIO.
I think that's how it works.

Fixes failure to open audio device on Mac OS X.
2010-01-11 07:45:34 +00:00
Ryan C. Gordon
629a33f24d Patched to compile. 2010-01-11 07:33:56 +00:00
Ryan C. Gordon
0a3afaa588 Merged r5194:5195 from branches/SDL-1.2: coldfire cpu arch support. 2010-01-10 08:21:19 +00:00
Ryan C. Gordon
7d6532fb7a Merged r5070:5071 from branches/SDL-1.2: forcibly disable buggy MMX mixers. 2010-01-10 07:48:14 +00:00
Ryan C. Gordon
fe2f3cf720 Merged r4991:5154 from branches/SDL-1.2/src/audio/alsa: many 1.2.14 ALSA fixes. 2010-01-10 07:40:12 +00:00
Ryan C. Gordon
8d46b44026 Merged r4713:4714 from branches/SDL-1.2: CoreAudio 64-bit & Snow Leopard fixes. 2010-01-06 20:31:21 +00:00
Ryan C. Gordon
af25176933 Merged r4121:4122 from branches/SDL-1.2: more double-free fixes. 2010-01-06 07:34:20 +00:00
Ryan C. Gordon
d3cffb3167 Fixed buffer overflows in resamplers.
I'm not confident this is a complete fix, but I'm not confident the current
 resamplers are really worth keeping at all, either.
2009-12-28 08:28:24 +00:00
Ryan C. Gordon
f644ae86a9 Implemented SDL_setenv(), moved SDL_putenv() to compat.
Fixes Bugzilla #779.
2009-12-16 10:59:51 +00:00
Sam Lantinga
75e75ae0c3 Fixed bug #741
The thread ID is an unsigned long so it can hold pthread_t so people can do naughty things with it.

I'm going to be adding additional useful thread API functions, but this should prevent crashes in people's existing code on 64-bit architectures.
2009-12-16 04:48:11 +00:00
Sam Lantinga
dd8238d718 Switch to mixed case for consistency with other enumerations 2009-12-10 08:28:26 +00:00
Sam Lantinga
3f0a66d3ef Add error messages for failure cases 2009-11-25 06:00:00 +00:00
Ryan C. Gordon
3842b74b75 Merged r4990:4991 from branches/SDL-1.2: ALSA 1.0 API and dlvsym() removal. 2009-10-10 07:34:15 +00:00
Sam Lantinga
c75e149ac8 Fixed a bug where when the audio starts paused all the DirectSound buffers
will end up getting locked and never unlocked and sound will never play.

Added a FIXME for Ryan to look at, too. :)
2009-10-04 09:18:48 +00:00
Sam Lantinga
2d97efbd4d Removed outdated Atari support 2009-09-20 04:15:19 +00:00
Sam Lantinga
fe586cb3f9 Removed outdated OS/2 support 2009-09-19 07:22:07 +00:00
Sam Lantinga
6bb854b1d4 Removed outdated Dreamcast support 2009-09-19 07:21:22 +00:00
Sam Lantinga
5bee043a89 Removed outdated OS/2 support 2009-09-19 06:43:45 +00:00
Sam Lantinga
b856e71f8d Fixed issues building 64-bit Windows binary 2009-09-05 23:37:35 +00:00
Sam Lantinga
33472500be Bye bye SoundManager, you are officially obsolete... 2009-09-05 09:03:35 +00:00
Couriersud
df5d56827d Fixed compiling SDL_fsaudio.c against fusionsound 1.0.0 2009-08-03 18:07:31 +00:00
Sam Lantinga
306f1dc431 Von: Thomas Zimmermann
Betreff: [SDL] [PATCH] Make static variables const
Datum: Tue, 19 May 2009 19:45:37 +0200

Hi,

this is a set of simple changes which make some of SDL's internal static
arrays constant. The purpose is to shrink the number of write-able
static bytes and thus increase the number of memory pages shared between
SDL applications.

The patch set is against trunk@4513. Each of the attached patch files is
specific to a sub-system. The set is completed by a second mail, because
of the list's 40 KiB limit.

The files readelf-r4513.txt and readelf-const-patch.txt where made by
calling 'readelf -S libSDL.so'. They show the difference in ELF sections
without and with the patch. Some numbers measured on my x86-64:

Before

 [13] .rodata           PROGBITS         00000000000eaaa0  000eaaa0
      0000000000008170  0000000000000000   A       0     0     32
 [19] .data.rel.ro      PROGBITS         00000000003045e0  001045e0
      00000000000023d0  0000000000000000  WA       0     0     32
 [23] .data             PROGBITS         00000000003076e0  001076e0
      0000000000004988  0000000000000000  WA       0     0     32

After

 [13] .rodata           PROGBITS         00000000000eaaa0  000eaaa0
      0000000000009a50  0000000000000000   A       0     0     32
 [19] .data.rel.ro      PROGBITS         0000000000306040  00106040
      0000000000002608  0000000000000000  WA       0     0     32
 [23] .data             PROGBITS         0000000000309360  00109360
      0000000000002e88  0000000000000000  WA       0     0     32

The size of the write-able data section decreased considerably. Some
entries became const-after-relocation, while most of its content went
straight into the read-only data section.

Best regards, Thomas
2009-06-03 04:37:27 +00:00
Sam Lantinga
83d7309416 indent 2009-05-23 22:41:08 +00:00
Mike Gorchak
a0f9e311d5 Set audio device handle to NULL in case of open was not successful. 2009-05-14 11:50:05 +00:00
Sam Lantinga
3532a3491b Date: Mon, 23 Mar 2009 09:17:24 +0200
From: "Mike Gorchak"
Subject: New QNX patches

Please apply patch qnx4.diff, which is attached. What has been done:
1)Added back OpenGL ES renderer for QNX target. Added few corrections to
OpenGL ES renderer to let it work under QNX. OpenGL ES renderer do not
support textures under QNX, so I think some additional work must be done.
2) Added GL_OES_query_matrix extension to SDL_opengles.h header file, which
required by OpenGL ES 1.1 specification.
3) Added attribute clearing at the entrance of function
SDL_GL_GetAttribure(). Added error checking into the function
SDL_GL_GetAttribure(), because some attributes can't be obtained in OpenGL
ES 1.0.
4) Porting testdyngles to OpenGL ES 1.0 (1.1 has glColor4ub() and
glColor4f() functions, but 1.0 has glColor4f() only).
5) Added error checking after obtaining attributes using
SDL_GL_GetAttribute() function to the testgl2 and testgles.
6) Small correction to testmultiaudio with printing errors.
7) Added software and accelerated OpenGL ES 1.0 support into the QNX GF
driver.

Please remove ./src/audio/nto directory - it will not be used anymore.
Please create ./src/audio/qsa directory and add content of the archive
qsa.tar.gz into this directory. I rewrote some sound code, added support for
multiple audio cards, enumeration, etc. Added initial support for capture.

As far as I can understand SDL 1.3 is not supporting audio capture right now
? Sam, Am I right ? Or audio capture must be supported through the
PlayDevice routine ?

And last, please put file SDL_gf_opengles.c to  the ./src/video/qnxgf
directory. It is OpenGL ES 1.1 emulation layer for some functions, which are
not supported by OpenGL ES 1.0.
2009-03-24 10:33:12 +00:00
Sam Lantinga
be3e33ab11 Date: Tue, 17 Feb 2009 14:00:25 +0100
From: Stefan Klug
Subject: [SDL] Possible bug, paused audio playing garbage

On my WinCE device a paused audio device plays random garbage.
This might also be the issue in the thread "sound cracks with SDL_mixer
and AUDIO_S16LSB"

I don't have that much knowledge of the SDL audio part, but the attached
patch fixes it for me, and collapses two redundant ifs.

I'm not sure if this is the correct way to fix this.
Shouldn't the complete stream conversion part of the RunAudio loop be
dependent on the paused property of the device? (not only the call to
(*fill)(udata, istream, istream_len).

Anyways. Would be great if the patch or a fix could find its way to SVN ;-)

Cheers
Stefan
2009-03-23 05:21:40 +00:00
Sam Lantinga
2d957ea3af Fixed bug #633
Description From  Michael Stone   2008-09-25 19:27:29   (-) [reply]

To determine whether a pid is occupied with the kill(pid, 0) idiom, you have to
test

#include <signal.h>
#include <errno.h>
kill(pid, 0) < 0 && errno == ESRCH

not just

#include <signal.h>
kill(pid, 0) < 0

otherwise you get incorrect results when pid is running as a different user
(causing kill(pid, 0) to return -1 + EPERM).

src/audio/alsa/SDL_alsa_audio.c is certainly affected by this bug in both
1.2.13 and 1.3-trunk. It probably occurs in other places as well.
2009-02-17 05:17:51 +00:00
Sam Lantinga
765fb4319c indent 2009-01-14 04:25:32 +00:00
Sam Lantinga
00db62df34 Fixed Visual C++ build 2009-01-12 08:46:28 +00:00
Ryan C. Gordon
7b1b655f97 First shot at new audio resampling code. 2009-01-11 04:46:42 +00:00
Ryan C. Gordon
691269eeef NULL-terminate the lists of autogenerated converters. 2009-01-11 04:46:14 +00:00
Ryan C. Gordon
9d2f640b65 Allow builds that reduce or eliminate the converters/resamplers.
We should probably give options to drop resamplers by channels, too, for
 developers that know they'll never need more than stereo, etc.
2009-01-11 04:39:09 +00:00
Sam Lantinga
19b003367c Reverted Bob's indent checkin 2009-01-10 21:50:26 +00:00
Sam Lantinga
22938ecdfb Fixed Visual C++ release build for Visual C++ 2005
* Some math functions become intrinsic in release mode, so we need to
  convert all the math functions into SDL math functions, like we did
  with the stdlib functions.
* Constant initializers of 8-bit values become calls to memset() in
  release mode, but memset() itself is an intrinsic when explicitly
  called.  So we'll just explicitly call memset() in those cases.
2009-01-10 18:32:24 +00:00
Bob Pendleton
68ff2ab932 I ran a global "make indent" it modified the following files. 2009-01-09 20:43:30 +00:00
Ryan C. Gordon
1ddbabe312 First shot at autogenerated audio resamplers.
Don't check in a new SDL_audiotypecvt.c yet, though.
2009-01-09 15:41:45 +00:00
Sam Lantinga
a2acb16266 Fixed some dependency issues with SDL_revision.h 2009-01-04 05:41:52 +00:00
Sam Lantinga
c1137076fc Fixed crash on Windows 2009-01-03 07:33:42 +00:00
Ryan C. Gordon
f39707fb6c Fixed off-by-one in audio converters, when growing a data type's size. 2009-01-02 08:12:14 +00:00
Ryan C. Gordon
b0a587ce40 Avoid unnecessary assignment in generated audio type converters. 2009-01-02 07:34:01 +00:00
Sam Lantinga
f4135a38db Date: Thu, 01 Jan 2009 21:32:12 +0100
From: Couriersud
Subject: Fusionsound audio driver

attached is a diff containing a audio driver for the FusionSound
library. This sound library is closely related to DirectFB and uses the
same transport (fusion) as DirectFB when running applications "remote",
i.e. over the network. As such, it natively redirects sound where
DirectFB redirects video. This may be handy for everyone using SDL over
DirectFB.
2009-01-01 21:34:22 +00:00
Sam Lantinga
6c7b800444 indent 2009-01-01 08:21:19 +00:00
Ryan C. Gordon
b0ba20156b Audio driver priority: favor PulseAudio and ALSA over OSS. 2009-01-01 07:58:20 +00:00
Ryan C. Gordon
0f0a6bb19c Adjusted default choice of audio driver.
If a driver can definitely see available devices, it is chosen. Otherwise,
 we'll take the first driver that initializes but saw no devices...this might
 be because it can't enumerate them, or there really aren't any available.

This prevents the dsp driver from hogging control when there are no /dev/dsp*
 nodes (for example, on a Linux box with ALSA and no OSS emulation).
2009-01-01 07:54:58 +00:00
Sam Lantinga
daf038ecc4 indent 2008-12-20 08:41:05 +00:00
Ryan C. Gordon
e0728d1927 More resampling fixes. 2008-12-19 09:15:59 +00:00
Ryan C. Gordon
29777ee64b Allocate SDL_AudioCVT::coeff before using it.
FIXME: this is a memory leak. We don't have an SDL_FreeAudioCVT() yet.
2008-12-19 08:30:26 +00:00
Ryan C. Gordon
809690101a Use SDL_zerop instead of SDL_memset. 2008-12-19 06:43:41 +00:00
Ryan C. Gordon
59c33d9a0b Zero out SDL_AudioCVT struct before using it, to ensure it's all initialized. 2008-12-19 06:01:03 +00:00
Sam Lantinga
c5a8886195 Fixed SDL 1.2 compatibility problem.
The API specifies that SDL_OpenAudio() will fill out the 'desired' audio spec
with the correct samples and size set by the driver.  This value is important
since it may be used by applications that size audio buffers, etc.

However, we want to allow advanced applications to call SDL_OpenAudioDevice()
which gets passed a const 'desired' parameter, and have the correct data filled
into the 'obtained' parameter, possibly allowing or not allowing format changes.

So... 'obtained' becomes the audio format the user callback is expected to use,
and we add flags to allow the application to specify which format changes are
allowed.

Note: We really need to add a way to query the 'obtained' audio spec.
2008-12-13 06:36:47 +00:00