Search
lxdream.org :: lxdream :: r657:c4143facbfcb
lxdream 0.9.1
released Jun 29
Download Now
changeset657:c4143facbfcb
parent656:031d23fa6d0b
child658:f5926310bfbe
authornkeynes
dateWed Apr 16 10:12:12 2008 +0000 (16 years ago)
Add support for the pulseaudio sound system
Makefile.in
config.h.in
configure
configure.in
src/Makefile.am
src/Makefile.in
src/aica/audio.c
src/aica/audio.h
src/drivers/audio_pulse.c
1.1 --- a/Makefile.in Wed Apr 02 01:46:58 2008 +0000
1.2 +++ b/Makefile.in Wed Apr 16 10:12:12 2008 +0000
1.3 @@ -49,6 +49,8 @@
1.4 AUDIO_ALSA_TRUE = @AUDIO_ALSA_TRUE@
1.5 AUDIO_ESOUND_FALSE = @AUDIO_ESOUND_FALSE@
1.6 AUDIO_ESOUND_TRUE = @AUDIO_ESOUND_TRUE@
1.7 +AUDIO_PULSE_FALSE = @AUDIO_PULSE_FALSE@
1.8 +AUDIO_PULSE_TRUE = @AUDIO_PULSE_TRUE@
1.9 AUTOCONF = @AUTOCONF@
1.10 AUTOHEADER = @AUTOHEADER@
1.11 AUTOMAKE = @AUTOMAKE@
1.12 @@ -129,6 +131,8 @@
1.13 POSUB = @POSUB@
1.14 PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@
1.15 PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@
1.16 +PULSE_CFLAGS = @PULSE_CFLAGS@
1.17 +PULSE_LIBS = @PULSE_LIBS@
1.18 SET_MAKE = @SET_MAKE@
1.19 SHCC = @SHCC@
1.20 SHELL = @SHELL@
2.1 --- a/config.h.in Wed Apr 02 01:46:58 2008 +0000
2.2 +++ b/config.h.in Wed Apr 16 10:12:12 2008 +0000
2.3 @@ -76,6 +76,9 @@
2.4 /* Have ARB shader support */
2.5 #undef HAVE_OPENGL_SHADER_ARB
2.6
2.7 +/* Have pulseaudio support */
2.8 +#undef HAVE_PULSE
2.9 +
2.10 /* Define to 1 if you have the <stdint.h> header file. */
2.11 #undef HAVE_STDINT_H
2.12
3.1 --- a/configure Wed Apr 02 01:46:58 2008 +0000
3.2 +++ b/configure Wed Apr 16 10:12:12 2008 +0000
3.3 @@ -715,6 +715,10 @@
3.4 BUILD_SH4X86_FALSE
3.5 BUILD_X86_64_TRUE
3.6 BUILD_X86_64_FALSE
3.7 +PULSE_CFLAGS
3.8 +PULSE_LIBS
3.9 +AUDIO_PULSE_TRUE
3.10 +AUDIO_PULSE_FALSE
3.11 ESOUND_CFLAGS
3.12 ESOUND_LIBS
3.13 AUDIO_ESOUND_TRUE
3.14 @@ -771,6 +775,8 @@
3.15 LIBPNG_LIBS
3.16 GTK_CFLAGS
3.17 GTK_LIBS
3.18 +PULSE_CFLAGS
3.19 +PULSE_LIBS
3.20 ESOUND_CFLAGS
3.21 ESOUND_LIBS
3.22 ALSA_CFLAGS
3.23 @@ -1382,6 +1388,9 @@
3.24 LIBPNG_LIBS linker flags for LIBPNG, overriding pkg-config
3.25 GTK_CFLAGS C compiler flags for GTK, overriding pkg-config
3.26 GTK_LIBS linker flags for GTK, overriding pkg-config
3.27 + PULSE_CFLAGS
3.28 + C compiler flags for PULSE, overriding pkg-config
3.29 + PULSE_LIBS linker flags for PULSE, overriding pkg-config
3.30 ESOUND_CFLAGS
3.31 C compiler flags for ESOUND, overriding pkg-config
3.32 ESOUND_LIBS linker flags for ESOUND, overriding pkg-config
3.33 @@ -6422,6 +6431,94 @@
3.34
3.35
3.36 pkg_failed=no
3.37 +{ echo "$as_me:$LINENO: checking for PULSE" >&5
3.38 +echo $ECHO_N "checking for PULSE... $ECHO_C" >&6; }
3.39 +
3.40 +if test -n "$PKG_CONFIG"; then
3.41 + if test -n "$PULSE_CFLAGS"; then
3.42 + pkg_cv_PULSE_CFLAGS="$PULSE_CFLAGS"
3.43 + else
3.44 + if test -n "$PKG_CONFIG" && \
3.45 + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libpulse-simple\"") >&5
3.46 + ($PKG_CONFIG --exists --print-errors "libpulse-simple") 2>&5
3.47 + ac_status=$?
3.48 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
3.49 + (exit $ac_status); }; then
3.50 + pkg_cv_PULSE_CFLAGS=`$PKG_CONFIG --cflags "libpulse-simple" 2>/dev/null`
3.51 +else
3.52 + pkg_failed=yes
3.53 +fi
3.54 + fi
3.55 +else
3.56 + pkg_failed=untried
3.57 +fi
3.58 +if test -n "$PKG_CONFIG"; then
3.59 + if test -n "$PULSE_LIBS"; then
3.60 + pkg_cv_PULSE_LIBS="$PULSE_LIBS"
3.61 + else
3.62 + if test -n "$PKG_CONFIG" && \
3.63 + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libpulse-simple\"") >&5
3.64 + ($PKG_CONFIG --exists --print-errors "libpulse-simple") 2>&5
3.65 + ac_status=$?
3.66 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
3.67 + (exit $ac_status); }; then
3.68 + pkg_cv_PULSE_LIBS=`$PKG_CONFIG --libs "libpulse-simple" 2>/dev/null`
3.69 +else
3.70 + pkg_failed=yes
3.71 +fi
3.72 + fi
3.73 +else
3.74 + pkg_failed=untried
3.75 +fi
3.76 +
3.77 +
3.78 +
3.79 +if test $pkg_failed = yes; then
3.80 +
3.81 +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
3.82 + _pkg_short_errors_supported=yes
3.83 +else
3.84 + _pkg_short_errors_supported=no
3.85 +fi
3.86 + if test $_pkg_short_errors_supported = yes; then
3.87 + PULSE_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "libpulse-simple"`
3.88 + else
3.89 + PULSE_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libpulse-simple"`
3.90 + fi
3.91 + # Put the nasty error message in config.log where it belongs
3.92 + echo "$PULSE_PKG_ERRORS" >&5
3.93 +
3.94 + { echo "$as_me:$LINENO: result: no" >&5
3.95 +echo "${ECHO_T}no" >&6; }
3.96 + true
3.97 +elif test $pkg_failed = untried; then
3.98 + true
3.99 +else
3.100 + PULSE_CFLAGS=$pkg_cv_PULSE_CFLAGS
3.101 + PULSE_LIBS=$pkg_cv_PULSE_LIBS
3.102 + { echo "$as_me:$LINENO: result: yes" >&5
3.103 +echo "${ECHO_T}yes" >&6; }
3.104 +
3.105 + HAVE_PULSE='yes'
3.106 +
3.107 +cat >>confdefs.h <<\_ACEOF
3.108 +#define HAVE_PULSE 1
3.109 +_ACEOF
3.110 +
3.111 +fi
3.112 +
3.113 +
3.114 +if test "$HAVE_PULSE" = 'yes' ; then
3.115 + AUDIO_PULSE_TRUE=
3.116 + AUDIO_PULSE_FALSE='#'
3.117 +else
3.118 + AUDIO_PULSE_TRUE='#'
3.119 + AUDIO_PULSE_FALSE=
3.120 +fi
3.121 +
3.122 +
3.123 +
3.124 +pkg_failed=no
3.125 { echo "$as_me:$LINENO: checking for ESOUND" >&5
3.126 echo $ECHO_N "checking for ESOUND... $ECHO_C" >&6; }
3.127
3.128 @@ -6481,9 +6578,9 @@
3.129
3.130 { echo "$as_me:$LINENO: result: no" >&5
3.131 echo "${ECHO_T}no" >&6; }
3.132 - echo "Warning: esound not found - building without esd audio support"
3.133 + true
3.134 elif test $pkg_failed = untried; then
3.135 - echo "Warning: esound not found - building without esd audio support"
3.136 + true
3.137 else
3.138 ESOUND_CFLAGS=$pkg_cv_ESOUND_CFLAGS
3.139 ESOUND_LIBS=$pkg_cv_ESOUND_LIBS
3.140 @@ -6569,9 +6666,9 @@
3.141
3.142 { echo "$as_me:$LINENO: result: no" >&5
3.143 echo "${ECHO_T}no" >&6; }
3.144 - echo "Warning: alsa not found - building without alsa audio support"
3.145 + true
3.146 elif test $pkg_failed = untried; then
3.147 - echo "Warning: alsa not found - building without alsa audio support"
3.148 + true
3.149 else
3.150 ALSA_CFLAGS=$pkg_cv_ALSA_CFLAGS
3.151 ALSA_LIBS=$pkg_cv_ALSA_LIBS
3.152 @@ -6596,6 +6693,10 @@
3.153 fi
3.154
3.155
3.156 +if test "x$HAVE_ESOUND" = "x" -a "x$HAVE_ALSA" = "x" -a "x$HAVE_PULSE" = "x"; then
3.157 + echo "Warning: Building without audio support"
3.158 +fi
3.159 +
3.160 if test "${ac_cv_header_linux_cdrom_h+set}" = set; then
3.161 { echo "$as_me:$LINENO: checking for linux/cdrom.h" >&5
3.162 echo $ECHO_N "checking for linux/cdrom.h... $ECHO_C" >&6; }
3.163 @@ -6740,6 +6841,7 @@
3.164 fi
3.165
3.166
3.167 +
3.168 if test "${ac_cv_header_linux_joystick_h+set}" = set; then
3.169 { echo "$as_me:$LINENO: checking for linux/joystick.h" >&5
3.170 echo $ECHO_N "checking for linux/joystick.h... $ECHO_C" >&6; }
3.171 @@ -8851,6 +8953,13 @@
3.172 Usually this means the macro was only invoked conditionally." >&2;}
3.173 { (exit 1); exit 1; }; }
3.174 fi
3.175 +if test -z "${AUDIO_PULSE_TRUE}" && test -z "${AUDIO_PULSE_FALSE}"; then
3.176 + { { echo "$as_me:$LINENO: error: conditional \"AUDIO_PULSE\" was never defined.
3.177 +Usually this means the macro was only invoked conditionally." >&5
3.178 +echo "$as_me: error: conditional \"AUDIO_PULSE\" was never defined.
3.179 +Usually this means the macro was only invoked conditionally." >&2;}
3.180 + { (exit 1); exit 1; }; }
3.181 +fi
3.182 if test -z "${AUDIO_ESOUND_TRUE}" && test -z "${AUDIO_ESOUND_FALSE}"; then
3.183 { { echo "$as_me:$LINENO: error: conditional \"AUDIO_ESOUND\" was never defined.
3.184 Usually this means the macro was only invoked conditionally." >&5
3.185 @@ -9572,6 +9681,10 @@
3.186 BUILD_SH4X86_FALSE!$BUILD_SH4X86_FALSE$ac_delim
3.187 BUILD_X86_64_TRUE!$BUILD_X86_64_TRUE$ac_delim
3.188 BUILD_X86_64_FALSE!$BUILD_X86_64_FALSE$ac_delim
3.189 +PULSE_CFLAGS!$PULSE_CFLAGS$ac_delim
3.190 +PULSE_LIBS!$PULSE_LIBS$ac_delim
3.191 +AUDIO_PULSE_TRUE!$AUDIO_PULSE_TRUE$ac_delim
3.192 +AUDIO_PULSE_FALSE!$AUDIO_PULSE_FALSE$ac_delim
3.193 ESOUND_CFLAGS!$ESOUND_CFLAGS$ac_delim
3.194 ESOUND_LIBS!$ESOUND_LIBS$ac_delim
3.195 AUDIO_ESOUND_TRUE!$AUDIO_ESOUND_TRUE$ac_delim
3.196 @@ -9615,7 +9728,7 @@
3.197 LTLIBOBJS!$LTLIBOBJS$ac_delim
3.198 _ACEOF
3.199
3.200 - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 46; then
3.201 + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 50; then
3.202 break
3.203 elif $ac_last_try; then
3.204 { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
4.1 --- a/configure.in Wed Apr 02 01:46:58 2008 +0000
4.2 +++ b/configure.in Wed Apr 16 10:12:12 2008 +0000
4.3 @@ -91,25 +91,34 @@
4.4 AM_CONDITIONAL(BUILD_X86_64, [test "$SH4_TRANSLATOR" = "x86_64"])
4.5
4.6 dnl ------------------ Optional driver support -------------------
4.7 +dnl Check for pulseaudio
4.8 +PKG_CHECK_MODULES(PULSE, [libpulse-simple], [
4.9 + HAVE_PULSE='yes'
4.10 + AC_DEFINE([HAVE_PULSE],1,[Have pulseaudio support]) ], [true])
4.11 +AM_CONDITIONAL( AUDIO_PULSE, [test "$HAVE_PULSE" = 'yes'] )
4.12 +
4.13 dnl Check for esound
4.14 PKG_CHECK_MODULES(ESOUND, [esound], [
4.15 HAVE_ESOUND='yes'
4.16 - AC_DEFINE([HAVE_ESOUND],1,[Have esound support]) ],
4.17 - [ echo "Warning: esound not found - building without esd audio support" ])
4.18 + AC_DEFINE([HAVE_ESOUND],1,[Have esound support]) ], [true])
4.19 AM_CONDITIONAL( AUDIO_ESOUND, [test "$HAVE_ESOUND" = 'yes'] )
4.20
4.21 dnl Check for alsa support
4.22 PKG_CHECK_MODULES(ALSA, [alsa], [
4.23 HAVE_ALSA='yes'
4.24 - AC_DEFINE([HAVE_ALSA],1,[Have alsa support]) ],
4.25 - [ echo "Warning: alsa not found - building without alsa audio support" ])
4.26 + AC_DEFINE([HAVE_ALSA],1,[Have alsa support]) ], [true])
4.27 AM_CONDITIONAL( AUDIO_ALSA, [test "$HAVE_ALSA" = 'yes'] )
4.28
4.29 +if test "x$HAVE_ESOUND" = "x" -a "x$HAVE_ALSA" = "x" -a "x$HAVE_PULSE" = "x"; then
4.30 + echo "Warning: Building without audio support"
4.31 +fi
4.32 +
4.33 dnl Check for linux cdrom device support
4.34 AC_CHECK_HEADER([linux/cdrom.h], [HAVE_LINUX_CDROM_H=yes], [
4.35 echo "Linux CDROM support not found, building without it."] )
4.36 AM_CONDITIONAL(CDROM_LINUX, [test "$HAVE_LINUX_CDROM_H" = "yes"])
4.37
4.38 +
4.39 AC_CHECK_HEADER([linux/joystick.h], [
4.40 HAVE_LINUX_JOYSTICK_H=yes
4.41 AC_DEFINE([HAVE_LINUX_JOYSTICK], 1, [Have linux joystick support]) ],
5.1 --- a/src/Makefile.am Wed Apr 02 01:46:58 2008 +0000
5.2 +++ b/src/Makefile.am Wed Apr 16 10:12:12 2008 +0000
5.3 @@ -5,7 +5,7 @@
5.4 -DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
5.5 -DPACKAGE_CONF_DIR=\""$(sysconfdir)"\" \
5.6 -Ish4 \
5.7 - @GTK_CFLAGS@ @LIBPNG_CFLAGS@ @ESOUND_CFLAGS@ @ALSA_CFLAGS@
5.8 + @GTK_CFLAGS@ @LIBPNG_CFLAGS@ @PULSE_CFLAGS@ @ESOUND_CFLAGS@ @ALSA_CFLAGS@
5.9
5.10 bin_PROGRAMS = lxdream
5.11 noinst_PROGRAMS = gendec genglsl
5.12 @@ -90,6 +90,10 @@
5.13 lxdream_SOURCES += drivers/joy_linux.c
5.14 endif
5.15
5.16 +if AUDIO_PULSE
5.17 +lxdream_SOURCES += drivers/audio_pulse.c
5.18 +endif
5.19 +
5.20 if AUDIO_ESOUND
5.21 lxdream_SOURCES += drivers/audio_esd.c
5.22 endif
5.23 @@ -98,7 +102,7 @@
5.24 lxdream_SOURCES += drivers/audio_alsa.c
5.25 endif
5.26
5.27 -lxdream_LDADD = @GTK_LIBS@ @LIBPNG_LIBS@ @ESOUND_LIBS@ @ALSA_LIBS@ $(INTLLIBS)
5.28 +lxdream_LDADD = @GTK_LIBS@ @LIBPNG_LIBS@ @PULSE_LIBS@ @ESOUND_LIBS@ @ALSA_LIBS@ $(INTLLIBS)
5.29
5.30 gendec_LDADD = @GTK_LIBS@ $(INTLLIBS)
5.31 genglsl_LDADD = @GTK_LIBS@ $(INTLLIBS)
6.1 --- a/src/Makefile.in Wed Apr 02 01:46:58 2008 +0000
6.2 +++ b/src/Makefile.in Wed Apr 16 10:12:12 2008 +0000
6.3 @@ -60,8 +60,9 @@
6.4 @CDROM_LINUX_TRUE@am__append_5 = drivers/cd_linux.c
6.5 @CDROM_LINUX_FALSE@am__append_6 = drivers/cd_none.c
6.6 @JOY_LINUX_TRUE@am__append_7 = drivers/joy_linux.c
6.7 -@AUDIO_ESOUND_TRUE@am__append_8 = drivers/audio_esd.c
6.8 -@AUDIO_ALSA_TRUE@am__append_9 = drivers/audio_alsa.c
6.9 +@AUDIO_PULSE_TRUE@am__append_8 = drivers/audio_pulse.c
6.10 +@AUDIO_ESOUND_TRUE@am__append_9 = drivers/audio_esd.c
6.11 +@AUDIO_ALSA_TRUE@am__append_10 = drivers/audio_alsa.c
6.12 ACLOCAL = @ACLOCAL@
6.13 ALSA_CFLAGS = @ALSA_CFLAGS@
6.14 ALSA_LIBS = @ALSA_LIBS@
6.15 @@ -75,6 +76,8 @@
6.16 AUDIO_ALSA_TRUE = @AUDIO_ALSA_TRUE@
6.17 AUDIO_ESOUND_FALSE = @AUDIO_ESOUND_FALSE@
6.18 AUDIO_ESOUND_TRUE = @AUDIO_ESOUND_TRUE@
6.19 +AUDIO_PULSE_FALSE = @AUDIO_PULSE_FALSE@
6.20 +AUDIO_PULSE_TRUE = @AUDIO_PULSE_TRUE@
6.21 AUTOCONF = @AUTOCONF@
6.22 AUTOHEADER = @AUTOHEADER@
6.23 AUTOMAKE = @AUTOMAKE@
6.24 @@ -155,6 +158,8 @@
6.25 POSUB = @POSUB@
6.26 PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@
6.27 PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@
6.28 +PULSE_CFLAGS = @PULSE_CFLAGS@
6.29 +PULSE_LIBS = @PULSE_LIBS@
6.30 SET_MAKE = @SET_MAKE@
6.31 SHCC = @SHCC@
6.32 SHELL = @SHELL@
6.33 @@ -210,7 +215,7 @@
6.34 -DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
6.35 -DPACKAGE_CONF_DIR=\""$(sysconfdir)"\" \
6.36 -Ish4 \
6.37 - @GTK_CFLAGS@ @LIBPNG_CFLAGS@ @ESOUND_CFLAGS@ @ALSA_CFLAGS@
6.38 + @GTK_CFLAGS@ @LIBPNG_CFLAGS@ @PULSE_CFLAGS@ @ESOUND_CFLAGS@ @ALSA_CFLAGS@
6.39
6.40
6.41 bin_PROGRAMS = lxdream
6.42 @@ -250,7 +255,7 @@
6.43 display.c display.h dckeysyms.h \
6.44 drivers/audio_null.c drivers/video_null.c \
6.45 drivers/video_gl.c drivers/video_gl.h drivers/gl_fbo.c\
6.46 -$(am__append_1) $(am__append_3) $(am__append_4) $(am__append_5) $(am__append_6) $(am__append_7) $(am__append_8) $(am__append_9)
6.47 +$(am__append_1) $(am__append_3) $(am__append_4) $(am__append_5) $(am__append_6) $(am__append_7) $(am__append_8) $(am__append_9) $(am__append_10)
6.48
6.49 @BUILD_SH4X86_TRUE@test_testsh4x86_LDADD = @GTK_LIBS@
6.50 @BUILD_SH4X86_TRUE@test_testsh4x86_SOURCES = test/testsh4x86.c x86dasm/x86dasm.c \
6.51 @@ -260,7 +265,7 @@
6.52 @BUILD_SH4X86_TRUE@ sh4/xltcache.h mem.c util.c sh4/mmu.c
6.53
6.54
6.55 -lxdream_LDADD = @GTK_LIBS@ @LIBPNG_LIBS@ @ESOUND_LIBS@ @ALSA_LIBS@ $(INTLLIBS)
6.56 +lxdream_LDADD = @GTK_LIBS@ @LIBPNG_LIBS@ @PULSE_LIBS@ @ESOUND_LIBS@ @ALSA_LIBS@ $(INTLLIBS)
6.57
6.58 gendec_LDADD = @GTK_LIBS@ $(INTLLIBS)
6.59 genglsl_LDADD = @GTK_LIBS@ $(INTLLIBS)
6.60 @@ -317,7 +322,8 @@
6.61 gtkui/gdrom_menu.c drivers/video_gtk.c drivers/video_gtk.h \
6.62 drivers/video_gdk.c drivers/video_gdk.h drivers/video_glx.c \
6.63 drivers/video_glx.h drivers/cd_linux.c drivers/cd_none.c \
6.64 - drivers/joy_linux.c drivers/audio_esd.c drivers/audio_alsa.c
6.65 + drivers/joy_linux.c drivers/audio_pulse.c drivers/audio_esd.c \
6.66 + drivers/audio_alsa.c
6.67 @BUILD_SH4X86_TRUE@am__objects_1 = sh4x86.$(OBJEXT) sh4trans.$(OBJEXT) \
6.68 @BUILD_SH4X86_TRUE@ x86dasm.$(OBJEXT) i386-dis.$(OBJEXT) \
6.69 @BUILD_SH4X86_TRUE@ dis-init.$(OBJEXT) dis-buf.$(OBJEXT)
6.70 @@ -346,8 +352,9 @@
6.71 @CDROM_LINUX_TRUE@am__objects_4 = cd_linux.$(OBJEXT)
6.72 @CDROM_LINUX_FALSE@am__objects_5 = cd_none.$(OBJEXT)
6.73 @JOY_LINUX_TRUE@am__objects_6 = joy_linux.$(OBJEXT)
6.74 -@AUDIO_ESOUND_TRUE@am__objects_7 = audio_esd.$(OBJEXT)
6.75 -@AUDIO_ALSA_TRUE@am__objects_8 = audio_alsa.$(OBJEXT)
6.76 +@AUDIO_PULSE_TRUE@am__objects_7 = audio_pulse.$(OBJEXT)
6.77 +@AUDIO_ESOUND_TRUE@am__objects_8 = audio_esd.$(OBJEXT)
6.78 +@AUDIO_ALSA_TRUE@am__objects_9 = audio_alsa.$(OBJEXT)
6.79 am_lxdream_OBJECTS = main.$(OBJEXT) config.$(OBJEXT) mem.$(OBJEXT) \
6.80 watch.$(OBJEXT) asic.$(OBJEXT) syscall.$(OBJEXT) bios.$(OBJEXT) \
6.81 dcload.$(OBJEXT) ide.$(OBJEXT) gdimage.$(OBJEXT) \
6.82 @@ -369,7 +376,7 @@
6.83 video_gl.$(OBJEXT) gl_fbo.$(OBJEXT) $(am__objects_1) \
6.84 $(am__objects_2) $(am__objects_3) $(am__objects_4) \
6.85 $(am__objects_5) $(am__objects_6) $(am__objects_7) \
6.86 - $(am__objects_8)
6.87 + $(am__objects_8) $(am__objects_9)
6.88 lxdream_OBJECTS = $(am_lxdream_OBJECTS)
6.89 lxdream_DEPENDENCIES =
6.90 lxdream_LDFLAGS =
6.91 @@ -402,45 +409,46 @@
6.92 @AMDEP_TRUE@ ./$(DEPDIR)/armmem.Po ./$(DEPDIR)/asic.Po \
6.93 @AMDEP_TRUE@ ./$(DEPDIR)/audio.Po ./$(DEPDIR)/audio_alsa.Po \
6.94 @AMDEP_TRUE@ ./$(DEPDIR)/audio_esd.Po ./$(DEPDIR)/audio_null.Po \
6.95 -@AMDEP_TRUE@ ./$(DEPDIR)/bios.Po ./$(DEPDIR)/bootstrap.Po \
6.96 -@AMDEP_TRUE@ ./$(DEPDIR)/cd_linux.Po ./$(DEPDIR)/cd_none.Po \
6.97 -@AMDEP_TRUE@ ./$(DEPDIR)/cdi.Po ./$(DEPDIR)/config.Po \
6.98 -@AMDEP_TRUE@ ./$(DEPDIR)/controller.Po ./$(DEPDIR)/ctrl_dlg.Po \
6.99 -@AMDEP_TRUE@ ./$(DEPDIR)/dcload.Po ./$(DEPDIR)/debug_win.Po \
6.100 -@AMDEP_TRUE@ ./$(DEPDIR)/dis-buf.Po ./$(DEPDIR)/dis-init.Po \
6.101 -@AMDEP_TRUE@ ./$(DEPDIR)/display.Po ./$(DEPDIR)/dmac.Po \
6.102 -@AMDEP_TRUE@ ./$(DEPDIR)/dreamcast.Po ./$(DEPDIR)/dump_win.Po \
6.103 -@AMDEP_TRUE@ ./$(DEPDIR)/edc_ecc.Po ./$(DEPDIR)/eventq.Po \
6.104 -@AMDEP_TRUE@ ./$(DEPDIR)/gdi.Po ./$(DEPDIR)/gdimage.Po \
6.105 -@AMDEP_TRUE@ ./$(DEPDIR)/gdrom.Po ./$(DEPDIR)/gdrom_menu.Po \
6.106 -@AMDEP_TRUE@ ./$(DEPDIR)/gendec.Po ./$(DEPDIR)/genglsl.Po \
6.107 -@AMDEP_TRUE@ ./$(DEPDIR)/gl_fbo.Po ./$(DEPDIR)/gl_sl.Po \
6.108 -@AMDEP_TRUE@ ./$(DEPDIR)/gl_slsrc.Po ./$(DEPDIR)/glrender.Po \
6.109 -@AMDEP_TRUE@ ./$(DEPDIR)/glutil.Po ./$(DEPDIR)/gtkcb.Po \
6.110 -@AMDEP_TRUE@ ./$(DEPDIR)/gtkui.Po ./$(DEPDIR)/i386-dis.Po \
6.111 -@AMDEP_TRUE@ ./$(DEPDIR)/ide.Po ./$(DEPDIR)/insparse.Po \
6.112 -@AMDEP_TRUE@ ./$(DEPDIR)/intc.Po ./$(DEPDIR)/joy_linux.Po \
6.113 -@AMDEP_TRUE@ ./$(DEPDIR)/kbd.Po ./$(DEPDIR)/loader.Po \
6.114 -@AMDEP_TRUE@ ./$(DEPDIR)/main.Po ./$(DEPDIR)/main_win.Po \
6.115 -@AMDEP_TRUE@ ./$(DEPDIR)/maple.Po ./$(DEPDIR)/mem.Po \
6.116 -@AMDEP_TRUE@ ./$(DEPDIR)/mmio_win.Po ./$(DEPDIR)/mmu.Po \
6.117 -@AMDEP_TRUE@ ./$(DEPDIR)/mouse.Po ./$(DEPDIR)/nrg.Po \
6.118 -@AMDEP_TRUE@ ./$(DEPDIR)/path_dlg.Po ./$(DEPDIR)/pvr2.Po \
6.119 -@AMDEP_TRUE@ ./$(DEPDIR)/pvr2mem.Po ./$(DEPDIR)/rendbkg.Po \
6.120 -@AMDEP_TRUE@ ./$(DEPDIR)/rendsave.Po ./$(DEPDIR)/rendsort.Po \
6.121 -@AMDEP_TRUE@ ./$(DEPDIR)/scene.Po ./$(DEPDIR)/scif.Po \
6.122 -@AMDEP_TRUE@ ./$(DEPDIR)/sh4.Po ./$(DEPDIR)/sh4core.Po \
6.123 -@AMDEP_TRUE@ ./$(DEPDIR)/sh4dasm.Po ./$(DEPDIR)/sh4mem.Po \
6.124 -@AMDEP_TRUE@ ./$(DEPDIR)/sh4mmio.Po ./$(DEPDIR)/sh4stat.Po \
6.125 -@AMDEP_TRUE@ ./$(DEPDIR)/sh4trans.Po ./$(DEPDIR)/sh4x86.Po \
6.126 -@AMDEP_TRUE@ ./$(DEPDIR)/syscall.Po ./$(DEPDIR)/tacore.Po \
6.127 -@AMDEP_TRUE@ ./$(DEPDIR)/testsh4x86.Po ./$(DEPDIR)/testxlt.Po \
6.128 -@AMDEP_TRUE@ ./$(DEPDIR)/texcache.Po ./$(DEPDIR)/timer.Po \
6.129 -@AMDEP_TRUE@ ./$(DEPDIR)/util.Po ./$(DEPDIR)/video_gdk.Po \
6.130 -@AMDEP_TRUE@ ./$(DEPDIR)/video_gl.Po ./$(DEPDIR)/video_glx.Po \
6.131 -@AMDEP_TRUE@ ./$(DEPDIR)/video_gtk.Po ./$(DEPDIR)/video_null.Po \
6.132 -@AMDEP_TRUE@ ./$(DEPDIR)/watch.Po ./$(DEPDIR)/x86dasm.Po \
6.133 -@AMDEP_TRUE@ ./$(DEPDIR)/xltcache.Po ./$(DEPDIR)/yuv.Po
6.134 +@AMDEP_TRUE@ ./$(DEPDIR)/audio_pulse.Po ./$(DEPDIR)/bios.Po \
6.135 +@AMDEP_TRUE@ ./$(DEPDIR)/bootstrap.Po ./$(DEPDIR)/cd_linux.Po \
6.136 +@AMDEP_TRUE@ ./$(DEPDIR)/cd_none.Po ./$(DEPDIR)/cdi.Po \
6.137 +@AMDEP_TRUE@ ./$(DEPDIR)/config.Po ./$(DEPDIR)/controller.Po \
6.138 +@AMDEP_TRUE@ ./$(DEPDIR)/ctrl_dlg.Po ./$(DEPDIR)/dcload.Po \
6.139 +@AMDEP_TRUE@ ./$(DEPDIR)/debug_win.Po ./$(DEPDIR)/dis-buf.Po \
6.140 +@AMDEP_TRUE@ ./$(DEPDIR)/dis-init.Po ./$(DEPDIR)/display.Po \
6.141 +@AMDEP_TRUE@ ./$(DEPDIR)/dmac.Po ./$(DEPDIR)/dreamcast.Po \
6.142 +@AMDEP_TRUE@ ./$(DEPDIR)/dump_win.Po ./$(DEPDIR)/edc_ecc.Po \
6.143 +@AMDEP_TRUE@ ./$(DEPDIR)/eventq.Po ./$(DEPDIR)/gdi.Po \
6.144 +@AMDEP_TRUE@ ./$(DEPDIR)/gdimage.Po ./$(DEPDIR)/gdrom.Po \
6.145 +@AMDEP_TRUE@ ./$(DEPDIR)/gdrom_menu.Po ./$(DEPDIR)/gendec.Po \
6.146 +@AMDEP_TRUE@ ./$(DEPDIR)/genglsl.Po ./$(DEPDIR)/gl_fbo.Po \
6.147 +@AMDEP_TRUE@ ./$(DEPDIR)/gl_sl.Po ./$(DEPDIR)/gl_slsrc.Po \
6.148 +@AMDEP_TRUE@ ./$(DEPDIR)/glrender.Po ./$(DEPDIR)/glutil.Po \
6.149 +@AMDEP_TRUE@ ./$(DEPDIR)/gtkcb.Po ./$(DEPDIR)/gtkui.Po \
6.150 +@AMDEP_TRUE@ ./$(DEPDIR)/i386-dis.Po ./$(DEPDIR)/ide.Po \
6.151 +@AMDEP_TRUE@ ./$(DEPDIR)/insparse.Po ./$(DEPDIR)/intc.Po \
6.152 +@AMDEP_TRUE@ ./$(DEPDIR)/joy_linux.Po ./$(DEPDIR)/kbd.Po \
6.153 +@AMDEP_TRUE@ ./$(DEPDIR)/loader.Po ./$(DEPDIR)/main.Po \
6.154 +@AMDEP_TRUE@ ./$(DEPDIR)/main_win.Po ./$(DEPDIR)/maple.Po \
6.155 +@AMDEP_TRUE@ ./$(DEPDIR)/mem.Po ./$(DEPDIR)/mmio_win.Po \
6.156 +@AMDEP_TRUE@ ./$(DEPDIR)/mmu.Po ./$(DEPDIR)/mouse.Po \
6.157 +@AMDEP_TRUE@ ./$(DEPDIR)/nrg.Po ./$(DEPDIR)/path_dlg.Po \
6.158 +@AMDEP_TRUE@ ./$(DEPDIR)/pvr2.Po ./$(DEPDIR)/pvr2mem.Po \
6.159 +@AMDEP_TRUE@ ./$(DEPDIR)/rendbkg.Po ./$(DEPDIR)/rendsave.Po \
6.160 +@AMDEP_TRUE@ ./$(DEPDIR)/rendsort.Po ./$(DEPDIR)/scene.Po \
6.161 +@AMDEP_TRUE@ ./$(DEPDIR)/scif.Po ./$(DEPDIR)/sh4.Po \
6.162 +@AMDEP_TRUE@ ./$(DEPDIR)/sh4core.Po ./$(DEPDIR)/sh4dasm.Po \
6.163 +@AMDEP_TRUE@ ./$(DEPDIR)/sh4mem.Po ./$(DEPDIR)/sh4mmio.Po \
6.164 +@AMDEP_TRUE@ ./$(DEPDIR)/sh4stat.Po ./$(DEPDIR)/sh4trans.Po \
6.165 +@AMDEP_TRUE@ ./$(DEPDIR)/sh4x86.Po ./$(DEPDIR)/syscall.Po \
6.166 +@AMDEP_TRUE@ ./$(DEPDIR)/tacore.Po ./$(DEPDIR)/testsh4x86.Po \
6.167 +@AMDEP_TRUE@ ./$(DEPDIR)/testxlt.Po ./$(DEPDIR)/texcache.Po \
6.168 +@AMDEP_TRUE@ ./$(DEPDIR)/timer.Po ./$(DEPDIR)/util.Po \
6.169 +@AMDEP_TRUE@ ./$(DEPDIR)/video_gdk.Po ./$(DEPDIR)/video_gl.Po \
6.170 +@AMDEP_TRUE@ ./$(DEPDIR)/video_glx.Po ./$(DEPDIR)/video_gtk.Po \
6.171 +@AMDEP_TRUE@ ./$(DEPDIR)/video_null.Po ./$(DEPDIR)/watch.Po \
6.172 +@AMDEP_TRUE@ ./$(DEPDIR)/x86dasm.Po ./$(DEPDIR)/xltcache.Po \
6.173 +@AMDEP_TRUE@ ./$(DEPDIR)/yuv.Po
6.174 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
6.175 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
6.176 CCLD = $(CC)
6.177 @@ -526,6 +534,7 @@
6.178 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audio_alsa.Po@am__quote@
6.179 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audio_esd.Po@am__quote@
6.180 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audio_null.Po@am__quote@
6.181 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audio_pulse.Po@am__quote@
6.182 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bios.Po@am__quote@
6.183 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bootstrap.Po@am__quote@
6.184 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cd_linux.Po@am__quote@
6.185 @@ -2167,6 +2176,28 @@
6.186 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
6.187 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o joy_linux.obj `if test -f 'drivers/joy_linux.c'; then $(CYGPATH_W) 'drivers/joy_linux.c'; else $(CYGPATH_W) '$(srcdir)/drivers/joy_linux.c'; fi`
6.188
6.189 +audio_pulse.o: drivers/audio_pulse.c
6.190 +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT audio_pulse.o -MD -MP -MF "$(DEPDIR)/audio_pulse.Tpo" \
6.191 +@am__fastdepCC_TRUE@ -c -o audio_pulse.o `test -f 'drivers/audio_pulse.c' || echo '$(srcdir)/'`drivers/audio_pulse.c; \
6.192 +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/audio_pulse.Tpo" "$(DEPDIR)/audio_pulse.Po"; \
6.193 +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/audio_pulse.Tpo"; exit 1; \
6.194 +@am__fastdepCC_TRUE@ fi
6.195 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='drivers/audio_pulse.c' object='audio_pulse.o' libtool=no @AMDEPBACKSLASH@
6.196 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/audio_pulse.Po' tmpdepfile='$(DEPDIR)/audio_pulse.TPo' @AMDEPBACKSLASH@
6.197 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
6.198 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o audio_pulse.o `test -f 'drivers/audio_pulse.c' || echo '$(srcdir)/'`drivers/audio_pulse.c
6.199 +
6.200 +audio_pulse.obj: drivers/audio_pulse.c
6.201 +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT audio_pulse.obj -MD -MP -MF "$(DEPDIR)/audio_pulse.Tpo" \
6.202 +@am__fastdepCC_TRUE@ -c -o audio_pulse.obj `if test -f 'drivers/audio_pulse.c'; then $(CYGPATH_W) 'drivers/audio_pulse.c'; else $(CYGPATH_W) '$(srcdir)/drivers/audio_pulse.c'; fi`; \
6.203 +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/audio_pulse.Tpo" "$(DEPDIR)/audio_pulse.Po"; \
6.204 +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/audio_pulse.Tpo"; exit 1; \
6.205 +@am__fastdepCC_TRUE@ fi
6.206 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='drivers/audio_pulse.c' object='audio_pulse.obj' libtool=no @AMDEPBACKSLASH@
6.207 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/audio_pulse.Po' tmpdepfile='$(DEPDIR)/audio_pulse.TPo' @AMDEPBACKSLASH@
6.208 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
6.209 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o audio_pulse.obj `if test -f 'drivers/audio_pulse.c'; then $(CYGPATH_W) 'drivers/audio_pulse.c'; else $(CYGPATH_W) '$(srcdir)/drivers/audio_pulse.c'; fi`
6.210 +
6.211 audio_esd.o: drivers/audio_esd.c
6.212 @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT audio_esd.o -MD -MP -MF "$(DEPDIR)/audio_esd.Tpo" \
6.213 @am__fastdepCC_TRUE@ -c -o audio_esd.o `test -f 'drivers/audio_esd.c' || echo '$(srcdir)/'`drivers/audio_esd.c; \
7.1 --- a/src/aica/audio.c Wed Apr 02 01:46:58 2008 +0000
7.2 +++ b/src/aica/audio.c Wed Apr 16 10:12:12 2008 +0000
7.3 @@ -25,6 +25,9 @@
7.4 #include <string.h>
7.5
7.6 audio_driver_t audio_driver_list[] = {
7.7 +#ifdef HAVE_PULSE
7.8 + &audio_pulse_driver,
7.9 +#endif
7.10 #ifdef HAVE_ESOUND
7.11 &audio_esd_driver,
7.12 #endif
8.1 --- a/src/aica/audio.h Wed Apr 02 01:46:58 2008 +0000
8.2 +++ b/src/aica/audio.h Wed Apr 16 10:12:12 2008 +0000
8.3 @@ -75,6 +75,7 @@
8.4 } *audio_driver_t;
8.5
8.6 extern struct audio_driver audio_null_driver;
8.7 +extern struct audio_driver audio_pulse_driver;
8.8 extern struct audio_driver audio_esd_driver;
8.9 extern struct audio_driver audio_alsa_driver;
8.10
9.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
9.2 +++ b/src/drivers/audio_pulse.c Wed Apr 16 10:12:12 2008 +0000
9.3 @@ -0,0 +1,85 @@
9.4 +/**
9.5 + * $Id: audio_pulse.c 661 2008-02-26 01:10:48Z bhaal22 $
9.6 + *
9.7 + * The pulseaudio sound driver
9.8 + *
9.9 + * Copyright (c) 2005 Nathan Keynes.
9.10 + *
9.11 + * This program is free software; you can redistribute it and/or modify
9.12 + * it under the terms of the GNU General Public License as published by
9.13 + * the Free Software Foundation; either version 2 of the License, or
9.14 + * (at your option) any later version.
9.15 + *
9.16 + * This program is distributed in the hope that it will be useful,
9.17 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
9.18 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9.19 + * GNU General Public License for more details.
9.20 + */
9.21 +#include <stdio.h>
9.22 +#include <unistd.h>
9.23 +#include <pulse/simple.h>
9.24 +#include "aica/audio.h"
9.25 +#include "lxdream.h"
9.26 +
9.27 +static pa_simple *pulse_server = NULL;
9.28 +
9.29 +gboolean audio_pulse_init()
9.30 +{
9.31 + return TRUE;
9.32 +}
9.33 +
9.34 +gboolean audio_pulse_set_format( uint32_t rate, uint32_t format )
9.35 +{
9.36 + pa_sample_spec ss;
9.37 +
9.38 + if( pulse_server != NULL ) {
9.39 + pa_simple_free(pulse_server);
9.40 + }
9.41 + ss.rate = rate;
9.42 +
9.43 + if( format & AUDIO_FMT_16BIT ) {
9.44 + ss.format = PA_SAMPLE_S16NE;
9.45 + } else {
9.46 + ss.format = PA_SAMPLE_U8;
9.47 + }
9.48 +
9.49 + if( format & AUDIO_FMT_STEREO ) {
9.50 + ss.channels = 2;
9.51 + } else {
9.52 + ss.channels = 1;
9.53 + }
9.54 +
9.55 + pulse_server = pa_simple_new(NULL, APP_NAME, PA_STREAM_PLAYBACK,
9.56 + NULL, "Audio", &ss, NULL, NULL, NULL);
9.57 + if( pulse_server == NULL ) {
9.58 + ERROR( "Unable to open audio output (pulseaudio)" );
9.59 + return FALSE;
9.60 + }
9.61 + return TRUE;
9.62 +}
9.63 +
9.64 +gboolean audio_pulse_process_buffer( audio_buffer_t buffer )
9.65 +{
9.66 + if( pulse_server != NULL ) {
9.67 + int error;
9.68 + pa_simple_write( pulse_server, buffer->data, buffer->length, &error );
9.69 + return TRUE;
9.70 + } else {
9.71 + ERROR( "Pulseaudio not initialized" );
9.72 + return FALSE;
9.73 + }
9.74 +}
9.75 +
9.76 +gboolean audio_pulse_close()
9.77 +{
9.78 + pa_simple_free(pulse_server);
9.79 + pulse_server = NULL;
9.80 + return TRUE;
9.81 +}
9.82 +
9.83 +struct audio_driver audio_pulse_driver = { "pulse",
9.84 + audio_pulse_init,
9.85 + audio_pulse_set_format,
9.86 + audio_pulse_process_buffer,
9.87 + audio_pulse_close};
9.88 +
.