diff --git a/config.h b/config.h index 0985063b1d..bd04de842a 100644 --- a/config.h +++ b/config.h @@ -53,8 +53,8 @@ static const float yscale = 4.0; // Real y res = 224 * yscale // Fullscreen static bool fullscreen = false; // To start in Fullscreen or not -static const unsigned fullscreen_x = 1280; -static const unsigned fullscreen_y = 720; +static const unsigned fullscreen_x = 1920; +static const unsigned fullscreen_y = 1200; // Video VSYNC (recommended) static const bool vsync = true; @@ -80,18 +80,24 @@ static const bool force_aspect = true; // Audio //////////////// +// Will enable audio or not. +static const bool audio_enable = true; + // Output samplerate -static const unsigned out_rate = 48000; +static const unsigned out_rate = 96000; // Input samplerate from libSNES. // Lower this (slightly) if you are experiencing frequent audio dropouts and vsync is enabled. static const unsigned in_rate = 31950; // Audio device (e.g. hw:0,0 or /dev/audio). If NULL, will use defaults. -static const char* audio_device = NULL; +static const char* audio_device = "hw:0"; // Desired audio latency in milliseconds. Might not be honored if driver can't provide given latency. -static const int out_latency = 64; +static const int out_latency = 16; + +// Will sync audio. (recommended) +static const bool audio_sync = true; // Defines the quality (and cpu reqirements) of samplerate conversion. #define SAMPLERATE_QUALITY SRC_LINEAR diff --git a/config.mk b/config.mk index fbce73ec6a..ae4d2a47e6 100644 --- a/config.mk +++ b/config.mk @@ -1,12 +1,12 @@ BUILD_OPENGL = 1 -BUILD_FILTER = 0 +BUILD_FILTER = 1 -BUILD_RSOUND = 0 -BUILD_OSS = 0 +BUILD_RSOUND = 1 +BUILD_OSS = 1 BUILD_ALSA = 1 -BUILD_ROAR = 0 +BUILD_ROAR = 1 -PREFIX = /usr/local +PREFIX = /usr diff --git a/ssnes.c b/ssnes.c index be84a25b28..d861a56add 100644 --- a/ssnes.c +++ b/ssnes.c @@ -90,7 +90,7 @@ void set_fast_forward_button(bool new_button_state) if (video_active) driver.video->set_nonblock_state(driver.video_data, syncing_state); if (audio_active) - driver.audio->set_nonblock_state(driver.audio_data, syncing_state); + driver.audio->set_nonblock_state(driver.audio_data, (audio_sync) ? syncing_state : true); if (syncing_state) audio_chunk_size = AUDIO_CHUNK_SIZE_NONBLOCKING; else @@ -113,16 +113,33 @@ static void uninit_drivers(void) static void init_audio(void) { + if (!audio_enable) + { + audio_active = false; + return; + } + driver.audio_data = driver.audio->init(audio_device, out_rate, out_latency); if ( driver.audio_data == NULL ) audio_active = false; + if (!audio_sync && audio_active) + driver.audio->set_nonblock_state(driver.audio_data, true); + int err; source = src_new(SAMPLERATE_QUALITY, 2, &err); + if (!source) + audio_active = false; } static void uninit_audio(void) { + if (!audio_enable) + { + audio_active = false; + return; + } + if ( driver.audio_data && driver.audio ) driver.audio->free(driver.audio_data);