Skip to content

Commit

Permalink
Version 0.3.3 Release [Bugfix]
Browse files Browse the repository at this point in the history
Bugfix release
  • Loading branch information
Dreaming381 committed Jun 20, 2021
1 parent 63c3e2c commit 769b1da
Show file tree
Hide file tree
Showing 9 changed files with 165 additions and 133 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic
Versioning](http://semver.org/spec/v2.0.0.html).

## [0.3.3] – 2021-6-19

Officially supports Entities [0.17.0]

### Changed

- Updated Myri to v0.3.3

## [0.3.2] – 2021-5-25

Officially supports Entities [0.17.0]
Expand Down
9 changes: 9 additions & 0 deletions Documentation~/Myri Audio/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic
Versioning](http://semver.org/spec/v2.0.0.html).

## [0.3.3] – 2021-6-19

Officially supports Entities [0.17.0]

### Fixed

- Fixed an issue where looping sources with a sample rate different from the
output sample rate would begin sampling from the wrong location each update.

## [0.3.2] – 2021-5-25

Officially supports Entities [0.17.0]
Expand Down
14 changes: 14 additions & 0 deletions Documentation~/Myri Audio/Getting Started.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,20 @@ framerate proportionally. This comes at a performance cost as well as less
accept the occasional first audio frame drops and leave *Audio Subframes Per
Frame* at *1*.

### Optimizing Clips for Performance

Every audio clip has a sample rate, typically measured in kHz. Common sample
rates may be 44.1 kHz and 48 kHz. The audio output of the device may have a
different sample rate than the audio clip. When this happens, Myri needs to
“resample” the clip to compensate at runtime, which may have a measurable
performance impact for complex audio workloads. Therefore, it is recommended to
convert the clips sample rates to the target device’s sample rate if performance
is a concern. This can be done using the import settings for the audio clip. The
following image shows an audio clip with a sample rate of 44.1 kHz being
converted to 48 kHz.

![](media/8986587ec983ff3f342baaf8990b8899.png)

## IComponentData

Myri’s entire API is exposed as Burst-friendly `IComponentData` that can be
Expand Down
21 changes: 16 additions & 5 deletions Documentation~/Myri Audio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,20 +80,31 @@ were hoping for, well I’m glad I delivered.
audio framerate is faster than the simulation framerate. A configurable
audio framerate multiplier exists to combat this, but issues may still arise
during frame spikes.
- A job which manages listeners and the DSP graph is not Bursted due to
DSPGraph limitations.
- Myri will only use up to `n` worker threads when performing sampling, where
`n` is the sum of spatialization channels across all listeners. A default
listener has four spatialization channels.
- Myri does not properly handle peaks in audio where the samples mixed become
greater than 1.0f. A proper limiter would likely solve this, but I’m not an
audio engineer, and so this is one of the areas I need help.

## Known DSPGraph Issues

The following issues are issues with Unity’s underlying DSPGraph and cannot be
resolved in Myri. If you encounter one of these issues, submit a bug report to
Unity!

- A job which manages listeners and the DSP graph is not Bursted due to
DSPGraph limitations.
- The Unity Editor sometimes emits an exception from a Bursted job. This is a
DSPGraph and job system bug related to scheduling, and does not appear to
have any adverse effects currently.
- Exiting play mode while an active listener exists will cause a warning
regarding DSPGraph nodes not being disposed. This is an execution order
issue on teardown.
- Myri does not properly handle peaks in audio where the samples mixed become
greater than 1.0f. A proper limiter would likely solve this, but I’m not an
audio engineer, and so this is one of the areas I need help.
- Audio causes crashes for MacOS builds using 2020.1.9f1 and possibly other
versions. (1 report)
- DSPGraph does not initialize correctly on 2020.3 using the new build system
packages for Windows (1 report)

## Near-Term Roadmap

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
196 changes: 98 additions & 98 deletions Documentation~/Optimization Adventures/Part 4 - Command Buffers 1.md

Large diffs are not rendered by default.

19 changes: 10 additions & 9 deletions Documentation~/Psyshock Physics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -303,15 +303,16 @@ it wouldn’t work.

## Near-Term Roadmap

- DeferredCollisionLayers
- FindPairsCache, FindPairsStream, and FindPairsAdvanced
- Cache and replay pairs
- Apply custom pair filtering
- Custom streams
- Indexing items in CollisionLayers
- Fix Part 2 performance issues
- FindAabbPairs
- Lightweight version which omits the Collider and RigidTransform
- Character Controller Utilities
- FindPairs overhaul
- Aabb layers
- Stack optimizations
- Pair caching
- Pair filter caching
- Mismatched layers support
- CollisionLayers fully deferrable (breaking)
- “Any” mode with early outs
- Bucket begin/end callbacks
- More Collider Shapes
- Triangle, Quad, BeveledBox, Cone, Cylinder
- Terrain, Convex Hull, Static Mesh, Dynamic Compound, Dynamic Mesh
Expand Down
29 changes: 9 additions & 20 deletions MyriAudio/Jobs/Sampling.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ public void Execute(int forIndex)
var outputSamples = outputSamplesMegaBuffer.GetSubArray(targetListenerParameters.bufferStart + targetListenerParameters.samplesPerChannel * channelIndex,
targetListenerParameters.samplesPerChannel);

ulong samplesPlayed = (ulong)samplesPerFrame * (ulong)audioFrame.Value;

for (int clipIndex = 0; clipIndex < clipFrameLookups.Length; clipIndex++)
{
if (targetListenerIndices[clipIndex] != listenerIndex)
Expand All @@ -167,33 +169,21 @@ public void Execute(int forIndex)
{
float weight = itdWeights[itd] * channelWeight;

double itdOffset = math.lerp(0, -itdMaxOffset, itd / (double)(itdWeights.Length - 1));
itdOffset = math.select(itdOffset, math.lerp(-itdMaxOffset, 0, itd / (double)(itdWeights.Length - 1)), isRightChannel);
itdOffset = math.select(itdOffset, 0, itdWeights.Length == 1);
ulong samplesPlayed = (ulong)samplesPerFrame * (ulong)audioFrame.Value;
double itdOffset = math.lerp(0, -itdMaxOffset, itd / (double)(itdWeights.Length - 1));
itdOffset = math.select(itdOffset, math.lerp(-itdMaxOffset, 0, itd / (double)(itdWeights.Length - 1)), isRightChannel);
itdOffset = math.select(itdOffset, 0, itdWeights.Length == 1);

if (weight > 0f)
{
if (clip.sampleRate == sampleRate)
{
int clipStart = (int)(samplesPlayed % (ulong)clip.samplesLeftOrMono.Length) + (int)math.round(itdOffset) + loopOffset;
int clipStart = (int)((samplesPlayed + (ulong)loopOffset) % (ulong)clip.samplesLeftOrMono.Length) + (int)math.round(itdOffset);
SampleMatchedRate(ref clip, clipStart, isRightChannel, weight, outputSamples);
}
else
{
double clipLengthInOutputSamples = clip.samplesLeftOrMono.Length * clipSampleStride;
ulong clipLengthInOutputSamplesFloor = (ulong)clipLengthInOutputSamples;
ulong loops = samplesPlayed / clipLengthInOutputSamplesFloor;
ulong currentLoopSamples = samplesPlayed - (loops * clipLengthInOutputSamplesFloor);
double clipStart = currentLoopSamples + loops * math.frac(clipLengthInOutputSamples) + itdOffset + loopOffset;
while (clipStart < 0)
{
clipStart += clipLengthInOutputSamples;
}
while (clipStart >= clipLengthInOutputSamples)
{
clipStart -= clipLengthInOutputSamples;
}
double samplesPlayedInSourceSamples = samplesPlayed * clipSampleStride;
double clipStart = (samplesPlayedInSourceSamples + loopOffset + itdOffset) % clip.samplesLeftOrMono.Length;
SampleMismatchedRate(ref clip, clipStart, clipSampleStride, isRightChannel, weight, outputSamples);
}
}
Expand Down Expand Up @@ -223,8 +213,7 @@ void SampleMatchedRate(ref AudioClipBlob clip, int clipStart, bool isRightChanne

void SampleMismatchedRate(ref AudioClipBlob clip, double clipStart, double clipSampleStride, bool isRightChannel, float weight, NativeArray<float> output)
{
ref var clipSamples = ref (isRightChannel && clip.isStereo ? ref clip.samplesRight : ref clip.samplesLeftOrMono);
double clipLengthInOutputSamples = clipSamples.Length * clipSampleStride;
ref var clipSamples = ref (isRightChannel && clip.isStereo ? ref clip.samplesRight : ref clip.samplesLeftOrMono);

for (int i = 0; i < output.Length; i++)
{
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "com.latios.latiosframework",
"displayName": "Latios Framework for DOTS",
"version": "0.3.2",
"version": "0.3.3",
"unity": "2020.1",
"description": "Latios Framework for DOTS is a collection of tools, algorithms, and API extensions developed by a hardcore hobbyist game developer.\n\nThis package includes all of the following packages:\n\u25aa Core\n\u25aa Psyshock Physics\n\u25aa Myri Audio\n\nComplete game examples: \n\u25aa Latios Space Shooter Sample - https://github.com/Dreaming381/lsss-wip/tree/v0.3.0",
"dependencies": {
Expand Down

0 comments on commit 769b1da

Please sign in to comment.