usleep in winmm/wineoss audio

eric pouech eric.pouech at
Mon Oct 22 13:27:02 CDT 2001

Simon Britnell wrote:
> For some games (HomeWorld 1.05 being the one I'm
> working on), a hang occurs where the system thrashes
> on an ioctl SNDCTL_GETOSPACE returning with 0
> fragments available.  The symptom went away when I
> turned on --debugmsg +wave, so it seems to be some
> kind of race.
> I've introduced a usleep(100); before returning FALSE
> when there are no fragments available.  This seems to
> fix the problem.
> I'm not overly happy with this solution and I'm
> examining the code with an eye to using poll/select to
> handle this more efficiently.  Any comments?
there's already a wait operation in wodPlayer, so writeFragments
shouldn't do any delay
there may be a race somewhere, but this is not the way to fix
it. are you sure that the 0 fragment is the cause of your issues ?
(and not between the sender of wavehdr and the playback thread ?)

Eric Pouech (
"The future will be better tomorrow", Vice President Dan Quayle

More information about the wine-devel mailing list