http://bugs.winehq.org/show_bug.cgi?id=21655
Summary: MacOS: broken mixing in dsound8 tests + assertion failure Product: Wine Version: 1.1.38 Platform: x86 OS/Version: Mac OS X 10.5 Status: UNCONFIRMED Severity: normal Priority: P2 Component: directx-dsound AssignedTo: wine-bugs@winehq.org ReportedBy: hoehle@users.sourceforge.net
Must set WINETEST_INTERACTIVE or use runtest -i to get this.
Ouch, my ears. OTOH, the interactive winmm/wave tests sound fine. More precisely, all primary buffers of the form Nx24x1|2 or Nx32x1|2 produce various forms of hissing or plain noise. ../../../tools/runtest -i -P wine -M dsound.dll -T ../../.. -p dsound_test.exe.so dsound8.c dsound8.c:624: Testing a primary buffer at 96000x32x2 with a secondary buffer at 11025x16x2 ds3d8.c:332: Playing 1 second 440Hz tone at 11025x16x2 Assertion failed: (ptr1 < buflen), function DSOUND_BufPtrDiff, file mixer.c, line 305. wine: Assertion failed at address 0x0007:0x91c09f95 (thread 0009), starting debugger... Abort trap
The wave tests report that 32bit width is unsupported. They also contain comment that 24bit width is not tested because ALSA has trouble with it. Yet dsound tests it?
First I suspected this to be another instance of the broken DSOUND_PrimarySetFormat known from bug #20056 or bug #19124. OTOH, what happens here is different: WaveOpen fails initially, then the MAPPER+ACM kicks in and accepts to convert 24 or 32bit PCM to 16 => WaveOpen succeeds. On Linux, the sound is far from correct too, but there's no crash.
With 24 or 32 bit tests outcomment in dsound8.c the only failure is: dsound8.c:624: Testing a primary buffer at 8000x16x2 with a secondary buffer at 11025x16x2 ds3d8.c:332: Playing 1 second 440Hz tone at 11025x16x2 ds3d8.c:517: Test failed: The sound played for 875 ms instead of 1000 ms (and 8kHz indeed sounds strange, while the other frequencies are much better).
http://bugs.winehq.org/show_bug.cgi?id=21655
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download, testcase
http://bugs.winehq.org/show_bug.cgi?id=21655
Raymond superquad.vortex2@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |superquad.vortex2@gmail.com
--- Comment #1 from Raymond superquad.vortex2@gmail.com 2010-09-16 02:42:34 CDT --- Do your sound card support 11025 Hz, 22050 Hz and 44100 Hz ?
if your card is HDA-intel , you can find the supported rate in [Audio Output]
cat /proc/asound/card0/codec#0
I guess is the patch which disable the resampling if your sound card does not support the requested rate
#if SND_LIB_VERSION >= 0x010009 - snd_pcm_hw_params_set_rate_resample(pcm, hw_params, 0 && forced); + snd_pcm_hw_params_set_rate_resample(pcm, hw_params, 0);
#endif
http://bugs.winehq.org/show_bug.cgi?id=21655
--- Comment #2 from Jörg Höhle hoehle@users.sourceforge.net 2011-06-13 15:49:46 CDT --- As of wine-1.3.21, the *interactive* test ../../../tools/runtest -i -P wine -M dsound.dll -T ../../.. -p dsound_test.exe.so dsound8.c hangs after the first time IEEE_FLOAT is used:
dsound8.c:629: Testing a primary buffer at 8000x24x2 (fmt=1) with a secondary buffer at 11025x16x2 ds3d8.c:337: Playing 1 second 440Hz tone at 11025x16x2 ds3d8.c:522: Test failed: The sound played for 874 ms instead of 1000 ms dsound8.c:629: Testing a primary buffer at 8000x32x1 (fmt=1) with a secondary buffer at 11025x16x2 ds3d8.c:337: Playing 1 second 440Hz tone at 11025x16x2 ds3d8.c:522: Test failed: The sound played for 874 ms instead of 1000 ms dsound8.c:629: Testing a primary buffer at 8000x32x1 (fmt=3) with a secondary buffer at 11025x16x2 ds3d8.c:337: Playing 1 second 440Hz tone at 11025x16x2
Prior to hanging, when 24 bit is tried, plain noise is produced at 8000 Hz, higher frequencies work with 24 bit samples. Commenting out solely the 32 bit tests allows the test to proceed to the end (with the same 875 ms failures as originally reported), so it's solely the 32bit samples that cause trouble.
It's really the 32bit IEEE_FLOAT that hangs (fmt=3). 32 bit integer samples play noise. Note that winecoreaudio.drv/audio.c was never updated to support IEEE_FLOAT, but I don't know if that's related.
http://bugs.winehq.org/show_bug.cgi?id=21655
--- Comment #3 from Raymond superquad.vortex2@gmail.com 2011-06-13 21:39:34 CDT --- yes, the compliance test also failed on windows too for some sound cards
only some of hda codec support IEEE FLOAT, I guess the wine developers are all using those hda codecs
dmix does not use float to mix
but jack and pulse plugin can support float
http://bugs.winehq.org/show_bug.cgi?id=21655
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- OS/Version|Mac OS X 10.5 |Mac OS X
http://bugs.winehq.org/show_bug.cgi?id=21655
--- Comment #4 from Jörg Höhle hoehle@users.sourceforge.net 2011-09-30 15:59:15 CDT --- As of wine-1.3.29, I aborted the interactive tests on MacOS because audio output was unbearable: everything from sine to machine gun. winmm/wave.ok sounds good except some of the 8000x8x1 mid-test.
Like in comment #0, when I comment out the 24 and 32 bit tests in dsound_test.h, then the sounds bear resemblance with a sine, depending on the frequency.
I then sometimes get a crash: ds3d8.c:170: stopping playback wine(95521,0x4082d200) malloc: *** error for object 0x40247740: Non-aligned pointer being freed (2) *** set a breakpoint in malloc_error_break to debug Backtrace: =>0 0x95e6cc53 _ZN16AudioQueueObjectD0Ev+0x473() in audiotoolbox (0x0053ee18) 1 0x95e54f47 AQServer_DisposeQueue+0x56() in audiotoolbox (0x0053ee98) 2 0x95e3f969 AudioQueueDispose+0x118() in audiotoolbox (0x0053ef18) 3 0x4243b90c _AudioClient_Release+0x13b() in winecoreaudio (0x0053ef68) 4 0x4243ae7f _AudioStreamVolume_Release+0x1e() in winecoreaudio (0x0053ef98) 5 0x42225067 _WOD_Close+0xc6() in winmm (0x0053efe8)
Sometimes sound is lost and I see err:ntdll:RtlpWaitForCriticalSection section 0x12eb84 "?" wait timed out in thread 002f, blocked by 0023, retrying (60 sec)
Sometimes this happens after a gadzillion err:winmm:WOD_PushData GetBuffer failed: 88890006 sometimes there's a single such 88890006 error prior to the deadlock.
When running with WINETEST_DEBUG<=1, i.e. without -v, that happens much less often. WINEDEBUG=warn+heap ../../../tools/runtest -i -v -P wine -M dsound.dll -T ../../.. -p dsound_test.exe.so dsound8.c
warn+heap doesn't seem to cause a difference.
http://bugs.winehq.org/show_bug.cgi?id=21655
--- Comment #5 from Jörg Höhle hoehle@users.sourceforge.net 2011-11-23 02:38:01 CST --- Ouch, after applying your patch atop 1.3.32 I obtain this shortly after the end of the second and subsequent runs, probably as Wine unloads, but not always.
malloc: *** error for object 0x402086c0: Non-aligned pointer being freed (2) *** set a breakpoint in malloc_error_break to debug wine(4406,0x4080c200) malloc: *** error for object 0x402085c0: Non-aligned pointer being freed (2) *** set a breakpoint in malloc_error_break to debug
git checkout HEAD^; make at that is gone.
http://bugs.winehq.org/show_bug.cgi?id=21655
--- Comment #6 from Jörg Höhle hoehle@users.sourceforge.net 2011-11-23 03:03:32 CST --- My last comment was meant for bug #28039. However, as of 1.3.32, the dsound8 tests may still trigger a "Non-aligned pointer" bug (even without the GetPosition patch), only this time I get no backtrace and it occurs seconds after the end of test execution, as Wine unloads.
wine(8541,0x4080c200) malloc: *** error for object 0x402086c0: Non-aligned pointer being freed (2) *** set a breakpoint in malloc_error_break to debug
Normal test execution with runtest -q seems to trigger less often than runtest -v. You don't need -i.
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; }
http://bugs.winehq.org/show_bug.cgi?id=21655
Jörg Höhle hoehle@users.sourceforge.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |FIXED
--- Comment #8 from Jörg Höhle hoehle@users.sourceforge.net 2013-03-04 15:35:00 CST --- As of 1.5.25 (Snow Leopard 10.6.8), dsound8 produces steady sound at 8000-96000/8/16/24/32 bits.
http://bugs.winehq.org/show_bug.cgi?id=21655
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #9 from Alexandre Julliard julliard@winehq.org 2013-03-15 14:46:31 CDT --- Closing bugs fixed in 1.5.26.