Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

ALSA - High CPU usage on the default device

Graphical Environments, Managers, Multimedia & Desktop questions.
Post Reply
Message
Author
andoru
Posts: 272
Joined: 2014-03-14 16:59

ALSA - High CPU usage on the default device

#1 Post by andoru »

As the title says, I'm having a bit of an issue with ALSA, and the high CPU (~15-20%) usage in some cases. So far on the default device, I've only noticed this with VLC and foobar2000 (through Wine), but there are other apps/games that might have the same problem. It's just easy to tell if an app/ALSA uses too much CPU if you just play some audio files and you don't have anything else that might need the extra CPU power, like rendering the video stream or render the graphics. I can fix the high CPU usage in VLC if I switch the audio sub-device from the Default to a specific one (in my case: Analog Front Speakers). There is no change in the audio quality, but the resources used instantly decrease. The only problem with this is that I can no longer play/hear any audio from other apps/games (so basically VLC monopolises the card). Also, this is not possible under Wine, so I can't achieve the same thing for foobar2000, or other Windows apps/games.
I haven't made any custom config files for ALSA, except to disable the HDMI audio output (so that the normal analogue output is used by default in all apps/games), and I've done that in /etc/modprobe.d/intel-disable-hdmi.conf with this as it's content:

Code: Select all

options snd_hda_intel enable=0,1
The soundcard that I'm using is an integrated one, and it's a Realtek ALC887-VD.
Does anyone know what I could do to fix this issue, while still being able to play multiple streams of audio at the same time?
Last edited by andoru on 2017-11-01 20:11, edited 1 time in total.

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: ALSA - High CPU usage on the default device

#2 Post by debiman »

obvious question:
when did the problem start, and what happened between now and then?
also:
do you know which process takes the cpu? have you checked with top/htop (make sure to see other users also)?

andoru
Posts: 272
Joined: 2014-03-14 16:59

Re: ALSA - High CPU usage on the default device

#3 Post by andoru »

debiman wrote:obvious question:
when did the problem start, and what happened between now and then?
I don't know, as I haven't looked at this closely until lately. I did so because some other processes and apps seemed slower after starting to play some music in the background.
I haven't done any modifications to the audio part except when I first installed the OS, so I'm assuming this issue was there since the beginning. What I did at the beginning was to remove Pulseaudio and created the file I mentioned above to disable the HDMI audio provided by the integrated audio chip, and so I could make sure that all the running programs on my system use the correct device.
I'm guessing this issue has something to do with dmix and/or resampling, but I don't know how to fix it.
debiman wrote:also:
do you know which process takes the cpu? have you checked with top/htop (make sure to see other users also)?
I mentioned this above, it's VLC and foobar2000. I ran htop, and I ran it again with root. All the processes are started/owned by my user.

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: ALSA - High CPU usage on the default device

#4 Post by debiman »

dunno.
maybe the common denominator is alsa, maybe it's something else.
if the processes with high cpu cycles are vlc and foobar2000, that's where i'd start the research.
or maybe troubleshooting: can you reproduce this with every media playback? every player, starting with aplay?

andoru
Posts: 272
Joined: 2014-03-14 16:59

Re: ALSA - High CPU usage on the default device

#5 Post by andoru »

As I mentioned in my first post, I've changed the subdevice in VLC, and the CPU problem went away. It can't be anything but ALSA.

Post Reply