mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 22:59:58 +02:00
add audiostream (jitter) logging
This commit is contained in:
parent
a40a9f1d73
commit
7b8f616099
3 changed files with 18 additions and 0 deletions
|
@ -12,3 +12,9 @@
|
||||||
#include "AudioLogging.h"
|
#include "AudioLogging.h"
|
||||||
|
|
||||||
Q_LOGGING_CATEGORY(audio, "hifi.audio")
|
Q_LOGGING_CATEGORY(audio, "hifi.audio")
|
||||||
|
|
||||||
|
#if DEV_BUILD || PR_BUILD
|
||||||
|
Q_LOGGING_CATEGORY(audiostream, "hifi.audio-stream", QtDebugMsg)
|
||||||
|
#else
|
||||||
|
Q_LOGGING_CATEGORY(audiostream, "hifi.audio-stream", QtInfoMsg)
|
||||||
|
#endif
|
||||||
|
|
|
@ -15,5 +15,6 @@
|
||||||
#include <QLoggingCategory>
|
#include <QLoggingCategory>
|
||||||
|
|
||||||
Q_DECLARE_LOGGING_CATEGORY(audio)
|
Q_DECLARE_LOGGING_CATEGORY(audio)
|
||||||
|
Q_DECLARE_LOGGING_CATEGORY(audiostream)
|
||||||
|
|
||||||
#endif // hifi_AudioLogging_h
|
#endif // hifi_AudioLogging_h
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
#include <NodeList.h>
|
#include <NodeList.h>
|
||||||
|
|
||||||
#include "InboundAudioStream.h"
|
#include "InboundAudioStream.h"
|
||||||
|
#include "AudioLogging.h"
|
||||||
|
|
||||||
const int STARVE_HISTORY_CAPACITY = 50;
|
const int STARVE_HISTORY_CAPACITY = 50;
|
||||||
|
|
||||||
|
@ -174,6 +175,9 @@ int InboundAudioStream::parseData(ReceivedMessage& message) {
|
||||||
_currentJitterBufferFrames = 0;
|
_currentJitterBufferFrames = 0;
|
||||||
|
|
||||||
_oldFramesDropped += framesToDrop;
|
_oldFramesDropped += framesToDrop;
|
||||||
|
|
||||||
|
qCDebug(audiostream, "Dropped %d frames", framesToDrop);
|
||||||
|
qCDebug(audiostream, "Resetted current jitter frames");
|
||||||
}
|
}
|
||||||
|
|
||||||
framesAvailableChanged();
|
framesAvailableChanged();
|
||||||
|
@ -228,6 +232,9 @@ int InboundAudioStream::writeDroppableSilentSamples(int silentSamples) {
|
||||||
_currentJitterBufferFrames -= numSilentFramesToDrop;
|
_currentJitterBufferFrames -= numSilentFramesToDrop;
|
||||||
_silentFramesDropped += numSilentFramesToDrop;
|
_silentFramesDropped += numSilentFramesToDrop;
|
||||||
|
|
||||||
|
qCDebug(audiostream, "Dropped %d silent frames", numSilentFramesToDrop);
|
||||||
|
qCDebug(audiostream, "Set current jitter frames to %d", _currentJitterBufferFrames);
|
||||||
|
|
||||||
_framesAvailableStat.reset();
|
_framesAvailableStat.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -308,6 +315,8 @@ void InboundAudioStream::framesAvailableChanged() {
|
||||||
|
|
||||||
if (_framesAvailableStat.getElapsedUsecs() >= FRAMES_AVAILABLE_STAT_WINDOW_USECS) {
|
if (_framesAvailableStat.getElapsedUsecs() >= FRAMES_AVAILABLE_STAT_WINDOW_USECS) {
|
||||||
_currentJitterBufferFrames = (int)ceil(_framesAvailableStat.getAverage());
|
_currentJitterBufferFrames = (int)ceil(_framesAvailableStat.getAverage());
|
||||||
|
qCDebug(audiostream, "Set current jitter frames to %d", _currentJitterBufferFrames);
|
||||||
|
|
||||||
_framesAvailableStat.reset();
|
_framesAvailableStat.reset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -355,6 +364,7 @@ void InboundAudioStream::setToStarved() {
|
||||||
// make sure _desiredJitterBufferFrames does not become lower here
|
// make sure _desiredJitterBufferFrames does not become lower here
|
||||||
if (calculatedJitterBufferFrames >= _desiredJitterBufferFrames) {
|
if (calculatedJitterBufferFrames >= _desiredJitterBufferFrames) {
|
||||||
_desiredJitterBufferFrames = calculatedJitterBufferFrames;
|
_desiredJitterBufferFrames = calculatedJitterBufferFrames;
|
||||||
|
qCDebug(audiostream, "Set desired jitter frames to %d", _desiredJitterBufferFrames);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -444,6 +454,7 @@ void InboundAudioStream::packetReceivedUpdateTimingStats() {
|
||||||
/ (float)AudioConstants::NETWORK_FRAME_USECS);
|
/ (float)AudioConstants::NETWORK_FRAME_USECS);
|
||||||
if (calculatedJitterBufferFrames < _desiredJitterBufferFrames) {
|
if (calculatedJitterBufferFrames < _desiredJitterBufferFrames) {
|
||||||
_desiredJitterBufferFrames = calculatedJitterBufferFrames;
|
_desiredJitterBufferFrames = calculatedJitterBufferFrames;
|
||||||
|
qCDebug(audiostream, "Set desired jitter frames to %d", _desiredJitterBufferFrames);
|
||||||
}
|
}
|
||||||
_timeGapStatsForDesiredReduction.clearNewStatsAvailableFlag();
|
_timeGapStatsForDesiredReduction.clearNewStatsAvailableFlag();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue