Skip to content

Commit

Permalink
#80 fixed debug logging. All debug is now on to enable my work on the…
Browse files Browse the repository at this point in the history
… 10.11 driver. This must be turned off to compile a working driver.
  • Loading branch information
Wouter1 committed Jul 1, 2016
1 parent 316547b commit 9c4f6c8
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 24 deletions.
14 changes: 7 additions & 7 deletions src/EMUUSBAudio.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
6CB2722F1A54197B00FA8B61 /* EMUUSBOutputStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6CB2722D1A54197B00FA8B61 /* EMUUSBOutputStream.cpp */; };
6CB272301A54197B00FA8B61 /* EMUUSBOutputStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 6CB2722E1A54197B00FA8B61 /* EMUUSBOutputStream.h */; };
6CE021FE1A5FCE9C00568A82 /* StreamInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6CE021FD1A5FCE9C00568A82 /* StreamInfo.cpp */; };
6CF9CB271D26D53200719B95 /* EMUUSBAudio-Info-11.plist in Resources */ = {isa = PBXBuildFile; fileRef = 6CF9CB261D26D53200719B95 /* EMUUSBAudio-Info-11.plist */; settings = {ASSET_TAGS = (); }; };
6CF9CB271D26D53200719B95 /* EMUUSBAudio-Info-11.plist in Resources */ = {isa = PBXBuildFile; fileRef = 6CF9CB261D26D53200719B95 /* EMUUSBAudio-Info-11.plist */; };
/* End PBXBuildFile section */

