PDA

View Full Version : Tip to improve PLAY perf on PowerPC macs


cjed
05-18-2008, 03:50 AM
Hi,

I've been doing hours of benchs of PLAY on my G4 1,25Ghz mac (1,5 Gb ram) to reach a playable setting (I would thank the support team for having responded quickly and having reported some things I discovered to the dev team). Here are some informations I would like to share, because I think it could help for PPC mac owners. All these informations are coming from the standalone PLAY in order to avoid specific host problems (actually it is reported in Apple forums that for example Logic 8 has strong CPU usage problems with audio plugins).

- on my mac (whatever OS, Tiger or Leopard) the PLAY process consumes more than 60% CPU (monitored through OSX activity monitor) when playing with the PLAY Player window active. When switching to the Browser PLAY window, it drops from 20 to 40% (20% for lighter sounds). So there seems to be a problem with the PLAY interface (uses the cross platform framework Qt), perhaps using native OSX Quartz would have been leading to better performance. However it can depend from you video card (but i'm not confident of that, as there isn't any such problem in Kontakt 2 with similar sampes libraries - CPU usage ranges from 10 to 15% and is very stable).

- so, appart from this previous tip that can increase dramatically performance (setting the generic AU controls instead of the complex PLAY interface - if you use PLAY as an audio unit plugin in a host - leads to the same result), you can load the samples in ram (uncheck the box Streaming from disk). For the Telecaster guitar in MOR it helps a lot (800Mb however to load) when playing chords with hold pedal on.

- turn off the convolution reverb as the CPU usage indication in PLAY is strongly false, only jumping a few percents when the reverb is on, where in fact (OSX activity monitor) it uses close to 80% (on my CPU).

- The CPU usage is also somewhat false even when the reverb is off, as I encounter audio cuts with PLAY CPU usage of less than 20%, where in fact it uses more (twice as much in the OS activity monitor).

