[Qt-interest] High CPU Usage With QAudioOutput

Barnes, Clifton A. cabarnes at indesign-llc.com
Fri Apr 8 13:31:04 CEST 2011


On Thursday, April 07, 2011 Justin McPherson wrote:

> Looks OK to me, there are a few tests that could be done from here, it's 
> best to open a bug report, someone will look at it and try and 
> understand what is happening.

After some investigation, it looks like the issue is with the buffer
size.  I tried using the QAudioOutput::setBufferSize function but
it always ended up using the same buffer size.  The documentation does
state: "It should not be assumed that the buffer size set is the actual 
buffer size used."  So, it looks like I can't make the modification
that I need to the buffer size.  I ended up switching to libSDL where
I could set the buffer size much larger and the load on the CPU went
down significantly from QAudioOutput.  The trade-off is that pausing
has a larger lag since it has to finish the current buffer.  I'm
assuming that's why Qt has a small buffer size.  So, I'm not sure that
it's a bug as much as just a different implementation.

-Clif



More information about the Qt-interest-old mailing list