/* Begin PBXCopyFilesBuildPhase section */
Expand Down Expand Up @@ -461,16 +461,16 @@
CREATE_INFOPLIST_SECTION_IN_BINARY = NO;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "EMUUSBAudio/EMUUSBAudio-Prefix.pch";
INFOPLIST_FILE = "EMUUSBAudio/EMUUSBAudio-Info-11.plist";
INFOPLIST_FILE = "EMUUSBAudio/EMUUSBAudio-Info.plist";
INFOPLIST_PREPROCESS = YES;
MACOSX_DEPLOYMENT_TARGET = 10.11;
MACOSX_DEPLOYMENT_TARGET = 10.9;
MODULE_NAME = com.emu.driver.EMUUSBAudio;
MODULE_START = 0;
MODULE_STOP = 0;
MODULE_VERSION = 1.0.0d1;
"OTHER_CFLAGS[arch=*]" = "-DDEBUGLOGGING";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx10.11;
SDKROOT = macosx10.9;
WRAPPER_EXTENSION = kext;
};
name = Debug;
Expand All @@ -483,15 +483,15 @@
CREATE_INFOPLIST_SECTION_IN_BINARY = NO;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "EMUUSBAudio/EMUUSBAudio-Prefix.pch";
INFOPLIST_FILE = "EMUUSBAudio/EMUUSBAudio-Info-11.plist";
INFOPLIST_FILE = "EMUUSBAudio/EMUUSBAudio-Info.plist";
INFOPLIST_PREPROCESS = YES;
MACOSX_DEPLOYMENT_TARGET = 10.11;
MACOSX_DEPLOYMENT_TARGET = 10.9;
MODULE_NAME = com.emu.driver.EMUUSBAudio;
MODULE_START = 0;
MODULE_STOP = 0;
MODULE_VERSION = 1.0.0d1;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx10.11;
SDKROOT = macosx10.9;
WRAPPER_EXTENSION = kext;
};
name = Release;
Expand Down
Binary file not shown.
8 changes: 4 additions & 4 deletions src/EMUUSBAudio/EMUUSBAudioDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ bool EMUUSBAudioDevice::start(IOService * provider) {
bool result = FALSE;

debugIOLogC("+ EMUUSBAudioDevice[%p]::start(%p)", this, provider);
mControlInterface = OSDynamicCast(IOUSBInterface1, provider);
mControlInterface = (IOUSBInterface1 *)provider;//OSDynamicCast(IOUSBInterface1, provider);
FailIf(FALSE == mControlInterface->open(this), Exit);
mCurSampleRate = mNumEngines = 0;
mInitHardwareThread = thread_call_allocate((thread_call_func_t)EMUUSBAudioDevice::initHardwareThread,(thread_call_param_t)this);
Expand Down Expand Up @@ -190,7 +190,7 @@ IOReturn EMUUSBAudioDevice::protectedInitHardware(IOService * provider) {
if (mControlInterface) {//FailIf(NULL == mControlInterface, Exit);
checkUHCI();// see whether we're attached via a UHCI controller
mInterfaceNum = mControlInterface->getInterfaceNumber();
debugIOLogC("There are %d configurations on this device", mControlInterface->GetDevice()->GetNumConfigurations());
//debugIOLogC("There are %d configurations on this device", mControlInterface->getDevice1()->GetNumConfigurations());
debugIOLogC("Our control interface number is %d", mInterfaceNum);
mUSBAudioConfig = EMUUSBAudioConfigObject::create(mControlInterface->getDevice1()->GetFullConfigurationDescriptor(0), mInterfaceNum);
FailIf(NULL == mUSBAudioConfig, Exit);
Expand Down Expand Up @@ -1481,7 +1481,7 @@ IOReturn EMUUSBAudioDevice::deviceRequestOut(UInt8 unitID, UInt8 controlSelector
ReturnIf(!settingDesc, kIOReturnNoMemory);


debugIOLogC("EMUUSBAudioDevice::deviceRequest bmRequestType=%x bRequest=%x wValue=%x wIndex=%x wLength=%x", devReq.bmRequestType, devReq.bRequest,devReq.wValue,devReq.wIndex,devReq.wLength);
debugIOLogC("EMUUSBAudioDevice::deviceRequest bmRequestType=%x", requestType);
if (!isInactive()) {
result = deviceRequest(USBmakebmRequestType(kUSBOut, kUSBClass, kUSBInterface), requestType, (controlSelector << 8) | channelNumber, (0xFF00 &(unitID << 8)) |(0x00FF & mInterfaceNum), length, settingDesc);
}
Expand Down Expand Up @@ -2192,7 +2192,7 @@ IOReturn EMUUSBAudioDevice::deviceRequest( UInt8 type,
}
IORecursiveLockUnlock(mInterfaceLock);
}
debugIOLogC("++EMUUSBAudioDevice[%p]::deviceRequest(%p, %p) = %x", this, request, completion, result);
debugIOLogC("++EMUUSBAudioDevice[%p]::deviceRequest( %d) = %d", this, request, result);
return result;
}

Expand Down
2 changes: 1 addition & 1 deletion src/EMUUSBAudio/EMUUSBAudioEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2006,7 +2006,7 @@ IOReturn EMUUSBAudioEngine::initBuffers() {
//UInt32 outputSize = mOutput.maxFrameSize;
//UInt32 samplesPerFrame = inputSize / usbInputStream.multFactor;
debugIOLogC("inputSize= %d multFactor= %d", inputSize, usbInputStream.multFactor);
debugIOLogC("outputSize= %d multFactor= %d", outputSize, mOutput.multFactor);
//debugIOLogC("outputSize= %d multFactor= %d", outputSize, mOutput.multFactor);

// FailIf(samplesPerFrame != outputSize / mOutput.multFactor, Exit); - JH allocated size may be off 1 such as with AC3

Expand Down
4 changes: 2 additions & 2 deletions src/EMUUSBAudio/EMUUSBInputStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ void EMUUSBInputStream::readCompleted ( void * frameListNrPtr,
IOReturn result, LowLatencyIsocFrame * pFrames) {

// HACK we have numUSBFramesPerList frames, which one to check?? Print frame 0 info.
debugIOLogR("+ readCompleted framelist %d result %x ", currentFrameList, result);
debugIOLogR("+ readCompleted framelist %p result %x ", frameListNrPtr, result);


startingEngine = FALSE; // HACK this is old code...
Expand Down Expand Up @@ -284,7 +284,7 @@ void EMUUSBInputStream::readCompleted ( void * frameListNrPtr,
// CheckForAssociatedEndpoint( interfaceNumber, alternateSettingID);
// }

debugIOLogR("- readCompleted currentFrameList=%d",currentFrameList);
debugIOLogR("- readCompleted currentFrameList=%p",frameListNrPtr);
return;
}

Expand Down
20 changes: 10 additions & 10 deletions src/EMUUSBAudio/EMUUSBLogging.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,33 +52,33 @@ do { printf ( message ); printf ("\n" ); } while (0)
// only messages that ALWAYS must print do use doLog.

// parse configuration descriptor log messages.define as debugIOLog(message) to turn on.
#define debugIOLogPC(message...);// debugIOLog(message);
#define debugIOLogPC(message...) debugIOLog(message);

// audio streaming interface log messages. define as debugIOLog(message) to turn on.
#define debugIOLogAS(message...) ;//debugIOLog(message);
#define debugIOLogAS(message...) debugIOLog(message);

// DOC
#define debugIOLog2(message...) ;//debugIOLog(message);
#define debugIOLog2(message...) debugIOLog(message);

// framelist write debug messages
#define debugIOLogW(message...);// debugIOLog(message);
#define debugIOLogW(message...) debugIOLog(message);

// debug time stamps.
#define debugIOLogT(message...);// debugIOLog(message);
#define debugIOLogT(message...) debugIOLog(message);

// debug timing details for each handler call (large number of messages)
#define debugIOLogTD(message...);// debugIOLog(message);
#define debugIOLogTD(message...) debugIOLog(message);


// debug USB speed estimator and jitter filter timestamps.
#define debugIOLogTT(message...);// debugIOLog(message);
#define debugIOLogTT(message...) debugIOLog(message);

// debug USB read messages
#define debugIOLogR(message...);// debugIOLog(message);
#define debugIOLogR(message...) debugIOLog(message);

// debug USB read messages details
#define debugIOLogRD(message...);// debugIOLog(message);
#define debugIOLogRD(message...) debugIOLog(message);

// debug all control-level messages (setup, initialization, takedown).
#define debugIOLogC(message...);// debugIOLog(message);
#define debugIOLogC(message...) debugIOLog(message);
#endif

0 comments on commit 9c4f6c8

Please sign in to comment.