[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: /dev/dsp and X11 related? I think not!
Lutz Sammer wrote:
> > It sounds like its not the correct sample format, even though I have
> > checks around the ioctl()s that request those and they report no
> > error...
>
> If you work with X11 all draw events are buffered (only drawn if needed).
> This means that the complete CPU time could be given to X11, you could
> also lock X11 if you send events faster than X11 could draw.
>
> Call each frame or frequently XSync, you know after this point all drawing
> events are handled.
I call XSync after each "frame" (I XPutImage only the smallest rectangle
that grabs all the changed pixels). Maybe the problem lies in event
handling, I do like this:
while(XPending) {
XNextEvent(event)
[ handle event ]
}
If more events keeps coming in while I'm handling them, I could stay in
this loop for a little too much of a while...
> And remember the time to do drawing is now doubled (game -> X11, X11
> -> video card)
>
> You could also increase the sound buffers.
The output I get really sounds like if I was mixing incorrectly, there's
no skipping or DMA looping happening. I've heard what it sounds like
when the machine is overloaded and Quadra can't write fast enough to
/dev/dsp, and it's not like that.
By mixing incorrectly, I mean that the sounds are longer than they
really are (bad rate for resampling), the samples are all over the place
(like if 16 bits samples were interpreted as two 8 bits ones, or
something similar to that) and they're delayed.
--
Pierre Phaneuf
Ludus Design, http://ludusdesign.com/
"First they ignore you. Then they laugh at you.
Then they fight you. Then you win." -- Gandhi