Posts

Post not yet marked as solved
4 Replies
1.5k Views
I made a MacOS app that does a long calculation (a theoretical simulation) in a large number of GCD background threads. The calculation can take many hours and periodically updates the application's window to show intermediate results. Performance is great as long as the application's window is visible: all cores at 100%, ventilator fan full blast, while the system remains completely responsive in other apps. I can still browse the web, watch videos, etcetera, but all excess power goes to the background threads which is great. However, as soon as I completely cover my app's windows, performance drops to something like 30% and I can hear the fan slow down and even turn completely off. The same thing happens if I lock the screen (when I want to leave the computer unattended while the calculation is running). What can I do to keep the computer from throttling down? I don't want to give the background threads real time priority because I want my computer to remain usable, but I do want to keep the computer as a whole at maximum power. Right now I try to keep a tiny corner of the app visible at all times, but there has to be a better way. I'm using Grand Central Dispatch for the threads, so I hope there's a simple solution without requiring explicit thread management. Thanks for any info! Michel
Posted Last updated
.
Post not yet marked as solved
0 Replies
1.9k Views
Hi everyone,I'm porting my ancient brick game Colibricks from carbon to cocoa to make it 64 bit.I noticed that some of the sounds suddenly sound a lot duller than before, as if they were much further away. First I thought I was doing something wrong in the sound routines (alSource3f, alPlay,...) but I had copied that OpenAL code from an earlier iOS port which sounds fine.To make sure there was nothing wrong with the sound files themselves, I played them in XCode. That's when I noticed something extremely weird: the sounds are OK when I first play them, but then sound dull when I play them again!I tried in VLC: sounds OK every time.Quicktime Player: OK the first time, dull the second and next times.Safari: same as Quicktime Player, OK first time, dull next times. Refresh page: OK again first time, then dull again.Chrome: OK every time.Does anyone have any idea what's going on and how I can fix it?You can download one of the sounds (a ping pong ball being hit by a paddle) from http://www.colibricks.com/Sound131.wavJust point Safari to that link, click the play button, then click it again to hear the difference. Refresh the page and do it again: first OK, then dull.The old Carbon version of the app (which I can't even compile anymore but still runs on Mojave) continues to sound fine. And so does the iOS version, even in the simulator on the mac.It seems like it's some sort of a bug in the MacOS core audio or openAL routines, since third party apps with custom sound routines don't seem to suffer from the problem. Maybe I should use a different sound framework to avoid the issue?Any help would be very much appreciated! I can't ship the game like this, it sounds dreadful compared to earlier versions.Thanks,Michel Colman(MacBook Pro 15 inch 2016, Mojave 10.14.5)
Posted Last updated
.