-
Notifications
You must be signed in to change notification settings - Fork 22
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
100% cpu usage #5
Comments
I've just implemented the library in the same manner and unfortunately I have 100% cpu usage without even adding an input as well. |
I have the same issue |
Unfortunately it seems this repo is no longer maintained. I was able to fork the repo (to our company repo) - you will be able to fix the CPU issue by doing the following here: https://github.com/ConnorChristie/Audio-Mixer/blob/master/src/mixer.ts#L82 Replace this bit: clearImmediate(this._timer)
this._timer = setImmediate(this._read.bind(this)); with clearTimeout(this._timer)
this._timer = setTimeout(this._read.bind(this), 0); I dont know what kind of impact it would have in terms of realtime processing. But for our use-case it works and all 2000 unit tests are still passing after this change. But CPU basically went down to 0 :) |
@Adrriii |
@timo-klarshift I don't remember why I mentionned ffmpeg at all, and looking at my project it seems like I didn't seek an alternative. Thank you for the fix though :) I'll close since it's not maintained and a good solution has been provided. |
@Adrriii Thanks for answering, but I dont think we should close it :) |
Alright :) |
ConnorChristie#5 (comment) Unfortunately it seems this repo is no longer maintained. I was able to fork the repo (to our company repo) - you will be able to fix the CPU issue by doing the following here: https://github.com/ConnorChristie/Audio-Mixer/blob/master/src/mixer.ts#L82 Replace this bit: clearImmediate(this._timer) this._timer = setImmediate(this._read.bind(this)); with clearTimeout(this._timer) this._timer = setTimeout(this._read.bind(this), 0); I dont know what kind of impact it would have in terms of realtime processing. But for our use-case it works and all 2000 unit tests are still passing after this change. But CPU basically went down to 0 :)
Haha super legit 🤣 |
Hi, i've been using audio-mixer in my recent project and noticed 100% audio usage.
The use case where i noticed this is :
This test case also has this problem :
You could think that it would be caused by too many streams, but actually even this test case works:
-> 100% cpu usage for a while
-> the file is empty
When using the profiler, i'm noticing 99% cpu usage for calls to
epoll_pwait
in c++ wrapper.I'm guessing this has to do with the usage of ffmpeg ? Is mixer always encoding even when there is no input ? I hope you can help with this :)
The text was updated successfully, but these errors were encountered: