fixes for ASIO sound interface

This commit is contained in:
Volker Fischer 2008-11-01 22:26:17 +00:00
parent 78684feaf7
commit 8de53c301a
2 changed files with 19 additions and 7 deletions

View file

@ -481,6 +481,18 @@ std::string CSound::PrepareDriver()
iMinNumSndBuf = static_cast<int> (
ceil ( static_cast<double> ( iASIOBufferSizeMono ) / iBufferSizeMono ) );
// TODO better solution
// For some ASIO buffer sizes, the above calculation seems not to work although
// it should be correct. Maybe there is a misunderstanding or a bug in the
// sound interface implementation. As a workaround, we implement a table here, to
// get working parameters for the most common ASIO buffer settings
// Interesting observation: only 256 samples seems to be wrong, all other tested
// buffer sizes like 192, 512, 384, etc. are correct...
if ( iASIOBufferSizeMono == 256 )
{
iMinNumSndBuf = 4;
}
Q_ASSERT ( iMinNumSndBuf < MAX_SND_BUF_IN );
Q_ASSERT ( iMinNumSndBuf < MAX_SND_BUF_OUT );
@ -498,7 +510,7 @@ std::string CSound::PrepareDriver()
QString().number ( iASIOBufferSizeMono ) +
QString ( " samples which is too large. Please try to modify "
"the ASIO buffer size value in your ASIO driver settings (most ASIO "
"drivers like ASIO4All or kx allow to change the ASIO buffer size). "
"drivers like ASIO4All or kx driver allow to change the ASIO buffer size). "
"Recommended settings are 96 or 128 samples." ), "Ok", 0 );
}