Clownacy
f78f6b7105
Split Organya callback data
...
The function pointer only ever needs to be set once, unlike the
timer. This should avoid any scary race-conditions.
2020-04-18 00:54:24 +01:00
Clownacy
1ad6fdf539
Rename mutex
2020-04-17 23:52:00 +01:00
Clownacy
b06e1e1312
Remove old junk
2020-04-17 23:48:40 +01:00
Clownacy
051d12f434
Stop shouldn't rewind the sound
...
According to the DirectSound docs, stop doesn't rewind.
https://docs.microsoft.com/en-us/previous-versions/ms817375%28v%3dmsdn.10%29
2020-04-17 23:47:45 +01:00
Clownacy
5bcc0ec393
New way to allocate Wii U voices
...
The previous method wasn't good enough: we were still maxing-out at
96 (did the Decaf devs misread that as hex? Is that why the
emulator's limit is 150 instead?).
Anyway, this new solution is a little brutish, but I can't think of
anything else that would work: right now, I have the Organya thread
constantly polling a linked-list of the currently-loaded sounds, and
checking if their voices have finished playing or not. If they've
finished, they get freed.
When AudioBackend_PlaySound is called, if checks if the sound's voice
has been freed or not, and reallocates it if it has.
There doesn't seem to be a noticable overhead to this, and it keeps
the number of currently-allocated voices *very* low (from 10 to 20 on
average).
2020-04-17 23:43:17 +01:00
Clownacy
b123e3743e
Clean-up the weird buggy code
...
I'mma just assume each sound needs their struct preserving for some
reason.
2020-04-17 21:48:34 +01:00
Clownacy
db14899b3e
Try to fix Wii U audio hang part 2
...
I encountered a hang earlier, so the previous attempt obviously
didn't work.
2020-04-17 18:34:26 +01:00
Clownacy
76e7a6f857
Revert some suspicious code
...
I'm getting some rare audio hangs. I tried doing some
regression-testing, but it's so random that I'm getting anomalous
results. That said, there were suspicious results around this change
(and also the way `mix_data` is initialised/cleared), so I'm
reverting this for now, and restoring it next time I encounter a
hang.
2020-04-17 16:58:07 +01:00
Clownacy
d025fecf54
Minor cleanup
2020-04-17 15:47:56 +01:00
Clownacy
a177f44b88
Clean up Wii U audio backend
2020-04-17 14:15:23 +01:00
Clownacy
9eacc74ee2
Got music working on Wii U!
2020-04-17 01:47:23 +01:00
Clownacy
edc9299007
Fix the game using too many Wii U voices
...
Now it just allocates channels on-demand, rather than ahead-of-time.
2020-04-16 22:42:33 +01:00
Clownacy
a7ebdb75e5
Added unfinished Wii U audio backend
...
Currently doesn't produce sound unless you stop Organya from calling
AudioBackend_CreateSound, because it exhausts the Wii U's 150-sound
pool before the SFX get any of them.
2020-04-16 22:19:00 +01:00
Clownacy
02f570cec7
Add Null audio backend
...
Literally doesn't do anything
2020-04-13 18:31:39 +01:00
Clownacy
c51a074fad
Big disgusting backend rework
...
We need to avoid `WindowsWrapper.h` in the backends whenever we can,
to avoid name collisions (the Wii U homebrew library) defines its own
BOOL/TRUE/FALSE, which really doesn't work with CSE2.
2020-04-13 18:19:39 +01:00
Clownacy
cdd97cb733
Some cleanup
2020-04-13 13:34:55 +01:00
Clownacy
4f7cc9582d
Revert "Backends: Added init/de-init messages for backends"
...
This reverts commit 9be8b9a493
.
2020-04-13 13:28:57 +01:00
Gabriel Ravier
9be8b9a493
Backends: Added init/de-init messages for backends
...
Signed-off-by: Gabriel Ravier <gabravier@gmail.com>
2020-04-12 02:26:51 +02:00
Gabriel Ravier
92d565692a
Backends: Use "SDL" instead of "SDL2" to match documentation vocabulary
...
Signed-off-by: Gabriel Ravier <gabravier@gmail.com>
2020-04-12 01:16:45 +02:00
Gabriel Ravier
27eb7d1788
Backend/Audio/SDL2: Replace puts
call with Backend_PrintInfo
...
Signed-off-by: Gabriel Ravier <gabravier@gmail.com>
2020-04-12 00:49:22 +02:00
Gabriel Ravier
dcd4bcf1b2
Backends: Fix some of the error handling and replaced some printf calls
...
Signed-off-by: Gabriel Ravier <gabravier@gmail.com>
2020-04-12 00:42:24 +02:00
Gabriel Ravier
16441ee87b
Backends: Improved miniaudio and GLFW3 error handling
...
Signed-off-by: Gabriel Ravier <gabravier@gmail.com>
2020-04-11 16:57:04 +02:00
Gabriel Ravier
7f7c3d8434
Backends: Started adding a bunch of error handling stuff (error checking only done in SDL2 for now)
...
Signed-off-by: Gabriel Ravier <gabravier@gmail.com>
2020-04-10 22:32:29 +02:00
Clownacy
6456649e11
Pre-process audio in the software mixer
...
This should improve performance slightly
2020-04-06 19:52:53 +01:00
Clownacy
5daea02ac6
Change the audio backend API
...
Removes locking and unlocking: instead, samples are passed to Create.
2020-04-06 19:44:45 +01:00
Clownacy
9fd95e720c
Whoops, remove a leftover std::
2020-04-06 13:49:57 +01:00
Clownacy
ba9ccec945
Change double to float
...
A quick test with godbolt shows this produces smaller (and presumably
faster) code.
2020-04-06 13:48:44 +01:00
Clownacy
545948584a
Different optimisation for software-mixer
...
`trunc` can resolve to a library call, while a cast-to-int doesn't
appear to. Since the mixer already does a cast-to-int when retrieving
samples, I can kill two birds with one stone.
2020-04-06 13:40:39 +01:00
Clownacy
1016411fa4
Cleanup
2020-04-06 13:37:53 +01:00
Gabriel Ravier
81e3259535
Backends/Audio/SoftwareMixer: Optimized fmod(x, 1.0)
to x - trunc(x)
...
Signed-off-by: Gabriel Ravier <gabravier@gmail.com>
2020-04-05 23:04:59 +02:00
Gabriel Ravier
1cf4200051
Merge branch 'portable' into improvePerformance2
2020-04-05 19:33:13 +02:00
Clownacy
bcd883e767
Fix weird buzzing in the software mixer
...
Not really sure why this causes it, but apparently it does.
2020-04-05 18:17:38 +01:00
Gabriel Ravier
1d9048c8a6
Merge branch 'portable' into improvePerformance2
...
# Conflicts:
# src/Backends/Rendering/Software.cpp
2020-04-05 01:16:09 +02:00
Clownacy
7c729af36f
Add a comment
2020-04-04 20:58:12 +01:00
Clownacy
6ea58290f4
Set SDL2 audio backend to 48000Hz
2020-04-04 20:57:34 +01:00
Clownacy
b3e40b0475
Fix SDL2 audio backend
2020-04-04 20:52:24 +01:00
Gabriel Ravier
afd3abecc4
Correctly used Attributes.h instead of a definition directly in SoftwareMixer.cpp
...
Signed-off-by: Gabriel Ravier <gabravier@gmail.com>
2020-04-03 00:43:34 +02:00
Gabriel Ravier
f68984bd58
Merge branch 'portable' into improvePerformance2
...
# Conflicts:
# src/Backends/Audio/SDL2.cpp
2020-04-03 00:36:44 +02:00
Clownacy
373c0e658a
Use PlatformBackend_ShowMessageBox somewhere
2020-04-02 21:32:50 +01:00
Clownacy
b57ccd7ed5
Shut up errors on Windows
2020-03-31 20:22:54 +01:00
Clownacy
d0b20316de
Don't do -Iexternal
...
It pollutes the #include space.
2020-03-31 14:26:24 +01:00
Clownacy
d91c1e9bdc
Update the SDL2 audio backend
...
Now uses the shared software mixer
2020-03-31 12:19:44 +01:00
Clownacy
732d3bbc5c
Split software audio mixer to its own file
...
This will be shared between the SDL2 and miniaudio backends,
eliminating all that digusting duplicate code.
2020-03-31 12:14:20 +01:00
Clownacy
4e58457e1d
Make miniaudio backend use native sample rate
...
This avoids the need for miniaudio to resample the mixer's output.
2020-03-31 10:20:20 +01:00
Clownacy
dd04977f29
Update miniaudio to v0.10.1
...
This newer version supports marking all of its declarations as
static, avoiding the conflict between the miniaudio audio backend,
and the copy of miniaudio embedded in clownaudio in the enhanced
branch.
2020-03-17 13:25:41 +00:00
Clownacy
9af25f7c67
Hopefully fixed miniaudio backend on Windows
...
Stupid BOOL type
2020-03-04 21:02:17 +00:00
Clownacy
af24d010a5
Clean-up miniaudio backend a little
...
Really need to figure out the best way to abstract-away the software
mixer...
2020-02-29 18:19:06 +00:00
Clownacy
8ec8a8d990
Added unfinished miniaudio audio backend
...
Currently only works with CMake
2020-02-29 18:18:59 +00:00
Gabriel Ravier
b238bcee03
Remove random lines mistakenly added by merge
2020-02-14 08:27:07 +01:00
Gabriel Ravier
65db12baaa
Started trying to optimize MakePixelWaveData
2020-02-13 19:55:39 +01:00