revision 643:653b0a70f173
summary |
tree |
shortlog |
changelog |
graph |
changeset |
raw | bz2 | zip | gz changeset | 643:653b0a70f173 |
parent | 642:c7383f21f122 |
child | 644:ccae4bfa5f82 |
author | bhaal22 |
date | Tue Feb 26 01:10:48 2008 +0000 (16 years ago) |
Commit initial ALSA audio driver
Add init/shutdown stubs to audio driver structure
Add init/shutdown stubs to audio driver structure
config.h.in | view | annotate | diff | log | ||
configure | view | annotate | diff | log | ||
configure.in | view | annotate | diff | log | ||
src/Makefile.am | view | annotate | diff | log | ||
src/Makefile.in | view | annotate | diff | log | ||
src/aica/audio.c | view | annotate | diff | log | ||
src/aica/audio.h | view | annotate | diff | log | ||
src/config.c | view | annotate | diff | log | ||
src/drivers/audio_alsa.c | view | annotate | diff | log | ||
src/drivers/audio_esd.c | view | annotate | diff | log | ||
src/drivers/audio_null.c | view | annotate | diff | log |
1.1 --- a/config.h.in Tue Feb 26 01:06:59 2008 +00001.2 +++ b/config.h.in Tue Feb 26 01:10:48 2008 +00001.3 @@ -22,6 +22,9 @@1.4 /* translation domain */1.5 #undef GETTEXT_PACKAGE1.7 +/* Have alsa support */1.8 +#undef HAVE_ALSA1.9 +1.10 /* Define to 1 if you have the `bind_textdomain_codeset' function. */1.11 #undef HAVE_BIND_TEXTDOMAIN_CODESET
2.1 --- a/configure Tue Feb 26 01:06:59 2008 +00002.2 +++ b/configure Tue Feb 26 01:10:48 2008 +00002.3 @@ -717,6 +717,10 @@2.4 ESOUND_LIBS2.5 AUDIO_ESOUND_TRUE2.6 AUDIO_ESOUND_FALSE2.7 +ALSA_CFLAGS2.8 +ALSA_LIBS2.9 +AUDIO_ALSA_TRUE2.10 +AUDIO_ALSA_FALSE2.11 CDROM_LINUX_TRUE2.12 CDROM_LINUX_FALSE2.13 JOY_LINUX_TRUE2.14 @@ -766,7 +770,9 @@2.15 GTK_CFLAGS2.16 GTK_LIBS2.17 ESOUND_CFLAGS2.18 -ESOUND_LIBS'2.19 +ESOUND_LIBS2.20 +ALSA_CFLAGS2.21 +ALSA_LIBS'2.24 # Initialize some variables set by options.2.25 @@ -1371,6 +1377,8 @@2.26 ESOUND_CFLAGS2.27 C compiler flags for ESOUND, overriding pkg-config2.28 ESOUND_LIBS linker flags for ESOUND, overriding pkg-config2.29 + ALSA_CFLAGS C compiler flags for ALSA, overriding pkg-config2.30 + ALSA_LIBS linker flags for ALSA, overriding pkg-config2.32 Use these variables to override the choices made by `configure' or to help2.33 it to find libraries and programs with nonstandard names/locations.2.34 @@ -5957,9 +5965,9 @@2.36 { echo "$as_me:$LINENO: result: no" >&52.37 echo "${ECHO_T}no" >&6; }2.38 - echo "Warning: esound not found - building without audio support"2.39 + echo "Warning: esound not found - building without esd audio support"2.40 elif test $pkg_failed = untried; then2.41 - echo "Warning: esound not found - building without audio support"2.42 + echo "Warning: esound not found - building without esd audio support"2.43 else2.44 ESOUND_CFLAGS=$pkg_cv_ESOUND_CFLAGS2.45 ESOUND_LIBS=$pkg_cv_ESOUND_LIBS2.46 @@ -5984,6 +5992,94 @@2.47 fi2.50 +2.51 +pkg_failed=no2.52 +{ echo "$as_me:$LINENO: checking for ALSA" >&52.53 +echo $ECHO_N "checking for ALSA... $ECHO_C" >&6; }2.54 +2.55 +if test -n "$PKG_CONFIG"; then2.56 + if test -n "$ALSA_CFLAGS"; then2.57 + pkg_cv_ALSA_CFLAGS="$ALSA_CFLAGS"2.58 + else2.59 + if test -n "$PKG_CONFIG" && \2.60 + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"alsa\"") >&52.61 + ($PKG_CONFIG --exists --print-errors "alsa") 2>&52.62 + ac_status=$?2.63 + echo "$as_me:$LINENO: \$? = $ac_status" >&52.64 + (exit $ac_status); }; then2.65 + pkg_cv_ALSA_CFLAGS=`$PKG_CONFIG --cflags "alsa" 2>/dev/null`2.66 +else2.67 + pkg_failed=yes2.68 +fi2.69 + fi2.70 +else2.71 + pkg_failed=untried2.72 +fi2.73 +if test -n "$PKG_CONFIG"; then2.74 + if test -n "$ALSA_LIBS"; then2.75 + pkg_cv_ALSA_LIBS="$ALSA_LIBS"2.76 + else2.77 + if test -n "$PKG_CONFIG" && \2.78 + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"alsa\"") >&52.79 + ($PKG_CONFIG --exists --print-errors "alsa") 2>&52.80 + ac_status=$?2.81 + echo "$as_me:$LINENO: \$? = $ac_status" >&52.82 + (exit $ac_status); }; then2.83 + pkg_cv_ALSA_LIBS=`$PKG_CONFIG --libs "alsa" 2>/dev/null`2.84 +else2.85 + pkg_failed=yes2.86 +fi2.87 + fi2.88 +else2.89 + pkg_failed=untried2.90 +fi2.91 +2.92 +2.93 +2.94 +if test $pkg_failed = yes; then2.95 +2.96 +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then2.97 + _pkg_short_errors_supported=yes2.98 +else2.99 + _pkg_short_errors_supported=no2.100 +fi2.101 + if test $_pkg_short_errors_supported = yes; then2.102 + ALSA_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "alsa"`2.103 + else2.104 + ALSA_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "alsa"`2.105 + fi2.106 + # Put the nasty error message in config.log where it belongs2.107 + echo "$ALSA_PKG_ERRORS" >&52.108 +2.109 + { echo "$as_me:$LINENO: result: no" >&52.110 +echo "${ECHO_T}no" >&6; }2.111 + echo "Warning: alsa not found - building without alsa audio support"2.112 +elif test $pkg_failed = untried; then2.113 + echo "Warning: alsa not found - building without alsa audio support"2.114 +else2.115 + ALSA_CFLAGS=$pkg_cv_ALSA_CFLAGS2.116 + ALSA_LIBS=$pkg_cv_ALSA_LIBS2.117 + { echo "$as_me:$LINENO: result: yes" >&52.118 +echo "${ECHO_T}yes" >&6; }2.119 +2.120 + HAVE_ALSA='yes'2.121 +2.122 +cat >>confdefs.h <<\_ACEOF2.123 +#define HAVE_ALSA 12.124 +_ACEOF2.125 +2.126 +fi2.127 +2.128 +2.129 +if test "$HAVE_ALSA" = 'yes' ; then2.130 + AUDIO_ALSA_TRUE=2.131 + AUDIO_ALSA_FALSE='#'2.132 +else2.133 + AUDIO_ALSA_TRUE='#'2.134 + AUDIO_ALSA_FALSE=2.135 +fi2.136 +2.137 +2.138 if test "${ac_cv_header_linux_cdrom_h+set}" = set; then2.139 { echo "$as_me:$LINENO: checking for linux/cdrom.h" >&52.140 echo $ECHO_N "checking for linux/cdrom.h... $ECHO_C" >&6; }2.141 @@ -8239,6 +8335,13 @@2.142 Usually this means the macro was only invoked conditionally." >&2;}2.143 { (exit 1); exit 1; }; }2.144 fi2.145 +if test -z "${AUDIO_ALSA_TRUE}" && test -z "${AUDIO_ALSA_FALSE}"; then2.146 + { { echo "$as_me:$LINENO: error: conditional \"AUDIO_ALSA\" was never defined.2.147 +Usually this means the macro was only invoked conditionally." >&52.148 +echo "$as_me: error: conditional \"AUDIO_ALSA\" was never defined.2.149 +Usually this means the macro was only invoked conditionally." >&2;}2.150 + { (exit 1); exit 1; }; }2.151 +fi2.152 if test -z "${CDROM_LINUX_TRUE}" && test -z "${CDROM_LINUX_FALSE}"; then2.153 { { echo "$as_me:$LINENO: error: conditional \"CDROM_LINUX\" was never defined.2.154 Usually this means the macro was only invoked conditionally." >&52.155 @@ -8948,6 +9051,10 @@2.156 ESOUND_LIBS!$ESOUND_LIBS$ac_delim2.157 AUDIO_ESOUND_TRUE!$AUDIO_ESOUND_TRUE$ac_delim2.158 AUDIO_ESOUND_FALSE!$AUDIO_ESOUND_FALSE$ac_delim2.159 +ALSA_CFLAGS!$ALSA_CFLAGS$ac_delim2.160 +ALSA_LIBS!$ALSA_LIBS$ac_delim2.161 +AUDIO_ALSA_TRUE!$AUDIO_ALSA_TRUE$ac_delim2.162 +AUDIO_ALSA_FALSE!$AUDIO_ALSA_FALSE$ac_delim2.163 CDROM_LINUX_TRUE!$CDROM_LINUX_TRUE$ac_delim2.164 CDROM_LINUX_FALSE!$CDROM_LINUX_FALSE$ac_delim2.165 JOY_LINUX_TRUE!$JOY_LINUX_TRUE$ac_delim2.166 @@ -8983,7 +9090,7 @@2.167 LTLIBOBJS!$LTLIBOBJS$ac_delim2.168 _ACEOF2.170 - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 40; then2.171 + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 44; then2.172 break2.173 elif $ac_last_try; then2.174 { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
3.1 --- a/configure.in Tue Feb 26 01:06:59 2008 +00003.2 +++ b/configure.in Tue Feb 26 01:10:48 2008 +00003.3 @@ -77,9 +77,16 @@3.4 PKG_CHECK_MODULES(ESOUND, [esound], [3.5 HAVE_ESOUND='yes'3.6 AC_DEFINE([HAVE_ESOUND],1,[Have esound support]) ],3.7 - [ echo "Warning: esound not found - building without audio support" ])3.8 + [ echo "Warning: esound not found - building without esd audio support" ])3.9 AM_CONDITIONAL( AUDIO_ESOUND, [test "$HAVE_ESOUND" = 'yes'] )3.11 +dnl Check for alsa support3.12 +PKG_CHECK_MODULES(ALSA, [alsa], [3.13 + HAVE_ALSA='yes'3.14 + AC_DEFINE([HAVE_ALSA],1,[Have alsa support]) ],3.15 + [ echo "Warning: alsa not found - building without alsa audio support" ])3.16 +AM_CONDITIONAL( AUDIO_ALSA, [test "$HAVE_ALSA" = 'yes'] )3.17 +3.18 dnl Check for linux cdrom device support3.19 AC_CHECK_HEADER([linux/cdrom.h], [HAVE_LINUX_CDROM_H=yes], [3.20 echo "Linux CDROM support not found, building without it."] )
4.1 --- a/src/Makefile.am Tue Feb 26 01:06:59 2008 +00004.2 +++ b/src/Makefile.am Tue Feb 26 01:10:48 2008 +00004.3 @@ -5,7 +5,7 @@4.4 -DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \4.5 -DPACKAGE_CONF_DIR=\""$(sysconfdir)"\" \4.6 -Ish4 \4.7 - @GTK_CFLAGS@ @LIBPNG_CFLAGS@ @ESOUND_CFLAGS@4.8 + @GTK_CFLAGS@ @LIBPNG_CFLAGS@ @ESOUND_CFLAGS@ @ALSA_CFLAGS@4.10 bin_PROGRAMS = lxdream4.11 noinst_PROGRAMS = gendec genglsl4.12 @@ -83,7 +83,11 @@4.13 lxdream_SOURCES += drivers/audio_esd.c4.14 endif4.16 -lxdream_LDADD = @GTK_LIBS@ @LIBPNG_LIBS@ @ESOUND_LIBS@ $(INTLLIBS)4.17 +if AUDIO_ALSA4.18 +lxdream_SOURCES += drivers/audio_alsa.c4.19 +endif4.20 +4.21 +lxdream_LDADD = @GTK_LIBS@ @LIBPNG_LIBS@ @ESOUND_LIBS@ @ALSA_LIBS@ $(INTLLIBS)4.23 gendec_LDADD = @GTK_LIBS@ $(INTLLIBS)4.24 genglsl_LDADD = @GTK_LIBS@ $(INTLLIBS)
5.1 --- a/src/Makefile.in Tue Feb 26 01:06:59 2008 +00005.2 +++ b/src/Makefile.in Tue Feb 26 01:10:48 2008 +00005.3 @@ -54,13 +54,18 @@5.4 @CDROM_LINUX_FALSE@am__append_5 = drivers/cd_none.c5.5 @JOY_LINUX_TRUE@am__append_6 = drivers/joy_linux.c5.6 @AUDIO_ESOUND_TRUE@am__append_7 = drivers/audio_esd.c5.7 +@AUDIO_ALSA_TRUE@am__append_8 = drivers/audio_alsa.c5.8 ACLOCAL = @ACLOCAL@5.9 +ALSA_CFLAGS = @ALSA_CFLAGS@5.10 +ALSA_LIBS = @ALSA_LIBS@5.11 AMDEP_FALSE = @AMDEP_FALSE@5.12 AMDEP_TRUE = @AMDEP_TRUE@5.13 AMTAR = @AMTAR@5.14 ARMCC = @ARMCC@5.15 ARMLD = @ARMLD@5.16 ARMOBJCOPY = @ARMOBJCOPY@5.17 +AUDIO_ALSA_FALSE = @AUDIO_ALSA_FALSE@5.18 +AUDIO_ALSA_TRUE = @AUDIO_ALSA_TRUE@5.19 AUDIO_ESOUND_FALSE = @AUDIO_ESOUND_FALSE@5.20 AUDIO_ESOUND_TRUE = @AUDIO_ESOUND_TRUE@5.21 AUTOCONF = @AUTOCONF@5.22 @@ -196,7 +201,7 @@5.23 -DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \5.24 -DPACKAGE_CONF_DIR=\""$(sysconfdir)"\" \5.25 -Ish4 \5.26 - @GTK_CFLAGS@ @LIBPNG_CFLAGS@ @ESOUND_CFLAGS@5.27 + @GTK_CFLAGS@ @LIBPNG_CFLAGS@ @ESOUND_CFLAGS@ @ALSA_CFLAGS@5.30 bin_PROGRAMS = lxdream5.31 @@ -234,7 +239,7 @@5.32 drivers/audio_null.c drivers/video_null.c \5.33 drivers/gl_common.c drivers/gl_common.h drivers/gl_fbo.c \5.34 drivers/gl_sl.c drivers/gl_slsrc.c\5.35 -$(am__append_1) $(am__append_3) $(am__append_4) $(am__append_5) $(am__append_6) $(am__append_7)5.36 +$(am__append_1) $(am__append_3) $(am__append_4) $(am__append_5) $(am__append_6) $(am__append_7) $(am__append_8)5.38 @BUILD_SH4X86_TRUE@test_testsh4x86_LDADD = @GTK_LIBS@5.39 @BUILD_SH4X86_TRUE@test_testsh4x86_SOURCES = test/testsh4x86.c x86dasm/x86dasm.c \5.40 @@ -244,7 +249,7 @@5.41 @BUILD_SH4X86_TRUE@ sh4/xltcache.h mem.c util.c sh4/mmu.c5.44 -lxdream_LDADD = @GTK_LIBS@ @LIBPNG_LIBS@ @ESOUND_LIBS@ $(INTLLIBS)5.45 +lxdream_LDADD = @GTK_LIBS@ @LIBPNG_LIBS@ @ESOUND_LIBS@ @ALSA_LIBS@ $(INTLLIBS)5.47 gendec_LDADD = @GTK_LIBS@ $(INTLLIBS)5.48 genglsl_LDADD = @GTK_LIBS@ $(INTLLIBS)5.49 @@ -298,7 +303,7 @@5.50 gtkui/path_dlg.c gtkui/gdrom_menu.c drivers/video_gtk.c \5.51 drivers/video_gtk.h drivers/video_glx.c drivers/video_glx.h \5.52 drivers/cd_linux.c drivers/cd_none.c drivers/joy_linux.c \5.53 - drivers/audio_esd.c5.54 + drivers/audio_esd.c drivers/audio_alsa.c5.55 @BUILD_SH4X86_TRUE@am__objects_1 = sh4x86.$(OBJEXT) sh4trans.$(OBJEXT) \5.56 @BUILD_SH4X86_TRUE@ x86dasm.$(OBJEXT) i386-dis.$(OBJEXT) \5.57 @BUILD_SH4X86_TRUE@ dis-init.$(OBJEXT) dis-buf.$(OBJEXT)5.58 @@ -312,6 +317,7 @@5.59 @CDROM_LINUX_FALSE@am__objects_4 = cd_none.$(OBJEXT)5.60 @JOY_LINUX_TRUE@am__objects_5 = joy_linux.$(OBJEXT)5.61 @AUDIO_ESOUND_TRUE@am__objects_6 = audio_esd.$(OBJEXT)5.62 +@AUDIO_ALSA_TRUE@am__objects_7 = audio_alsa.$(OBJEXT)5.63 am_lxdream_OBJECTS = main.$(OBJEXT) config.$(OBJEXT) mem.$(OBJEXT) \5.64 watch.$(OBJEXT) asic.$(OBJEXT) syscall.$(OBJEXT) bios.$(OBJEXT) \5.65 dcload.$(OBJEXT) ide.$(OBJEXT) gdimage.$(OBJEXT) \5.66 @@ -331,7 +337,7 @@5.67 video_null.$(OBJEXT) gl_common.$(OBJEXT) gl_fbo.$(OBJEXT) \5.68 gl_sl.$(OBJEXT) gl_slsrc.$(OBJEXT) $(am__objects_1) \5.69 $(am__objects_2) $(am__objects_3) $(am__objects_4) \5.70 - $(am__objects_5) $(am__objects_6)5.71 + $(am__objects_5) $(am__objects_6) $(am__objects_7)5.72 lxdream_OBJECTS = $(am_lxdream_OBJECTS)5.73 lxdream_DEPENDENCIES =5.74 lxdream_LDFLAGS =5.75 @@ -362,45 +368,46 @@5.76 @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/actparse.Po ./$(DEPDIR)/aica.Po \5.77 @AMDEP_TRUE@ ./$(DEPDIR)/armcore.Po ./$(DEPDIR)/armdasm.Po \5.78 @AMDEP_TRUE@ ./$(DEPDIR)/armmem.Po ./$(DEPDIR)/asic.Po \5.79 -@AMDEP_TRUE@ ./$(DEPDIR)/audio.Po ./$(DEPDIR)/audio_esd.Po \5.80 -@AMDEP_TRUE@ ./$(DEPDIR)/audio_null.Po ./$(DEPDIR)/bios.Po \5.81 -@AMDEP_TRUE@ ./$(DEPDIR)/bootstrap.Po ./$(DEPDIR)/cd_linux.Po \5.82 -@AMDEP_TRUE@ ./$(DEPDIR)/cd_none.Po ./$(DEPDIR)/cdi.Po \5.83 -@AMDEP_TRUE@ ./$(DEPDIR)/config.Po ./$(DEPDIR)/controller.Po \5.84 -@AMDEP_TRUE@ ./$(DEPDIR)/ctrl_dlg.Po ./$(DEPDIR)/dcload.Po \5.85 -@AMDEP_TRUE@ ./$(DEPDIR)/debug_win.Po ./$(DEPDIR)/dis-buf.Po \5.86 -@AMDEP_TRUE@ ./$(DEPDIR)/dis-init.Po ./$(DEPDIR)/display.Po \5.87 -@AMDEP_TRUE@ ./$(DEPDIR)/dmac.Po ./$(DEPDIR)/dreamcast.Po \5.88 -@AMDEP_TRUE@ ./$(DEPDIR)/dump_win.Po ./$(DEPDIR)/eventq.Po \5.89 -@AMDEP_TRUE@ ./$(DEPDIR)/gdi.Po ./$(DEPDIR)/gdimage.Po \5.90 -@AMDEP_TRUE@ ./$(DEPDIR)/gdrom.Po ./$(DEPDIR)/gdrom_menu.Po \5.91 -@AMDEP_TRUE@ ./$(DEPDIR)/gendec.Po ./$(DEPDIR)/genglsl.Po \5.92 -@AMDEP_TRUE@ ./$(DEPDIR)/gl_common.Po ./$(DEPDIR)/gl_fbo.Po \5.93 -@AMDEP_TRUE@ ./$(DEPDIR)/gl_sl.Po ./$(DEPDIR)/gl_slsrc.Po \5.94 -@AMDEP_TRUE@ ./$(DEPDIR)/gtkcb.Po ./$(DEPDIR)/gtkui.Po \5.95 -@AMDEP_TRUE@ ./$(DEPDIR)/i386-dis.Po ./$(DEPDIR)/ide.Po \5.96 -@AMDEP_TRUE@ ./$(DEPDIR)/insparse.Po ./$(DEPDIR)/intc.Po \5.97 -@AMDEP_TRUE@ ./$(DEPDIR)/joy_linux.Po ./$(DEPDIR)/kbd.Po \5.98 -@AMDEP_TRUE@ ./$(DEPDIR)/loader.Po ./$(DEPDIR)/main.Po \5.99 -@AMDEP_TRUE@ ./$(DEPDIR)/main_win.Po ./$(DEPDIR)/maple.Po \5.100 -@AMDEP_TRUE@ ./$(DEPDIR)/mem.Po ./$(DEPDIR)/mmio_win.Po \5.101 -@AMDEP_TRUE@ ./$(DEPDIR)/mmu.Po ./$(DEPDIR)/mouse.Po \5.102 -@AMDEP_TRUE@ ./$(DEPDIR)/nrg.Po ./$(DEPDIR)/path_dlg.Po \5.103 -@AMDEP_TRUE@ ./$(DEPDIR)/pvr2.Po ./$(DEPDIR)/pvr2mem.Po \5.104 -@AMDEP_TRUE@ ./$(DEPDIR)/rendbkg.Po ./$(DEPDIR)/rendcore.Po \5.105 -@AMDEP_TRUE@ ./$(DEPDIR)/render.Po ./$(DEPDIR)/rendsave.Po \5.106 -@AMDEP_TRUE@ ./$(DEPDIR)/rendsort.Po ./$(DEPDIR)/scif.Po \5.107 -@AMDEP_TRUE@ ./$(DEPDIR)/sh4.Po ./$(DEPDIR)/sh4core.Po \5.108 -@AMDEP_TRUE@ ./$(DEPDIR)/sh4dasm.Po ./$(DEPDIR)/sh4mem.Po \5.109 -@AMDEP_TRUE@ ./$(DEPDIR)/sh4mmio.Po ./$(DEPDIR)/sh4stat.Po \5.110 -@AMDEP_TRUE@ ./$(DEPDIR)/sh4trans.Po ./$(DEPDIR)/sh4x86.Po \5.111 -@AMDEP_TRUE@ ./$(DEPDIR)/syscall.Po ./$(DEPDIR)/tacore.Po \5.112 -@AMDEP_TRUE@ ./$(DEPDIR)/testsh4x86.Po ./$(DEPDIR)/testxlt.Po \5.113 -@AMDEP_TRUE@ ./$(DEPDIR)/texcache.Po ./$(DEPDIR)/timer.Po \5.114 -@AMDEP_TRUE@ ./$(DEPDIR)/util.Po ./$(DEPDIR)/video_glx.Po \5.115 -@AMDEP_TRUE@ ./$(DEPDIR)/video_gtk.Po ./$(DEPDIR)/video_null.Po \5.116 -@AMDEP_TRUE@ ./$(DEPDIR)/watch.Po ./$(DEPDIR)/x86dasm.Po \5.117 -@AMDEP_TRUE@ ./$(DEPDIR)/xltcache.Po ./$(DEPDIR)/yuv.Po5.118 +@AMDEP_TRUE@ ./$(DEPDIR)/audio.Po ./$(DEPDIR)/audio_alsa.Po \5.119 +@AMDEP_TRUE@ ./$(DEPDIR)/audio_esd.Po ./$(DEPDIR)/audio_null.Po \5.120 +@AMDEP_TRUE@ ./$(DEPDIR)/bios.Po ./$(DEPDIR)/bootstrap.Po \5.121 +@AMDEP_TRUE@ ./$(DEPDIR)/cd_linux.Po ./$(DEPDIR)/cd_none.Po \5.122 +@AMDEP_TRUE@ ./$(DEPDIR)/cdi.Po ./$(DEPDIR)/config.Po \5.123 +@AMDEP_TRUE@ ./$(DEPDIR)/controller.Po ./$(DEPDIR)/ctrl_dlg.Po \5.124 +@AMDEP_TRUE@ ./$(DEPDIR)/dcload.Po ./$(DEPDIR)/debug_win.Po \5.125 +@AMDEP_TRUE@ ./$(DEPDIR)/dis-buf.Po ./$(DEPDIR)/dis-init.Po \5.126 +@AMDEP_TRUE@ ./$(DEPDIR)/display.Po ./$(DEPDIR)/dmac.Po \5.127 +@AMDEP_TRUE@ ./$(DEPDIR)/dreamcast.Po ./$(DEPDIR)/dump_win.Po \5.128 +@AMDEP_TRUE@ ./$(DEPDIR)/eventq.Po ./$(DEPDIR)/gdi.Po \5.129 +@AMDEP_TRUE@ ./$(DEPDIR)/gdimage.Po ./$(DEPDIR)/gdrom.Po \5.130 +@AMDEP_TRUE@ ./$(DEPDIR)/gdrom_menu.Po ./$(DEPDIR)/gendec.Po \5.131 +@AMDEP_TRUE@ ./$(DEPDIR)/genglsl.Po ./$(DEPDIR)/gl_common.Po \5.132 +@AMDEP_TRUE@ ./$(DEPDIR)/gl_fbo.Po ./$(DEPDIR)/gl_sl.Po \5.133 +@AMDEP_TRUE@ ./$(DEPDIR)/gl_slsrc.Po ./$(DEPDIR)/gtkcb.Po \5.134 +@AMDEP_TRUE@ ./$(DEPDIR)/gtkui.Po ./$(DEPDIR)/i386-dis.Po \5.135 +@AMDEP_TRUE@ ./$(DEPDIR)/ide.Po ./$(DEPDIR)/insparse.Po \5.136 +@AMDEP_TRUE@ ./$(DEPDIR)/intc.Po ./$(DEPDIR)/joy_linux.Po \5.137 +@AMDEP_TRUE@ ./$(DEPDIR)/kbd.Po ./$(DEPDIR)/loader.Po \5.138 +@AMDEP_TRUE@ ./$(DEPDIR)/main.Po ./$(DEPDIR)/main_win.Po \5.139 +@AMDEP_TRUE@ ./$(DEPDIR)/maple.Po ./$(DEPDIR)/mem.Po \5.140 +@AMDEP_TRUE@ ./$(DEPDIR)/mmio_win.Po ./$(DEPDIR)/mmu.Po \5.141 +@AMDEP_TRUE@ ./$(DEPDIR)/mouse.Po ./$(DEPDIR)/nrg.Po \5.142 +@AMDEP_TRUE@ ./$(DEPDIR)/path_dlg.Po ./$(DEPDIR)/pvr2.Po \5.143 +@AMDEP_TRUE@ ./$(DEPDIR)/pvr2mem.Po ./$(DEPDIR)/rendbkg.Po \5.144 +@AMDEP_TRUE@ ./$(DEPDIR)/rendcore.Po ./$(DEPDIR)/render.Po \5.145 +@AMDEP_TRUE@ ./$(DEPDIR)/rendsave.Po ./$(DEPDIR)/rendsort.Po \5.146 +@AMDEP_TRUE@ ./$(DEPDIR)/scif.Po ./$(DEPDIR)/sh4.Po \5.147 +@AMDEP_TRUE@ ./$(DEPDIR)/sh4core.Po ./$(DEPDIR)/sh4dasm.Po \5.148 +@AMDEP_TRUE@ ./$(DEPDIR)/sh4mem.Po ./$(DEPDIR)/sh4mmio.Po \5.149 +@AMDEP_TRUE@ ./$(DEPDIR)/sh4stat.Po ./$(DEPDIR)/sh4trans.Po \5.150 +@AMDEP_TRUE@ ./$(DEPDIR)/sh4x86.Po ./$(DEPDIR)/syscall.Po \5.151 +@AMDEP_TRUE@ ./$(DEPDIR)/tacore.Po ./$(DEPDIR)/testsh4x86.Po \5.152 +@AMDEP_TRUE@ ./$(DEPDIR)/testxlt.Po ./$(DEPDIR)/texcache.Po \5.153 +@AMDEP_TRUE@ ./$(DEPDIR)/timer.Po ./$(DEPDIR)/util.Po \5.154 +@AMDEP_TRUE@ ./$(DEPDIR)/video_glx.Po ./$(DEPDIR)/video_gtk.Po \5.155 +@AMDEP_TRUE@ ./$(DEPDIR)/video_null.Po ./$(DEPDIR)/watch.Po \5.156 +@AMDEP_TRUE@ ./$(DEPDIR)/x86dasm.Po ./$(DEPDIR)/xltcache.Po \5.157 +@AMDEP_TRUE@ ./$(DEPDIR)/yuv.Po5.158 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \5.159 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)5.160 CCLD = $(CC)5.161 @@ -483,6 +490,7 @@5.162 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/armmem.Po@am__quote@5.163 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asic.Po@am__quote@5.164 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audio.Po@am__quote@5.165 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audio_alsa.Po@am__quote@5.166 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audio_esd.Po@am__quote@5.167 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audio_null.Po@am__quote@5.168 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bios.Po@am__quote@5.169 @@ -2079,6 +2087,28 @@5.170 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@5.171 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o audio_esd.obj `if test -f 'drivers/audio_esd.c'; then $(CYGPATH_W) 'drivers/audio_esd.c'; else $(CYGPATH_W) '$(srcdir)/drivers/audio_esd.c'; fi`5.173 +audio_alsa.o: drivers/audio_alsa.c5.174 +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT audio_alsa.o -MD -MP -MF "$(DEPDIR)/audio_alsa.Tpo" \5.175 +@am__fastdepCC_TRUE@ -c -o audio_alsa.o `test -f 'drivers/audio_alsa.c' || echo '$(srcdir)/'`drivers/audio_alsa.c; \5.176 +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/audio_alsa.Tpo" "$(DEPDIR)/audio_alsa.Po"; \5.177 +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/audio_alsa.Tpo"; exit 1; \5.178 +@am__fastdepCC_TRUE@ fi5.179 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='drivers/audio_alsa.c' object='audio_alsa.o' libtool=no @AMDEPBACKSLASH@5.180 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/audio_alsa.Po' tmpdepfile='$(DEPDIR)/audio_alsa.TPo' @AMDEPBACKSLASH@5.181 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@5.182 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o audio_alsa.o `test -f 'drivers/audio_alsa.c' || echo '$(srcdir)/'`drivers/audio_alsa.c5.183 +5.184 +audio_alsa.obj: drivers/audio_alsa.c5.185 +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT audio_alsa.obj -MD -MP -MF "$(DEPDIR)/audio_alsa.Tpo" \5.186 +@am__fastdepCC_TRUE@ -c -o audio_alsa.obj `if test -f 'drivers/audio_alsa.c'; then $(CYGPATH_W) 'drivers/audio_alsa.c'; else $(CYGPATH_W) '$(srcdir)/drivers/audio_alsa.c'; fi`; \5.187 +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/audio_alsa.Tpo" "$(DEPDIR)/audio_alsa.Po"; \5.188 +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/audio_alsa.Tpo"; exit 1; \5.189 +@am__fastdepCC_TRUE@ fi5.190 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='drivers/audio_alsa.c' object='audio_alsa.obj' libtool=no @AMDEPBACKSLASH@5.191 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/audio_alsa.Po' tmpdepfile='$(DEPDIR)/audio_alsa.TPo' @AMDEPBACKSLASH@5.192 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@5.193 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o audio_alsa.obj `if test -f 'drivers/audio_alsa.c'; then $(CYGPATH_W) 'drivers/audio_alsa.c'; else $(CYGPATH_W) '$(srcdir)/drivers/audio_alsa.c'; fi`5.194 +5.195 testsh4x86.o: test/testsh4x86.c5.196 @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT testsh4x86.o -MD -MP -MF "$(DEPDIR)/testsh4x86.Tpo" \5.197 @am__fastdepCC_TRUE@ -c -o testsh4x86.o `test -f 'test/testsh4x86.c' || echo '$(srcdir)/'`test/testsh4x86.c; \
6.1 --- a/src/aica/audio.c Tue Feb 26 01:06:59 2008 +00006.2 +++ b/src/aica/audio.c Tue Feb 26 01:10:48 2008 +00006.3 @@ -28,6 +28,9 @@6.4 #ifdef HAVE_ESOUND6.5 &audio_esd_driver,6.6 #endif6.7 +#ifdef HAVE_ALSA6.8 + &audio_alsa_driver,6.9 +#endif6.10 &audio_null_driver,6.11 NULL };
7.1 --- a/src/aica/audio.h Tue Feb 26 01:06:59 2008 +00007.2 +++ b/src/aica/audio.h Tue Feb 26 01:10:48 2008 +00007.3 @@ -68,12 +68,15 @@7.5 typedef struct audio_driver {7.6 char *name;7.7 + gboolean (*init)( );7.8 gboolean (*set_output_format)( uint32_t sample_rate, uint32_t format );7.9 gboolean (*process_buffer)( audio_buffer_t buffer );7.10 + gboolean (*close)( );7.11 } *audio_driver_t;7.13 extern struct audio_driver audio_null_driver;7.14 extern struct audio_driver audio_esd_driver;7.15 +extern struct audio_driver audio_alsa_driver;7.17 audio_driver_t get_audio_driver_by_name( const char *name );
8.1 --- a/src/config.c Tue Feb 26 01:06:59 2008 +00008.2 +++ b/src/config.c Tue Feb 26 01:10:48 2008 +00008.3 @@ -27,6 +27,9 @@8.4 #include "config.h"8.5 #include "maple/maple.h"8.7 +8.8 +extern struct lxdream_config_entry alsa_config[];8.9 +8.10 gboolean lxdream_load_config_file( const gchar *filename );8.11 gboolean lxdream_save_config_file( const gchar *filename );8.12 gboolean lxdream_load_config_stream( FILE *f );8.13 @@ -50,6 +53,9 @@8.14 {{ "global", global_config },8.15 { "controllers", NULL },8.16 { "serial", serial_config },8.17 +#ifdef HAVE_ALSA8.18 + { "alsa", alsa_config },8.19 +#endif8.20 { NULL, CONFIG_TYPE_NONE }};8.22 static gchar *lxdream_config_load_filename = NULL;
9.1 --- /dev/null Thu Jan 01 00:00:00 1970 +00009.2 +++ b/src/drivers/audio_alsa.c Tue Feb 26 01:10:48 2008 +00009.3 @@ -0,0 +1,203 @@9.4 +/**9.5 + * $Id: audio_esd.c 602 2008-01-15 20:50:23Z nkeynes $9.6 + *9.7 + * The asla audio driver9.8 + *9.9 + * Copyright (c) 2008 Jonathan Muller9.10 + *9.11 + * This program is free software; you can redistribute it and/or modify9.12 + * it under the terms of the GNU General Public License as published by9.13 + * the Free Software Foundation; either version 2 of the License, or9.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 of9.18 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the9.19 + * GNU General Public License for more details.9.20 + */9.21 +#include <stdio.h>9.22 +#include <unistd.h>9.23 +9.24 +/* Use the newer ALSA API */9.25 +#define ALSA_PCM_NEW_HW_PARAMS_API9.26 +9.27 +#include <alsa/asoundlib.h>9.28 +#include "config.h"9.29 +#include "aica/audio.h"9.30 +#include "dream.h"9.31 +9.32 +9.33 +static snd_pcm_t *_soundDevice = NULL;9.34 +static int frames;9.35 +static int frame_bytes;9.36 +9.37 +9.38 +struct lxdream_config_entry alsa_config[] = {9.39 + {"device", CONFIG_TYPE_FILE, "default"},9.40 + {NULL, CONFIG_TYPE_NONE}9.41 +};9.42 +9.43 +9.44 +gboolean audio_alsa_init( )9.45 +{9.46 + int err;9.47 +9.48 + return TRUE;9.49 +}9.50 +9.51 +9.52 +gboolean audio_alsa_set_format( uint32_t rate, uint32_t format )9.53 +{9.54 + int i;9.55 + int err;9.56 + snd_pcm_hw_params_t *hw_params;9.57 + snd_pcm_sw_params_t *sw_params;9.58 + snd_pcm_uframes_t frames;9.59 + unsigned int resample = 1;9.60 + unsigned int actualRate = rate;9.61 + snd_pcm_uframes_t bufferSize;9.62 + int dir;9.63 +9.64 +9.65 + // Open the device we were told to open.9.66 + err = snd_pcm_open( &_soundDevice, alsa_config[0].value,9.67 + SND_PCM_STREAM_PLAYBACK, 0 );9.68 +9.69 + // Check for error on open.9.70 + if ( err < 0 ) {9.71 + ERROR( "Init: cannot open audio device %s (%s)\n",9.72 + alsa_config[0].value, snd_strerror( err ) );9.73 + return FALSE;9.74 + } else {9.75 + DEBUG( "Audio device opened successfully." );9.76 + }9.77 +9.78 + frame_bytes = ( 2 * ( snd_pcm_format_width( SND_PCM_FORMAT_S16_LE ) / 8 ) );9.79 +9.80 +9.81 + //snd_pcm_hw_params_alloca (&hw_params);9.82 + // Allocate the hardware parameter structure.9.83 + if ( ( err = snd_pcm_hw_params_malloc( &hw_params ) ) < 0 ) {9.84 + ERROR( "Init: cannot allocate hardware parameter structure (%s)\n",9.85 + snd_strerror( err ) );9.86 + return FALSE;9.87 + }9.88 +9.89 + if ( ( err = snd_pcm_hw_params_any( _soundDevice, hw_params ) ) < 0 ) {9.90 + ERROR( "Init: cannot allocate hardware parameter structure (%s)\n",9.91 + snd_strerror( err ) );9.92 + return FALSE;9.93 + }9.94 + // Set access to RW interleaved.9.95 + if ( ( err = snd_pcm_hw_params_set_access( _soundDevice, hw_params,9.96 + SND_PCM_ACCESS_RW_INTERLEAVED ) )9.97 + < 0 ) {9.98 + ERROR( " Init: cannot set access type (%s)\n", snd_strerror( err ) );9.99 + return FALSE;9.100 + }9.101 +9.102 + if ( ( err = snd_pcm_hw_params_set_format( _soundDevice, hw_params,9.103 + SND_PCM_FORMAT_S16_LE ) ) <9.104 + 0 ) {9.105 + ERROR( "Init: cannot set sample format (%s)\n", snd_strerror( err ) );9.106 + return FALSE;9.107 + }9.108 +9.109 + err = snd_pcm_hw_params_set_rate_near( _soundDevice, hw_params, &rate, 0 );9.110 + if ( err < 0 ) {9.111 + ERROR( "Init: Resampling setup failed for playback: %s\n",9.112 + snd_strerror( err ) );9.113 + return err;9.114 + }9.115 + // Set channels to stereo (2).9.116 + err = snd_pcm_hw_params_set_channels( _soundDevice, hw_params, 2 );9.117 + if ( err < 0 ) {9.118 + ERROR( "Init: cannot set channel count (%s)\n", snd_strerror( err ) );9.119 + return FALSE;9.120 + }9.121 +9.122 + // frames = 4410;9.123 + // snd_pcm_hw_params_set_period_size_near( _soundDevice, hw_params, &frames,9.124 + // &dir );9.125 +9.126 + // Apply the hardware parameters that we've set.9.127 + err = snd_pcm_hw_params( _soundDevice, hw_params );9.128 + if ( err < 0 ) {9.129 + DEBUG( "Init: cannot set parameters (%s)\n", snd_strerror( err ) );9.130 + return FALSE;9.131 + } else {9.132 + DEBUG( "Audio device parameters have been set successfully." );9.133 + }9.134 +9.135 + snd_pcm_hw_params_get_period_size( hw_params, &frames, &dir );9.136 + DEBUG( "period size = %d\n", frames );9.137 +9.138 + // Get the buffer size.9.139 + snd_pcm_hw_params_get_buffer_size( hw_params, &bufferSize );9.140 + DEBUG("Buffer Size = %d\n", bufferSize);9.141 +9.142 + // If we were going to do more with our sound device we would want to store9.143 + // the buffer size so we know how much data we will need to fill it with.9.144 +9.145 + //cout << "Init: Buffer size = " << bufferSize << " frames." << endl;9.146 +9.147 + // Display the bit size of samples.9.148 + //cout << "Init: Significant bits for linear samples = " << snd_pcm_hw_params_get_sbits(hw_params) << endl;9.149 +9.150 + // Free the hardware parameters now that we're done with them.9.151 + snd_pcm_hw_params_free( hw_params );9.152 +9.153 + // Set the start threshold to reduce inter-buffer gaps9.154 + snd_pcm_sw_params_alloca( &sw_params );9.155 + snd_pcm_sw_params_current( _soundDevice, sw_params );9.156 + snd_pcm_sw_params_set_start_threshold( _soundDevice, sw_params, bufferSize/2 );9.157 + err = snd_pcm_sw_params( _soundDevice, sw_params );9.158 + if( err < 0 ) {9.159 + ERROR("Unable to set sw params for alsa driver: %s\n", snd_strerror(err));9.160 + return FALSE;9.161 + }9.162 +9.163 + err = snd_pcm_prepare( _soundDevice );9.164 + if ( err < 0 ) {9.165 + ERROR( "Init: cannot prepare audio interface for use (%s)\n",9.166 + snd_strerror( err ) );9.167 + return FALSE;9.168 + }9.169 + return TRUE;9.170 +}9.171 +9.172 +gboolean audio_alsa_process_buffer( audio_buffer_t buffer )9.173 +{9.174 + int err;9.175 + int length;9.176 +9.177 +9.178 + length = buffer->length / frame_bytes;9.179 +9.180 + err = snd_pcm_writei( _soundDevice, buffer->data, length );9.181 + if( err == -EPIPE ) {9.182 + snd_pcm_prepare( _soundDevice );9.183 + } else if( err == -ESTRPIPE ) {9.184 + snd_pcm_resume( _soundDevice );9.185 + }9.186 +9.187 + return TRUE;9.188 +}9.189 +9.190 +9.191 +gboolean audio_alsa_close( )9.192 +{9.193 + int err;9.194 +9.195 + return TRUE;9.196 +}9.197 +9.198 +9.199 +9.200 +struct audio_driver audio_alsa_driver = {9.201 + "alsa",9.202 + audio_alsa_init,9.203 + audio_alsa_set_format,9.204 + audio_alsa_process_buffer,9.205 + audio_alsa_close9.206 +};
10.1 --- a/src/drivers/audio_esd.c Tue Feb 26 01:06:59 2008 +000010.2 +++ b/src/drivers/audio_esd.c Tue Feb 26 01:10:48 2008 +000010.3 @@ -24,6 +24,12 @@10.4 int esd_handle = -1;10.5 int esd_sample_size = 1;10.7 +10.8 +gboolean audio_esd_init()10.9 +{10.10 + return TRUE;10.11 +}10.12 +10.13 gboolean audio_esd_set_format( uint32_t rate, uint32_t format )10.14 {10.15 if( esd_handle != -1 ) {10.16 @@ -58,5 +64,14 @@10.17 }10.18 }10.20 -struct audio_driver audio_esd_driver = { "esd", audio_esd_set_format, audio_esd_process_buffer };10.21 +gboolean audio_esd_close()10.22 +{10.23 + return TRUE;10.24 +}10.26 +struct audio_driver audio_esd_driver = { "esd",10.27 + audio_esd_init,10.28 + audio_esd_set_format,10.29 + audio_esd_process_buffer,10.30 + audio_esd_close};10.31 +
11.1 --- a/src/drivers/audio_null.c Tue Feb 26 01:06:59 2008 +000011.2 +++ b/src/drivers/audio_null.c Tue Feb 26 01:10:48 2008 +000011.3 @@ -18,6 +18,11 @@11.4 */11.5 #include "aica/audio.h"11.7 +gboolean audio_null_init()11.8 +{11.9 + return TRUE;11.10 +}11.11 +11.12 gboolean audio_null_set_format( uint32_t rate, uint32_t format )11.13 {11.14 return TRUE;11.15 @@ -28,4 +33,13 @@11.16 return TRUE;11.17 }11.19 -struct audio_driver audio_null_driver = { "null", audio_null_set_format, audio_null_process_buffer };11.20 +gboolean audio_null_close()11.21 +{11.22 + return TRUE;11.23 +}11.24 +11.25 +struct audio_driver audio_null_driver = { "null",11.26 + audio_null_init,11.27 + audio_null_set_format,11.28 + audio_null_process_buffer,11.29 + audio_null_close};
.