<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	>

<channel>
	<title>My Delusional Dream &#187; mythtv</title>
	<atom:link href="http://patrick.wagstrom.net/weblog/category/linux/mythtv/feed/" rel="self" type="application/rss+xml" />
	<link>http://patrick.wagstrom.net/weblog</link>
	<description>Thoughts of a Cautious Technocrat</description>
	<pubDate>Tue, 16 Dec 2008 01:28:44 +0000</pubDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Pieces of MythTV (December 2008 Hardware Edition)</title>
		<link>http://patrick.wagstrom.net/weblog/2008/12/13/pieces-of-mythtv-december-2008-hardware-edition/</link>
		<comments>http://patrick.wagstrom.net/weblog/2008/12/13/pieces-of-mythtv-december-2008-hardware-edition/#comments</comments>
		<pubDate>Sat, 13 Dec 2008 18:52:45 +0000</pubDate>
		<dc:creator>Patrick Wagstrom</dc:creator>
		
		<category><![CDATA[mythtv]]></category>

		<category><![CDATA[drobo]]></category>

		<category><![CDATA[hardware]]></category>

		<category><![CDATA[hauppauge]]></category>

		<category><![CDATA[hdhomerun]]></category>

		<guid isPermaLink="false">http://patrick.wagstrom.net/weblog/?p=525</guid>
		<description><![CDATA[I&#8217;m five and half years into my journey with MythTV, and in that time I&#8217;ve managed to upgrade my system several times.  Back in 2006 I wrote a tutorial on installing MythTV under Ubuntu with a pcHDTV card and a firewire tuner.  While some pieces of the machine remain the same, most of the pieces [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m five and half years into my journey with MythTV, and in that time I&#8217;ve managed to upgrade my system several times.  Back in 2006 I wrote a tutorial on <a href="http://patrick.wagstrom.net/tutorials/mythTV64/" >installing MythTV under Ubuntu with a pcHDTV card and a firewire tuner</a>.  While some pieces of the machine remain the same, most of the pieces of hardware have changed pretty radically since then.</p>
<h3>The Case</h3>
<p>I use an <a href="http://www.antec.com/usa/productDetails.php?lan=us&amp;id=15730" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.antec.com');">Antec Overture 2</a> desktop ATX case.  It&#8217;s a fairly large case, but it fits nicely in my entertainment center.  Unfortunately, it vents out the sides and is a tight fit, so I had to do some modifications to give it better airflow.   I removed the back of my entertainment center where the box is (a virtual necessity given the number of cables hanging from it), and also cut a hole in the side leading from one compartment to another so the vent from the power supply would go somewhere.</p>
<p style="text-align: center;">
<div id="attachment_566" class="wp-caption aligncenter" style="width: 330px"><img class="size-full wp-image-566" title="Antec Overture II Case" src="http://patrick.wagstrom.net/weblog/wp-content/uploads/2008/12/overtureii.jpg" alt="Antec Overture II Case" width="320" height="204" /><p class="wp-caption-text">Antec Overture II Case</p></div>
<h3>The Processor</h3>
<p>Athlon 64&#215;2 4400+ on an MSI K8N-Neo4 Platinum motherboard - the processor is overclock slightly, so it runs at about the speed of a 5000+.  You can&#8217;t get either of these anymore because it&#8217;s a socket 939 setup.  It goes to show you don&#8217;t need a beast of a Core i7 processor to run MythTV.  It has 2GB of Dual Channel DDR ram.  Certainly not anything overly spectacular, but pleanty for running a combination Front End/Backend MythTV setup.  While viewing 1080i HD the processor maxes out at about 60% utilization of a single core.</p>
<h3>Capture Devices</h3>
<p>Analog cable is captured using a WinTV PVR-250 PCI card.  The card is getting pretty old, being the first part of MythTV I bought, but it still works like a champ.  I capture HD Cable using an <a href="http://www.silicondust.com/products/hdhomerun" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.silicondust.com');">HD HomeRun</a>.  I only have the most basic of cable, just enough for broadcast and a few other channels, so the HD HomeRun can capture everything.</p>
<div id="attachment_567" class="wp-caption aligncenter" style="width: 410px"><img class="size-full wp-image-567" title="Silicon Dust HD HomeRun" src="http://patrick.wagstrom.net/weblog/wp-content/uploads/2008/12/hdhomerun.jpg" alt="Silicon Dust HD HomeRun Networked HDTV Tuner" width="400" height="244" /><p class="wp-caption-text">Silicon Dust HD HomeRun Networked HDTV Tuner</p></div>
<p>I can&#8217;t stress how great the HD HomeRun is for capturing OTA or QAM unencrypted cable.  It&#8217;s a small box, about the size of a few DVDs stacked, with two coax inputs, and an ethernet output.  These boxes have virtually zero configuration, and because it just speaks a simple network protocol, you don&#8217;t need to worry about kernel changes or drivers.  The HD HomeRun just works.  Additionally, because it takes up no slots in the computer, you can go with a much smaller form factor system.  This works nicely for my eventual goal of putting everything on a Mac Mini or comparable tiny system.</p>
<h3>Storage</h3>
<p>Inside of the Overture 2 I have two 320GB hard drives running as a mirrored pair.  This is where my database, photos, and music live.  For recordings I have a 1st generation <a href="http://www.drobo.com/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.drobo.com');">Drobo</a> with 2&#215;1GB and 2&#215;320GB drives in it, providing about 1.6TB of protected space.  The Drobo is another great device that if you&#8217;re serious about MythTV you should strongly consider getting.  Some folks will complain about the noise, but I&#8217;ve never noticed the Drobo make any notice.  Although, as a disclaimre, I have two fairly large fish tanks in my living room that produce significant noise.  HD actually doesn&#8217;t need that much bandwidth and the Drobo can easily supply enough over USB for all of my needs.  As the limiting factor in the system is the USB bandwidth, you&#8217;re safe going for slightly slower, quieter, and cooler drives like the <a href="http://www.wdc.com/en/products/products.asp?driveid=336" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.wdc.com');">Western Digital GreenPower</a> drives.</p>
<div id="attachment_568" class="wp-caption aligncenter" style="width: 310px"><img class="size-full wp-image-568" title="Data Robotics DROBO Storage Robot" src="http://patrick.wagstrom.net/weblog/wp-content/uploads/2008/12/drobo.jpg" alt="The DROBO USB Storage Robot" width="300" height="300" /><p class="wp-caption-text">The DROBO USB Storage Robot</p></div>
<h3>Display</h3>
<p>Inside the Overture 2 is an nVidia GeForce 6600LE.  It&#8217;s fanless and really underpowered, I won&#8217;t want to play games on it or anything like that, but at the time, it was a decent card to have, unfortunately, it doesn&#8217;t support VDPAU, so at some point it will probably have to go.  This is connected via a DVI-&gt;HDMI cable to a Sharp Aquos 32&#8243; 720p display.  I realize the videophiles are laughing at me because it&#8217;s a small TV, but the picture is quite good, blacks are black, no overscan, etc.  The display is driven at near-native resolution of 1366&#215;768.  This means I lose a 1 pixel strip on each side.  I&#8217;ve never actually noticed that.</p>
<h3>Remote Control</h3>
<p>Currently I use the remote control that came with the WinTV PVR-250 and the attached IR dongle.  It&#8217;s been supported just as long as the WinTV card has and it works well enough.  There are some strange quirks where sometimes it seems to fall asleep and needs to be &#8220;woken up&#8221;.  In addition, it only accepts IR codes from Hauppauge remotes.  The HD Homerun also has an IR receiver that is more generic and should work with most remotes.  I haven&#8217;t gotten a chance to play with that yet, however.</p>
<h3>Future Upgrades</h3>
<p>For my current cable signal, it seems as though this works quite nicely.  If I were to add components to my MythTV box in the future it would most likely be a <a href="http://www.hauppauge.com/site/products/data_hdpvr.html" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.hauppauge.com');">Hauppauge HD-PVR</a> once I get a better selection of cable channels.  At that point, there is a good chance I&#8217;ll reture the PVR-250 card and switch to a much smaller case with everything external.</p>
]]></content:encoded>
			<wfw:commentRss>http://patrick.wagstrom.net/weblog/2008/12/13/pieces-of-mythtv-december-2008-hardware-edition/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Why MythTV 0.22 Will Rock You</title>
		<link>http://patrick.wagstrom.net/weblog/2008/12/11/why-mythtv-022-will-rock-you/</link>
		<comments>http://patrick.wagstrom.net/weblog/2008/12/11/why-mythtv-022-will-rock-you/#comments</comments>
		<pubDate>Thu, 11 Dec 2008 23:01:31 +0000</pubDate>
		<dc:creator>Patrick Wagstrom</dc:creator>
		
		<category><![CDATA[mythtv]]></category>

		<category><![CDATA[hdpvr]]></category>

		<category><![CDATA[hdtv]]></category>

		<category><![CDATA[qt]]></category>

		<category><![CDATA[vdpau]]></category>

		<category><![CDATA[xvmc]]></category>

		<guid isPermaLink="false">http://patrick.wagstrom.net/weblog/?p=495</guid>
		<description><![CDATA[Way back in May of 2003, when the internet was ugly and Web 2.0 didn&#8217;t exist yet, CompUSA had an online deal that caught my eye - a WinTV PVR-250 Hardware MPEG Encoder card for $99 after rebate.  I had been debating the whole media center setup for a while and decided this was good [...]]]></description>
			<content:encoded><![CDATA[<p>Way back in May of 2003, when the internet was ugly and Web 2.0 didn&#8217;t exist yet, CompUSA had an online deal that caught my eye - a <a href="http://www.hauppauge.com/html/wintvpvr250_datasheet.htm" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.hauppauge.com');">WinTV PVR-250 Hardware MPEG Encoder card</a> for $99 after rebate.  I had been debating the whole media center setup for a while and decided this was good time to make the leap.  The state of media center software at the time was pretty shoddy &#8212; convergence was talked about, but rarely happened.  Windows Media Center wasn&#8217;t generally available and <a href="http://www.xbmc.org/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.xbmc.org');">XBox Media Center </a>was still in its infancy.  In either case, recording and playback of liveTV wasn&#8217;t possible.  On the Linux front a war was being waged between <a href="http://www.mythtv.org/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.mythtv.org');">MythTV</a> and <a href="http://freevo.sourceforge.net/" onclick="javascript:pageTracker._trackPageview('/outbound/article/freevo.sourceforge.net');">Freevo</a>.  Freevo had a slick interface and supported almost any capture card, but because it shelled out to other programs for recording and viewing content, it just felt weird.  Furthermore, this lack of integration meant you couldn&#8217;t use it like a TiVo to watch and record live TV because one program recorded TV while another played it back, and a notification was made only after it was done recording.  MythTV was still fairly new at the time, and sure enough, just before I got the card, support was added for hardware MPEG encoders that used the <a href="http://www.ivtvdriver.org/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.ivtvdriver.org');">IVTV driver</a> &#8212; such as the WinTV PVR 250.  I&#8217;ve been a reliable MythTV user and occasional hacker since then.</p>
<p>MythTV has developed very slowly since then.  Each new release brings support for a few more capture cards, and maybe some small new features, but it&#8217;s slow development, especially in the user interface category leaves me feeling like I&#8217;m stuck in 2003 still.  With some luck, the upcoming release of MythTV 0.22 will change that.  In fact, MythTV 0.22 could really rock your world, and here is why:</p>
<h3>Hauppauge HD-PVR Support</h3>
<p>MythTV remains one of the best choices if you want to capture high definition video.  The excellent support for pcHDTV cards, and the even better support for the incredible <a href="http://www.silicondust.com/products/hdhomerun" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.silicondust.com');">HD HomeRun</a>, make it trivial to capture over the air or unencrypted cable high definition signals.  However, once spot where MythTV cannot compete with Windows Media center is for premium cable channels.  MythTV will never be able to support cable card tuners  because of the closed environment that these external tuners live in and the current requirement that the tuners be locked to the PC they&#8217;re purchased with.  So while it&#8217;s perfectly easy to watch NBC and CBS in high definition, your hopes of being able to watch HBO or ESPN in high definition are slim at best.  Luckily, Hauppauge has developed an excellent solution that fits the needs of the MythTV user perfectly.</p>
<div id="attachment_497" class="wp-caption aligncenter" style="width: 279px"><img class="size-full wp-image-497" title="hd_pvr_small" src="http://patrick.wagstrom.net/weblog/wp-content/uploads/2008/12/hd_pvr_small.jpg" alt="The Hauppauge HD-PVR" width="269" height="176" /><p class="wp-caption-text">The Hauppauge HD-PVR model 1212</p></div>
<p>The <a href="http://www.hauppauge.com/site/products/data_hdpvr.html" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.hauppauge.com');">Hauppauge HD-PVR</a> is a USB component video capture box that transcodes signals up to 1080i to H.264 video in real time.  On a technical level this means that you take the analog component (YPbPr) output of your cable TV box and it feed to the HD-PVR which will then re-digitize the video.  Quality snobs will note that this results in an extra stage of decompression and recompression which leads to artifacts, and they&#8217;d be right, but luckily the quality of the box is pretty good, so only the most discerning eye will notice a different in video quality.  HD-PVR support will be included in the next release of MythTV.</p>
<h3>QT4 and New Theming</h3>
<p>MythTV is probably one of the last programs on the planet that still uses QT3 as it&#8217;s widget set. It&#8217;s a reliable widget set, with moderate theme capabilities, but it was clearly designed for desktop applications.  You can change the color and appearance of widgets, like scroll bars, buttons, and drop down menus, but it doesn&#8217;t have the ability to provide nice transitions between screens or widgets.  Basically, you&#8217;re working with a static widget set.  Sometime, probably a couple of years ago, MythTV introduced support for OpenGL screen transitions.  Now when I go from the main menu to my recordings screen, a nice transition happens, but on the screen I&#8217;m still using the same static screen with no transitions or interactivity.  Several times on the mailing list people have brought up how subtle transitions and audible feedback would really add to the experience &#8212; after all, TiVo didn&#8217;t succeed because it was the most feature filled, it succeeded because it had the best user interface.  Currently the closest thing that MythTV can do is run an external program that plays a sound when a key is received by the application.  I&#8217;ve tried it, and it&#8217;s just not quite right.</p>
<p>QT4 should fix many of these issues.  Nokia didn&#8217;t purchase QT to sell the widget toolkit as another system for creating desktop applications, they intended to use it in embedded applications where things don&#8217;t always look the same.  The new features of QT4, which was released way back in 2005, really make it a top notch widget set.  In particular, the entire toolkit has been abstracted to work nicely with OpenGL, allowing for better transition effects, theming and mapping of graphics.</p>
<p style="text-align: center;"><object width="425" height="344" data="http://www.youtube.com/v/MXS3xKV-UM0&amp;hl=en&amp;fs=1" type="application/x-shockwave-flash"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/MXS3xKV-UM0&amp;hl=en&amp;fs=1" /><param name="allowfullscreen" value="true" /></object></p>
<p style="text-align: center;">Watch out for the <a title="Trippy Pink Floyd Shit Airline Safety Card" href="http://www.boingboing.net/2008/05/27/mashed-frontier-airl.html" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.boingboing.net');">Trippy Pink Floyd Shit</a> around 1:40</p>
<p style="text-align: left;">When combined with the <a href="http://svn.mythtv.org/trac/ticket/12" onclick="javascript:pageTracker._trackPageview('/outbound/article/svn.mythtv.org');">longstanding ticket to create and have all widgets use libmythui</a>, this means that effects will be getting a much needed overhaul.  Including smooth transitions on sliders and small amounts of sound effects.</p>
<h3>VDPAU Support</h3>
<p>Although PCs have gotten much faster since MythTV first arrived on the scene, MythTV can still tax your computer, especially when watching HD content and doing other things in the background.  It&#8217;s fairly normal for me to watch an HD program as it is recording, record another HD program, flag previous recordings for commercials, and transcode content all at the same time.  You can play with <span class="program">nice</span> settings and realtime threads to ensure the playback never skips a beat, but that&#8217;s difficult, also you&#8217;re ignoring the fact that most modern video cards have video decoding acceleration built in &#8212; effectively allowing you use your CPU only to push data across the bus, while the video card decodes and displays the video.</span></p>
<p>This support is nothing new, it&#8217;s been around for a while in the form of XvMC.  Unfortunately, unless you&#8217;re using a Via or Intel chipset, which are not common in standalone MythTV boxes, you&#8217;re probably going to be out of luck here.  nVidia cards do have some support for XvMC, but you sacrifice color in your on screen display and it rarely works properly.  Furthermore, XvMC has some architectural issues that cause problems when decoding HD size content frames.  In November, however, nVidia announced the creation of <a href="ftp://download.nvidia.com/XFree86/vdpau/doxygen/html/index.html" onclick="javascript:pageTracker._trackPageview('/outbound/article/download.nvidia.com');">VDPAU</a> - the Video Decoding and Presentation API for Unix.  In a nutshell, VDPAU is a moderately generic API, like <a href="http://en.wikipedia.org/wiki/DirectX_Video_Acceleration" onclick="javascript:pageTracker._trackPageview('/outbound/article/en.wikipedia.org');">Microsoft&#8217;s DxVA</a>, that utilizes nVidia&#8217;s PureVideo technology to display video with less CPU.  Taking less CPU means that you can do more in the background and not worry about stuttering &#8212; or, if you&#8217;re concerned about power, heat, and noise, like most MythTV users, you can use a more efficient less power hungry processor.  Just how much better is it?  The guys at <a href="http://www.phoronix.com/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.phoronix.com');">Phoronix</a> did a series of <a href="http://www.phoronix.com/scan.php?page=article&amp;item=nvidia_vdpau&amp;num=1" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.phoronix.com');">VDPAU benchmarks</a> that showed CPU usage with VDPAU go from around 40% with <a href="http://en.wikipedia.org/wiki/X_video_extension" onclick="javascript:pageTracker._trackPageview('/outbound/article/en.wikipedia.org');">X-Video</a> to less than 5% with VDPAU.  More savings for you.</p>
<p>Even though VDPAU has been released for only a month, the MythTV guys are hard at work supporting it.  The first patches for VDPAU support were committed in late November and there has been heavy development ever since.  If you&#8217;re thinking about getting a new video card an nVidia 9000 series looks like it would be a great choice.</p>
<h3>The Future</h3>
<p>I&#8217;ll be honest, there are times that I get really frustrated with the slow progress of MythTV and how the development seems to stall out frequently, despite its fairly large user base.  I don&#8217;t consider myself  a developer of MythTV, but I have contributed patches to the project, such as <a href="http://svn.mythtv.org/trac/ticket/2581" onclick="javascript:pageTracker._trackPageview('/outbound/article/svn.mythtv.org');">allowing the transcoder to crop letterboxes and pillarboxes from videos</a>, and have worked as an advocate of MythTV locally.  Despite this, the poor usuability of the project continually has me evaluating other options, such as <a href="http://www.boxee.tv" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.boxee.tv');">Boxee</a>, which provides integration with Hulu and soon Netflix, but sadly lacks the ability to record and play back television.  I was really excited when Nero announced <a href="http://www.nero.com/enu/liquidtv-introduction.html" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.nero.com');">LiquidTV</a>, but the <a href="http://www.engadgethd.com/2008/10/15/nero-liquidtv-tivo-pc-review/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.engadgethd.com');">poor review and complete inability to record QAM</a> make it useless in hilly Pittsburgh where cable is required if you want to receive more than one or two stations.  So, for the time being, I&#8217;m on MythTV &#8212; it has a suitable wife acceptance factor and allows me to record most everything I want.  The changes coming down the pipe for 0.22 will only make that better.</p>
]]></content:encoded>
			<wfw:commentRss>http://patrick.wagstrom.net/weblog/2008/12/11/why-mythtv-022-will-rock-you/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Fixing Letterboxed and Pillarboxed Transcoding in MythTV</title>
		<link>http://patrick.wagstrom.net/weblog/2007/09/05/aspect-ratio-fix/</link>
		<comments>http://patrick.wagstrom.net/weblog/2007/09/05/aspect-ratio-fix/#comments</comments>
		<pubDate>Wed, 05 Sep 2007 15:08:00 +0000</pubDate>
		<dc:creator>Patrick Wagstrom</dc:creator>
		
		<category><![CDATA[mythtv]]></category>

		<category><![CDATA[code]]></category>

		<category><![CDATA[letterbox]]></category>

		<category><![CDATA[patches]]></category>

		<category><![CDATA[pillarbox]]></category>

		<category><![CDATA[transcode]]></category>

		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://patrick.wagstrom.net/wp/?p=160</guid>
		<description><![CDATA[The recent demise of Zap2it labs and the subsuquent creation of Schedules Direct was a pretty remarkable change in the MythTV community.  The community now has an almost official blessing from a TV Guide service to continue, a pretty big event for most open source projects.
However, due to the infrastructure of MythTV, it&#8217;s not [...]]]></description>
			<content:encoded><![CDATA[<p>The recent demise of <a href="http://labs.zap2it.com/" onclick="javascript:pageTracker._trackPageview('/outbound/article/labs.zap2it.com');">Zap2it labs</a> and the subsuquent creation of <a href="http://www.schedulesdirect.org/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.schedulesdirect.org');">Schedules Direct</a> was a pretty remarkable change in the MythTV community.  The community now has an almost official blessing from a TV Guide service to continue, a pretty big event for most open source projects.</p>
<p>However, due to the infrastructure of MythTV, it&#8217;s not easy to add a new TV listing service.  Rather, the change from Zap2it to Schedules Direct required all users to upgrade their copies of MythTV to the newest version of the stable branch.  Unfortunately, this version still has issues with transcoding high definition signals.  The major issue is that mythtranscode has no knowledge of the program aspect ratio.  It ends up storing pixels that aren&#8217;t needed, such as what happens when a 16:9 signal is sent in a 4:3 signal (letterboxed) or when a 4:3 signal is sent in a 16:9 signal (pillarboxed, much more common). In an ideal world, MythTV would know how to cope with these automatically when transcoding and just magically cut off the offending portions.</p>
<table border="0" cellspacing="10" cellpadding="0">
<tbody>
<tr>
<td><img src="/resources/images/blog/mythPillarBoxed.png" alt="A pillarboxed episode of The Simpsons" width="160" height="90" /><br />
Pillarboxing on an episode of <em>The Simpsons</em> recorded from a high definition source</td>
<td><img src="/resources/images/blog/mythLetterBoxed.png" alt="A letterboxed episode of Frontline" width="160" height="120" /><br />
Letterboxing of a <em>Frontline</em> episode recorded from a standard definition source</td>
</tr>
</tbody>
</table>
<p>While the result is still acceptable, it&#8217;s not perfect and may force you to switch aspect ratios to watch the video. About a year ago, I wrote a patch for MythTV that transcoders to specify a target aspect ratio. This was against MythTV 0.20, and because the newer versions didn&#8217;t provide that many desirable features, I never updated the patch or my installation of MythTV. Facing the impending loss of guide data just days before that start of the NFL season, and only weeks before the start of the new TV season, I updated the patch for MythTV 0.20.2. You can find the <a href="http://svn.mythtv.org/trac/ticket/2581" onclick="javascript:pageTracker._trackPageview('/outbound/article/svn.mythtv.org');">transcoding aspect ratio patch in the MythTV Trac system</a>.</p>
<p>The patch still is far from perfect, and you&#8217;ll need some cron hackery to get it to work right. The main reason is because although MythTV allows you to create non-standard transcoder names in the frontend, it won&#8217;t let you use them for anything but the default transcoder. To get around this, you&#8217;ll need to look into your MythTV database and get the transcoder id numbers. For my system, I created a set of transcoders for 1080i, 720p, and 480i content that give me the option<br />
of whether or not to resize on the transcode and the quality. Run the following command on your database to get a listing of the transcoders:</p>
<pre>mysql&gt; select * from recordingprofiles;
+----+-------------------+-------------------------+-------------------------+--------------+
| id | name              | videocodec              | audiocodec              | profilegroup |
+----+-------------------+-------------------------+-------------------------+--------------+
                                          :: snip ::
| 27 | 1080i No Resize   | MPEG-4                  | MP3                     |            6 |
| 28 | 1080i Resize      | MPEG-4                  | MP3                     |            6 |
| 29 | 720p No Resize    | MPEG-4                  | MP3                     |            6 |
| 30 | 480i No Resize    | MPEG-4                  | MP3                     |            6 |
| 31 | 720p Resize       | MPEG-4                  | MP3                     |            6 |
| 32 | 720p Resize Med   | MPEG-4                  | MP3                     |            6 |
| 33 | 1080i Resize Med  | MPEG-4                  | MP3                     |            6 |
                                          :: snip ::
| 46 | 1080i SDTV Resize | MPEG-4                  | MP3                     |            6 |
| 47 | 720p SDTV Resize  | MPEG-4                  | MP3                     |            6 |
+----+-------------------+-------------------------+-------------------------+--------------+
47 rows in set (0.01 sec)</pre>
<p>Transcoders 27, 28, 29, 31, 32, and 33 all leave the aspect ratio unchanged.  Transcoder 30 is a transcoder that resizes 480i letterboxed content.  Transcoders 46 and 47 remove pillarboxes from SDTV signals transmitted over HD.  You&#8217;ll also notice that I have different transcoders for 1080i and 720p.  You don&#8217;t need to do this, but I have chosen to do this to avoid deinterlacing 720p signals &#8212; saving a bit of time and power.</p>
<p>The final step is to tell MythTV to periodically update the transcoders settings. I use a simple script called from cron about every 15 minutes:</p>
<pre>#!/bin/sh
MYTHPASSWORD="-pYOURMYTHPASSWORD"
echo "update recorded set transcoder=28 where chanid=3215 or chanid=3220 or chanid=3212 or chanid=3211;" | nice -n 10 mysql -u mythtv $MYTHPASSWORD mythconverg
echo "update recorded set transcoder=31 where chanid=3213 or chanid=3210 or chanid=3214;" | nice -n 10 mysql -u mythtv $MYTHPASSWORD mythconverg
echo "update recorded set transcoder=47 where (chanid=3213 or chanid=3210) and (title='The Simpsons' or title='Family Guy' or title='American Dad' or title='King of the Hill');" | nice -n 10 mysql -u mythtv $MYTHPASSWORD mythconverg
echo "update recorded set transcoder=47 where (chanid=3214) and (title='Mad Max' or title='Bubble Boy' or title='Hotel Rwanda');" | nice -n 10 mysql -u mythtv $MYTHPASSWORD mythconverg
echo "update recorded set transcoder=47 where (chanid=3210) and (title='The Ten Commandments');" | nice -n 10 mysql -u mythtv $MYTHPASSWORD mythconverg</pre>
<p>This script forces the 1080i channels to use transcoder 28 and the 720p channels to use transcoder 31.  The last three lines are for pillarboxed programs that recorded off 720p that must be unpillarboxed. With this in the background, when transcoding I select the default transcoder and the output will be properly cropped.</p>
<p>As an added bonus, this patch also fixes issues with mythtranscode not understanding that 1080i signals are encoded as 1088 (due to MPEG files needing to be a multiple of 16 lines high) and encoding a nasty gray bar at the bottom of your 1080i transcoded vidoes. It also cuts off the top eight pixels of most recordings because Comcast normally sends junk on those lines that looks like static.</p>
<p><strong>Update:</strong> I didn&#8217;t mention on my original post that if you schedule a recording via MythWeb, there is an option to set the transcoder.  In this screenshot (click for full size), you can see where I specified the transcoder &#8220;720p SDT Resize&#8221; for use on &#8220;The Simpsons&#8221;.</p>
<p style="text-align: center;"><a href="/resources/images/blog/mythtvTranscoderSet.png"><img src="/resources/images/blog/mythtvTranscoderSet.thumb.png" alt="Setting the transcoder in Mythweb.  Click for full size" width="160" height="94" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://patrick.wagstrom.net/weblog/2007/09/05/aspect-ratio-fix/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Compiling a custom kernel can save you more than $60 a year!</title>
		<link>http://patrick.wagstrom.net/weblog/2006/08/19/custom-powersaving-kernel-for-profit/</link>
		<comments>http://patrick.wagstrom.net/weblog/2006/08/19/custom-powersaving-kernel-for-profit/#comments</comments>
		<pubDate>Sat, 19 Aug 2006 18:56:00 +0000</pubDate>
		<dc:creator>Patrick Wagstrom</dc:creator>
		
		<category><![CDATA[linux]]></category>

		<category><![CDATA[mythtv]]></category>

		<category><![CDATA[acpi]]></category>

		<category><![CDATA[dsdt]]></category>

		<category><![CDATA[kernel]]></category>

		<category><![CDATA[recompile]]></category>

		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://patrick.wagstrom.net/wp/?p=175</guid>
		<description><![CDATA[Hey you!  Yes you!  What does your computer do most of the time?  If it&#8217;s like most computers, it just sits idle.   Sure, some of us may have reasons to leave our computers on all day, such as a web server, or a mythtv box, but even then they sit [...]]]></description>
			<content:encoded><![CDATA[<p>Hey you!  Yes you!  What does your computer do most of the time?  If it&#8217;s like most computers, it just sits idle.   Sure, some of us may have reasons to leave our computers on all day, such as a web server, or a <a href="http://www.mythtv.org/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.mythtv.org');">mythtv</a> box, but even then they sit idle. Fortunately, CPU manufacturers have noticed this fact, and developed technologies that allow processors to slow down when not being fully utilized. On Intel chips this is called SpeedStep, and on AMD chips it&#8217;s called Cool&#8217;n'Quiet.</p>
<p>Here&#8217;s the dirty little secret you may have not known.  Altough the chip you bought may support this wonderful technology, your motherboard may not be able to enable it.  I previously had an AMD Athlon 64 3500+ in an MSI K8N Neo4 Platinum motherboard.  It was really a nice combination, worked pretty zippy. Then, when Conroe dropped at the end of July, I decided to take advantage of the price drops and install a nice new AMD Athlon 64&#215;2 4400+.  After all, it was just a matter of dropping the chip into the board.  When I booted up though, I was greated by something I didn&#8217;t expect.  The new system was drawing 65 watts more power than the old system was.  Ouch.  A look at the <span class="verbatim">dmesg</span> logs showed exactly what the problem was.</p>
<pre>Aug  2 13:06:39 spongebob kernel: [4294696.356000] powernow-k8: Found 1 AMD Athlon 64 / Opteron processors (version 1.50.4)
Aug  2 13:06:39 spongebob kernel: [4294696.360000] powernow-k8: BIOS error - no PSB or ACPI _PSS objects</pre>
<p>That&#8217;s odd, that can&#8217;t be normal.  I looked back further in my logs and found this result from my Athlon 64 3500+:</p>
<pre>Aug  1 07:10:00 spongebob kernel: [4294691.444000] powernow-k8: Found 1 AMD Athlon 64 / Opteron processors (version 1.50.4)
Aug  1 07:10:00 spongebob kernel: [4294691.444000] powernow-k8:    0 : fid 0xc (2000 MHz), vid 0x6 (1400 mV)
Aug  1 07:10:00 spongebob kernel: [4294691.444000] powernow-k8:    1 : fid 0xa (1800 MHz), vid 0x8 (1350 mV)
Aug  1 07:10:00 spongebob kernel: [4294691.444000] powernow-k8:    2 : fid 0x2 (1000 MHz), vid 0x12 (1100 mV)</pre>
<p>Time for some fun hacking away at stuff.  Apparently, this means that my motherboard wasn&#8217;t providing the correct data in the BIOS for the operating system to know how to sleep the processor.  In other words, while my processor could be put to sleep, the motherboard didn&#8217;t know how to.  The specific item that Linux was looking for is called the Differentiated System Description Table, or DSDT for short.  Lucky for us, there is a feature of Linux that lets you override the motherboard DSDT with one you specify yourself.  Wonderfuly, just hack the DSDT and you&#8217;ve got powersaving!  Wait, you didn&#8217;t say we&#8217;re going to hack the firmware of a critical system did you?  Of course I did!  It&#8217;s not that hard, so let&#8217;s jump right in!</p>
<p>First things you&#8217;ll need the Intel ASL compiler/decompiler to build get your DSDT to a readable format.  Under ubuntu this is just a matter of running <span class="verbatim">sudo apt-get install iasl</span>.  Now we&#8217;ll dump the DSDT to a file and then decode it to make it human readable.  Linux is nice in that it makes the DSDT availble at <span class="verbatim">/proc/acpi/dsdt</span></p>
<pre>cat /proc/acpi/dsdt &gt; custom.aml
iasl -d custom.aml</pre>
<p>This should have created a file called <span class="verbatim">custom.dsl</span>. Open it up with your favorite text editor and have a look around.  If you&#8217;re like me and lacking support for power saving, see a block for your processors that looks a little like this at the top:</p>
<pre>    Scope (\_PR)
    {
        Processor (\_PR.CPU0, 0x00, 0x00000000, 0x00) {}
        Processor (\_PR.CPU1, 0x01, 0x00000000, 0x00) {}
    }</pre>
<p>The <span class="verbatim">\_PR</span> scope defines ACPI information for your processors.  As you can see here, it&#8217;s completely empty.  There are a couple of ways to populate it, you can either trust the snippet of code that I&#8217;m going to paste below, or you can try to find your own information from the <a href="http://acpi.sourceforge.net/dsdt/view.php" onclick="javascript:pageTracker._trackPageview('/outbound/article/acpi.sourceforge.net');">ACPI4Linux DSDT Repository</a>.  You&#8217;ll need to find a DSDT for a motherboard that is reasonably close to yours, thus if you&#8217;ve got a socket 939 motherboard, like I do, you&#8217;ll need to find a DSDT for a different socket 939 motherboard. Unfortunately, their site is very difficult to navigate, so if you trust me, you can paste the information here.</p>
<pre>Scope (\_PR)
    {
        Processor (\_PR.CPU0, 0x00, 0x00000000, 0x00)
        {
            Name (_PCT, Package (0x02)
            {
                ResourceTemplate ()
                {
                    Register (FFixedHW,
                        0x00,               // Register Bit Width
                        0x00,               // Register Bit Offset
                        0x0000000000000000, // Register Address
                        )
                },

                ResourceTemplate ()
                {
                    Register (FFixedHW,
                        0x00,               // Register Bit Width
                        0x00,               // Register Bit Offset
                        0x0000000000000000, // Register Address
                        )
                }
            })
            Name (_PSS, Package (0x04) // number of p-states
            {
                Package (0x06)
                {
                    0x0898, // 2200 MHz
                    0x000105B8,
                    0x64,
                    0x07,
                    0xE020298E,
                    0x018E
                },

                Package (0x06)
                {
                    0x07D0, // 2000 MHz
                    0xFCBC,
                    0x64,
                    0x07,
                    0xE0202A0C,
                    0x020C
                },

                Package (0x06)
                {
                    0x0708, // 1800 MHz
                    0xD610,
                    0x64,
                    0x07,
                    0xE0202A8A,
                    0x028A
                },

                Package (0x06)
                {
                    0x03E8, // 1000 MHz
                    0x6B6C,
                    0x64,
                    0x07,
                    0xE0202C82,
                    0x0482
                }
            })
            Name (PSXG, Buffer (0x18)
            {
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
            })
            Name (PSXF, Buffer (0x18)
            {
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
            })
            Name (PSXE, Buffer (0x18)
            {
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
            })
            Name (PSXD, Buffer (0x18)
            {
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
            })
            Name (PSXC, Buffer (0x18)
            {
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
            })
            Name (PSXB, Buffer (0x18)
            {
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
            })
            Method (_PPC, 0, NotSerialized)
            {
                Return (Zero)
            }

            Name (PSSC, 0x0A)
        }
        Processor (\_PR.CPU1, 0x01, 0x00000000, 0x00)
        {
            Name (APCT, Package (0x02)
            {
                ResourceTemplate ()
                {
                    Register (FFixedHW,
                        0x00,               // Register Bit Width
                        0x00,               // Register Bit Offset
                        0x0000000000000000, // Register Address
                        )
                },

                ResourceTemplate ()
                {
                    Register (FFixedHW,
                        0x00,               // Register Bit Width
                        0x00,               // Register Bit Offset
                        0x0000000000000000, // Register Address
                        )
                }
            })
            Name (APSS, Package (0x0A)
            {
                Package (0x06)
                {
                    0x09999999,
                    0x00099999,
                    0x00999999,
                    0x00999999,
                    0x99999999,
                    0x99999999
                },

                Package (0x06)
                {
                    0x09999999,
                    0x00099999,
                    0x00999999,
                    0x00999999,
                    0x99999999,
                    0x99999999
                },

                Package (0x06)
                {
                    0x09999999,
                    0x00099999,
                    0x00999999,
                    0x00999999,
                    0x99999999,
                    0x99999999
                },

                Package (0x06)
                {
                    0x09999999,
                    0x00099999,
                    0x00999999,
                    0x00999999,
                    0x99999999,
                    0x99999999
                },

                Package (0x06)
                {
                    0x09999999,
                    0x00099999,
                    0x00999999,
                    0x00999999,
                    0x99999999,
                    0x99999999
                },

                Package (0x06)
                {
                    0x09999999,
                    0x00099999,
                    0x00999999,
                    0x00999999,
                    0x99999999,
                    0x99999999
                },

                Package (0x06)
                {
                    0x09999999,
                    0x00099999,
                    0x00999999,
                    0x00999999,
                    0x99999999,
                    0x99999999
                },

                Package (0x06)
                {
                    0x09999999,
                    0x00099999,
                    0x00999999,
                    0x00999999,
                    0x99999999,
                    0x99999999
                },

                Package (0x06)
                {
                    0x09999999,
                    0x00099999,
                    0x00999999,
                    0x00999999,
                    0x99999999,
                    0x99999999
                },

                Package (0x06)
                {
                    0x09999999,
                    0x00099999,
                    0x00999999,
                    0x00999999,
                    0x99999999,
                    0x99999999
                }
            })
            Method (APPC, 0, NotSerialized)
            {
                Return (Zero)
            }

            Name (PSSC, 0x0A)
        }
    }</pre>
<p>Whew, that&#8217;s a lot of data.  Don&#8217;t ask me what it all means either, because I&#8217;m not an ACPI expert.  I had to dig around to find a DSDT that worked for me. You&#8217;ll notice that I have 4 different processor power states, which correspond to the states for the AMD Athlon 64&#215;2 4400+.  If your processor doesn&#8217;t have four states, such as with an Athlon 64 3500+, then you&#8217;ll want to comment out the fastest state and change the line that says <span class="verbatim">number of p-states</span> to 3 instead of 4.  Anyway, your mileage may very. You&#8217;ll also notice that the first value for each p-state corresponds to the speed in MHz.  I&#8217;ll leave it as an exercise to the reader what sort of damage you can do with that.</p>
<p>Great, now you&#8217;ve got your spiffy new dsl file &#8212; time to compile it and have the kernel load it.  Running the command <span class="verbatim">iasl -tc custom.dsl</span> will produce a file called <span class="verbatim">custom.hex</span>, this is your new compiled DSDT table for inclusion in the kernel.  If you&#8217;re like me you might have had errors at this point.  If you&#8217;re smart, you can fix them, if you&#8217;re lazy you can ignore them. I chose the latter.</p>
<p>Because you&#8217;re running Ubuntu (right?), the kernel source tree already has support for Cool&#8217;n'Quiet by default.  But it doesn&#8217;t enable drivers that require additional firmware.  Unselect <span class="verbatim">Device Drivers-&gt; Generic Driver Options-&gt; Select only drivers that don&#8217;t need compile-time external firmware</span>.  Then go to <span class="verbatim">Power management options-&gt; ACPI Support -&gt; Include Custom DSDT</span> and give it the path of your custom.hex file you just created.  Finally, rebuild your kernel with <span class="verbatim">make-kpkg clean &amp;&amp; make &#8211;append-to-version=-customdsdt kernel_image modules_image kernel_headers initrd</span>.  This will dump a few new .deb files in /usr/src for you.  Install them with <span class="verbatim">dpkg -i</span> and reboot!</p>
<p>After the reboot your system will take lots of juice initially, that&#8217;s because a system is usually pegged during the boot sequence, but afterwards it should drop precipitously.  You can verify it&#8217;s working by looking at the contents of your <span class="verbatim">dmesg</span> output and see the following:</p>
<pre>[17179571.504000] powernow-k8: Found 2 AMD Athlon 64 / Opteron processors (version 1.50.4)
[17179571.508000] powernow-k8:    0 : fid 0xe (2200 MHz), vid 0x6 (1400 mV)
[17179571.508000] powernow-k8:    1 : fid 0xc (2000 MHz), vid 0x8 (1350 mV)
[17179571.508000] powernow-k8:    2 : fid 0xa (1800 MHz), vid 0xa (1300 mV)
[17179571.508000] powernow-k8:    3 : fid 0x2 (1000 MHz), vid 0x12 (1100 mV)</pre>
<p>If you see something like this, congratulations, it&#8217;s working quite well.  It&#8217;s not perfect, I still get a few little error, but at least Cool&#8217;n'Quiet works now.  My system idle power dropped from 195W to 134W.  Going off the rough estimate the 1W of power costs about $1/yr, that&#8217;s a saving of $61!  Nice.  Of course, it took me about four hours to figure this out, which means it may have not been worth it, espeically if I apply a discount rate to my future savings, but I digress.  If you use external proprietary drivers, it might be worth your time to install module-assistant so those get compiled too.  Otherwise you&#8217;ll boot your nice new kernel without support for 3d acceleration and all that jazz.</p>
<p>After all of this, I found a nice package that allows for the placement of the <a href="http://gaugusch.at/kernel.shtml" onclick="javascript:pageTracker._trackPageview('/outbound/article/gaugusch.at');">DSDT in the initrd</a>.  Using this method, you don&#8217;t need to recompile your kernel every time you change your DSDT &#8212; instead you just rebuild your initrd.  Very nice for situations where the drivers aren&#8217;t always built as part of the kernel build process, such as <a href="http://www.ivtvdriver.org/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.ivtvdriver.org');">IVTV</a>.</p>
<p>Happy Hacking!</p>
]]></content:encoded>
			<wfw:commentRss>http://patrick.wagstrom.net/weblog/2006/08/19/custom-powersaving-kernel-for-profit/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Measuring Power Consumption in MythTV</title>
		<link>http://patrick.wagstrom.net/weblog/2006/08/08/mythtv-power-consumption/</link>
		<comments>http://patrick.wagstrom.net/weblog/2006/08/08/mythtv-power-consumption/#comments</comments>
		<pubDate>Tue, 08 Aug 2006 21:42:00 +0000</pubDate>
		<dc:creator>Patrick Wagstrom</dc:creator>
		
		<category><![CDATA[mythtv]]></category>

		<category><![CDATA[money]]></category>

		<category><![CDATA[power]]></category>

		<category><![CDATA[treehugger]]></category>

		<guid isPermaLink="false">http://patrick.wagstrom.net/wp/?p=153</guid>
		<description><![CDATA[Somehow I&#8217;m becoming a bit of a treehugger. Either that or I&#8217;m just getting annoyed with how hot rooms in the house get as a when I have computers on all the time.  So, I set out to figure out how much power each of my computers takes to run and how much this [...]]]></description>
			<content:encoded><![CDATA[<p>Somehow I&#8217;m becoming a bit of a <a href="http://www.treehugger.com/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.treehugger.com');">treehugger</a>. Either that or I&#8217;m just getting annoyed with how hot rooms in the house get as a when I have computers on all the time.  So, I set out to figure out how much power each of my computers takes to run and how much this power costs.  The easiest way way to measure these devices was with my handy <a href="http://www.p3international.com/products/special/P4400/P4400-CE.html" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.p3international.com');">Kill A Watt</a>. A rather nerdy Christmas present from Kristina a few years ago (I asked for it).</p>
<p>To test each of the machines I hooked them into the Kill A Watt for an extended time period and watched the load of the machine at different times.  For multiple tasks on the machines I would read the Watts from the Kill A Watt and then look at the overall power usage over an extended period.  For the costs of electricity I used the price on my July 2006 statement from <a href="http://www.duquesnelight.com/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.duquesnelight.com');">Duquesne Light</a>, which is about $0.10 per KWh.  At this rate, 1W on all year costs a little under a dollar.</p>
<p>So let&#8217;s start out with dearly departed Scissors.  Unfortunately, I did the measurements on scissors a long time ago and since have given it away, so I couldn&#8217;t get the same variety of measurements.  Scissors was a tiny K6-200 machine with 96MB of ram and a single Quantum Fireball 4.3GB hard disk.  It had no other disk drives, furthermore, the fans on the machine were broken.  Over a course of 100 hours, this machine consumed about 3.78KWh - an average usage of 38W, for a yearly cost of $32.58.</p>
<p>Next I monitored the power consumption of Igel, my current server machine.  This machine is a PIII-900MHz machine with a single 45GB drive, CDRW drive, and 768MB of RAM.  As this is a server, I didn&#8217;t break the load down by category.  Over 1222 hours (yes, that&#8217;s well over a month), the machine used 84.4KWh of power, for an average consumption of 69W and a yearly cost of $59.22.  The faster machine costs nearly twice as much as the older machine to power.</p>
<p>Next up I did two rounds of measurements on Spongebob, my MythTV box.  The first round of tests were done before the upgrade I gave it as a birthday present to myself.  At this point, Spongebob was an AMD Athlon 64 3500+ with 3 200GB hard disks, 1G of ram, a WinTV PVR 250, a pcHDTV HD-3000, and a DVD drive.  I should also mention that the northbridge fan was not working.  Over 96 hours the machine used 10.17KWh of power, for an average of 106W and yearly cost of $90.  When watching HDTV the consumption shot up to 130W - increasing the cost to $111.  Luckily, it&#8217;s not watching HDTV that often.</p>
<p>Recently I upgraded Spongebob to a AMD Athlon 64&#215;2 4400, 1 200GB hard disk, 4&#215;320GB hard disks, 1G of ram, a WinTV PVR 250, 2 pcHDTV HD-3000s, and a DVD drive.  I also replaced the northbridge fan with a really fancy lanboy style cooler.  Initially, however this new configuration did not support CPU throttling.  The load was averaging about 165W making the cost $142.32.  Ouch.  That had to change.  Luckily, there&#8217;s a way to fix this that involves hacking your kernel and your ACPI settings, but I&#8217;ll cover that later.  When monitored over 97 hours the machine consumed 13KWh of power, for an average of 134W and a cost of $114.89. Watching HDTV put the usage back up to 165W, which left the $142.32 cost.  Overall, adding in the upgrades costs me about $25/yr in power costs, significant, but still the MythTV box comes out to less than $10/month.</p>
<p>For convenience, here&#8217;s a chart showing some of the power costs:</p>
<table style="border: 1px solid black;" border="0">
<tbody>
<tr>
<th>Machine</th>
<th>Avg W/h</th>
<th>Yearly Cost</th>
</tr>
<tr>
<td style="border-top: 1px solid black;">Scissors</td>
<td style="border-top: 1px solid black;" align="center">38</td>
<td style="border-top: 1px solid black;" align="center">$32.58</td>
</tr>
<tr>
<td style="border-bottom: 1px solid black;" colspan="3">AMD K6 200, 4.3GB disk, 96MB ram</td>
</tr>
<tr>
<td>Igel</td>
<td align="center">69</td>
<td align="center">$59.22</td>
</tr>
<tr>
<td style="border-bottom: 1px solid black;" colspan="3">PIII 900, 45GB, 768MB ram, CDRW</td>
</tr>
<tr>
<td>Spongebob</td>
<td align="center">106</td>
<td align="center">$90.83</td>
</tr>
<tr>
<td style="border-bottom: 1px solid black;" colspan="3">Athlon 64 3500, 3&#215;200GB, 1GB ram, DVD</td>
</tr>
<tr>
<td>Spongebob</td>
<td align="center">134</td>
<td align="center">$114.89</td>
</tr>
<tr>
<td colspan="3">Athlon 64&#215;2 4400, 1&#215;200GB, 4&#215;320GB, 1GB ram, DVD</td>
</tr>
</tbody>
</table>
<p>So what&#8217;s this going to change?  I had no idea that running Igel was costing me $60/yr for just power.  Wow.  That&#8217;s gonna make me do one of two things, either migrate the virtual machines down to the MythTV box, or purchase a cheapo shared server &#8212; probably the former.  With that sort of change, our power consumption will be under the levels from when I had scissors as my server and the pre-upgraded Spongebob as MythTV (total consumption of 141W) as opposed to 134W now.  Still, I&#8217;m a little shocked at the power consumption of everything.  I wish I had an easier way to quantify the power consumption of individual components of the system.  If anyone knows of a way, short of ramming probes into the<br />
system, I&#8217;d love to hear it.</p>
]]></content:encoded>
			<wfw:commentRss>http://patrick.wagstrom.net/weblog/2006/08/08/mythtv-power-consumption/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Faster Transcoding on AMD Athlon 64&#8217;s</title>
		<link>http://patrick.wagstrom.net/weblog/2006/01/13/faster-transcoding/</link>
		<comments>http://patrick.wagstrom.net/weblog/2006/01/13/faster-transcoding/#comments</comments>
		<pubDate>Fri, 13 Jan 2006 16:18:00 +0000</pubDate>
		<dc:creator>Patrick Wagstrom</dc:creator>
		
		<category><![CDATA[mythtv]]></category>

		<category><![CDATA[power saving]]></category>

		<category><![CDATA[powernow]]></category>

		<category><![CDATA[powernowd]]></category>

		<category><![CDATA[transcoding]]></category>

		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://patrick.wagstrom.net/wp/?p=168</guid>
		<description><![CDATA[
If you&#8217;re running MythTV on an Athlon 64 platform, you&#8217;ve probably
noticed that the CPU throttles itself down when transcoding and cutting
commercials despite the fact that your processor may show as being
100% utilized.  This results in much slower transcoding than one would
normally expect, but saves a small amount of power.


However, if you record a lot [...]]]></description>
			<content:encoded><![CDATA[<p>
If you&#8217;re running MythTV on an Athlon 64 platform, you&#8217;ve probably<br />
noticed that the CPU throttles itself down when transcoding and cutting<br />
commercials despite the fact that your processor may show as being<br />
100% utilized.  This results in much slower transcoding than one would<br />
normally expect, but saves a small amount of power.
</p>
<p>
However, if you record a lot of stuff, or even a moderate amount of stuff<br />
in HD, this property and increased delay can be quite annoying.  It can take several extra hours to cut and<br />
transcode an hour long HDTV program when running at 1.2GHz instead of 2.4GHz (my analysis shows<br />
a greater then 2.5x slowdown - which is weird in itself).  First, let&#8217;s cover the reason<br />
you system slow down, and then we&#8217;ll cover what to do about it.
</p>
<p>
Processors take a lot of power - most of that power is dissipated as heat<br />
because of the resistance in the CPU.  Slowly, <a href="http://www.amd.com/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.amd.com');">AMD</a> and <a href="http://www.intel.com/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.intel.com');">Intel</a> are realizing that people<br />
don&#8217;t want extra heaters in their living room/office, that powering all of these computers puts a real dent in your wallet, and that most of the energy is wasted because the processor is idle anyway.  The solution?  Create not only more effecient processors,<br />
but also allow processors that throttle back to conserve power when they&#8217;re not being fully<br />
utilized.  On the Athlon 64 platform this is called<br />
&#8220;<a href="http://www.amd.com/us-en/Processors/ProductInformation/0,,30_118_9485_9487%5E10272,00.html" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.amd.com');">Cool&#8217;n'Quiet</a>&#8221;<br />
and has been available since the Winchester core chips.
</p>
<p>
Cool&#8217;n'Quiet works with a couple of different parts: a Cool&#8217;n'Quiet enabled<br />
processor, a Cool&#8217;n'Quiet enabled motherboard, and a software program that<br />
manages it all.  If you&#8217;re running a socket 939 Athlon 64, you&#8217;ve almost<br />
certainly got the first two.  Under Linux, you can directly control the CPU<br />
power state through the <span class="verbatim">proc</span> file system, or you can have a<br />
daemon process, such as <span class="verbatim">powernowd</span>, manage it for you.  <a href="http://www.ubuntu.com/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.ubuntu.com');">Ubuntu</a> installs <span class="verbatim">powernowd</span> automatically and starts it for you, so out of the box you&#8217;re getting<br />
some of the benefits of this technology.
</p>
<p>
However, <span class="verbatim">powernowd</span> is configured to not take into<br />
account nice processes.  Normally, this is fine, nice processes can afford to<br />
run a bit slower, that&#8217;s why they&#8217;re nice in the first place.  Unfortunately,<br />
it is only set up to consider nice processes as a group and can&#8217;t differentiate between a process that can&#8217;t take advantage of increase speed and one that can, such as transcoding.  And, as you&#8217;ve probably guessed<br />
by now, to minimize interference with other programs, <a href="http://www.mythtv.org/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.mythtv.org');">MythTV</a> runs transcoding and commercial flagging processes as nice.<br />
To speed them up all we need to do is tell <span class="verbatim">powernowd</span><br />
to take into account nice processes.
</p>
<p>
In Ubuntu, this is really straight forward.  Most startup scripts for daemons<br />
look in the <span class="verbatim">/etc/default</span> directory for local<br />
configuration overrides.  By default <span class="verbatim">powernow</span> is<br />
run with only the <span class="verbatim">-q</span> flag, telling it to be quiet.<br />
If we also pass the <span class="verbatim">-n</span> flag, it will take nice<br />
processes into account when deciding whether or not to throttle the processor.<br />
The solution, create a file <span class="verbatim">/etc/default/powernowd</span><br />
with a single line in it:
</p>
<pre>OPTIONS="-q -n"</pre>
<p>
Then issue the command <span class="verbatim">/etc/init.d/powernowd restart</span><br />
and your computer will no longer throttle itself when transcoding and commercial<br />
flagging.  Enjoy the increased speed of transcoding and happy MythTVing.</p>
]]></content:encoded>
			<wfw:commentRss>http://patrick.wagstrom.net/weblog/2006/01/13/faster-transcoding/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Electromagnetic Lovin</title>
		<link>http://patrick.wagstrom.net/weblog/2005/11/20/emi-love/</link>
		<comments>http://patrick.wagstrom.net/weblog/2005/11/20/emi-love/#comments</comments>
		<pubDate>Mon, 21 Nov 2005 02:20:00 +0000</pubDate>
		<dc:creator>Patrick Wagstrom</dc:creator>
		
		<category><![CDATA[mythtv]]></category>

		<category><![CDATA[asrock]]></category>

		<category><![CDATA[emi]]></category>

		<category><![CDATA[interference]]></category>

		<category><![CDATA[msi]]></category>

		<guid isPermaLink="false">http://patrick.wagstrom.net/wp/?p=154</guid>
		<description><![CDATA[After much frustration I&#8217;ve decided that no matter how many bells and whistles the MSI K8N-Neo4 Platinum has, it still can&#8217;t make up for the fact that I get some crazy bad electormagnetic interference when the system is under heavy load.  At first I thought it was just going to be on the pcHDTV [...]]]></description>
			<content:encoded><![CDATA[<p>After much frustration I&#8217;ve decided that no matter how many bells and whistles the <a href="http://www.msi.com.tw/program/products/mainboard/mbd/pro_mbd_detail.php?UID=637" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.msi.com.tw');">MSI K8N-Neo4 Platinum</a> has, it still can&#8217;t make up for the fact that I get some crazy bad electormagnetic interference when the system is under heavy load.  At first I thought it was just going to be on the pcHDTV HD-3000 card, but today during the Steelers game, while I was watching the game while it was recording and had commercial flagging running and the MPEG file just started to crap out.  Then blammo, MythTV died.  This is really annoying.  It doesn&#8217;t appear to actually mess up data on the bus, just the ability of the tuners to pull in channels using internal tuners.</p>
<p>After three weeks of fighting, vengeance will be mine.  I&#8217;m returning the board and getting a new <a href="http://www.asrock.com.tw/product/product_939Dual-SATA2.htm" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.asrock.com.tw');">ASRock 939Dual-SATA2</a> board instead.  This requires me to pick up a firewire card too and means that all the slots will be filled up from the get go.  But whatever, we&#8217;ll see how this works.  I may have to do another return if that doesn&#8217;t work well.</p>
]]></content:encoded>
			<wfw:commentRss>http://patrick.wagstrom.net/weblog/2005/11/20/emi-love/feed/</wfw:commentRss>
		</item>
		<item>
		<title>MythTV, Ubuntu, Athlon64, WinTVPVR, Comcast Digital Cable, and a pcHDTV HD-3000 in a pear tree!</title>
		<link>http://patrick.wagstrom.net/weblog/2005/11/17/mythtv-ubuntu-athlon64-tutorial/</link>
		<comments>http://patrick.wagstrom.net/weblog/2005/11/17/mythtv-ubuntu-athlon64-tutorial/#comments</comments>
		<pubDate>Thu, 17 Nov 2005 16:08:00 +0000</pubDate>
		<dc:creator>Patrick Wagstrom</dc:creator>
		
		<category><![CDATA[mythtv]]></category>

		<category><![CDATA[comcast]]></category>

		<category><![CDATA[hd3000]]></category>

		<category><![CDATA[hdtv]]></category>

		<category><![CDATA[howto]]></category>

		<category><![CDATA[linux]]></category>

		<category><![CDATA[tutorial]]></category>

		<category><![CDATA[ubuntu]]></category>

		<category><![CDATA[x86_64]]></category>

		<guid isPermaLink="false">http://patrick.wagstrom.net/wp/?p=155</guid>
		<description><![CDATA[
I&#8217;ve been writing a nice tutorial on setting up
MythTV on Ubuntu x86_64 over the course of the past few weeks.  Please feel free to browse
it and give feedback.  It still is a work in progress and I could certainly use some help in
some spots.  I should clarify this by explaining that I&#8217;ve [...]]]></description>
			<content:encoded><![CDATA[<p>
I&#8217;ve been writing a nice <a href="/tutorials/mythTV64/mythTV64.xml">tutorial on setting up<br />
MythTV on Ubuntu x86_64</a> over the course of the past few weeks.  Please feel free to browse<br />
it and give feedback.  It still is a work in progress and I could certainly use some help in<br />
some spots.  I should clarify this by explaining that I&#8217;ve got my system more or less working,<br />
with the exception of static on my pcHDTV which I understand is an electro-magnetic interference issue that<br />
I can&#8217;t do anything about.  When I move that card into another computer, I&#8217;ll add details about<br />
that too.
</p>
<p>
For those that are concerned, I&#8217;ll eventually put up a TRAC site for managing the project and<br />
and providing access to the repository of revisions.  My goal is to provide a slightly more up-to-date<br />
and <a href="http://www.ubuntulinux.com/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.ubuntulinux.com');">Ubuntu</a> centric version of <a href="http://wilsonet.com/mythtv/">Jarod<br />
Wilson&#8217;s Fedora MythTV Guide</a>.  I know, that&#8217;s a lot of hoping.  Come on magic<br />
<a href="http://en.wikipedia.org/wiki/Google_juice" onclick="javascript:pageTracker._trackPageview('/outbound/article/en.wikipedia.org');">google juice</a>, lead people to me.</p>
]]></content:encoded>
			<wfw:commentRss>http://patrick.wagstrom.net/weblog/2005/11/17/mythtv-ubuntu-athlon64-tutorial/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Motorola DCT 6200 Firewire Workaround</title>
		<link>http://patrick.wagstrom.net/weblog/2005/11/10/6200-firewire-fix/</link>
		<comments>http://patrick.wagstrom.net/weblog/2005/11/10/6200-firewire-fix/#comments</comments>
		<pubDate>Thu, 10 Nov 2005 23:48:00 +0000</pubDate>
		<dc:creator>Patrick Wagstrom</dc:creator>
		
		<category><![CDATA[mythtv]]></category>

		<category><![CDATA[code]]></category>

		<category><![CDATA[dct6200]]></category>

		<category><![CDATA[firewire]]></category>

		<category><![CDATA[oss]]></category>

		<guid isPermaLink="false">http://patrick.wagstrom.net/wp/?p=166</guid>
		<description><![CDATA[
I wrote a patch for MythTV
that fixes some of the issues with a DCT 6200 being on a system where node 1 is not established.  This is useful
for folks like me have multiple firewire ports on their PCs.   I feel ownership in MythTV now.  Woot.
]]></description>
			<content:encoded><![CDATA[<p>
I wrote a <a href="http://cvs.mythtv.org/trac/changeset/7836" onclick="javascript:pageTracker._trackPageview('/outbound/article/cvs.mythtv.org');">patch</a> for <a href="http://www.mythtv.org/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.mythtv.org');">MythTV</a><br />
that fixes some of the issues with a DCT 6200 being on a system where node 1 is not established.  This is useful<br />
for folks like me have multiple firewire ports on their PCs.   I feel ownership in MythTV now.  Woot.</p>
]]></content:encoded>
			<wfw:commentRss>http://patrick.wagstrom.net/weblog/2005/11/10/6200-firewire-fix/feed/</wfw:commentRss>
		</item>
		<item>
		<title>DVB and Digital Static</title>
		<link>http://patrick.wagstrom.net/weblog/2005/11/09/dvb-digital-noise/</link>
		<comments>http://patrick.wagstrom.net/weblog/2005/11/09/dvb-digital-noise/#comments</comments>
		<pubDate>Wed, 09 Nov 2005 13:32:00 +0000</pubDate>
		<dc:creator>Patrick Wagstrom</dc:creator>
		
		<category><![CDATA[mythtv]]></category>

		<category><![CDATA[dvb]]></category>

		<category><![CDATA[firewire]]></category>

		<category><![CDATA[pchdtv]]></category>

		<category><![CDATA[static]]></category>

		<category><![CDATA[tuner]]></category>

		<guid isPermaLink="false">http://patrick.wagstrom.net/wp/?p=156</guid>
		<description><![CDATA[It kills me how I&#8217;m so close I can feel it, but it&#8217;s completely out of my power to reach a 100% working system right now.  The reason?  I&#8217;m experiencing digital noise on my HDTV tuner card.  This REALLY blows. When the system is at low load, I have no problem recording [...]]]></description>
			<content:encoded><![CDATA[<p>It kills me how I&#8217;m so close I can feel it, but it&#8217;s completely out of my power to reach a 100% working system right now.  The reason?  I&#8217;m experiencing digital noise on my HDTV tuner card.  This REALLY blows. When the system is at low load, I have no problem recording HDTV programs, however, as the load increases, I see lots of noise show up on my system. Apparently, I&#8217;m not the only one having these problems, as <a href="http://www.gossamer-threads.com/lists/mythtv/users/159591" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.gossamer-threads.com');">this thread from the MythTV users list</a> shows.  I&#8217;ve also started a <a href="http://pchdtv.com/forum/viewtopic.php?t=1077" onclick="javascript:pageTracker._trackPageview('/outbound/article/pchdtv.com');">discussion on the pcHDTV.com forums</a>.</p>
<p>So what&#8217;s a guy to do then?  I bought a system to make it HDTV compatible, but the HDTV is sucking it up.  I can get HDTV over the firewire, so I may just have to loose digital cable for right now.  Maybe this is the kick in the ass that I needed to create the mutually exclusive tuners.  Here&#8217;s a brief explanation of what this would do.</p>
<p>Normally, I&#8217;ve got my WinTV PVR-250 hooked up to the cable box via svideo, and the channels are changed through firewire.  This lets me record all the channels out of the cable box in analog mode.  This card is also hooked up to the standard cable input and can tune the lower channels just fine.  In addition, I&#8217;m able to pull the firewire HDTV signal from the box onto my computer.  However, as you can now see, when I pull in the firewire HDTV signal, I&#8217;m going to end up changing channels on the WinTV PVR-250 that is getting it&#8217;s signal over firewire.  So, I&#8217;d like to make it so only one of either the WinTV PVR-250 (with SVideo) and the Firewire cable input can be used at the same time.  Furthermore, it would be neat if as an extension, when the Firewire input was in use, it would automatically let my WinTV PVR-250 know that it should use the standard cable tuner input.  I wonder how hard this would be to hack together.</p>
]]></content:encoded>
			<wfw:commentRss>http://patrick.wagstrom.net/weblog/2005/11/09/dvb-digital-noise/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.717 seconds -->
<!-- Cached page generated by WP-Super-Cache on 2009-01-09 13:38:42 -->
<!-- Compression = gzip -->