Commit df971a5e authored by Sam Lantinga's avatar Sam Lantinga

Updated ALSA audio support for ALSA 0.9

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40355
parent 33c6476a
......@@ -269,14 +269,25 @@ CheckALSA()
[ --enable-alsa support the ALSA audio API [default=yes]],
, enable_alsa=yes)
if test x$enable_audio = xyes -a x$enable_alsa = xyes; then
AC_MSG_CHECKING(for ALSA audio support)
have_alsa=no
AC_CHECK_HEADER(sys/asoundlib.h, have_alsa_hdr=yes)
AC_CHECK_LIB(asound, snd_pcm_open, have_alsa_lib=yes)
if test x$have_alsa_hdr = xyes -a x$have_alsa_lib = xyes; then
AC_TRY_COMPILE([
#include <alsa/asoundlib.h>
],[
#if SND_LIB_VERSION < ((0<<16)|(9<<8)|0)
#error Your version of ALSA is too old
#endif
snd_pcm_t *pcm_handle;
],[
AC_CHECK_LIB(asound, snd_pcm_open, have_alsa=yes)
])
if test x$have_alsa = xyes; then
CFLAGS="$CFLAGS -DALSA_SUPPORT"
SYSTEM_LIBS="$SYSTEM_LIBS -lasound"
AUDIO_SUBDIRS="$AUDIO_SUBDIRS alsa"
AUDIO_DRIVERS="$AUDIO_DRIVERS alsa/libaudio_alsa.la"
else
AC_MSG_RESULT($have_alsa)
fi
fi
}
......
This diff is collapsed.
......@@ -24,38 +24,27 @@
#define _ALSA_PCM_audio_h
#include "SDL_sysaudio.h"
#include <sys/asoundlib.h>
#include <alsa/asoundlib.h>
/* Hidden "this" pointer for the video functions */
#define _THIS SDL_AudioDevice *this
struct SDL_PrivateAudioData {
/* The audio device handle */
snd_pcm_t *audio_handle;
/* The audio file descriptor */
int audio_fd;
snd_pcm_t *pcm_handle;
/* The parent process id, to detect when application quits */
pid_t parent;
/* Raw mixing buffer */
Uint8 *pcm_buf;
int pcm_len;
/* Support for audio timing using a timer, in addition to select() */
float frame_ticks;
float next_frame;
Uint8 *mixbuf;
int mixlen;
};
#define FUDGE_TICKS 10 /* The scheduler overhead ticks per frame */
/* Old variable names */
#define audio_handle (this->hidden->audio_handle)
#define audio_fd (this->hidden->audio_fd)
#define pcm_handle (this->hidden->pcm_handle)
#define parent (this->hidden->parent)
#define pcm_buf (this->hidden->pcm_buf)
#define pcm_len (this->hidden->pcm_len)
#define frame_ticks (this->hidden->frame_ticks)
#define next_frame (this->hidden->next_frame)
#define mixbuf (this->hidden->mixbuf)
#define mixlen (this->hidden->mixlen)
#endif /* _ALSA_PCM_audio_h */
......@@ -377,6 +377,7 @@ static int DMA_OpenAudio(_THIS, SDL_AudioSpec *spec)
}
break;
default:
format = 0;
break;
}
if ( ! format ) {
......
......@@ -394,6 +394,7 @@ static int DSP_OpenAudio(_THIS, SDL_AudioSpec *spec)
}
break;
default:
format = 0;
break;
}
if ( ! format ) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment