Page 1 of 1

+5W power consumption when playing audio on X201 with Linux

Posted: Mon Sep 12, 2011 4:54 am
by Mike42
Hi folks!

My Thinkpad X201’s power consumption raises from ~12W to ~17W when playing any kind of audio. It seems that the additional power consumption is not caused by interrupts or CPU usage of alsa or pulseaudio. The problem does not occur on Windows XP where the consumption only increases slightly by about half a watt.

I’m using Fedora 15 x86_64 with kernel v2.6.40 (a renamed v3.0 kernel for compatibility reasons) but I’ve also tried a live cd (run from SD-Card) of Bodhi (a minimal Ubuntu derivative which seems to omit PulseAudio) where the problem occurs too.

Since this problem is very annoying I’m highly interested in a solution — any ideas?

Thanks in advance
Michael

€dit: Just wondering if this thread would better fit in the “Thinkpad - General HARDWARE/SOFTWARE questions” subforum. Could an admin please move it if I’m correct?

Re: +5W power consumption when playing audio on X201 with Linux

Posted: Sat Sep 17, 2011 11:37 am
by Volker
Let me start with the obvious... is the Audio power management enabled? E.g. run powertop -> Tunables -> Enable Audio codec power management.

Re: +5W power consumption when playing audio on X201 with Linux

Posted: Sat Sep 24, 2011 1:25 pm
by Mike42
Volker wrote:Let me start with the obvious... is the Audio power management enabled? E.g. run powertop -> Tunables -> Enable Audio codec power management.
Yes.

Code: Select all

[root@hal ~]# cat /sys/module/snd_hda_intel/parameters/power_save
1
[root@hal ~]# cat /sys/module/snd_hda_intel/parameters/power_save_controller 
Y

Re: +5W power consumption when playing audio on X201 with Linux

Posted: Thu Oct 27, 2011 6:18 am
by Mike42
*push* the Problem still exists and is as anoying as ever.

Re: +5W power consumption when playing audio on lenov with Linux

Posted: Mon Oct 31, 2011 2:26 pm
by rzr
This is also affecting lenovo g470 , even on idle I donno if this is related to pulseaudio or alsa

Note, I reported this bug on various boards :

http://rzr.online.fr/q/lenovo

Re: +5W power consumption when playing audio on X201 with Linux

Posted: Tue Jan 24, 2012 4:05 pm
by Mike42
I just tried Ubuntu 12.04 beta with XFCE. The problem still remains. With everything turned off I can get power consumption as low as 7.5W but as soon as I play any music it raises to 13.2W.
It seems to be somehow CPU/RAM-related. If I stress the CPU with mprime’s Blend-test the power consumption goes up to 42W (what a coincidence ;) ) and barely rises by maybe 0.5W (hard to measure because mprime’s load is not really constant) as soon as I play music. Those 0.5W could be inevitable caused by DACs, amplifiers etc. and would be quite okay.

Can anyone confirm this problem? I don’t want to open a bug report in bugzilla.kernel.org without some backing.

Edit: Just did some more testing with 4 instances of md5sum /dev/zero. As you can see in this picture the power consumption raises from 34W to 35W after I start gmpc+mpd at ~30 seconds: http://www.abload.de/image.php?img=cpu36fc7.png
I used

Code: Select all

while true; do bc -l <<< "$(cat /sys/class/power_supply/BAT0/current_now)/10^6*$(cat /sys/class/power_supply/BAT0/voltage_now)/10^6" | tee -a powerlog.txt; sleep 1; done
to record the power consumption. Used kernel is Linux hal 3.2.1-3.fc16.x86_64 #1 SMP Mon Jan 23 15:36:17 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux.

Re: +5W power consumption when playing audio on X201 with Linux

Posted: Wed Feb 22, 2012 11:13 am
by ThinkRob
Wait, so it's actually just +1W due to audio?

Well... yeah, that seems pretty reasonable actually.

