Module: wine Branch: master Commit: e690d7c83baeee424fb081f7bb5715aa6b22f9cd URL: http://source.winehq.org/git/wine.git/?a=commit;h=e690d7c83baeee424fb081f7bb...
Author: Ken Thomases ken@codeweavers.com Date: Sun Oct 11 14:11:37 2009 -0500
winecoreaudio: Add more debug logging.
---
dlls/winecoreaudio.drv/audio.c | 12 ++++++++++-- dlls/winecoreaudio.drv/audiounit.c | 19 +++++++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-)
diff --git a/dlls/winecoreaudio.drv/audio.c b/dlls/winecoreaudio.drv/audio.c index 0521ff0..90e3baa 100644 --- a/dlls/winecoreaudio.drv/audio.c +++ b/dlls/winecoreaudio.drv/audio.c @@ -53,12 +53,13 @@
WINE_DEFAULT_DEBUG_CHANNEL(wave);
- #if defined(HAVE_COREAUDIO_COREAUDIO_H) && defined(HAVE_AUDIOUNIT_AUDIOUNIT_H) #include <CoreAudio/CoreAudio.h> #include <CoreFoundation/CoreFoundation.h> #include <libkern/OSAtomic.h>
+WINE_DECLARE_DEBUG_CHANNEL(coreaudio); + /* Due to AudioUnit headers conflict define some needed types. */ @@ -528,6 +529,9 @@ BOOL CoreAudio_GetDevCaps (void)
CoreAudio_DefaultDevice.out_caps.wChannels = 2; CoreAudio_DefaultDevice.out_caps.dwFormats|= WAVE_FORMAT_4S16; + + TRACE_(coreaudio)("out dwFormats = %08x, dwSupport = %08x\n", + CoreAudio_DefaultDevice.out_caps.dwFormats, CoreAudio_DefaultDevice.out_caps.dwSupport);
return TRUE; } @@ -758,6 +762,8 @@ void CoreAudio_WaveRelease(void) */ static DWORD wodNotifyClient(WINE_WAVEOUT* wwo, WORD wMsg, DWORD dwParam1, DWORD dwParam2) { + TRACE_(coreaudio)("wMsg = 0x%04x dwParm1 = %04x dwParam2 = %04x\n", wMsg, dwParam1, dwParam2); + switch (wMsg) { case WOM_OPEN: case WOM_CLOSE: @@ -767,10 +773,12 @@ static DWORD wodNotifyClient(WINE_WAVEOUT* wwo, WORD wMsg, DWORD dwParam1, DWORD (HDRVR)wwo->waveDesc.hWave, wMsg, wwo->waveDesc.dwInstance, dwParam1, dwParam2)) { + ERR("can't notify client !\n"); return MMSYSERR_ERROR; } break; default: + ERR("Unknown callback message %u\n", wMsg); return MMSYSERR_INVALPARAM; } return MMSYSERR_NOERROR; @@ -1214,7 +1222,7 @@ static DWORD wodWrite(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize) LPWAVEHDR*wh; WINE_WAVEOUT *wwo;
- TRACE("(%u, %p, %08X);\n", wDevID, lpWaveHdr, dwSize); + TRACE("(%u, %p, %lu, %08X);\n", wDevID, lpWaveHdr, (unsigned long)lpWaveHdr->dwBufferLength, dwSize);
/* first, do the sanity checks... */ if (wDevID >= MAX_WAVEOUTDRV) diff --git a/dlls/winecoreaudio.drv/audiounit.c b/dlls/winecoreaudio.drv/audiounit.c index 998dbe7..9314ef3 100644 --- a/dlls/winecoreaudio.drv/audiounit.c +++ b/dlls/winecoreaudio.drv/audiounit.c @@ -38,6 +38,19 @@ WINE_DEFAULT_DEBUG_CHANNEL(wave); WINE_DECLARE_DEBUG_CHANNEL(midi);
+static const char *streamDescription(const AudioStreamBasicDescription* stream) +{ + return wine_dbg_sprintf("\n mSampleRate : %f\n mFormatID : %s\n mFormatFlags : %lX\n mBytesPerPacket : %lu\n mFramesPerPacket : %lu\n mBytesPerFrame : %lu\n mChannelsPerFrame : %lu\n mBitsPerChannel : %lu\n", + stream->mSampleRate, + wine_dbgstr_fourcc(stream->mFormatID), + stream->mFormatFlags, + stream->mBytesPerPacket, + stream->mFramesPerPacket, + stream->mBytesPerFrame, + stream->mChannelsPerFrame, + stream->mBitsPerChannel); +} + extern OSStatus CoreAudio_woAudioUnitIOProc(void *inRefCon, AudioUnitRenderActionFlags *ioActionFlags, const AudioTimeStamp *inTimeStamp, @@ -58,6 +71,8 @@ int AudioUnit_CreateDefaultAudioUnit(void *wwo, AudioUnit *au) Component comp; ComponentDescription desc; AURenderCallbackStruct callbackStruct; + + TRACE("\n");
desc.componentType = kAudioUnitType_Output; desc.componentSubType = kAudioUnitSubType_DefaultOutput; @@ -95,6 +110,8 @@ int AudioUnit_InitializeWithStreamDescription(AudioUnit au, AudioStreamBasicDesc { OSStatus err = noErr;
+ TRACE("input format: %s\n", streamDescription(stream)); + err = AudioUnitSetProperty(au, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Input, 0, stream, sizeof(*stream));
@@ -116,6 +133,7 @@ int AudioUnit_InitializeWithStreamDescription(AudioUnit au, AudioStreamBasicDesc int AudioUnit_SetVolume(AudioUnit au, float left, float right) { OSStatus err = noErr; + FIXME("independent left/right volume not implemented (%f, %f)\n", left, right);
err = AudioUnitSetParameter(au, kHALOutputParam_Volume, kAudioUnitParameterFlag_Output, 0, left, 0);
@@ -130,6 +148,7 @@ int AudioUnit_SetVolume(AudioUnit au, float left, float right) int AudioUnit_GetVolume(AudioUnit au, float *left, float *right) { OSStatus err = noErr; + FIXME("independent left/right volume not implemented\n");
err = AudioUnitGetParameter(au, kHALOutputParam_Volume, kAudioUnitParameterFlag_Output, 0, left); if (err != noErr)