diff --git a/dlls/dsound/primary.c b/dlls/dsound/primary.c index 3e75275cdb..4063266891 100644 --- a/dlls/dsound/primary.c +++ b/dlls/dsound/primary.c @@ -224,8 +224,19 @@ HRESULT DSOUND_PrimaryCreate(DirectSoundDevice *device) &(device->buflen),&(device->buffer), (LPVOID*)&(device->hwbuf)); if (err != DS_OK) { - WARN("IDsDriver_CreateSoundBuffer failed\n"); - return err; + WARN("IDsDriver_CreateSoundBuffer failed, falling back to waveout\n"); + /* Wine-only: close wine directsound driver, then reopen without WAVE_DIRECTSOUND */ + device->drvdesc.dwFlags = DSDDESC_DOMMSYSTEMOPEN | DSDDESC_DOMMSYSTEMSETFORMAT; + waveOutClose(device->hwo); + IDsDriver_Release(device->driver); + device->driver = device->buffer = NULL; + device->hwo = 0; + err = mmErr(waveOutOpen(&(device->hwo), device->drvdesc.dnDevNode, device->pwfx, (DWORD_PTR)DSOUND_callback, (DWORD)device, CALLBACK_FUNCTION)); + if (err != DS_OK) + { + WARN("Falling back to waveout failed too! Giving up\n"); + return err; + } } } diff --git a/dlls/wineoss.drv/dsrender.c b/dlls/wineoss.drv/dsrender.c index aa9d373cbe..27672fbdc6 100644 --- a/dlls/wineoss.drv/dsrender.c +++ b/dlls/wineoss.drv/dsrender.c @@ -344,9 +344,7 @@ static HRESULT DSDB_MapBuffer(IDsDriverBufferImpl *dsdb) dsdb->mapping = mmap(NULL, dsdb->maplen, PROT_WRITE, MAP_SHARED, dsdb->fd, 0); if (dsdb->mapping == (LPBYTE)-1) { - ERR("Could not map sound device for direct access (%s)\n", strerror(errno)); - ERR("Please run winecfg, open \"Audio\" page and set\n" - "\"Hardware Acceleration\" to \"Emulation\".\n"); + WARN("Could not map sound device for direct access (%s)\n", strerror(errno)); return DSERR_GENERIC; } TRACE("The sound device has been mapped for direct access at %p, size=%d\n", dsdb->mapping, dsdb->maplen);