Linux/SPU2-X: A bit more work on the Linux port of SPU2-X.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@827 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
arcum42 2009-03-20 10:13:19 +00:00
parent 2baace0895
commit 65822fbfdc
6 changed files with 87 additions and 13 deletions

View File

@ -3,6 +3,8 @@
curdir=`pwd`
buildplugin() {
if [ -d ${curdir}/$1 ]
then
cd ${curdir}/$1
sh build.sh $2
@ -10,6 +12,7 @@ if [ $? -ne 0 ]
then
exit 1
fi
fi
}
buildplugin CDVDnull $@
@ -19,6 +22,7 @@ buildplugin USBnull $@
buildplugin SPU2null $@
buildplugin zerogs $@
buildplugin zzogl $@
buildplugin zeropad $@
buildplugin zerospu2 $@

View File

@ -24,17 +24,19 @@
#define ALSA_MEM_DEF
#include "Alsa.h"
#include "SndOut.h"
class AlsaMod: public SndOutModule
{
protected:
static const int PacketsPerBuffer = 1; // increase this if ALSA can't keep up with 512-sample packets
static const int MAX_BUFFER_COUNT = 4;
static const int NumBuffers = 4; // TODO: this should be configurable someday -- lower values reduce latency.
static const int NumBuffers = 4; // TODO: this should be configurable someday -- lower values reduce latency.
unsigned int pspeed;
snd_pcm_t *handle = NULL;
snd_pcm_t *handle;
snd_pcm_uframes_t buffer_size;
snd_async_handler_t *pcm_callback = NULL;
snd_async_handler_t *pcm_callback;
uint period_time;
uint buffer_time;
@ -64,7 +66,7 @@ protected:
// entry point for our C++ified object state. :)
static void ExternalCallback( snd_async_handler_t *pcm_callback )
{
AlsaMod *data = snd_async_handler_get_callback_private( pcm_callback );
AlsaMod *data = (AlsaMod*)snd_async_handler_get_callback_private( pcm_callback );
jASSUME( data != NULL );
jASSUME( data->handle == snd_async_handler_get_pcm(pcm_callback) );
@ -85,6 +87,10 @@ public:
int pchannels = 2;
snd_pcm_format_t format = SND_PCM_FORMAT_S16_LE;
handle = NULL;
pcm_callback = NULL;
pspeed = SAMPLE_RATE;
// buffer time and period time are in microseconds...
// (don't simplify the equation below -- it'll just cause integer rounding errors.
period_time = (SndOutPacketSize*1000) / (SampleRate / 1000);
@ -191,13 +197,11 @@ public:
handle = NULL;
}
virtual void Configure(HWND parent)
virtual void Configure(uptr parent)
{
}
virtual bool Is51Out() const { return false; }
{
}
virtual bool Is51Out() const { return false; }
s32 Test() const
{

View File

@ -103,11 +103,11 @@ public:
static void ReadSettings();
static void WriteSettings();
//static void OpenDialog( HWND hWnd );
static void OpenDialog( uptr hWnd );
protected:
static void ClampValues();
//static BOOL CALLBACK DialogProc(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam);
//static bool CALLBACK DialogProc(uptr hWnd,u32 uMsg,WPARAM wParam,LPARAM lParam);
};

View File

@ -0,0 +1,57 @@
/* SPU2-X, A plugin for Emulating the Sound Processing Unit of the Playstation 2
* Developed and maintained by the Pcsx2 Development Team.
*
* Original portions from SPU2ghz are (c) 2008 by David Quintana [gigaherz]
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the the License, or (at your
* option) any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with this library; if not, write to the Free Software Foundation, Inc., 59
* Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include "Dialogs.h"
int SoundtouchCfg::SequenceLenMS = 63;
int SoundtouchCfg::SeekWindowMS = 16;
int SoundtouchCfg::OverlapMS = 7;
void SoundtouchCfg::ClampValues()
{
Clampify( SequenceLenMS, SequenceLen_Min, SequenceLen_Max );
Clampify( SeekWindowMS, SeekWindow_Min, SeekWindow_Max );
Clampify( OverlapMS, Overlap_Min, Overlap_Max );
}
void SoundtouchCfg::ReadSettings()
{
//SequenceLenMS = CfgReadInt( L"SOUNDTOUCH", L"SequenceLengthMS", 63 );
//SeekWindowMS = CfgReadInt( L"SOUNDTOUCH", L"SeekWindowMS", 16 );
//OverlapMS = CfgReadInt( L"SOUNDTOUCH", L"OverlapMS", 7 );
ClampValues();
}
void SoundtouchCfg::WriteSettings()
{
//CfgWriteInt( L"SOUNDTOUCH", L"SequenceLengthMS", SequenceLenMS );
//CfgWriteInt( L"SOUNDTOUCH", L"SeekWindowMS", SeekWindowMS );
//CfgWriteInt( L"SOUNDTOUCH", L"OverlapMS", OverlapMS );
}
/*bool CALLBACK SoundtouchCfg::DialogProc(uptr hWnd,u32 uMsg,uptr wParam,uptr lParam)
{
}*/
void SoundtouchCfg::OpenDialog( uptr hWnd )
{
}

View File

@ -3,8 +3,8 @@ AUTOMAKE_OPTIONS = foreign
noinst_LIBRARIES = libSPU2X.a
INCLUDES = -I@srcdir@/../../../common/include -I@srcdir@/3rdparty -I@srcdir@/../../../3rdparty -I@srcdir@/Linux
libSPU2X_a_CXXFLAGS = $(shell pkg-config --cflags gtk+-2.0)
libSPU2X_a_CFLAGS = $(shell pkg-config --cflags gtk+-2.0)
libSPU2X_a_CXXFLAGS = $(shell pkg-config --cflags gtk+-2.0) -liconv
libSPU2X_a_CFLAGS = $(shell pkg-config --cflags gtk+-2.0) -liconv
if X86_64
libSPU2X_a_CXXFLAGS += -fPIC
@ -33,6 +33,14 @@ Dma.cpp Lowpass.cpp RegLog.cpp Reverb.cpp SndOut.cpp Spu2replay.cpp Wavedump_w
libSPU2X_a_SOURCES += BaseTypes.h Debug.h Dma.h Lowpass.h RegTable.h SndOut.h ConvertUTF.h \
Spu2.h Spu2replay.h defs.h regs.h spdif.h utf8.h
libSPU2X_a_SOURCES += Linux/Config.h Linux/Config.cpp Linux/ConfigSoundTouch.cpp Linux/Linux.h Linux/Alsa.cpp Linux/Alsa.h Linux/Dialogs.cpp Linux/Dialogs.h
libSPU2X_a_SOURCES += Linux/Config.h Linux/Config.cpp Linux/Linux.h Linux/Alsa.cpp Linux/Alsa.h \
Linux/Dialogs.cpp Linux/Dialogs.h Linux/ConfigSoundTouch.cpp
libSPU2X_a_SOURCES += 3rdparty/liba52/bitstream.c 3rdparty/liba52/downmix.c 3rdparty/liba52/parse.c \
3rdparty/liba52/bit_allocate.c 3rdparty/liba52/imdct.c \
3rdparty/liba52/a52.h 3rdparty/liba52/attributes.h 3rdparty/liba52/config.h 3rdparty/liba52/inttypes.h \
3rdparty/liba52/tendra.h 3rdparty/liba52/a52_internal.h 3rdparty/liba52/bitstream.h \
3rdparty/liba52/mm_accel.h 3rdparty/liba52/tables.h
#SUBDIRS = 3rdparty/SoundTouch

View File

@ -98,6 +98,7 @@ AC_SUBST(SHARED_LDFLAGS)
AC_CHECK_LIB(stdc++,main,[LIBS="$LIBS -lstdc++"])
AC_CHECK_LIB(dl,main,[LIBS="$LIBS -ldl"])
AC_CHECK_LIB(asound,main,[LIBS="$LIBS -lasound"])
AC_CHECK_LIB(iconv,main,[LIBS="$LIBS -liconv"])
AC_CHECK_FUNCS(iconv, [ have_iconv="1" ], [ have_iconv="0" ])
AC_OUTPUT([