<?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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Arie's Blog &#187; Tutorials</title>
	<atom:link href="http://ariekanarie.nl/category/tutorials/feed" rel="self" type="application/rss+xml" />
	<link>http://ariekanarie.nl</link>
	<description></description>
	<lastBuildDate>Mon, 14 Jun 2010 09:48:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Smooth 1080p h264 playback on Linux</title>
		<link>http://ariekanarie.nl/archives/143/smooth-1080p-h264-playback-on-linux</link>
		<comments>http://ariekanarie.nl/archives/143/smooth-1080p-h264-playback-on-linux#comments</comments>
		<pubDate>Wed, 29 Jul 2009 20:22:35 +0000</pubDate>
		<dc:creator>Arie</dc:creator>
				<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://ariekanarie.nl/?p=143</guid>
		<description><![CDATA[I&#8217;ve been struggling for quite some time trying to get 1080p content to play smoothly on my MythTV pc. I managed to get good playback of 720p files by compiling mplayer myself and using a recent version of the closed source nvidia driver. Playing back 1080p content however, was still a problem. I was never [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been struggling for quite some time trying to get 1080p content to play smoothly on my MythTV pc. I managed to get good playback of 720p files by compiling mplayer myself and using a recent version of the closed source nvidia driver.</p>
<p>Playing back 1080p content however, was still a problem. I was never able to get smooth playback with mplayer. Only the xbmc videoplayer could play 1080p smoothly on my system. XBMC is not an option due to the <a title="WAF" href="http://en.wikipedia.org/wiki/Woman_acceptance_factor" target="_blank">WAF</a>, it has to be something that runs from MythTV.</p>
<p>Fooling around with coreavc-for-linux (I love CoreAVC on Windows) got me nowhere. Recompiling, tweaking and updating mplayer/nvidia/xorg, nothing seemed to work.</p>
<p>Until I tried a new version of mplayer from the Debian Multimedia repositories. The mplayer version in that repository has support for a new feature in the linux nvidia drivers that (finally) allows video decoding on the GPU.</p>
<p>The easy steps to get this to work:</p>
<ul>
<li>Download and install the new nvidia linux drivers (180+)</li>
<li>Add the Debian Multimedia repository to your sources.list</li>
<li>Install mplayer from the new Debian Multimedia repository</li>
<li>Start mplayer with &#8216;-vo vdpau -vc ffh264vdpau&#8217;</li>
</ul>
<p>More than a year of tweaking and tinkering made redundant by these easy steps, excellent!</p>
]]></content:encoded>
			<wfw:commentRss>http://ariekanarie.nl/archives/143/smooth-1080p-h264-playback-on-linux/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using MemCached to speed up fragment caching</title>
		<link>http://ariekanarie.nl/archives/46/using-memcached-to-speed-up-fragment-caching</link>
		<comments>http://ariekanarie.nl/archives/46/using-memcached-to-speed-up-fragment-caching#comments</comments>
		<pubDate>Wed, 02 Apr 2008 17:56:04 +0000</pubDate>
		<dc:creator>Arie</dc:creator>
				<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[memcache]]></category>
		<category><![CDATA[memcached]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://ariekanarie.nl/?p=148</guid>
		<description><![CDATA[Like any web 2.0 site, leefjedoel.nl is currently in beta. During this phase we&#8217;re trying to find bottlenecks, fix the last few bugs and optimize heavy parts of the site. During development we already prepared caching for all pages, mostly fragment caching. To expire cache that&#8217;s no longer current, we use sweepers that get called [...]]]></description>
			<content:encoded><![CDATA[<p>Like any web 2.0 site, <a title="leefjedoel.nl" href="http://leefjedoel.nl" target="_blank">leefjedoel.nl</a> is currently in beta. During this phase we&#8217;re trying to find bottlenecks, fix the last few bugs and optimize heavy parts of the site.</p>
<p>During development we already prepared caching for all pages, mostly fragment caching. To expire cache that&#8217;s no longer current, we use sweepers that get called when something relevant is updated. These sweepers only sweep the caches that get outdated.</p>
<p>Because we were unfamiliar with caching and needed to see the result of our fragment caching, we used the file_store to store the generated caches. These files are stored on disk and this way you can easily see how many cache gets generated and what they contain.</p>
<p><strong>Regex and file_store == FAIL</strong></p>
<p>To sweep caches we used regular expressions, this way we could easily sweep all relevant caches at once. This was a bad idea, as you can read <a title="Caching makes your brain explode" href="http://blog.craigambrose.com/past/2007/11/13/caching_makes_your_brain_explode/" target="_blank">here</a> and <a title="Rails expire_fragment(regex) Considered Harmful" href="http://gurge.com/blog/2007/02/04/rails-expire_fragmentregex-considered-harmful/" target="_blank">here</a></p>
<p>During the beta phase the size of the site steadily increased, more users, more goals, more groups. There was a noticeable delay whenever you updated/created something. A short investigation pointed to the cache sweepers as the culprit.</p>
<p>The file_store for cache isn&#8217;t exactly the fastest solution to store your cache, but when you combine it with regex sweepers, things really slow down. Whenever you do a regex sweep, all files in the cache directory get returned (not that surprising if you think of it), and the regex is run against it. So even if you do a sweep on /goals, it will also return files in /users and /groups. As a result, updating your profile could take 15 seconds.</p>
<p><strong>MemCached</strong></p>
<p>We&#8217;d been planning on moving the cache to memcached all along, so this seemed a good opportunity to do it. In the next few paragraphs I&#8217;ll describe how to install memcached, get the correct Rails plugin to make memcached play nice with fragment caching and how to configure your Rails application so it uses your memcache server.</p>
<p><strong>Installation of MemCached on GNU/Linux</strong></p>
<p>First of all, you&#8217;ll need to memcache daemon, assuming you have a nice linux distro you can:</p>
<blockquote><p>sudo apt-get install memcached</p></blockquote>
<p>This will work on Debian, Ubuntu and other Debian-based distro&#8217;s, on Gentoo you can</p>
<blockquote><p>emerge memcached</p></blockquote>
<p>The great thing about memcached is its simplicity, it requires no configuration after installation, just run it.</p>
<p><strong>All about the gems baby</strong></p>
<p>Now we&#8217;ll get the gem to allow Ruby to talk to memcache. There are two gems that do this, Ruby-MemCache and memcache-client. memcache-client is supposed to be faster, so I used that.</p>
<blockquote><p>sudo gem install memcache-client</p></blockquote>
<p><strong>Plugin to play nice with rails</strong></p>
<p>Rails&#8217; fragment caching doesn&#8217;t work with memcached out of the box, you&#8217;ll need a plugin. This plugin also adds a nice bonus to the cache method in views.</p>
<blockquote><p>script/plugin install svn://rubyforge.org/var/svn/zventstools/projects/extended_fragment_cache</p></blockquote>
<div><strong>Environment setup</strong></div>
<p>Now we need to configure your Rails app to use the memcached server. You&#8217;ll need to edit your config/environments/production.rb</p>
<pre name="code" class="ruby">memcache_options = {
:c_threshold = 10_00,
:compression = true,
:debug = false,
:namespace = 'yourappname_or_anything_you_like',
:readonly = false,
:urlencode = false
}
CACHE = MemCache.new(memcache_options)
CACHE.servers = '127.0.0.1:11211'
config.action_controller.fragment_cache_store = CACHE, {}
</pre>
<p><strong>That&#8217;s all folks!</strong></p>
<p>That&#8217;s it, you&#8217;re all done, the &#8216;cache&#8217; method in your views will now use the memcache server.</p>
<p><strong>Oh wait, there&#8217;s an encore</strong></p>
<p>But there&#8217;s more, using memcached you can set expiry times for caches. I edited the plugin for a default expiry time of 1 day. In vendor/plugins/extended_fragment_cache/lib/extended_fragment_cache.rb look for def write(key,content,options=nil)</p>
<pre name="code" class="ruby">
def write(key,content,options=nil)
  expiry = options &amp;&amp; options[:expire] || 1.day
  begin
    set(key,content,expiry)
    rescue ActiveRecord::Base.logger.error("MemCache Error: #{$!}")
    rescue MemCache::MemCacheError = err
    ActiveRecord::Base.logger.error("MemCache Error: #{$!}")
  end
end
</pre>
<p>You can change the 1.day to anything you want. To override this default behaviour, you can use the following code in your views</p>
<pre name="code" class="ruby">
cache('goals/large_cloud', {:expire = 30.minutes.to_i})  do
</pre>
<p>This will make the cache called &#8216;goals/large_cloud&#8217; to expire 30 minutes after it got created.</p>
<p>There are two important things to consider when you move to memcached</p>
<blockquote><p>1. MemCached doesn&#8217;t support regex based expiry of caches. You need to manually enter every cache you want to expire. You can do this in some nice methods of course. Here&#8217;s ours for expiring the cache when a user gets updated.</p>
<pre name="code" class="ruby">
def expire_user_fragments(user)
  fragments = %w[author_icon author_link side_block_friends ..snip...]
  fragments.each do |f|
    expire_fragment("user/#{user.id}/#{f}")
  end
end</pre>
<p>2. Your application will fail when the MemCache server becomes unavailable. If you ever restart MemCache, or if it crashes (haven&#8217;t seen that happen yet), you need to restart your mongrel-cluster/thin/ebb.</p>
<p>3. When you restart MemCache, all cache is cleared, and you need to restart your mongrel-cluster/thin/ebb.</p></blockquote>
<p>This guide only talks about fragment caching, over at <a href="http://www.bencurtis.com/archives/2007/12/painless-rails-action-caching-with-memcached/#more-111">Ben Curtis&#8217; blog</a>, you can read all about action caching.</p>
]]></content:encoded>
			<wfw:commentRss>http://ariekanarie.nl/archives/46/using-memcached-to-speed-up-fragment-caching/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Areca HDD temperature in MRTG</title>
		<link>http://ariekanarie.nl/archives/27/areca-hdd-temperature-in-mrtg</link>
		<comments>http://ariekanarie.nl/archives/27/areca-hdd-temperature-in-mrtg#comments</comments>
		<pubDate>Tue, 07 Aug 2007 18:10:29 +0000</pubDate>
		<dc:creator>Arie</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[ariekanarie.nl]]></category>
		<category><![CDATA[areca]]></category>
		<category><![CDATA[graph]]></category>
		<category><![CDATA[mrtg]]></category>
		<category><![CDATA[raid]]></category>
		<category><![CDATA[temperature]]></category>

		<guid isPermaLink="false">http://ariekanarie.nl/wordpress/archives/75</guid>
		<description><![CDATA[I&#8217;ve been running my Areca RAID array for a few months now and I&#8217;m very pleased with it. The only thing that was bothering me was the lack of MRTG graphs for the attached disks. The disk temperature is an important thing to monitor, because as Google pointed out, a high disk temperature has a [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been running my Areca RAID array for a few months now and I&#8217;m very pleased with it. The only thing that was bothering me was the lack of <a href="http://oss.oetiker.ch/mrtg/" target="_blank">MRTG</a> graphs for the attached disks.<br />
The disk temperature is an important thing to monitor, because as <a href="http://labs.google.com/papers/disk_failures.pdf" title="Google harddisk paper" target="_blank">Google pointed out</a>, a high disk temperature has a significant effect on drive failure.</p>
<p><a href="http://ariekanarie.nl/wordpress/wp-content/uploads/2007/08/hddtemps.PNG" title="HDD temperatures" rel="lightbox"><img src="http://ariekanarie.nl/wordpress/wp-content/uploads/2007/08/hddtemps.PNG" title="HDD temperatures" alt="HDD temperatures" align="right" /></a>Areca has made some excellent tools available to monitor your array and attached disks. For example, Areca&#8217;s web interface can show you all the disk temperatures.</p>
<p>In Areca&#8217;s web interface you have total control over your RAID array. You can add/remove disks, create new arrays and do a check on existing arrays.</p>
<p>But it&#8217;s annoying to have to log in to this web interface just to check the temperatures of the disks. Also, it doesn&#8217;t come with nice graphs and history information. It just shows the current temperatures.</p>
<p><a href="http://mrtg.ariekanarie.nl" target="_new" title="hddtemp-day.png"><img src="http://mrtg.ariekanarie.nl/hddtemp-day.png" title="hddtemp-day.png" alt="hddtemp-day.png" /></a></p>
<p>Areca has also made a CLI utility. Using this utility you can do the same things as in the web interface. I&#8217;ve used the CLI utility to generate the data needed by MRTG. MRTG can only handle 2 datasources in one graph. Having 5 disks total (1 bootdisk, 4 RAID member disks), I would need 3 graphs to monitor the disks. So I decided to create <a href="http://ariekanarie.nl/tutorials/hddtemp" target="_blank">a little BASH script</a> that would take the temperature of the bootdisk, and the average temperature of the 4 RAID disks and feed this to MRTG.</p>
]]></content:encoded>
			<wfw:commentRss>http://ariekanarie.nl/archives/27/areca-hdd-temperature-in-mrtg/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Eggdrop script for controlling HLTV&#8217;s</title>
		<link>http://ariekanarie.nl/archives/9/eggdrop-script-for-controlling-hltvs-wip</link>
		<comments>http://ariekanarie.nl/archives/9/eggdrop-script-for-controlling-hltvs-wip#comments</comments>
		<pubDate>Thu, 31 Aug 2006 11:07:07 +0000</pubDate>
		<dc:creator>Arie</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.ariekanarie.nl/wordpress/2006/08/31/eggdrop-script-for-controlling-hltvs-wip/</guid>
		<description><![CDATA[As one of the founders of online gaming community #cs.gather.nl, part of the Gather Network, I&#8217;ve had quite some dealings with people cheating in online games, and people calling eachother cheaters.There are various ways to fight cheaters in the game Counter-Strike. First there&#8217;s the built-in anti-cheat from the developer, Valve, called Valve Anti-Cheat. Despite it&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>As one of the founders of online gaming community #cs.gather.nl, part of the <a title="Gather Network" href="http://www.gather-network.eu">Gather Network</a>, I&#8217;ve had quite some dealings with people cheating in online games, and people calling eachother cheaters.There are various ways to fight cheaters in the game Counter-Strike. First there&#8217;s the built-in anti-cheat from the developer, Valve, called Valve Anti-Cheat. Despite it&#8217;s name, it does little against most popular cheats.Second there&#8217;s a global blacklist of cheaters, called <a title="SteamBans" href="http://www.steambans.com">Steambans</a>. This will stop people who have cheated before and have been caught by an alert admin, who submitted a recording of the cheater&#8217;s actions to <a title="SteamBans" href="http://www.steambans.com">Steambans</a>.</p>
<p>Third, admins of the match can request a player to record his actions to a so called &#8216;demo&#8217;. If the user would be cheating this would show on a demo. However, no sane player would still cheat while recording a demo.<br />
A few years ago Valve released a piece of software that allows you to watch matches. This software was created due to the increasing popularity of Counter-Strike as an &#8220;e-Sports&#8217; game.</p>
<p>The software, called HLTV, is basically a proxy server that allows people to watch a match without overloading the gameserver. It has a built-in delay, so that spectating people can&#8217;t give vital informatin, like enemy positions, to the players with tools as direct messaging and voice communication.</p>
<p><span id="more-9"></span></p>
<p>HLTV is also able to record a demo. The great advantage of demo&#8217;s recorded by HLTV is that the single HLTV demo records all the actions of all players, and players don&#8217;t have to do anything. If an admin suscpects someone is cheating, he would go into the HLTV console and record a demo. When the match is over he could send this file to him and watch for cheats.</p>
<p>However, with about 30 admins in #cs.gather.nl who normally stay for just a few weeks, it&#8217;s not possible to give them shell access to a <a title="Debian" href="http://www.debian.org">Debian GNU/Linux</a> machine and control the HLTV consoles. It would be much easier to communicate with the HLTV consoles from IRC and only allow operators from #cs.gather.nl (the admins) to execute commands.</p>
<p>To do this, you need an automated chat client, a bot, and a specially written program for ths bot, a script. I had seen IRC bots that appeared to be controlling HLTV&#8217;s, but never found a script that was freely available. It also appeared that most bots depended on so-called &#8220;remote console&#8221; connections to the HLTV&#8217;s.</p>
<p>The remote console, or rcon, is a way of remotely controlling consoles of gameservers. Unfortunately, the developer of Counter-Strike has changed this protocol in the past a few times, leading to non-functional scripts/bots.</p>
<p>I also wanted to try another method of talking to the HTLV consoles. I&#8217;ve decided to let the bot talk to the HLTV consoles using the &#8220;screen&#8221; command. Screen is a GNU tool for running programs in the background. Whenever you want you can bring it back to the foreground and execute commands. It&#8217;s also possible to send commands to a screen in the background and get information from a screen running in the background.</p>
<p>The downside of this approache compared to the remote console approach is that all HLTV proxy&#8217;s have to run on the same physical computer as the bot controlling them. But at that cost, it is more reliable and faster to talk to the HLTV proxy&#8217;s.</p>
<p>To setup your own HLTV&#8217;s which you control with a bot:</p>
<p>Prerequisites:<strong> </strong></p>
<blockquote><p><strong>Eggdrop bot</strong></p>
<p>Instructions for installing eggdrop can be found at <a target="_blank" title="Eggheads" href="http://www.eggheads.org">www.eggheads.org</a></p>
<p><strong>Screen</strong></p>
<p>On Debian/Ubuntu simply apt-get install screen</p></blockquote>
<p><strong>Step 1 &#8211; Install HLTV</strong></p>
<blockquote><p>wget http://www.ariekanarie.nl/tutorials/hltv.tar.bz2</p>
<p>tar vfxj hltv.tar.bz2</p></blockquote>
<p>Set up hltv.cfg and hltv.sh according to your configuration.<br />
<strong>Step 2 &#8211; Runnng HLTV<br />
</strong></p>
<p>You have to run HLTV in a screen. The TCL script will send commands to this screen. If you want to run multiple HLTV&#8217;s, simply copy the installation directory and make the hltv run in a different screenname. You have to run HLTV with the same username as the eggdrop bot, else the eggdrop script can&#8217;t send commands to the screen sessions.<br />
<strong>Step 3 &#8211; Installing/Configuring the HLTV TCL script</strong></p>
<p>First download the hltv script <a title="here" target="_blank" href="http://www.ariekanarie.nl/tutorials/hltv.tcl">here</a> and put it in your eggdrop/scripts directory.<br />
Open hltv.tcl with your favorite text editor and change the following variables to what you need/like.</p>
<blockquote><p>set hltv_channel &#8220;#cs.gather.nl&#8221;<br />
set hltv_command &#8220;!hltv&#8221;</p></blockquote>
<p>Put the names of the screen sessions in a space seperated list.</p>
<p>For example, my hltv screen names are hltv1, hltv2, hltv3, etc&#8230;</p>
<blockquote><p>set hltv_screens {hltv1 hltv2 hltv3 hltv4 hltv5}</p></blockquote>
<p><strong>Step 4 &#8211; Loading the HLTV TCL script</strong></p>
<p>Open the config file of your eggdrop,  and scroll down to the part where all scripts are loaded. Add the following line:</p>
<blockquote><p>source scripts/hltv.tcl</p></blockquote>
<p>Save and exit the editor. Rehash the bot to load the script</p>
<p><strong>Commands for the script</strong></p>
<blockquote><p>!hltv status &#8211; Detailed statusreport<br />
!hltv stat &#8211; Basic statusreport<br />
!hltv  connect ip:port password (optional) &#8211; Connect  to server, takes optional password argument<br />
!hltv  record demoname &#8211; Starts demorecord with name<br />
!hltv  stop &#8211; Disconnects  from server<br />
!hltv  stoprecord &#8211; Stops demorecording on<br />
!hltv  status &#8211; Detailed statusreport for</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://ariekanarie.nl/archives/9/eggdrop-script-for-controlling-hltvs-wip/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>MythTV PVR350 tutorial</title>
		<link>http://ariekanarie.nl/archives/5/mythtv-pvr350-tutorial</link>
		<comments>http://ariekanarie.nl/archives/5/mythtv-pvr350-tutorial#comments</comments>
		<pubDate>Wed, 16 Aug 2006 21:05:14 +0000</pubDate>
		<dc:creator>Arie</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.ariekanarie.nl/wordpress/?p=3</guid>
		<description><![CDATA[I&#8217;ve never managed to finish this tutorial, but luckily thanks to user-friendly distro&#8217;s like Ubuntu, I don&#8217;t think I&#8217;ll have to.  Tutorial for installing MythTV frontend-backend on Debian with Hauppauge 350 capture card Requirements: Hauppauge PVR350 capture card (most parts of this guide will work with other cards) Working Debian Stable/Testing/Unstable installation (Ubuntu will work [...]]]></description>
			<content:encoded><![CDATA[<p><strong>I&#8217;ve never managed to finish this tutorial, but luckily thanks to user-friendly distro&#8217;s like Ubuntu, I don&#8217;t think I&#8217;ll have to. </strong></p>
<p><strong>Tutorial for installing MythTV frontend-backend on Debian with Hauppauge 350 capture card</strong></p>
<p>Requirements:</p>
<ul>
<li>Hauppauge PVR350 capture card (most parts of this guide will work with other cards)</li>
<li>Working Debian Stable/Testing/Unstable installation (Ubuntu will work as well)</li>
<li>Patience</li>
<li>Some experience with kernels, modules, nasty compilation problems</li>
<li>More patience</li>
</ul>
<p><span id="more-5"></span></p>
<p><strong>Step 1 &#8211; Installing kernel 2.6.17</strong><br />
Kernel 2.6.17 has some of the drivers we need available in the kernel, as opposed to previous versions which were only available through the IVTV project (http://ivtvdriver.org)</p>
<p>Note that kernel 2.6.17 is currently only available in the Debian Unstable repository. But you can also get it from <a href="http://www.kernel.org" title="www.kernel.org" target="_blank">www.kernel.org</a><br />
So, get your root-hat on by su root, sudo -s, logging in as root, or whatever you like.</p>
<p>Getting the kernel:</p>
<blockquote><p>apt-get install linux-source-2.6.17</p></blockquote>
<p>After downloading 40MB of kernel source code, comments and kernel jokes, we&#8217;re ready to extract these from the tarball it came in.</p>
<blockquote><p>cd /usr/src<br />
tar vfxj linux-source-2.6.17.tar.bz2<br />
ln -s linux-source-2.6.17 linux</p></blockquote>
<p>Before we can compile a kernel, we&#8217;ll need some stuff to make it all possible.</p>
<blockquote><p>apt-get install build-essential kernel-package libncurses5-dev wget gcc-4.1</p></blockquote>
<p>This should have gotten us all the tools we&#8217;ve need.</p>
<p>We&#8217;re now gonna steal your working kernel configuration, to save you a lot of headaches concerning the compilation of your first kernel.<br />
The config file of your current kernel is located in /boot/config-&#8221;name-of-your-current-kernel&#8221;.<br />
To make it easier, just type the following.</p>
<blockquote><p>cp /boot/config-`uname -r` /usr/src/linux/.config</p></blockquote>
<p>We&#8217;ve now copied your current kernel configuration to the 2.6.17 kernel source directory.</p>
<p>Let&#8217;s do some kernel configuration stuff, don&#8217;t worry, it&#8217;s a ton of fun.</p>
<blockquote><p>cd /usr/src/linux<br />
make menuconfig</p></blockquote>
<p>You&#8217;ll now be presented with the glorious ncurses kernel configuration.</p>
<p><img src="http://www.ariekanarie.nl/gallery2/d/13913-2/kernel0.PNG" alt="ncursues rule" title="ncursues rule" /><br />
Navigate to &#8220;Device drivers&#8221; -&gt; &#8220;Multimedia Support&#8221; and make sure you select &#8220;Video For Linux&#8221; by pressing the &#8220;Y&#8221; key.</p>
<p><img src="http://www.ariekanarie.nl/gallery2/d/13917-2/kernel1.PNG" alt="ncurses rule" title="ncurses rule" /><br />
Go to &#8220;Video Capture Adapters&#8221; and press the M key on the following lines:<br />
BT848 Video For Linux<br />
Conexant 2388x (bt878 successor) support</p>
<p>Go to &#8220;Encoders and Decoders&#8221; and press the M key on the following lines:<br />
Conexant CX2584x audio/video decoders<br />
Philips SAA7113/4/5 video decoders<br />
Philips SAA7127/9 digital video encoders</p>
<p>Exit the kernel configuration menu and save the configuration when asked to do so.</p>
<p>Back at the prompt, you&#8217;ll have to type some stuff to start the kernel compilation.</p>
<blockquote><p>make-kpkg kernel_image</p></blockquote>
<p>This will take a while.</p>
<p>After compiling, you can install the kernel.</p>
<blockquote><p>cd /usr/src<br />
dpkg -i linux-image-2.6.17_i386.deb (the name might be slightly different)</p></blockquote>
<p>After installing the kernel, it should have been put into your bootloader as the new default kernel to boot.<br />
This is a good time to reboot your machine and prey it will work.</p>
<p>Assuming your machine is still working, you should now be in kernel 2.6.17. Congratulations! <img src='http://ariekanarie.nl/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>Step 2. IVTV Installation </strong></p>
<p>We&#8217;re now going to install IVTV.<br />
This is a good time to make a user called mythtv where you can dump all this shit and run mythbackend from in the end.<br />
But first we&#8217;re going to download and &#8216;install&#8217; the firmware for your TV card.<br />
The guys at IVTVdriver.org made this one very easy, so kudos to them.</p>
<blockquote><p>cd /lib/firmware<br />
wget http://dl.ivtvdriver.org/ivtv/firmware/firmware.tar.gz<br />
tar zxvf firmware.tar.gz</p></blockquote>
<blockquote><p>adduser mythtv<br />
cd /home/mythtv<br />
mkdir mythsetup<br />
cd mythsetup<br />
wget http://dl.ivtvdriver.org/ivtv/archive/0.7.x/ivtv-0.7.0.tar.gz<br />
tar zxvf ivtv-0.7.0.tar.gz<br />
cd ivtv-0.7.0<br />
make<br />
make install</p></blockquote>
<p>Because we&#8217;re running kernel 2.6.17, we need lirc (for the remote control) to be built from CVS.<br />
To make life easy for you, you can grab a tarball and compile.</p>
<blockquote><p>cd /home/mythtv/mythsetup<br />
wget http://www.ariekanarie.nl/tutorials/lirc-cvs.tar.gz<br />
tar zxvf lirc-cvs.tar.gz<br />
cd lirc<br />
./configure<br />
make<br />
make install</p></blockquote>
<p>Open /etc/modules in your favourite editor and enter the following modulenames</p>
<blockquote><p>ivtv<br />
msp3400<br />
saa7115<br />
saa7127<br />
tuner<br />
lirc_i2c<br />
ivtv_fb</p></blockquote>
<p>Save and exit.Create a new file called /etc/modprobe.d/ivtv and enter the following in that file:</p>
<blockquote><p>alias char-major-61 lirc_i2c<br />
alias char-major-81 videodev<br />
alias char-major-81-0 ivtv<br />
alias char-major-81-1 bttv<br />
options ivtv ivtv_debug=1<br />
options tuner pal=B</p></blockquote>
<p>Save the file and exit your favourite editor and type the following commands.</p>
<blockquote><p>depmod -a<br />
modprobe ivtv ivtv_fb lirc_i2c lirc_dev</p></blockquote>
<p>This should fire up all the modules we need. Use the command &#8216;dmesg&#8217; to check for any errors regarding the ivtv modules.</p>
<p><strong>Step 3. MythTV installation</strong></p>
<p>The current MythTV release is 0.19.1. For reasons beyond my comprehension, this version is not directly available from the MythTV website (just 0.19).</p>
<p>To get the latest and greatest MythTV, you need to get it from SVN. Don&#8217;t worry, the code is stable, it&#8217;s just not in a tarball.</p>
<p>How to get the good stuff. First we&#8217;ll try to satisfy a load of dependencies for compiling MythTV.</p>
<blockquote><p>apt-get install subversion liblame-dev liblame0 libdvdnav-dev libdvdnav4 libiec61883-0 libiec61883-dev libavc1394-0 libavc1394-dev libasound2-dev libqt3-mt-dev en qt3-dev-tools libqt3-mt-mysql mysql-server<br />
cd /home/mythtv/mythsetup</p>
<p>svn co http://svn.mythtv.org/svn/branches/release-0-19-fixes/mythtv</p>
<p>svn co http://svn.mythtv.org/svn/branches/release-0-19-fixes/mythplugins</p>
<p>svn co http://svn.mythtv.org/svn/branches/release-0-19-fixes/myththemes</p></blockquote>
<p>This should have downloaded MythTV 0.19.1</p>
<p>Now on to compiling.</p>
<blockquote><p>cd /home/mythtv/mythtv/mythsetup/mythtv</p>
<p>./configure</p>
<p>qmake mythtv.pro</p>
<p>make</p>
<p>make install</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://ariekanarie.nl/archives/5/mythtv-pvr350-tutorial/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
