Commit Graph

158 Commits

Author SHA1 Message Date
bjorn 37221afbc6 rm graphics module; 2022-04-21 17:39:58 -07:00
bjorn b115e5865f Fix miniaudio warning; 2022-03-30 21:15:51 -07:00
bjorn e47f3eb108 Use doubles for noise; 2022-03-27 14:51:06 -07:00
bjorn f347ac98d9 Switch to simplex noise;
Pending test
2022-03-27 01:21:52 -07:00
bjorn 20caeca69a Upgrade miniaudio; 2022-03-23 10:57:30 -07:00
bjorn b132eaf889 Patch tinycthread to work with Visual Studio C11; 2022-03-20 01:42:31 -07:00
bjorn 998b355e30 Make some private functions static; 2021-10-31 12:35:49 -07:00
bjorn ecd7769ba0 Convert Tupfile to Lua; 2021-07-18 22:24:00 -07:00
Nevyn Bengtsson ff4f594a62 switch back from aaudio to opensl
because capture on quest is broken with miniaudio's aaudio backend :/
2021-05-31 09:07:38 -06:00
bjorn 51f81c9db6 Switch back to ALSA on Linux; 2021-04-27 22:20:56 -06:00
bjorn 87bf9c7b27 Merge branch 'master' into dev 2021-04-27 22:20:38 -06:00
bjorn 4a4aff210d Upgrade miniaudio; 2021-04-27 22:17:07 -06:00
bjorn 70bbbc4549 Use pulseaudio on linux; 2021-04-11 07:19:49 -06:00
bjorn f565a7b69b rm linking to OpenSLES; 2021-04-03 18:42:34 -06:00
bjorn 3b61dfc8c9 miniaudio: Use AAudio instead of OpenSL; 2021-04-03 18:42:34 -06:00
bjorn efa48bda70 Manually disable a few miniaudio features; 2021-04-03 13:57:13 -06:00
bjorn 35032bb21c Upgrade miniaudio; 2021-03-31 22:32:16 -06:00
bjorn 441039db19 miniadio: Enable WebAudio backend; 2021-03-31 14:30:06 -06:00
bjorn e008dd2323 Fix stb_vorbis bug with empty comment list files; 2021-03-18 12:43:36 -06:00
mcc d233d5ccd3 Fix MSVC build
- stdatomic.h had not defined ATOMIC_INT_LOCK_FREE, but it is now required
- It's _MSC_VER, not _MSVC_VER
2021-02-28 14:12:16 -08:00
bjorn 1145085446 macOS fixes; 2021-02-22 17:07:28 -07:00
bjorn fb1447503b Fix gcc warnings; 2021-02-19 23:44:23 -07:00
bjorn ef438d48b3 Upgrade stb_vorbis; 2021-02-19 23:44:23 -07:00
bjorn 72284c2c5b Merge branch 'master' into dev 2021-02-12 08:16:36 -07:00
bjorn 0e318aa46e Make Rasterizer opaque; 2021-02-08 10:58:39 -07:00
bjorn 1c3e29b3e5 Start windows atomics; 2021-02-08 16:50:43 -07:00
bjorn 4f5f5b2289 Start stdatomic.h shim; 2021-02-08 16:50:43 -07:00
bjorn 8bf0acd2eb Add minimp3; 2021-02-08 16:08:29 -07:00
bjorn 2c37bd1a58 Only enable specific miniaudio backends;
Start with a conservative set, expand as needed.
2021-02-08 16:08:29 -07:00
bjorn 93ea56155e scribbling; 2021-02-08 16:08:29 -07:00
bjorn 13e100275e Fix style issues; 2021-02-08 16:08:29 -07:00
mcc 9ba4037e74 LOVR_USE_OCULUS_AUDIO
This is a large patch which adds a new Oculus Audio spatializer. Oculus Audio is slightly different from the dummy spatializer in a few ways:

    - It *must* receive fixed-size input buffers, every time, always.
    - It can only handle a fixed number of spatialized sound sources at a time.
    - It has a concept of "tails"; the spatialization of a sound can continue after the sound itself ends (eg echo).

Changes to audio.c were needed to support Oculus Audio's quirks:

    - audio.c now supports a "fixedBuffer" mode which invokes the generator/spatializer in fixed size chunks
    - Each source now has an intptr_t "memo" field that the spatializer may use to store whatever (Oculus spatializer uses this to handle the sound source limit).
    - The spatializer interface got a couple new methods: A "tail" method which returns a sound buffer after all sources are processed; and "create" and "destroy" methods that are called when a sound source is created or destroyed (Oculus spatializer uses this to populate/clear the "memo" field).