- There is audio cuts (not really audio overload but cutted audio, and without reaching the 32 notes max polyphony - doesn"t produce the same cut) that appear randomly (even when the OS activity monitor is not so high). For example playing a chord many times (whith pauses), sometimes it is ok, but a few seconds later the same chord can cause problems (audio cut). There isn't any predictable behaviour in audio cuts (not really tied with the real process CPU usage).

- Globally loading the samples in RAM can help a little (the case for large sounds like MOR Telecaster guitar), and the audio buffer (then latency) also a little (I can't go higher than 1024 because it then sounds distorded with my Echo MIA card - I can only use 512 or 256 - 512 is fine with all other instruments plugins I have, in fact i previously used 256 with Kontakt 2 and more demanding plugins without any problem).

- I have only one processor, but as a single audio plugin instance can only take benefit from one processor (at least if used in a host sequencer) it shouldn't matter. Well, a single G4 1,25 should not perform so bad compared with an Intel single Core 2 Ghz, as the G4 Altivec vector engine is far more powerful than even Intel's SSE4. So I wonder if PLAY on PPC uses the Apple unified vector engine APIs (that uses Altivec on PPC and SSE on Intel). I know the G4 memory bus and memory speed is a limiting factor, but finally it is only playing/merging some samples (a single chord), with all the samples in ram in my latest tests. So it shouldn't suffer that much.

To conclude, there seem to be a problem with CoreAudio data buffer feedding in PLAY with PowerPC macs (the PLAY audio enine probably can't feed as fast as needed the buffers and it leads to audio cuts - CoreAudio has to ensure a minimum latency by design, and triggers an audio overload message if the plugin doesn"t respond in a given time). The problem appears randomly, and isn't completely tied with CPU usage (nor disk usage, the same problem with samples loaded in ram). And finally the PLAY cpu usage is very far from accurate (and its audio overload system doesn't seem to help).

I wad told improvements are being made to the convolution reverb, but I think more work/profiling with Apple tools (Shark, etc.) has to be done on PowerPC (and perhaps on other systems) to discover why sometimes (randomly) PLAY audio engine doesn't meet the time dedaline fixed by CoreAudio, leading to random audio cuts. I think it perhaps wasn't discovered in beta test phase because more powerful machines were used. The PLAY interface should also be strongly optimized, and perhaps the Qt framework should be dropped in favor of a native solution on each platform.

I wonder how it performs on your G5 (or Intel) : what are your OSX activity monitor reporting (also with PLAY Player window or Browser window) ?

Thanks,
Jerome

ETM Dude
05-18-2008, 05:07 PM
Its been mentioned that Play unloads its GUI memory when you close the window, so after you load your sounds and make your tweaks its recommended not to leave the window open.

cjed
05-19-2008, 07:06 AM
Its been mentioned that Play unloads its GUI memory when you close the window, so after you load your sounds and make your tweaks its recommended not to leave the window open.

Thank you, but it has nothing to do with memory usage, it is CPU resources usage that causes problems (probably what you meant :)). The fact is that when the PLAY UI is displayed the whole player uses three times more CPU resources as with the Browser windows, so there is plenty of room for improvements.

For what I said about the Qt cross platform framework, in fact high level wrapper frameworks always call at end native system APIs of the host OS. For example when we look at the PLAY process under OS activity monitor (inspect process) whe can see it is linked (among others) to Quartz framework (also CoreAudio framework obviously, etc.). The question is to know how efficient is the Qt binding process to OSX core APIs at compile time. It has to make the call in a proper and efficent way, and there isn"t any mean that way to improve (hand optimizing) areas of drawing, as we could have done when writting the whole UI code in Carbon or Cocoa.
So using the Qt could not be a wrong idea (easier to maintain for multiple OS, strongly emerging solution, and finally the UI isn't the most resources demanding part of an audio plugin theorically), but I hope it won"t be a limiting factor at the end.

When I see the high quality convolution reverb the EastWest (or third party) dev team produced in PLAY (performances/bugs issues appart), I'm confident they will bring huge improvements (the current version is 0.056, not even 1.0 :))

But the UI point is not the most important thing, the random audio cuts have to be fixed. Without that, such demanding sounds as the MOR Telecaster Lead Guitar (really nice) aren't usable even with all the tricks I mentioned. It seems that there is some of sympathetic resonance when playing many notes (i can be wrong), so perhaps it adds complexity (and resources requirements) to the PLAY audio engine. But finally PLAY was promoted/announced as the solution to get rid of Kontakt limitations and not optimal performances, so it is normal to have such (finally not so high) performances expectations.

It is clearly stated that PLAY performance is better on Intel machines, but I have to ask why ? Aren't the dual or quad G5 as powerful for audio handling thanks to their Altivec engines and Hypertransport CPU interconnexion bus (at processor speed) ? Even Intels dual cores can't do that. The memory and bus are also great in G5.
So what about such problems of audio cuts even with dual G5 (for a few notes polyphony used and low CPU usage) :
http://www.soundsonline-forums.com/showthread.php?t=13555

I agree there could be some explanations when the direct from disk streaming is on : the CPUs could be waiting data (and so doing nothing meanwhile, so not so high CPU usage), the data fail to come as quick as needed, and cannot be supplied to CoreAudio buffer at the fixed rate (so latency problems and audio cuts or even worse audio overload). BUT it also happens (for me) with DFD off. So there seems to be something that consumes too much CPU power in the audio engine (samples mixing and sympathetic resonance, alternate samples, etc.), that isn't reported well in the PLAY CPU usage meter.

Besides that I noticed a lot of problems in some MOR guitar sounds : for some notes there is a high pitched click that appears exactly half the time for the same note (probably a problem with some alternate samples as the problem is completely predictable for these notes, and doesn't appear for others). I also noticed such problems in some guitar sounds of Colossus. So can this be a problem with the DVDs, should I ask for a replacement ? I will give the details to the provided link, and also here to check if it happens with other installations.

Doug Rogers
05-19-2008, 07:30 AM
PLAY is optimized to run on Intel Macs, not 10 year old G4s. Convolution is optimized to run on multiple processors (which you don't have).

Rather than us trying to optimize PLAY for your old G4 I would suggest you upgrade your equipment because this is only going to get more problematic as these instruments get more sophisticated. Remember, the minimum spec just means you can run an instrument with that system, for practical purposes you need a recommended system.

I don't have any of the problems you describe.

- DR

cjed
05-19-2008, 07:59 AM
Sorry Doug, I did'nt mean any offense or misleading. I'm confident It plays well on Intel machines, I only tried to understand some weird problems with audio cuts that appear without any apparent reason (not high CPU usage, not high polyphony used, random cuts). It also seems it appears on some G5 macs. But as you say the PPC (5 years old for my G4, 3 years old for G5s) aren't the future and I will end with an Intel mac. Finally even Apple's recent benchs when introducing Intel macs showed far more better results on the new Intel machines, so there must be better optimizations for Intel in OSX (and better compilers as we know).

I made my first song with MOR so there is hope :cool:

Doug Rogers
05-19-2008, 08:10 AM
No problem, with current Mac software development you have a choice of optimizing the code for PPC or Intel. Guess which we chose?

G5 works OK (we have a test unit) but Intel Macs offer superior performance.

- DR

charles
05-21-2008, 02:35 PM
Hi Doug [or anyone else]:

In your testing of PLAY as a plugin on Intel Macs, do you find any differences in performance
when used with the various host programs[Logic, DP, etc]?

And any differences between 10.4 and 10.5?
Still on 10.4 with dual G5 here, no PLAY libs yet...

Thanks,
Charles

johng
05-23-2008, 11:41 AM
I heard that DP can access 4 Gigs of memory and that Logic can only access 2 Gigs, but I have not proven the latter.

cjed
05-28-2008, 12:59 PM
Hi, back to the thread, with this (last normally) time a really useful discover that solved my performances issues and random sound cut artefacts on the PPC !! :):)

I noticed that if I switch the audio frequency from one value to another (for example 44,1Khz, then 48, and then back 44,1) in the audio settings (standalone PLAY or AU host) after having loaded each PLAY patch (MOR in my tests, not tested in VOP but it should also work), the audio cuts artefacts are gone and even the Telecaster Lead guitar of MOR is playable with long arpeggios and sustains (and that with streaming on !).
I saw this advice in some forum about something else (another software that i don't remember).

So you would think there is probably something wrong with my audio card (Echo MIA) driver, but i don't think, as it is ok with Kontakt 2.
I also just buyed Synthogy Ivory Italian Grand and was stunned as on my PowerPC G4 MDD single 1,25 Ghz I can play without any problem the fullest piano patch (12 velocity layers, that is 19 Gb and 800Mb loaded in ram, with 2 to 11Mb/s stream from my firewire disk without any hit in performance !), and all that with all parameters on (hold pedal samples, release samples, sustain DSP algorithm, included reverb and other effects). That is one sound about the size of the whole MOR library ! It used from 20 to 30% CPU and I even couldn't go higher than 40% CPU at only 256 samples size buffer (and noticed only one time a sound cut, hardly to trigger again, and never happened at 512 samples buffer size) ! Same results with standalone Synthogy player and AU mode (their player is said to use the code from the AU plugin).

Then I think an universal binary (Intel and PowerPC mac) samples player application with great performance is possible.

(the only disapointed thing for me was the sound of Ivory Italian Grand, very deceiving compared with my Roland Complete Piano, and not that better than Colossus's Fazioli - same piano - or Steinway B, or Kontakt 2's Steinway D and August Forester - the later offers even better resonance than the Ivory). Well, the Italian Grand notes attack is really short and harsh, the problem probably comes with this piano model only. The sustain and resonance is not that great either.)

So problem solved temporarly, waiting for some optimizations in PLAY. Note there even could be a combinatory problem with my audio card driver and PLAY engine, such specific problems happen frequently in audio applications world (users with other cards generally are not affected). So many things to check : PLAY engine, Echo card driver, Apple Core audio (the latest MacOSX 10.5.3 beta is said to fix stong audio and video related issues in the kernel - including firewire audio cards handling, mine is PCI however -, so there is hope :)).