My bet is that the audio player(s) that you're using are keeping the CPU out of the deeper C-states. Have you tried checking with powertop to see if that's the case? I know you said that they're not generating too many interrupts, but perhaps they're still keeping the CPU out of C6 et al. Recent Intel chips are *very* efficient in their deepest sleep states, but the challenge is often to get them to stay there...

Re: +5W power consumption when playing audio on X201 with Linux

Posted: Thu Mar 01, 2012 3:37 am
by Mike42
ThinkRob wrote:Wait, so it's actually just +1W due to audio?

Well... yeah, that seems pretty reasonable actually.

My bet is that the audio player(s) that you're using are keeping the CPU out of the deeper C-states. Have you tried checking with powertop to see if that's the case? I know you said that they're not generating too many interrupts, but perhaps they're still keeping the CPU out of C6 et al. Recent Intel chips are *very* efficient in their deepest sleep states, but the challenge is often to get them to stay there...
Very good point!
Take a look:
Without music everything’s fine:
http://www.abload.de/image.php?img=2012 ... 84txlg.png
With music the C3 and C6 values are dropping and in “package” they are dropping to a steady 0.
http://www.abload.de/image.php?img=2012 ... 8dbaf6.png

Especially the “package” values are outstanding. I don’t know what they mean with “package” exactly, but something’s apparently preventing it from sleeping.

Re: +5W power consumption when playing audio on X201 with Linux

Posted: Thu Mar 01, 2012 11:22 am
by ThinkRob
Mike42 wrote: Especially the “package” values are outstanding. I don’t know what they mean with “package” exactly, but something’s apparently preventing it from sleeping.
I believe that "package" refers to the CPU package, i.e. the complete CPU (as opposed to the individual cores.) This would be useful since threads can (and will) shift around from core-to-core. [1]

I don't know what player, codec, bitrate, etc. was used for your test, but what you posted doesn't really seem abnormal. Using the CPU will indeed keep it awake more. :D

Music playback is actually one of those things that people tend to forget about, but which can be rather bad for power savings. It requires constant CPU activity, and depending on your OS's process scheduler, thread/core scheduling, frequency scaling algorithms, etc. can make for some interesting edge cases.

[1] When discussing modern Intel CPUs in detail, we're *rapidly* veering out of my realm of expertise. Most of the processors that I grok at a low level are old enough that "superscalar" was a hot new term when they were new...

Re: +5W power consumption when playing audio on X201 with Linux

Posted: Thu Mar 01, 2012 5:11 pm
by Mike42
ThinkRob wrote: I believe that "package" refers to the CPU package, i.e. the complete CPU (as opposed to the individual cores.) This would be useful since threads can (and will) shift around from core-to-core. [1]
Well, that would include PCI Express, DMI and Memory Controller too, since those have been integrated into the Nehalem (Core i) Microarchitecture.
I don't know what player, codec, bitrate, etc. was used for your test,
I’ve tried several different players, codecs and pluseaudio or plain alsa.
but what you posted doesn't really seem abnormal. Using the CPU will indeed keep it awake more. :D
Yes of course, but apparently the cores themself are not the problem (since their Sleep-States only worsen slightly).
Music playback is actually one of those things that people tend to forget about, but which can be rather bad for power savings. It requires constant CPU activity, and depending on your OS's process scheduler, thread/core scheduling, frequency scaling algorithms, etc. can make for some interesting edge cases.
But but but in WindowsXP it only causes a small increase in power consumption! So there has to be some driver issue somewhere.

Re: +5W power consumption when playing audio on X201 with Linux

Posted: Sun Oct 14, 2012 10:39 am
by Mike42
Someone confirmed my Bugreport :thumbs-UP:
Now we only need a Fix :D

Re: +5W power consumption when playing audio on X201 with Li

Posted: Mon Feb 03, 2014 8:21 am
by spuhpointer
Hi Folks,

Any news about this? Mike42 did you manage to fix this?
Seems kernel developers blames some Alsa shared libraries.
I am getting the same issue +5 watt on Linux mint 16, 64bit, kernel 3.11 when playing musing on my lenovo x201.
This really makes the battery to drain two times faster!

Thanks