From 143b9c663f2e6cb530133aadf19e6f27d49ebe2d Mon Sep 17 00:00:00 2001 From: Ken Cooke Date: Thu, 29 Oct 2015 12:21:28 -0700 Subject: [PATCH 1/5] Quick fix for audio having channels swapped under Qt 5.5.1. --- libraries/audio-client/src/AudioClient.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libraries/audio-client/src/AudioClient.cpp b/libraries/audio-client/src/AudioClient.cpp index b528b67745..c321a32211 100644 --- a/libraries/audio-client/src/AudioClient.cpp +++ b/libraries/audio-client/src/AudioClient.cpp @@ -313,7 +313,9 @@ QAudioDeviceInfo defaultAudioDeviceForMode(QAudio::Mode mode) { bool adjustedFormatForAudioDevice(const QAudioDeviceInfo& audioDevice, const QAudioFormat& desiredAudioFormat, QAudioFormat& adjustedAudioFormat) { - if (!audioDevice.isFormatSupported(desiredAudioFormat)) { + // FIXME: direcly using 24khz has a bug somewhere that causes channels to be swapped. + // Continue using our internal resampler, for now. + if (false && !audioDevice.isFormatSupported(desiredAudioFormat)) { qCDebug(audioclient) << "The desired format for audio I/O is" << desiredAudioFormat; qCDebug(audioclient, "The desired audio format is not supported by this device"); From 4d576d7aaff7284d4d5d10640d1ab97c27b4405c Mon Sep 17 00:00:00 2001 From: Ken Cooke Date: Thu, 29 Oct 2015 12:23:36 -0700 Subject: [PATCH 2/5] Fix typo --- libraries/audio-client/src/AudioClient.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/audio-client/src/AudioClient.cpp b/libraries/audio-client/src/AudioClient.cpp index c321a32211..a67ab460d1 100644 --- a/libraries/audio-client/src/AudioClient.cpp +++ b/libraries/audio-client/src/AudioClient.cpp @@ -313,7 +313,7 @@ QAudioDeviceInfo defaultAudioDeviceForMode(QAudio::Mode mode) { bool adjustedFormatForAudioDevice(const QAudioDeviceInfo& audioDevice, const QAudioFormat& desiredAudioFormat, QAudioFormat& adjustedAudioFormat) { - // FIXME: direcly using 24khz has a bug somewhere that causes channels to be swapped. + // FIXME: directly using 24khz has a bug somewhere that causes channels to be swapped. // Continue using our internal resampler, for now. if (false && !audioDevice.isFormatSupported(desiredAudioFormat)) { qCDebug(audioclient) << "The desired format for audio I/O is" << desiredAudioFormat; From 1c2973f17d9b292c699a5899385d392ae8cb779a Mon Sep 17 00:00:00 2001 From: Brad Hefta-Gaub Date: Thu, 29 Oct 2015 12:34:24 -0700 Subject: [PATCH 3/5] removed old metavoxel example, since the api is no longer available --- examples/example/metavoxels/metavoxels.js | 41 ----------------------- 1 file changed, 41 deletions(-) delete mode 100644 examples/example/metavoxels/metavoxels.js diff --git a/examples/example/metavoxels/metavoxels.js b/examples/example/metavoxels/metavoxels.js deleted file mode 100644 index 32177cdcba..0000000000 --- a/examples/example/metavoxels/metavoxels.js +++ /dev/null @@ -1,41 +0,0 @@ -// -// metavoxels.js -// examples -// -// Copyright 2014 High Fidelity, Inc. -// -// Distributed under the Apache License, Version 2.0. -// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html -// - -Script.setInterval(function() { - var spanner; - if (Math.random() < 0.5) { - spanner = new Sphere(); - } else { - spanner = new Cuboid(); - spanner.aspectX = 0.1 + Math.random() * 1.9; - spanner.aspectY = 0.1 + Math.random() * 1.9; - } - spanner.scale = 0.1 + Math.random() * 1.9; - spanner.rotation = Quat.fromPitchYawRollDegrees(Math.random() * 360.0, Math.random() * 360.0, Math.random() * 360.0); - spanner.translation = { x: 10.0 + Math.random() * 10.0, y: 10.0 + Math.random() * 10.0, z: 10.0 + Math.random() * 10.0 }; - - if (Math.random() < 0.5) { - var material = new MaterialObject(); - if (Math.random() < 0.5) { - material.diffuse = "http://www.fungibleinsight.com/faces/grass.jpg"; - } else { - material.diffuse = "http://www.fungibleinsight.com/faces/soil.jpg"; - } - Metavoxels.setVoxelMaterial(spanner, material); - - } else if (Math.random() < 0.5) { - Metavoxels.setVoxelColor(spanner, { red: Math.random() * 255.0, green: Math.random() * 255.0, - blue: Math.random() * 255.0 }); - - } else { - Metavoxels.setVoxelColor(spanner, { red: 0, green: 0, blue: 0, alpha: 0 }); - } -}, 1000); - From fb55f0becbbb1a0ae589224f4f26906d939ed191 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Thu, 29 Oct 2015 12:50:34 -0700 Subject: [PATCH 4/5] guard timeElapsed for simulateKinematicMotion to max 1s --- libraries/entities/src/EntityItem.cpp | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/libraries/entities/src/EntityItem.cpp b/libraries/entities/src/EntityItem.cpp index f012ba6eee..cce3045049 100644 --- a/libraries/entities/src/EntityItem.cpp +++ b/libraries/entities/src/EntityItem.cpp @@ -736,18 +736,11 @@ int EntityItem::readEntityDataFromBuffer(const unsigned char* data, int bytesLef // is sending us data with a known "last simulated" time. That time is likely in the past, and therefore // this "new" data is actually slightly out of date. We calculate the time we need to skip forward and // use our simulation helper routine to get a best estimate of where the entity should be. - const float MIN_TIME_SKIP = 0.0f; - const float MAX_TIME_SKIP = 1.0f; // in seconds - float skipTimeForward = glm::clamp((float)(now - lastSimulatedFromBufferAdjusted) / (float)(USECS_PER_SECOND), - MIN_TIME_SKIP, MAX_TIME_SKIP); - if (skipTimeForward > 0.0f) { - #ifdef WANT_DEBUG - qCDebug(entities) << "skipTimeForward:" << skipTimeForward; - #endif - // we want to extrapolate the motion forward to compensate for packet travel time, but - // we don't want the side effect of flag setting. - simulateKinematicMotion(skipTimeForward, false); - } + float skipTimeForward = (float)(now - lastSimulatedFromBufferAdjusted) / (float)(USECS_PER_SECOND); + + // we want to extrapolate the motion forward to compensate for packet travel time, but + // we don't want the side effect of flag setting. + simulateKinematicMotion(skipTimeForward, false); } if (overwriteLocalData) { @@ -887,6 +880,15 @@ void EntityItem::simulate(const quint64& now) { } void EntityItem::simulateKinematicMotion(float timeElapsed, bool setFlags) { +#ifdef WANT_DEBUG + qCDebug(entities) << "EntityItem::simulateKinematicMotion timeElapsed" << timeElapsed; +#endif + + const float MIN_TIME_SKIP = 0.0f; + const float MAX_TIME_SKIP = 1.0f; // in seconds + + timeElapsed = glm::clamp(timeElapsed, MIN_TIME_SKIP, MAX_TIME_SKIP); + if (hasActions()) { return; } From 1eabb924f1ce844332bc9e7f001bf50a6bc9fb27 Mon Sep 17 00:00:00 2001 From: Ken Cooke Date: Thu, 29 Oct 2015 12:53:47 -0700 Subject: [PATCH 5/5] Fixed the logic to be correct --- libraries/audio-client/src/AudioClient.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/audio-client/src/AudioClient.cpp b/libraries/audio-client/src/AudioClient.cpp index a67ab460d1..d4980596dd 100644 --- a/libraries/audio-client/src/AudioClient.cpp +++ b/libraries/audio-client/src/AudioClient.cpp @@ -315,7 +315,7 @@ bool adjustedFormatForAudioDevice(const QAudioDeviceInfo& audioDevice, QAudioFormat& adjustedAudioFormat) { // FIXME: directly using 24khz has a bug somewhere that causes channels to be swapped. // Continue using our internal resampler, for now. - if (false && !audioDevice.isFormatSupported(desiredAudioFormat)) { + if (true || !audioDevice.isFormatSupported(desiredAudioFormat)) { qCDebug(audioclient) << "The desired format for audio I/O is" << desiredAudioFormat; qCDebug(audioclient, "The desired audio format is not supported by this device"); @@ -323,7 +323,7 @@ bool adjustedFormatForAudioDevice(const QAudioDeviceInfo& audioDevice, adjustedAudioFormat = desiredAudioFormat; adjustedAudioFormat.setChannelCount(2); - if (audioDevice.isFormatSupported(adjustedAudioFormat)) { + if (false && audioDevice.isFormatSupported(adjustedAudioFormat)) { return true; } else { adjustedAudioFormat.setChannelCount(1);