Log available sound formats.
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "RageSoundDriver_CA.h"
|
#include "RageSoundDriver_CA.h"
|
||||||
#include "CAHelpers.h"
|
#include "CAHelpers.h"
|
||||||
|
#include "RageLog.h"
|
||||||
|
|
||||||
#include "CAAudioHardwareSystem.h"
|
#include "CAAudioHardwareSystem.h"
|
||||||
#include "CAAudioHardwareDevice.h"
|
#include "CAAudioHardwareDevice.h"
|
||||||
@@ -88,6 +89,8 @@ RageSound_CA::RageSound_CA()
|
|||||||
{
|
{
|
||||||
UInt32 frames = mOutputDevice->GetLatency(kAudioDeviceSectionOutput);
|
UInt32 frames = mOutputDevice->GetLatency(kAudioDeviceSectionOutput);
|
||||||
mLatency = frames / 44100.0;
|
mLatency = frames / 44100.0;
|
||||||
|
LOG->Info("Frames of latency: %lu\n"
|
||||||
|
"Seconds of latency: %f", frames, mLatency);
|
||||||
}
|
}
|
||||||
catch (const CAException& e)
|
catch (const CAException& e)
|
||||||
{
|
{
|
||||||
@@ -100,11 +103,48 @@ RageSound_CA::RageSound_CA()
|
|||||||
|
|
||||||
vector<Desc> physicalFormats;
|
vector<Desc> physicalFormats;
|
||||||
GetPhysicalFormats( sID, physicalFormats );
|
GetPhysicalFormats( sID, physicalFormats );
|
||||||
|
unsigned i;
|
||||||
|
LOG->Info("Available physical formats:");
|
||||||
|
for (i = 0; i < physicalFormats.size(); ++i)
|
||||||
|
{
|
||||||
|
const Desc& f = physicalFormats[i];
|
||||||
|
|
||||||
|
LOG->Info("Format %u:\n"
|
||||||
|
"Sample rate: %f\n"
|
||||||
|
"Format ID: %lu\n"
|
||||||
|
"Format flags: 0x%lx\n"
|
||||||
|
"Bytes per packet: %lu\n"
|
||||||
|
"Frames per packet: %lu\n"
|
||||||
|
"Bytes per frame: %lu\n"
|
||||||
|
"Channels per frame: %lu\n"
|
||||||
|
"Bits per channel: %lu",
|
||||||
|
i, f.mSampleRate, f.mFormatID, f.mFormatFlags,
|
||||||
|
f.mBytesPerPacket, f.mFramesPerPacket, f.mBytesPerFrame,
|
||||||
|
f.mChannelsPerFrame, f.mBitsPerChannel);
|
||||||
|
}
|
||||||
const Desc& physicalFormat = FindClosestFormat( physicalFormats );
|
const Desc& physicalFormat = FindClosestFormat( physicalFormats );
|
||||||
stream.SetCurrentPhysicalFormat( physicalFormat );
|
stream.SetCurrentPhysicalFormat( physicalFormat );
|
||||||
|
|
||||||
vector<Desc> procFormats;
|
vector<Desc> procFormats;
|
||||||
GetIOProcFormats( sID, procFormats );
|
GetIOProcFormats( sID, procFormats );
|
||||||
|
LOG->Info("---------------------------\nAvailable I/O procedure formats:");
|
||||||
|
for (i = 0; i < procFormats.size(); ++i)
|
||||||
|
{
|
||||||
|
const Desc& f = procFormats[i];
|
||||||
|
|
||||||
|
LOG->Info("Format %u:\n"
|
||||||
|
"Sample rate: %f\n"
|
||||||
|
"Format ID: %lu\n"
|
||||||
|
"Format flags: 0x%lx\n"
|
||||||
|
"Bytes per packet: %lu\n"
|
||||||
|
"Frames per packet: %lu\n"
|
||||||
|
"Bytes per frame: %lu\n"
|
||||||
|
"Channels per frame: %lu\n"
|
||||||
|
"Bits per channel: %lu",
|
||||||
|
i, f.mSampleRate, f.mFormatID, f.mFormatFlags,
|
||||||
|
f.mBytesPerPacket, f.mFramesPerPacket, f.mBytesPerFrame,
|
||||||
|
f.mChannelsPerFrame, f.mBitsPerChannel);
|
||||||
|
}
|
||||||
const Desc& procFormat = FindClosestFormat( procFormats );
|
const Desc& procFormat = FindClosestFormat( procFormats );
|
||||||
stream.SetCurrentIOProcFormat( procFormat );
|
stream.SetCurrentIOProcFormat( procFormat );
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user