Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / CodeWarrior / May 2005



Tip: Looking for answers? Try searching our database.

Beware of coalesced updates after compiling on 10.4

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kent Sorensen - 19 May 2005 17:00 GMT
 If you experience slowdowns in your application after compiling it
under 10.4 you're probably a victim of the coalesced update feature that
is new in the 10.4 CoreGraphics.

As usual, perusing the release notes is a good idea:

http://developer.apple.com/releasenotes/Carbon/HIToolbox.html

Basically, if you call QDFlushPortBuffer, your application will block
until the flush is complete. On a 10.4 compiled, Mach-O application CG
will avoid unnecessary flushes by only flushing your buffers as often as
the display hardware actually works (60Hz for LCD, 70-90Hz for a CRT)

It is unclear, however, how you can detect the right time to flush the
buffer. Ideally, you'd do it just before the display hw actually
updates, but I'd be surprised if the old VBL interrupt techniques
actually work.

Basically, I guess it boils down to, they don't want you to call
QDFlushPortBuffer.

Kent
Chris Baum - 20 May 2005 03:26 GMT
> Basically, I guess it boils down to, they don't want you to call
> QDFlushPortBuffer.

You can call it but just don't do it > 60 times per second.  You can
update existing code very easily by adding a lastTimeFlushed variable
to your render loop and then replace:

QDFlushPortBuffer

with:

if(curTime - lastTimeFlushed > 1/60th second) {

  QDFlushPortBuffer;
  lastTimeFlushed = curTime;
}
rob@haptek.com - 26 May 2005 11:48 GMT
> If you experience slowdowns in your application after compiling it
> under 10.4 you're probably a victim of the coalesced update feature that
[quoted text clipped - 18 lines]
>
> Kent

This isn't the first time the low-level graphics behavior has changed
on the
same hardware after a software update.  But there is some good news.
I'm interested in getting back basic OS 7-9  functionality such as the
ability
to sync to the screen refresh.  The best (only) source of information
on this
topic that I know is the "psychtoolbox" effort.  After a lot of work
they've
had success.

As you've noted CopyBits() and QDFlushPortBuffer() sort of work,
sometimes,
depending, with the latter call blocking until the screen refresh.
Here's what
Allen Ingling of the psychtoolbox group had to say:

"By the way, we tried the carbon copybits calls on OS X for the HIPS
viewer.
Useless on OS X.  Slow transfer rates and unreliably and unverifiable
video synching."

So what they do is set up a high-priority "time contraint" thread and
add
other tricks like killing  the "update" process.  They write to the
back buffer
and there is an openGL call which will will block until the buffers are
flipped.
They report getting reliable syncing to the monitor with jitter in the
100 microsecond range.  It's not solid real-time as you can get under
classic,
but pretty good.

That group has performed a real public service, there's a lot of good
example
code.  They run under matlab, but there is c code which shows how to do
the
basic stuff.

Rob Shaw
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.