Because MythTV frontends & backends are often running 24 hours a day, they can use a significant amount of power. This can be expensive on your power bill. By choosing hardware carefully and configuring it correctly, you can significantly reduce the power usage of your mythbox.
- 1 Hardware Selection
- 2 Automatic powerdown/wakeup
- 3 CPU Frequency Throttling
- 4 Display Power Management
- 5 Hard Drive Spin Down
- 6 Animated Themes
- 7 Preview Window
- 8 Sound Card Powersave
- 9 Tuner Card Powersave
- 10 Network card speed reduction
- 11 SATA Aggressive Link Power Management (ALPM)
- 12 PCI Express (PCIe) Active State Power Management (ASPM)
- 13 Don't enable Commercial detection for commercial-free channels
If designing a new MythBox, choose efficient hardware - low power CPUs, efficient hard drives, and efficient power supplies.
Low power CPUs such as the AMD 5050e 45W series should have more than enough power even for an HDTV frontend, see AMD or Intel Integrated Graphics for more information on performance / power consumption.
See also the frequency scaling selection below to run the cpu at a lower frequency when it's idle; this can save significant power. Forcing underclocking or undervolting for a CPU is possible through the BIOS settings but is advanced and may void your warranty.
Western Digital Green Power drives and Seagate LP drives use much less power than their predecessors, especially when idle (~2W vs ~8W when idle), and should keep up fine with even demanding HDTV setups.
Consider an SSD for the root drive, so that the media drives can spin down easily when not in use. SSDs use as little as 1/2 Watt when idle.
Use onboard video, or a low end discrete adapter. MythTV only needs Xv support and only uses a small amount of performance even for OpenGL render modes. Cards supporting hardware video decoding do this using dedicated hardware and is unrelated to shader performance. For VDPAU, deinterlace filters are run on the shader hardware, however a midrange card will have sufficient performance to use all available filters.
Any card which needs a separate power plug is overkill for Myth's needs, and lower end cards can be purchased fanless, helping create a lower noise machine.
Choose an 80Plus power supply which are much more efficient, and often no more expensive. Note that 80 Plus power supplies are rated for efficiency in the region of approximately 50-90% of total capacity. Therefore it is recommended you purchase the smallest powersupply that can power your system under the highest strain.
Not a lot of information is available on tuner card power draw; if you measure yours, please add it to this list:
* Hauppauge HVR-1250: 6W in idle mode * Hauppauge WinTV Nova-T 500: 20W idling * SiliconDust HDhomerun DUAL HDHR4-2US (gen4): 1.3 watts idle, 1 watt extra per tuner used. * SiliconDust HDhomerun DUAL HDHR3-US (gen3): 2.2 watts idle, 1.7 watt per tuner used.
CPU Frequency Throttling
Reduction in load on the CPU is all handled automatically by the kernel. On Fedora, for example, the cpufrequtils package contains these tools. The kernel has an "ondemand" cpu governor which makes it all easy and automatic.
On a combined frontend/backend, starting the cpuspeed initscript with the ondemand regulator drops power consumption from 97W to 69W, saving 28W!
Display Power Management
DPMS will turn off your display when the PC has been idle for a while
Hard Drive Spin Down
Spinning down you harddrives not only will save power but save the life of your drives.
hdparm can be used to spin down internet IDE and SATA drives. First you must disable access times to the drives to keep them from waking up.
Edit your fstab adding noatime and nodiratime.
LABEL=d3 /tv/d3 xfs rw,noatime,nodiratime 0 0
Now, add hdparm statements to rc.local to set the default spindown time, i have used 20mins as a timeout:
vi /etc/rc.local /sbin/hdparm -S240 /dev/sda
Animated themes can actually add a few watts to your frontend usage! Consider using a non-animated theme, or modify your theme to remove animations. For example, the XBMC theme with scrolling text adds an additional 6W to idle usage.
The Preview window in the recorded show listing causes the CPU to do real work to display it - on my box an extra 15W was used, almost 25% above true idle. Worse, frontends are often left on this menu screen, so it's almost always playing.
Ideally MythTV could time out a preview after a set time, but in the meantime you can simply disable the live thumbnail preview to save power.
Sound Card Powersave
If you're using a sound card with the snd_hda_intel module, you can use the power_save option to tell the card to go into power saving mode after a period of inactivity.
options snd_hda_intel power_save=7200
in modprobe.conf or similar will tell the sound card to sleep after 7200 seconds (2 hours) of inactivity. Some cards work better than others with this; sometimes clicks and pops result, so it may take some experimentation.
Tuner Card Powersave
Many drivers in recent kernels support power save or sleep modes for various components of tuner cards. For this to work, the driver needs to know that the card is idle, so tell your backend to open video cards on demand in the card setup portion of mythtv-setup.
Network card speed reduction
Especially if you have an all-in-one frontend/backend mythbox, you may not need that gig-E connectivity, at least not all the time. You can tune the speed of the link:
# ethtool -s eth0 advertise 0x002 (10 mbit) # ethtool -s eth0 advertise 0x008 (100 mbit) # ethtool -s eth0 advertise 0x020 (1000 mbit) # ethtool -s eth0 advertise 0x03F (auto)
Note however that this doesn't work on all cards. Reducing my card from gig-e to 100 mbit saved a watt. On many switches this will save power on the switch end as well.
SATA Aggressive Link Power Management (ALPM)
ALPM is a power-saving technique that focuses on the SATA link. When enabled, it allows the host controller and the disk to negotiate when to lower the power of the SATA link. When it is enabled, it can provide power savings of anywhere from .5-1.5 Watts per disk, depending on the system.
You could add something like this to your local initscripts (rc.local) to set ALPM to save power at boot time:
for HOST in `seq 0 3`; do echo min_power > /sys/class/scsi_host/host$HOST/link_power_management_policy done
Note that not all hardware supports this feature.
PCI Express (PCIe) Active State Power Management (ASPM)
From the original LKML posting:
PCI Express ASPM defines a protocol for PCI Express components in the D0 state to reduce Link power by placing their Links into a low power state and instructing the other end of the Link to do likewise. This capability allows hardware-autonomous, dynamic Link power reduction beyond what is achievable by software-only controlled power management. However, The device should be configured by software appropriately. Enabling ASPM will save power, but will introduce device latency. This patch adds ASPM support in Linux. It introduces a global policy for ASPM, a sysfs file /sys/module/pcie_aspm/parameters/policy can control it. The interface can be used as a boot option too. Currently we have below setting: -default, BIOS default setting -powersave, highest power saving mode, enable all available ASPM state and clock power management -performance, highest performance, disable ASPM and clock power management By default, the 'default' policy is used currently. In my test, power difference between powersave mode and performance mode is about 1.3w in a system with 3 PCIE links.
You could add:
echo powersave > /sys/module/pcie_aspm/parameters/policy
to your local initscripts (rc.local) to enable this.
Don't enable Commercial detection for commercial-free channels
Tell MythTV which channels are commercial-free, so the commercial detection job won't spend time (and cpu and disk power and energy) looking for something that's not there.