http://bugs.winehq.org/show_bug.cgi?id=21655
--- Comment #7 from Raymond superquad.vortex2@gmail.com 2011-11-23 18:37:14 CST --- it is also broken in winealsa too
440Hz tone when using primary buffer of 24bit become noise
dsound8.c:651: Test failed: Primary and secondary buffers have different vtbls. ds3d8.c:337: Playing 1 second 440Hz tone at 11025x16x2 ds3d8.c:522: Test failed: The sound played for 861 ms instead of 1000 ms dsound8.c:640: Testing a primary buffer at 96000x32x2 (fmt=1) with a secondary buffer at 11025x16x2 dsound8.c:651: Test failed: Primary and secondary buffers have different vtbls. ds3d8.c:337: Playing 1 second 440Hz tone at 11025x16x2 est.exe.so: mixer.c:330: DSOUND_BufPtrDiff: Assertion `ptr1 < buflen' failed. dsound8: unhandled exception 80000101 at 0x68000832
AudioClient_GetMixFormat() prefer FLOAT_LE for those "plughw" device and limit the rate to 48000Hz but user is allowed to change dsound's default sample rate in registry to 96000Hz
fmt->Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE; if(snd_pcm_format_mask_test(formats, SND_PCM_FORMAT_FLOAT_LE)){ fmt->Format.wBitsPerSample = 32; fmt->SubFormat = KSDATAFORMAT_SUBTYPE_IEEE_FLOAT; }else if(snd_pcm_format_mask_test(formats, SND_PCM_FORMAT_S16_LE)){ fmt->Format.wBitsPerSample = 16; fmt->SubFormat = KSDATAFORMAT_SUBTYPE_PCM; }else if(snd_pcm_format_mask_test(formats, SND_PCM_FORMAT_U8)){ fmt->Format.wBitsPerSample = 8; fmt->SubFormat = KSDATAFORMAT_SUBTYPE_PCM; }else if(snd_pcm_format_mask_test(formats, SND_PCM_FORMAT_S32_LE)){ fmt->Format.wBitsPerSample = 32; fmt->SubFormat = KSDATAFORMAT_SUBTYPE_PCM; }else if(snd_pcm_format_mask_test(formats, SND_PCM_FORMAT_S24_3LE)){ fmt->Format.wBitsPerSample = 24; fmt->SubFormat = KSDATAFORMAT_SUBTYPE_PCM; }else{ ERR("Didn't recognize any available ALSA formats\n"); hr = E_FAIL; goto exit; }
if(max_rate >= 48000) fmt->Format.nSamplesPerSec = 48000; else if(max_rate >= 44100) fmt->Format.nSamplesPerSec = 44100; else if(max_rate >= 22050) fmt->Format.nSamplesPerSec = 22050; else if(max_rate >= 11025) fmt->Format.nSamplesPerSec = 11025; else if(max_rate >= 8000) fmt->Format.nSamplesPerSec = 8000; else{ ERR("Unknown max rate: %u\n", max_rate); hr = E_FAIL; goto exit; }