Along the way some other miscellaneous changes got made:

    - lovr.audio.getSpatializerName() returns the current spatializer
    - Spatializer init now takes in "config in" and "config out" structs (Spatializer changes fields in config out to request things, currently fixed buffer mode).
    - lovr.conf now takes t.audio.spatializer (string name of desired spatializer) and t.audio.spatializerMaxSourcesHint (Spatializers with max sources limits like Oculus will use this as the limit).
    - audio.c went back to tracking position/orientation as vectors rather than a matrix
    - A file oculus_spatializer_math_shim.h was added containing a minimal copypaste of OVR_CAPI.h from Oculus SDK to support a ovrPoseStatef the spatializer API needs. This may have license consequences but we are probably OK via a combination of fair use and the fact that a user cannot use this header file without accepting Oculus's license through other means.

Some work remains to be done, in particular there is an entire reverb feature I did not touch and LOVR_USE_OCULUS_AUDIO cannot be activated from tup. Oculus Spatializer works better when it has velocity and time information but this patch does not supply it.
2021-02-08 16:08:29 -07:00
Nevyn Bengtsson f8c29d1c79 bump to miniaudio with Quest fix
This is a WIP version v0.10.28 aka 6c60953e9cb587
2021-02-08 16:08:29 -07:00
Nevyn Bengtsson 8b594332dc Revert miniaudio to 0.10.12
aka a9541579f38a0c1bab4bba294f3602fa0b80f127, plus cherry-pick of
2dc604ecde0f02280690c72f943bfb8bf52dd820.

There is a crasher in 0.10.13 and newer on Oculus Quest
(See https://github.com/mackron/miniaudio/issues/247)
2021-02-08 16:08:29 -07:00
Nevyn Bengtsson cd1cddcd93 WIP streaming SoundData
It seems Bjorn had the idea to back SoundData with
an array of buffers, so I'm running
with that but changing the array
into a ringbuffer.
2021-02-08 16:08:29 -07:00
Nevyn Bengtsson 381e3f3850 Bump miniaudio to 0.10.27
aka caad0bc436ade1633cdc47892bd0d9a36623a298
2021-02-08 16:08:29 -07:00
Nevyn Bengtsson 2317ae31cd miniaudio: cherry-pick 2dc604ecde0f02280690c72f943bfb8bf52dd820
This fixes capture on linux/pulseaudio
2021-02-08 16:08:29 -07:00
bjorn 40cffbe590 Remove integer conversion APIs from stb_vorbis; 2021-02-08 16:08:29 -07:00
bjorn 1eb4070c92 Mixing; 2021-02-08 16:08:29 -07:00
bjorn c92b47e3a6 Another miniaudio attempt WIP; 2021-02-08 16:08:29 -07:00
bjorn 0c03be1090 tup updates;
- rm json and enet (they're plugins now)
- ignore a warning in stb_image
2021-01-07 14:35:28 -07:00
bjorn b356ce2546 Plugins;
- The plugins folder can contain native plugins.
- CMake will build plugins with CMakeLists in them
  - They can check the LOVR variable to see if they are being built inside LOVR.
  - They can set the LOVR_PLUGIN_TARGETS variable to a list of targets they build.
    - If blank, all non-imported targets added in the folder will be used.
  - The libraries built by their targets will be moved next to the executable or into the apk.
- The library loader now tries to load libraries next to the executable or in the APK.
  - It is "fixed function" now, this may be improved in the future.
- The lovr.filesystem C require path has been removed.
- enet and cjson have been removed.  Use plugins.
2020-12-28 12:37:35 -07:00
bjorn 30e01f94a3 Upgrade stb_image; rm stb_image threadlocal patch;
stb_image's vertical flip flag was not thread safe in the version
of stb_image we were using.  We patched stb_image to use a thread
local variable for the flag.  stb_image has since been upgraded to
expose a thread local version of the flag, so our patch is no longer
necessary after upgrading.

The CMake flag to enable the thread local patch did not make very much
sense because thread local stuff is unconditionally used elsewhere.
2020-12-25 16:43:25 -07:00
bjorn 96839c5181 Slightly better error messages on image load failure; 2020-12-15 20:20:25 -07:00
bjorn d28d96008c Windows: Thread:wait no longer destroys thread; 2020-09-19 17:42:55 -07:00
bjorn 5a17b48e4e Add GL_KHR_debug; 2020-07-28 16:08:37 -06:00
bjorn 47f4319ba8 core/png; rm stb_image_write; 2020-02-16 04:11:55 -08:00
bjorn e538965f77 Add newline to end of stb_image.h; 2019-12-28 23:16:36 -08:00
mcc 21a52368f5 Patch in thread local storage for stb_image vflip
This makes loading images in multiple threads concurrently safe.

Adds a new CMake variable LOVR_USE_THREADLOCAL, by default on
2019-12-20 16:09:18 -05:00
mcc 735d2e1011 Upgrade stb_image from v2.12 to v2.23 2019-12-20 16:24:05 -05:00