highfidelity/hifi — pull request #3186 by wangyix (2014-07-21 20:36:52+00:00)
Title: made Audio::_ringBuffer size 10 frames for non-Windows builds; improved interface downstream audio framesAvailable stat; disable QAudioOutput overflow check by default

Issue 1: the downstream audio ring buffer was 100 frames for all builds. This was set initially for windows since windows experienced large jitters. However, some Macs play back audio at a slightly slower rate than they're received, causing a buildup in delay. Having 100 frames in the ring buffer allows the delay to go up to 1 second as opposed to 0.1s, which is undesirable

Fix: that ringbuffer has been reduced back to 10 frames for all builds but Windows.
NOTE: one way to eliminate the delay buildup (on any build) is to go to Developer Options->Audio Debugging Tools and check Disable QAudioOutput Overflow Check. This will empty the ringbuffer every time an audio packet is received (possibly losing some frames if the audio output buffer doesn't have room for the data to be flushed to).

Testing: not tested

Issue 2: the interface stats for the downstream frames-available stat is incorrectly calculated and also does not show the ring buffer frames and the audio output frames available separately.

Fix: the networkOutputToOutputRatio is now included in the calculating for frames available in the audioOutput. Also, the frames available in the two buffers are now displayed separately.

Testing: ran interface and verified new stats.

Issue 3: The dev option Disable QAudioOutput Overflow Check is not checked by default. This check seems to cause a some problems on Mac.

Fix: made option checked by default (QAudioOutput Overflow Check is now disabled by default).

Testing: removed interface.ini, ran interface, and verified that option was checked.