Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

High CPU load #38

Closed
Wiksnet opened this issue Feb 1, 2019 · 6 comments
Closed

High CPU load #38

Wiksnet opened this issue Feb 1, 2019 · 6 comments

Comments

@Wiksnet
Copy link

Wiksnet commented Feb 1, 2019

Tested on iPad Pro 13 inch - CPU usage is about 30-45% in idle. And a lot more in the old iPads
Sound of AUv3 in 90% cases is late and goes crazy (I used code for auv3 from brokenV3) If I add two or more plugins, then CPU load 100% and sound is hang

@aure
Copy link
Member

aure commented Feb 1, 2019

Hi Wiksnet. Yea, its in a broken branch for a reason. :). What is your testing method. What host? How do the numbers in AUv3 compare with the standalone app? Lets use this issue for further communication, but since this is on-going develop, I'll close this as an open issue.

@aure aure closed this as completed Feb 1, 2019
@Wiksnet
Copy link
Author

Wiksnet commented Feb 2, 2019

Hello Aure,

Thank you.
I use Garageband and Cubasis 2. iPad 12.9inch, ios: 12.1.3 (16D40). Output: built-in iPad speakers.

  1. First I compiled app (no difference if I run debug+garageband or just compile app and run garageband)
  2. Open GarageBand or Cubasis (better garageband, in cubasis for some reason in 50% of cases it worked fine)
  3. Remove all instruments and add just one Synth One auv3

result... sound is fine, but CPU in the XCode or Cubasis metric control is about 32-45% that seems to be alarming, because the simple use of SynthKit with 1 oscillator usually shows 1% CPU, other auv3 plugins also shows for me 1-5% cpu

  1. Add second auv3:Synth One instrument

the sound starts to distort very much and the processor shows 75-100% load
it seems as if two synthesizers use one buffer for sound and edit it - but I'm newbie for programming with audio and can't be sure. one thing I am sure for sure. that this should not be so, because adding 4-5 synthesizers just puts down the whole system and GarageBand or Cubasis is hang.

ps...
I tried to record a video today, but for the most cases it worked all day for me :) Only 3-4 times I noticed it. Yesterday it not worked at all in 90% cases. Anyway I'll try to catch it and show you.
Also I went the other way and created an empty new project with added AudioKit framework. Auv3 is running and by pressing a note I just reproduce sound of 1 oscillator using this code:
` //osc
let oscillator = AKOscillator() //Create the sound generator

                                    //master out
                                    AudioKit.output = oscillator    //Tell AudioKit what to output
                                    
                                    do {
                                        try AudioKit.start()    ///Start up AudioKit
                                    } catch {
                                        print(error)
                                    }
                                    
                                    oscillator.amplitude = 0.5
                                    oscillator.frequency = random(in: 220...880)    //Set oscillator parameters
                                    oscillator.start()    //Start the oscillator`

It sound good in garageband/cubasis and cpu:0-1%, but when I'm adding a second auv3, then sound then the sound is very distorted.

Here is private video - https://youtu.be/SDG_x2yAM9E

and also issue with cpu load (this one from "broken" branch*, but for the master cpu load is actually same)
https://youtu.be/8OMlE80o9DM

@Wiksnet
Copy link
Author

Wiksnet commented Feb 2, 2019

Added project for test - https://github.com/Wiksnet/AudioKit-AUV3-Experiments

ps>the main thing is not to click on the note twice, since I, as a test, made the oscillator initialization on note on

@Wiksnet
Copy link
Author

Wiksnet commented Feb 2, 2019

Finally catch it - https://www.youtube.com/watch?v=vdrDd3WEmVo

@aure
Copy link
Member

aure commented Feb 3, 2019

Yikes, we definitely got some issues don't we? I'll see what I can do. I think I see what is wrong with your experiment, I'll make a commit there directly.

@Wiksnet
Copy link
Author

Wiksnet commented Feb 3, 2019

Thanks. Sure. I rather ran into two problems. 1st is a broken/hang sound like on the last video (used code from "broken" branch, nothing has been changed). And the second is that the sound from plugin1 comes out from a second pluging too. Even if I did not press the note on second. - The same issue actually I saw in the "experimentation" branch, in the "broken" branch it seems fixed.

NEW update:
it seems that the problem with the sound freezing is reproduced ONLy when I load the main SynthOne app and then even if I closed it, the sound is distorted in auv3, but again not always :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants