You are not logged in.

#1 2010-04-03 10:17:37

spidernik84
Member
From: Italy
Registered: 2009-12-26
Posts: 30

[SOLVED] High cpu usage on audio playback

Hello, i've been trying to fix this since installing Arch, and so far this is my only problem:

As you can see from the screenshot below, every time i'm starting an audio file playback my cpu gets to a 20% load, used by the audio player of choice. This happens with exaile and banshee, while mpg123 uses an 8% (is this a good value?).
scro.th.png
I'm currently using alsa, and here's my lspci (acer aspire one AOA150):

00:00.0 Host bridge: Intel Corporation Mobile 945GME Express Memory Controller Hub (rev 03)
00:02.0 VGA compatible controller: Intel Corporation Mobile 945GME Express Integrated Graphics Controller (rev 03)
00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS/GME, 943/940GML Express Integrated Graphics Controller (rev 03)
00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 02)
00:1c.0 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 1 (rev 02)
00:1c.1 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 2 (rev 02)
00:1c.2 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 3 (rev 02)
00:1c.3 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 4 (rev 02)
00:1d.0 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #1 (rev 02)
00:1d.1 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #2 (rev 02)
00:1d.2 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #3 (rev 02)
00:1d.3 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #4 (rev 02)
00:1d.7 USB Controller: Intel Corporation 82801G (ICH7 Family) USB2 EHCI Controller (rev 02)
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev e2)
00:1f.0 ISA bridge: Intel Corporation 82801GBM (ICH7-M) LPC Interface Bridge (rev 02)
00:1f.2 IDE interface: Intel Corporation 82801GBM/GHM (ICH7 Family) SATA IDE Controller (rev 02)
00:1f.3 SMBus: Intel Corporation 82801G (ICH7 Family) SMBus Controller (rev 02)
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101E/RTL8102E PCI Express Fast Ethernet controller (rev 02)
03:00.0 Ethernet controller: Atheros Communications Inc. AR5001 Wireless Network Adapter (rev 01)

While this are the gstreamer components actually installed:

# powerpill -Qs 'gstream*'
local/gstreamer0.10 0.10.28-1
    GStreamer Multimedia Framework
local/gstreamer0.10-base 0.10.28-1
    GStreamer Multimedia Framework Base plugin libraries
local/gstreamer0.10-base-plugins 0.10.28-1 (gstreamer0.10-plugins)
    GStreamer Multimedia Framework Base Plugins (gst-plugins-base)
local/gstreamer0.10-ffmpeg 0.10.10-1 (gstreamer0.10-plugins)
    Gstreamer FFMpeg Plugin
local/gstreamer0.10-good 0.10.21-1
    GStreamer Multimedia Framework Good plugin libraries
local/gstreamer0.10-good-plugins 0.10.21-1 (gstreamer0.10-plugins)
    GStreamer Multimedia Framework Good Plugins (gst-plugins-good)
local/gstreamer0.10-python 0.10.18-1
    Python bindings for GStreamer 0.10

Any clue? could it have something to do with gstreamer?

Thank you!

Last edited by spidernik84 (2010-09-28 18:51:15)

Offline

#2 2010-04-03 10:26:06

barzam
Member
From: Sweden
Registered: 2009-01-27
Posts: 277

Re: [SOLVED] High cpu usage on audio playback

Does it happen when playing any audio file (mp3, ogg, flac, wav etc)? What's the load in mplayer?

Offline

#3 2010-04-03 11:13:11

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] High cpu usage on audio playback

Does it stay at 20% longer than - say - a second or two? I use mplayer, give it a try.

Offline

#4 2010-04-03 12:12:07

spidernik84
Member
From: Italy
Registered: 2009-12-26
Posts: 30

Re: [SOLVED] High cpu usage on audio playback

Hello, thanks for the fast response smile

I'm now trying with a 45 Kbps OGG, and it's even worse: 30% cpu usage!
On mplayer through console the result is the same as mpg123 and even Totem, for both mp3 or ogg: 8-9%.
The cpu usage is constant, and lasts until i pause or stop the playback. Seems related to the deconding process, somehow, but i can't sort out what causes Banshee, Exaile and even Guayadeque to experience this high usage. No visualizations active in any of these programs.

Offline

#5 2010-04-03 12:41:13

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: [SOLVED] High cpu usage on audio playback

In ALSA, samplerate_best takes a lot more CPU power than the default. Example usage.
Choices: samplerate_best samplerate_medium samplerate samplerate_order samplerate_linear

Offline

#6 2010-04-03 14:47:38

spidernik84
Member
From: Italy
Registered: 2009-12-26
Posts: 30

Re: [SOLVED] High cpu usage on audio playback

brebs wrote:

In ALSA, samplerate_best takes a lot more CPU power than the default. Example usage.
Choices: samplerate_best samplerate_medium samplerate samplerate_order samplerate_linear

Thank you brebs, i think you got the point.
Alsa is upsampling my 44.1KHz music to 48KHz, thus pushing up my cpu usage.
I tried to force alsa to play sounds at 44.1KHz creating /etc/asound.conf and pasting this, but i ended up with randomic errors and no sound (apps are crashing now!)

pcm.!default {
  type plug
  slave.pcm {
    type dmix
    ipc_key 1024
    slave {
       pcm "hw:0,0"
       rate 44100
    }
  }
}

Looks like i have to keep my cpu usage like that neutral

Offline

#7 2010-09-28 18:49:29

spidernik84
Member
From: Italy
Registered: 2009-12-26
Posts: 30

Re: [SOLVED] High cpu usage on audio playback

Ooookay, i solved the problem, in the end! Forget the last post of mine.

You just disable upsampling to 48 KHz configuring your ~/.asoundrc like this:

# ALSA library configuration file

# Include settings that are under the control of asoundconf(1).
# (To disable these settings, comment out this line.)
</home/spidernik84/.asoundrc.asoundconf>
defaults.pcm.dmix.rate 44100

The last line is the one that solves it all. Exaile is now occupying 10% cpu instead of 30%. Still high, i guess is due to my crappy Atom. If anyone has suggestions on how to drop the usage to lower levels just write! smile

Last edited by spidernik84 (2010-09-28 18:50:47)

Offline

Board footer

Powered by FluxBB