[Bug 13852] 2d game has lost sounds (some go some don't go)

wine-bugs at winehq.org wine-bugs at winehq.org
Tue Jan 11 16:34:38 CST 2011


http://bugs.winehq.org/show_bug.cgi?id=13852

--- Comment #9 from Jörg Höhle <hoehle at users.sourceforge.net> 2011-01-11 16:34:35 CST ---
Created an attachment (id=32819)
 --> (http://bugs.winehq.org/attachment.cgi?id=32819)
Patch to ignore SND_NOWAIT

Admins, please set the component to winmm

This app uses PlaySound() with flags 00002005
= SND_NOWAIT SND_MEMORY SND_ASYNC

001b:trace:winmm:MULTIMEDIA_PlaySound pszSound='0x50ec98' hmod=(nil)
fdwSound=00002005
001b:trace:winmm:MULTIMEDIA_PlaySound pszSound='0x50ec98' hmod=(nil)
fdwSound=00002005
clearly shows the former call is immediately returned.

I once made a note to myself that says "patch PlaySound to ignore SND_NOWAIT;
SND_NOSTOP does not abort (fixme: sounds of the current process only) and
returns FALSE." but did not write it yet because it needs validation on several
versions of MS-Windows (w95/98/2k/xp etc.). I tested it on one system only. 
IIRC I read somewhere that the behaviour changed along the way.  That alone may
explain the differences you observe.

With SND_NOSTOP, "the function immediately returns FALSE without playing the
requested sound", according to MSDN
http://msdn.microsoft.com/en-us/library/ms712879.aspx.  Currently Wine equates
SND_NOWAIT and SND_NOSTOP.  Therefore, if the app is busy playing a
blimp, it will not abort it to play an explosion.

The app never uses the PlaySound(NULL,0,SND_NODEFAULT) pattern that Larry
Osterman recommends in his blog
http://blogs.msdn.com/b/larryosterman/archive/2008/09/15/why-call-playsound-null-null-snd-nodefault.aspx
He further explained that "the current implementation [he wrote this in 2009]
... simply queues the request...  So if you have a situation where you call
PlaySound many times in succession, ... all the calls to PlaySound pile up
behind each other."
I have no idea whether win9x queued.  Wine does not queue. 
http://blogs.msdn.com/b/larryosterman/archive/2009/02/19/playsound-xxx-snd-memory-snd-async-is-almost-always-a-bad-idea.aspx
gives a good reason not to queue.

>err:alsa:wine_snd_pcm_recover underrun occurred
Can be ignored for now.  Same in the MCI.
The built-in players do not handle short sounds well.


>The game is freeware unlimited so don't worry about copyrights.
The .hlp file says "Shareware" which is quite the opposite.
Why don't you play Gnome's "5 in a row" on Linux?

-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.


More information about the wine-bugs mailing list