diff options
author | Chris Robinson <[email protected]> | 2010-08-01 16:20:28 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2010-08-01 16:20:28 -0700 |
commit | fe6e73ede9c4137992e2945bf4db0d7ab897208b (patch) | |
tree | f41d7d6bf96e7dc3cffc15d51821fbe5e24bafff | |
parent | 8dab4c418cd95a9ceb7ecf3211c1cf97201b7b1e (diff) |
Be a bit more verbose when a device fails to open
-rw-r--r-- | Alc/dsound.c | 1 | ||||
-rw-r--r-- | Alc/oss.c | 6 | ||||
-rw-r--r-- | Alc/pulseaudio.c | 1 | ||||
-rw-r--r-- | Alc/solaris.c | 3 | ||||
-rw-r--r-- | Alc/winmm.c | 14 |
5 files changed, 14 insertions, 11 deletions
diff --git a/Alc/dsound.c b/Alc/dsound.c index f513f2ef..5779e5f7 100644 --- a/Alc/dsound.c +++ b/Alc/dsound.c @@ -296,6 +296,7 @@ static ALCboolean DSoundOpenPlayback(ALCdevice *device, const ALCchar *deviceNam if(pData->lpDS) IDirectSound_Release(pData->lpDS); free(pData); + AL_PRINT("Device init failed: 0x%08lx\n", hr); return ALC_FALSE; } @@ -166,8 +166,7 @@ static ALCboolean oss_open_playback(ALCdevice *device, const ALCchar *deviceName if(data->fd == -1) { free(data); - if(errno != ENOENT) - AL_PRINT("Could not open %s: %s\n", driver, strerror(errno)); + AL_PRINT("Could not open %s: %s\n", driver, strerror(errno)); return ALC_FALSE; } @@ -336,8 +335,7 @@ static ALCboolean oss_open_capture(ALCdevice *device, const ALCchar *deviceName) if(data->fd == -1) { free(data); - if(errno != ENOENT) - AL_PRINT("Could not open %s: %s\n", driver, strerror(errno)); + AL_PRINT("Could not open %s: %s\n", driver, strerror(errno)); return ALC_FALSE; } diff --git a/Alc/pulseaudio.c b/Alc/pulseaudio.c index 4fb3c8e8..1fa16d7e 100644 --- a/Alc/pulseaudio.c +++ b/Alc/pulseaudio.c @@ -830,6 +830,7 @@ static ALCboolean pulse_open_playback(ALCdevice *device, const ALCchar *device_n if(ppa_stream_is_suspended(stream)) { + AL_PRINT("Device is suspended\n"); ppa_stream_disconnect(stream); ppa_stream_unref(stream); ppa_threaded_mainloop_unlock(data->loop); diff --git a/Alc/solaris.c b/Alc/solaris.c index 4fbb1942..275d81ac 100644 --- a/Alc/solaris.c +++ b/Alc/solaris.c @@ -111,8 +111,7 @@ static ALCboolean solaris_open_playback(ALCdevice *device, const ALCchar *device if(data->fd == -1) { free(data); - if(errno != ENOENT) - AL_PRINT("Could not open %s: %s\n", driver, strerror(errno)); + AL_PRINT("Could not open %s: %s\n", driver, strerror(errno)); return ALC_FALSE; } diff --git a/Alc/winmm.c b/Alc/winmm.c index 70398a17..61ff87b7 100644 --- a/Alc/winmm.c +++ b/Alc/winmm.c @@ -190,6 +190,7 @@ static ALCboolean WinMMOpenCapture(ALCdevice *pDevice, const ALCchar *deviceName ALint lDeviceID = 0; ALbyte *BufferData; ALint lBufferSize; + MMRESULT res; ALuint i; if(!CaptureDeviceList) @@ -240,16 +241,19 @@ static ALCboolean WinMMOpenCapture(ALCdevice *pDevice, const ALCchar *deviceName wfexCaptureFormat.nBlockAlign; wfexCaptureFormat.cbSize = 0; - if (waveInOpen(&pData->hWaveInHandle, lDeviceID, &wfexCaptureFormat, (DWORD_PTR)&WaveInProc, (DWORD_PTR)pDevice, CALLBACK_FUNCTION) != MMSYSERR_NOERROR) + if((res=waveInOpen(&pData->hWaveInHandle, lDeviceID, &wfexCaptureFormat, (DWORD_PTR)&WaveInProc, (DWORD_PTR)pDevice, CALLBACK_FUNCTION)) != MMSYSERR_NOERROR) + { + AL_PRINT("waveInOpen failed: %u\n", res); goto failure; + } pData->hWaveInHdrEvent = CreateEvent(NULL, AL_TRUE, AL_FALSE, "WaveInAllHeadersReturned"); - if (pData->hWaveInHdrEvent == NULL) - goto failure; - pData->hWaveInThreadEvent = CreateEvent(NULL, AL_TRUE, AL_FALSE, "WaveInThreadDestroyed"); - if (pData->hWaveInThreadEvent == NULL) + if(pData->hWaveInHdrEvent == NULL || pData->hWaveInThreadEvent == NULL) + { + AL_PRINT("CreateEvent failed: %lu\n", GetLastError()); goto failure; + } // Allocate circular memory buffer for the captured audio ulCapturedDataSize = pDevice->UpdateSize*pDevice->NumUpdates; |