[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Sc-devel] PsyCollider server latency (was [sc-book] my av examples - psycollider)



I actually found out what the problem was:

The latency available for the standard MME drivers is 0.2 sec - really poor.... (I have added a message when booting the server so people can see what the latency used is - unfortunately this is not yet changeable through s.options)

If you use a proper audio interface (I tested with a MOTU) the latency disappears. Also, you should get much better results with ASIO4All drivers, but I had no time to test that.

Chris

On 7 Feb 2008, at 00:16, Christopher Frauenberger wrote:

Oh sorry, I should have checked more carefully. I will investigate whats going on...

Chris

On 7 Feb 2008, at 00:08, Fredrik Olofsson wrote:

yes, it is the sound that is delayed. here's a simplified example. runs stable and in sync on intel/ppc with cocoa/ swing0.59. no ripples or tearing in the picture.

same machine with xp and psycollider the sound is late, not in time and it even drops out now and then. picture tearing.

perhaps someone could test this quickly on linux? (i failed to install - latest dynebolic livecd was close but the mouse and keyboard was all messed up so i couldn't navigate - believe that?)



//dead simple test.  circle and sound at the same time?
(
s.latency= 0.05;
s.waitForBoot{
	var width= 640, height= 480;
var w= GUI.window.new("latency test", Rect(99, 99, width, height), false);
	var u= GUI.userView.new(w, Rect(0, 0, width, height));
	var syn= SynthDef(\av, {|amp= 0|
		var z= LPF.ar(LFSaw.ar(#[300, 301, 80, 81], 0, amp).mean, 2000);
		Out.ar(0, Pan2.ar(z));
	}, #[0.05]).play(s);
	var amp= 0, cnt= 0;
	u.drawFunc= {
		if(cnt==0, {
			syn.set(\amp, 1);
			amp= 1;
		}, {
			if(cnt==1, {
				syn.set(\amp, 0);
				amp= 0;
			});
		});
		cnt= cnt+1%25;
		GUI.pen.translate(width*0.5, height*0.5);
		GUI.pen.fillColor= Color.white;
		GUI.pen.fillOval(Rect.aboutPoint(Point(0, 0), 99*amp, 99*amp));
	};
	u.clearOnRefresh= true;
	u.relativeOrigin= true;
	w.onClose= {syn.free};
	w.view.background= Color.black;
	w.front;
Routine({while({w.isClosed.not}, {w.refresh; (1/25).wait})}).play (AppClock);
};
)



Am 06.02.2008 um 23:26 schrieb Sciss:

? fredrik's mail sounds the opposite to me, that the sound is delayed by some half second, not the graphics? or am i wrong?

Am 06.02.2008 um 19:19 schrieb Christopher Frauenberger:

Hey,

just tested on my windows machine with SwingOSC 0.59 - same trouble... Sciss, any ideas where that latency comes from? It seems that the Windows Java introduces this as the sound is ahead??

Chris

On 6 Feb 2008, at 00:15, Fredrik Olofsson wrote:

hi,
i just tested all my examples for the book with the new psycollider 20080203 (swingosc0.58). big trouble.

they all run but there's a long delay (~0.5 sec) between the sound and the graphical events. the sound is very late and this totally screws up all my audiovisual examples. they're now pointless. this is on a dualcore intel macbook pro 2.16ghz with xp pro sp2 and bootcamp. i tried lowering the s.latency but no visible change. any ideas? and will there be a similar latency on linux too? anyone would be so kind to help me test? else i'll try to install linux here tomorrow.

also, on windows, i have problems with trail effects and clearOnRefresh= false. none of the examples where i try to manually clear a userview with a rect in a colour with some alpha (to get slow fadeout - see example 16) work.

both these issues don't appear with swing on osx. if these can't be resolved, i rather claim the code osx only and go back from using GUI to cocoa.

here are 2 of the examples that'll show what i mean. first the big latency and then the lack of trails (and with that wrong background colour - compare with screenshot). also there are some not so nice tearing in the graphics on windows but i can live with that.

<Example01a.scd><Example16.scd>

_f


  #|
     fredrikolofsson.com     klippav.org     musicalfieldsforever.com
  |#