Commit graph

164 commits

Author SHA1 Message Date
Henrik Rydgard
1e095951dd Replace while loop with division (technically a right shift). 2016-12-20 22:02:40 +01:00
Henrik Rydgard
ff4b99dd97 Replace for-loop with multiplication 2016-12-20 21:52:25 +01:00
Henrik Rydgard
6782f7c75d Just figure out how many samples to read, then read it, instead of one-by-one. 2016-12-20 21:47:50 +01:00
Henrik Rydgard
e802fb0b73 Remove the verification. 2016-12-20 21:42:11 +01:00
Henrik Rydgard
451388070a Fix bug. Now use the quick inner loop, just need to redo the sample reader... 2016-12-20 21:37:31 +01:00
Henrik Rydgard
064795216e Add parallel resampling algorithm that reads directly from the temp buf 2016-12-20 21:05:23 +01:00
Henrik Rydgard
47df134b66 Optimization step 1: Separate the loops, save history from buffer. 2016-12-20 20:50:34 +01:00
Henrik Rydgard
61f80edda3 SasAudio: Straightforward implementation of linear interpolation.
Not sure about the performance impact, but calling ReadSamples with 1 as
an argument can't be terribly fast. So this might need some redesign
before merge, but should be a good starting point.
2016-12-20 20:23:00 +01:00
Henrik Rydgard
b68f2deca8 Set the reverb type when loading a savestate. May help #8528 2016-01-31 11:20:26 +01:00
Unknown W. Brackets
23441d12fb Sas: Estimate time taken for mixing.
Tests seem to show it's not affected by mhz.
2015-11-25 18:44:34 -08:00
Unknown W. Brackets
6290ac6cbd Sas: Process SAS on a separate thread.
Remaining issues:
 * Need a config setting.
 * Locking for voices / config?
 * Locking for atrac interop?
2015-11-25 18:44:30 -08:00
Unknown W. Brackets
6b413a808f Atrac: Handle SAS end the same way as other types.
It makes sense to match, and this sounds right in Sol Trigger.  Haven't
tested in detail yet, but it should prevent cutting off sounds.
2015-11-08 12:23:32 -08:00
Unknown W. Brackets
1aac569e73 Sas: Add in zeroes like the PSP seems to. 2015-11-01 20:56:34 -08:00
Unknown W. Brackets
9c378c4eda Sas: Properly support the OFF reverb type. 2015-11-01 20:33:42 -08:00
Unknown W. Brackets
42222ad497 Sas: Support the dry flag as well as wet. 2015-11-01 20:32:35 -08:00
Henrik Rydgard
9fa6f1f89d Minor improvements to audio debug display 2015-10-31 13:02:19 +01:00
Henrik Rydgard
40246e894c Fix buzzsaw noises in reverb by preventing integer wraparound in a couple of places 2015-10-28 21:36:00 +01:00
Henrik Rydgard
22f71f1e9a Show simple info about currently playing audio in on-screen Debug Statistics 2015-10-28 21:20:20 +01:00
Henrik Rydgard
06fec54dba Forgot to scale a multiplication. Slightly better but quickly devolves into harsh noise. 2015-10-27 15:56:11 +01:00
Henrik Rydgard
9bb8aff715 Forgot that the address registers are scaled. still doens't fix it. 2015-10-27 15:52:19 +01:00
Henrik Rydgard
85c8f7d3c2 Hook up SasReverb. It sounds more like a buzzsaw than a reverb at the moment, needs debugging.
Added a bit of code that only enables it when a reverbed sound is active. This will need to be turned off later but useful right now for hearing when it's used..
2015-10-27 12:36:30 +01:00
Unknown W. Brackets
ec2d88cf17 Make the vag block buffer s16.
The values are clamped already, anyway.
2015-10-24 13:08:10 -07:00
Henrik Rydgard
26624709f7 Hook up the frame profiler to a few measurements 2015-05-24 23:45:36 +02:00
Unknown W. Brackets
2450724be2 Make Memory::Memcpy() execute memchecks directly.
This makes it easier to handle breakpoints in HLE.
2015-04-05 18:09:20 -07:00
Henrik Rydgard
1a1faeffd1 More audio microoptimization 2014-12-07 21:14:09 +01:00
Lioncash
f830d5dec7 Core: Mark some functions as const 2014-12-03 15:16:11 -05:00
Henrik Rydgard
d24abb3af0 More GetPointer cleanup. memCardDirectory->memStickDirectory. 2014-10-19 23:20:51 +02:00
Unknown W. Brackets
4702ae0e41 Add breakpoints to most sceAtrac mem access. 2014-09-23 11:33:18 -07:00
Unknown W. Brackets
5c470a1923 Remove bgm and sfx volume settings.
They don't actually work in all games, and this only confuses users.

