dsound questions

Jeremy White jwhite at codeweavers.com
Thu Feb 24 22:56:01 CST 2005


Okay,

So I'm trying to clean up dsound before I make it run properly
in different scheduling conditions, and I'm having a heck of
a time with it; hoping for some advice/thoughts.

First, I encountered two glitches in dsound/mixer.c that appear
to be bugs, but I do not understand the code well enough to be sure.
The attached diff addresses both.

Case 1:  In the first case, in DSOUND_MixOne, we compute
a 'probably_valid_to' based on the 'write_pos', which seems quite
wrong; I believe the logic should be testing whether or not
there is sufficient data in the mixing buffer, not whether or
not there is sufficient room in the buffer overall.

Case 2:  In DSOUND_PerformMix, I found that on my sound card, I
frequently hit cases where 'inq' (afaict, amount mixed but yet to be played) was
higher than the computed value of 'maxq' (maximum amount we're supposed
to write).  At best, the calculations for 'maxq' need to be corrected,
and perhaps coupled directly to the code that limits the data.  At worst,
I suspect the entire block of code could be removed, but
I know way too little to be sure.

Then, to my great joy, I found two separate apparent OSS bugs on
two different systems.  In one, the result of DSP_GETOPTR would
temporarily 'go backwards' when doing mmaped transfers; in the other,
my laptop would just stop reading data out of an mmapped buffer,
for no apparent reason.  Questions:  1) Is there a good set of OSS
test programs (particularly for mmap) I could/should use to simply validate that
my system is rational wrt OSS?  2) Are the performance gains from
DMA mmap really worthwhile?  I wonder if mmap mode is buggy and if we wouldn't
be better off swtiching to a pure 'write' approach.

I'd appreciate any thoughts/feedback/wacks with a clue bat.

Cheers,

Jeremy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mixerhack.diff
Type: text/x-patch
Size: 1175 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-devel/attachments/20050224/29c7c4c2/mixerhack.bin


More information about the wine-devel mailing list