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

10% cpu usage by pulseaudio when a UI is loaded #147

Open
hamoid opened this issue Mar 28, 2019 · 2 comments
Open

10% cpu usage by pulseaudio when a UI is loaded #147

hamoid opened this issue Mar 28, 2019 · 2 comments

Comments

@hamoid
Copy link

hamoid commented Mar 28, 2019

Hi! I see a 10% CPU usage when loading a page with the Nexus UI. I can also hear the soundcard being activated and deactivated (a small click) when opening and closing such a web page.

Why is that the case? Is the audiocontext used for timing? Would it be possible to have an alternative method? Or maybe only activate it when using the sequencer? I'm just using a bunch of knobs, so no need for timing...

If I play an mp3 in cmus the CPU usage is around 0%. If I play audio on a web page the CPU usage is about 2%. Is maybe Nexus UI using a very tiny buffer that produces a high CPU usage?

@taylorbf
Copy link
Contributor

taylorbf commented Apr 3, 2019

This is the second request for a way to use NexusUI that does not rely on the web audio context. It's a good point.

A context really is necessary for part of the library and for timing, however it seems like it would be ideal to design the library so that a web audio context is created only if an interface necessitates it -- i.e. an interval, a sequencer, or an audio analyzer. This should be possible with a little extra logic. I will take a look at this as soon as I can.

@taylorbf
Copy link
Contributor

taylorbf commented Apr 3, 2019

That said, it is also possible that other elements of the library are creating the spike in CPU usage. When a NexusUI page loads, it can create a great number of SVG elements, depending on the interface. However it sounds like your interface should not involve any heavy processing and it very well may be the audio context.

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