From fe1f4d53c6012ceceaab16dc3b680de3accefa72 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 1 Sep 2013 16:59:37 -0700 Subject: [PATCH 1/3] Return an error on bad SAS sample rate. Also reorder the types to fit the PSP's flag values. --- Core/HLE/sceSas.cpp | 4 ++++ Core/HW/SasAudio.h | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Core/HLE/sceSas.cpp b/Core/HLE/sceSas.cpp index 61487737aa..d6897c1e82 100644 --- a/Core/HLE/sceSas.cpp +++ b/Core/HLE/sceSas.cpp @@ -86,6 +86,10 @@ u32 sceSasInit(u32 core, u32 grainSize, u32 maxVoices, u32 outputMode, u32 sampl ERROR_LOG_REPORT(HLE, "sceSasInit(%08x, %i, %i, %i, %i): bad output mode", core, grainSize, maxVoices, outputMode, sampleRate); return ERROR_SAS_INVALID_OUTPUT_MODE; } + if (sampleRate != 44100) { + ERROR_LOG_REPORT(HLE, "sceSasInit(%08x, %i, %i, %i, %i): bad sample rate", core, grainSize, maxVoices, outputMode, sampleRate); + return ERROR_SAS_INVALID_SAMPLE_RATE; + } INFO_LOG(HLE, "sceSasInit(%08x, %i, %i, %i, %i)", core, grainSize, maxVoices, outputMode, sampleRate); sas->SetGrainSize(grainSize); diff --git a/Core/HW/SasAudio.h b/Core/HW/SasAudio.h index fd4f84a126..9fcec058d4 100644 --- a/Core/HW/SasAudio.h +++ b/Core/HW/SasAudio.h @@ -66,11 +66,11 @@ struct WaveformEffect enum VoiceType { VOICETYPE_OFF, VOICETYPE_VAG, // default - VOICETYPE_PCM, VOICETYPE_NOISE, - VOICETYPE_ATRAC3, VOICETYPE_TRIWAVE, // are these used? there are functions for them (sceSetTriangularWave) VOICETYPE_PULSEWAVE, + VOICETYPE_PCM, + VOICETYPE_ATRAC3, }; // VAG is a Sony ADPCM audio compression format, which goes all the way back to the PSX. From 2a478c26ca5fa2caf4a539f2b9d4b33fe110d958 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 1 Sep 2013 17:18:55 -0700 Subject: [PATCH 2/3] Fix mp3 bit rate info in sceMp3GetBitRate(). --- Core/HLE/sceMp3.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/HLE/sceMp3.cpp b/Core/HLE/sceMp3.cpp index 859ce7fb12..35e186df2c 100644 --- a/Core/HLE/sceMp3.cpp +++ b/Core/HLE/sceMp3.cpp @@ -380,7 +380,7 @@ int sceMp3Init(u32 mp3) { ctx->mp3SamplingRate = ctx->decoder_context->sample_rate; ctx->mp3Channels = ctx->decoder_context->channels; - ctx->mp3Bitrate = ctx->decoder_context->bit_rate; + ctx->mp3Bitrate = ctx->decoder_context->bit_rate / 1000; if (!ctx->resampler_context) { ERROR_LOG(HLE, "Could not allocate resampler context %d", ret); From 16f4288901657378e1d8f7a74309689e88f926a2 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 1 Sep 2013 17:01:48 -0700 Subject: [PATCH 3/3] Update tests. --- pspautotests | 2 +- test.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pspautotests b/pspautotests index 30e70f0630..dfb1451c49 160000 --- a/pspautotests +++ b/pspautotests @@ -1 +1 @@ -Subproject commit 30e70f0630542155cbc8ccf3508929be9a1d98d4 +Subproject commit dfb1451c490bc9c7b8286f2f1fea69ced66a8327 diff --git a/test.py b/test.py index 5197bad262..a2d6b11391 100755 --- a/test.py +++ b/test.py @@ -69,6 +69,8 @@ tests_good = [ "cpu/fpu/fpu", "audio/atrac/ids", + "audio/mp3/mp3test", + "audio/sascore/sascore", "ctrl/ctrl", "ctrl/idle/idle", "ctrl/sampling/sampling", @@ -185,8 +187,6 @@ tests_good = [ tests_next = [ # These are the next tests up for fixing. These run by default. "audio/atrac/atractest", - "audio/mp3/mp3test", - "audio/sascore/sascore", "audio/sceaudio/datalen", "audio/sceaudio/output", "audio/sceaudio/reserve",