Also, the default 7 lowers the volume of audio detected as bgm or sfx, but
not other volume.  This means that some audio may have played too loud in
some games by default, which will be fixed by this change.
2014-08-17 14:16:59 -07:00
Henrik Rydgard
c8e719e165 Inline ADSREnvelope::Step (thanks @unknownbrackets)
(Some compilers want it declared inline in the header too)
2014-03-22 09:31:09 +01:00
Unknown W. Brackets
da1e4a80a6 Tone down sas raw output reporting, found a game.
Crimson Gem Saga apparently uses this mode.
2014-03-01 15:32:34 -08:00
Unknown W. Brackets
be79670efb Revert "Smooth SAS resampling when pitch != 0x1000."
This reverts commit 1efcebb121.
2014-02-23 08:48:49 -08:00
Unknown W. Brackets
c806ae0982 Revert "Optimize mixing samples at common pitches."
This reverts commit dd434cd7c5.

Conflicts:
	Core/HW/SasAudio.cpp
2014-02-23 08:48:30 -08:00
Unknown W. Brackets
97e8f36a9b Revert "Actually use the resample buffer."
This reverts commit dc5d17971c.
2014-02-23 08:46:33 -08:00
Unknown W. Brackets
d6f203db99 Revert "Reset resample hist on keyon, round up read."
This reverts commit 3edebbfba9.
2014-02-23 08:45:46 -08:00
Unknown W. Brackets
3edebbfba9 Reset resample hist on keyon, round up read.
If we have an uneven pitch, round up so that we get the next sample to
resample in.
2014-02-22 22:38:03 -08:00
Unknown W. Brackets
9cba543a4b sceSasCoreWithMix() returns an error in raw mode.
And does not reschedule, specifically.
2014-02-22 08:48:55 -08:00
Unknown W. Brackets
0939065333 Report the raw output mode to find examples.
I can't find any games actually leaving the output mode at 1.
2014-02-22 08:07:51 -08:00
Unknown W. Brackets
ff920f6af6 Fix sceSas outputMode = 1 (which is not mono.)
May fix games that played audio only on the left side, or something.
2014-02-22 07:52:18 -08:00
Unknown W. Brackets
a1283644ab If never set, loop to the first vag block.
Not the second (0 = second.)
2014-02-19 01:03:11 -08:00
Unknown W. Brackets
a36f7bf267 Fill in predict_nr's above 5, fix clamping.
We weren't processing vag properly when it hit the edges.

The coefficients were found with testing about 384 samples.
2014-02-19 01:01:56 -08:00
Unknown W. Brackets
11df9dabf9 Add an extra delay to VAG keyon.
It seems to come in an extra sample late.  PCM doesn't.

This corrects timing for VAG samples so they match up exactly.  Really
minor, of course...
2014-02-18 23:32:37 -08:00
Unknown W. Brackets
dc5d17971c Actually use the resample buffer.
Fixes static in Final Fantasy Tactics music.
2014-02-17 23:23:44 -08:00
Unknown W. Brackets
93060e3aef Avoid some divisions, just in case. 2014-02-17 23:19:30 -08:00
Unknown W. Brackets
b5bdac211a Ignore pitch > 0x1000 for pcm.
It seems to be supported only below 0x1000.  Also, drop optimization for
double for now, simpler this way and doesn't seem common?
2014-02-17 21:09:44 -08:00
Unknown W. Brackets
dd434cd7c5 Optimize mixing samples at common pitches.
Doesn't seem to be a big help but may matter more on mobile.
2014-02-17 21:09:44 -08:00
Unknown W. Brackets
1efcebb121 Smooth SAS resampling when pitch != 0x1000. 2014-02-17 21:09:43 -08:00
Unknown W. Brackets
8ded863231 Reset sampleFrac on keyon.
Since we're starting the samples over.
2014-02-17 21:09:42 -08:00
Unknown W. Brackets
38053df4ca Don't drop the last mix of vag samples.
Wait instead until the end of mixing to end the envelope.
2014-02-17 21:09:42 -08:00
Unknown W. Brackets
3899e18422 Always key on for 32 samples regardless of pitch.
Before it would be more or less depending on pitch.  It's always 32.
2014-02-17 21:09:41 -08:00