This commit is contained in:
Lirusaito
2012-07-18 23:41:23 -04:00
3 changed files with 16 additions and 59 deletions

View File

@@ -150,56 +150,8 @@ bool LLAudioEngine_FMODEX::init(const S32 num_channels, void* userdata)
<< ")! You should be using FMOD Ex" << FMOD_VERSION << LL_ENDL;
}
#if LL_WINDOWS
int numdrivers;
FMOD_SPEAKERMODE speakermode;
FMOD_CAPS caps;
char name[256];
//Is this block applicable to linux?
{
result = mSystem->getNumDrivers(&numdrivers);
Check_FMOD_Error(result, "FMOD::System::getNumDrivers");
if (numdrivers == 0)
{
result = mSystem->setOutput(FMOD_OUTPUTTYPE_NOSOUND);
Check_FMOD_Error(result, "FMOD::System::setOutput");
}
else
{
result = mSystem->getDriverCaps(0, &caps, 0, &speakermode);
Check_FMOD_Error(result,"FMOD::System::getDriverCaps");
/*
Set the user selected speaker mode.
*/
result = mSystem->setSpeakerMode(speakermode);
Check_FMOD_Error(result, "FMOD::System::setSpeakerMode");
if (caps & FMOD_CAPS_HARDWARE_EMULATED)
{
/*
The user has the 'Acceleration' slider set to off! This is really bad
for latency! You might want to warn the user about this.
*/
result = mSystem->setDSPBufferSize(1024, 10);
Check_FMOD_Error(result, "FMOD::System::setDSPBufferSize");
llwarns << "Windows audio acceleration is disabled. This may introduce latency issues." << llendl;
}
result = mSystem->getDriverInfo(0, name, 256, 0);
Check_FMOD_Error(result, "FMOD::System::getDriverInfo");
if (strstr(name, "SigmaTel"))
{
llwarns << "SigmaTel device detected. This may introduce audio quality issues." << llendl;
/*
Sigmatel sound devices crackle for some reason if the format is PCM 16bit.
PCM floating point output seems to solve it.
*/
result = mSystem->setSoftwareFormat(48000, FMOD_SOUND_FORMAT_PCMFLOAT, 0,0, FMOD_DSP_RESAMPLER_LINEAR);
Check_FMOD_Error(result,"FMOD::System::setSoftwareFormat");
}
}
}
#endif //LL_WINDOWS
result = mSystem->setSoftwareFormat(44100, FMOD_SOUND_FORMAT_PCM16, 0, 0, FMOD_DSP_RESAMPLER_LINEAR);
Check_FMOD_Error(result,"FMOD::System::setSoftwareFormat");
// In this case, all sounds, PLUS wind and stream will be software.
result = mSystem->setSoftwareChannels(num_channels + 2);
@@ -325,6 +277,19 @@ bool LLAudioEngine_FMODEX::init(const S32 num_channels, void* userdata)
LL_INFOS("AppInit") << "LLAudioEngine_FMODEX::init() FMOD Ex initialized correctly" << LL_ENDL;
int r_numbuffers, r_samplerate, r_channels, r_bits;
unsigned int r_bufferlength;
char r_name[256];
mSystem->getDSPBufferSize(&r_bufferlength, &r_numbuffers);
mSystem->getSoftwareFormat(&r_samplerate, NULL, &r_channels, NULL, NULL, &r_bits);
mSystem->getDriverInfo(0, r_name, 255, 0);
r_name[255] = '\0';
int latency = 1000.0 * r_bufferlength * r_numbuffers /r_samplerate;
LL_INFOS("AppInit") << "FMOD device: "<< r_name << "\n"
<< "FMOD Ex parameters: " << r_samplerate << " Hz * " << r_channels << " * " <<r_bits <<" bit\n"
<< "\tbuffer " << r_bufferlength << " * " << r_numbuffers << " (" << latency <<"ms)" << LL_ENDL;
mInited = true;
return true;

View File

@@ -174,7 +174,7 @@ void LLStreamingAudio_FMODEX::update()
if(mFMODInternetStreamChannelp)
{
llinfos << "progress = " << progress << llendl;
//llinfos << "progress = " << progress << llendl;
if(!mMetaData)
mMetaData = new LLSD;

View File

@@ -55,7 +55,6 @@ set_target_properties(SLPlugin
)
target_link_libraries(SLPlugin
${GOOGLE_PERFTOOLS_LIBRARIES}
${LLPLUGIN_LIBRARIES}
${LLMESSAGE_LIBRARIES}
${LLCOMMON_LIBRARIES}
@@ -82,11 +81,4 @@ if (DARWIN)
)
endif (DARWIN)
if (WINDOWS)
set_target_properties(SLPlugin
PROPERTIES
LINK_FLAGS "${GOOGLE_PERFTOOLS_LINKER_FLAGS}"
)
endif (WINDOWS)
#ll_deploy_sharedlibs_command(SLPlugin)