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

playbackDevice.writeSamples eating CPU #2252

Closed
tnelsond opened this issue Aug 21, 2014 · 2 comments
Closed

playbackDevice.writeSamples eating CPU #2252

tnelsond opened this issue Aug 21, 2014 · 2 comments

Comments

@tnelsond
Copy link

@tnelsond tnelsond commented Aug 21, 2014

On my system which is a 64-bit Linux box using Alsa for sound, the call to writeSamples on a AudioDevice maxes out a CPU core if the samplerate is 30khz (30000) or higher; however hardly any at all ( < 10% CPU) is used when the samplerate is 20khz (20000) or lower. 44.1khz and 48khz also maxes out a CPU.

Android seems to have no problem whatsoever.

@badlogic
Copy link
Member

@badlogic badlogic commented Aug 31, 2014

That's an issue in the audio driver for which we have no solution. We could look into the OpenAL sources, but that really just calls into the platform dependend audio API. I'm afraid there's not much we can do.

@badlogic badlogic closed this Aug 31, 2014
mgsx-dev added a commit to mgsx-dev/libgdx that referenced this issue Nov 26, 2016
With sample rate of 44100 Hz or above, Thread doesn't sleep and eat CPU.
Thread should sleep one buffer duration.
@mgsx-dev
Copy link
Contributor

@mgsx-dev mgsx-dev commented Dec 30, 2016

Issue is not related to audio driver but to java code (see my PR that fix it)

badlogic added a commit that referenced this issue Jan 4, 2017
fixes #2252 reduce CPU usage in OpenALAudioDevice
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants