<?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>Marcus Hellberg &#187; Linux</title>
	<atom:link href="http://www.marcushellberg.com/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.marcushellberg.com</link>
	<description>blog.</description>
	<lastBuildDate>Sat, 20 Mar 2010 12:39:50 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Digital TV in Linux</title>
		<link>http://www.marcushellberg.com/2009/12/23/digital-tv-in-linux/</link>
		<comments>http://www.marcushellberg.com/2009/12/23/digital-tv-in-linux/#comments</comments>
		<pubDate>Wed, 23 Dec 2009 18:23:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[dvb-t]]></category>
		<category><![CDATA[tv]]></category>

		<guid isPermaLink="false">http://www.marcushellberg.com/?p=94</guid>
		<description><![CDATA[Watching digital tv in Linux with em2880 devices
Note: This post is from my earlier site. I moved it over here because I see that a lot of people are trying to access it without finding it. It is written in 2007, so all content may not be up to date. You can report successes/failures in [...]]]></description>
			<content:encoded><![CDATA[<h2>Watching digital tv in Linux with em2880 devices</h2>
<p><strong><em>Note: </em></strong><em>This post is from my earlier site. I moved it over here because I see that a lot of people are trying to access it without finding it. It is written in 2007, so all content may not be up to date. You can report successes/failures in the comments so I know if it needs to be updated. </em></p>
<p>I found a really cheap refurbished Pinnacle PCTV USB DVB-T receiver in my local computer store and after googling to make sure it supported Linux I bought it. Here&#8217;s how I made it work in Linux.</p>
<p>The USB stick itself is fairly small, although it is just wide enough to block the other USB port on my laptop. It came with a small antenna with a magnetic stand and a tiny remote. The antenna is connected to the USB stick with a regular antenna connector, you can easily connect it to a better antenna if needed.</p>
<p>In this article I&#8217;ll show you how I first set up the drivers for the tuner, then setting up kaffeine for viewing TV and lastly configuring the remote. The steps should be fairly easy to follow if you&#8217;ve used the console before &#8211; if not, just copy n paste and you should be fine.</p>
<p>This article is about the Pinnacle PCTV USB Stick DVB-T receiver, but the same steps should work for any device using the em2880 driver. According to the em28xx wiki, these devices should also work:</p>
<p><strong>Digital devices:</strong></p>
<ul>
<li>Pinnacle/800e|Pinnacle HD Pro Stick (North American version, NTSC/ATSC)</li>
<li>Kworld 350 U DVB-T</li>
<li>Kworld 310 U</li>
<li>MSI DigiVox A/D (USB2.0)</li>
<li>Hauppauge HVR 950 (NTSC/ATSC)</li>
<li>Hauppauge WinTV HVR 900 M/R: 65008/A1C0</li>
<li>Terratec Cinergy Hybrid T XS &#8211; ZL10353</li>
<li>Terratec Cinergy Hybrid T XS &#8211; MT352</li>
<li>Terratec Cinergy Hybrid T XS France</li>
<li>Terratec Prodigy Hybrid T XS</li>
<li>Terratec Cinergy T XS &#8211; xc3028</li>
<li>Terratec Cinergy T XS &#8211; mt2060</li>
<li>Pinnacle PCTV USB Stick</li>
<li>DNT DA2 Hybrid</li>
<li>Pinnacle PCTV Hybrid Pro Stick</li>
<li>Empire USB 2.0 Pen Dual TV</li>
<li>BestBuy Easy TV USB hybrid</li>
</ul>
<p><strong>Analog devices:</strong></p>
<ul>
<li>Usbgear VD204v9</li>
<li>Leadtek Winfast USB II deluxe</li>
<li>SIIG AVTuner-PVR</li>
<li>Prolink PlayTV USB 2.0</li>
<li>Terratec Cinergy 250 USB</li>
<li>Pinnacle PCTV USB 2</li>
<li>Hauppauge WinTV USB 2</li>
<li>MSI VOX USB 2.0</li>
<li>Pinnacle Dazzle DVC 90</li>
<li>Kworld PVR TV 2800 RF</li>
<li>Hercules Smart TV USB 2.0</li>
<li>MSI Movie Vox</li>
<li>D-Link DUB-T210 TV Tuner</li>
<li>Gadmei UTV 330</li>
<li>Gadmei UTV 310</li>
<li>Supertronindia Supercomp TV USB 2.0</li>
</ul>
<h3>Programs needed</h3>
<p>You will need the following programs for this to work, we&#8217;ll install everything up front so we can concentrate on the more interesting stuff later.</p>
<ul>
<li>a recent kernel with sources, 2.6.15 and newer should be fine (install kernel-sources in SuSE)</li>
<li>Hg from <a href="http://www.selenic.com/mercurial/">http://www.selenic.com/mercurial/</a> (in SuSE you should find a package named mercurial)</li>
<li><a href="http://kaffeine.sourceforge.net/">kaffeine</a> with the <a href="http://xinehq.de/">xine</a> engine (in SuSE, <a href="http://www.marcushellberg.com/pages/projects/suse-on-vaio.php">add packman and guru repositories</a> and install kaffeine, libxine and libxine-dvb)</li>
<li><a href="http://lineak.sourceforge.net/">lineak</a> with kde plugin (on SuSE, install lineakd, lineakd_kde and lineak_defaultplugin)</li>
<li>gcc compiler, is included on most distros by default</li>
<li>dvb package (dvb in SuSE)</li>
</ul>
<p><strong>For Ubuntu (Edgy) you&#8217;ll need the following packages:</strong></p>
<p>All should be available from the default repositories, make sure to have the &#8220;Universe&#8221; repositories enabled (under System&gt;Administration&gt;Software Sources).</p>
<ul>
<li>mercurial</li>
<li>gcc</li>
<li>build-essential</li>
<li>linux-source</li>
<li>linux-headers-`uname -r` (the linux headers for your specific kernel version)</li>
<li>kaffeine (version 0.8 or above. Other dvb watching applications will work as well but only kaffeine will be covered here)</li>
</ul>
<p>Otherwise the install works the same as for SuSE.</p>
<h3>Downloading and compiling the driver</h3>
<p><span style="font-weight: bold;"> </span>Some users will need a firmware file to make their devices work, if you see your device listed here follow the directions, if not continue on to installing the driver.</p>
<p>These devices need firmware version 1:</p>
<ul>
<li>Terratec Cinergy Hybrid T XS (french edition)</li>
<li>Terratec Cinergy T XS</li>
<li>DNT DA2 Hybrid</li>
<li>Kworld 350U</li>
</ul>
<p>These devices need firmware version 2:</p>
<ul>
<li>MSI DigiVox A/D</li>
<li>Kworld 310U</li>
<li>Terratec Cinergy Hybrid T XS (USB ID=0ccd:005e)</li>
</ul>
<p>These devices need firmware version 3:</p>
<ul>
<li>HVR 900 B2C0(sticker on the dev.)</li>
<li>HVR 900 A1C0</li>
<li>Terratec Cinergy Hybrid T XS</li>
<li>Pinnacle PCTV Hybrid Pro</li>
<li>Pinnacle PCTV Hybrid Pro Stick (320e) (USB ID=eb1a:2881)</li>
</ul>
<p>These devices need firmware version 4:</p>
<ul>
<li>Pinnacle HD Pro Stick (North American version, NTSC/ATSC)</li>
</ul>
<p><a href="http://konstantin.filtschew.de/v4l-firmware/">These firmware files can be obtained from here.</a></p>
<p><strong>IMPORTANT:</strong> Download the file into /lib/firmware, then extract them with &#8220;sudo tar zxvf filename.tar.gz&#8221;<br />
<strong>Getting and installing the driver</strong></p>
<p>Create a folder somewhere convenient.</p>
<pre>mkdir driver</pre>
<p>Now, go into that directory and type</p>
<pre>hg clone http://mcentral.de/hg/~mrec/v4l-dvb-kernel</pre>
<p>Which will download a copy of the driver sources to your directory.</p>
<p>Compiling the driver varies a bit depending on if you had to download the firmware or not. If you had to download it keep reading here, if not skip on to part b.</p>
<p>Compiling:</p>
<pre>
<pre>cd v4l-dvb-kernel/v4l
make
sudo make install</pre>
</pre>
<p><strong> You now need to reboot </strong>(bookmark this page so you&#8217;ll find it again).</p>
<h3>The fun part</h3>
<p>Hi and welcome back, I hope the boot didn&#8217;t take too long.</p>
<p>If everything has gone well you should be a few short steps away from viewing tv on your computer.</p>
<p>We still need to load the driver we compiled earlier, as root type in the following.</p>
<pre>modprobe em28xx</pre>
<p>You shouldn&#8217;t get any messages, just be returned to the prompt.</p>
<p>Open up kaffeine either from the menu, or from the console by typing &#8216;kaffeine&#8217;. It should recognize that you</p>
<p>have a dvb adapter and ask you for some additional info.</p>
<p>Select your location and check that everything else is in order and then continue.</p>
<p>In kaffeine you have in the menu bar a DVB menu, select channels from that. Now just press scan and hope. If all went well you&#8217;ll soon start seeing all the channels that have been found. If you can&#8217;t find any channels its most likely because of the tiny little antenna that came with the tuner, either try going to some place with better reception, or plug the antenna cable to a roof-top antenna.</p>
<p>If you&#8217;re happy controlling your viewing with a mouse and keyboard, you&#8217;re done. If you want to get the remote to work as well stay with me for a little while longer.</p>
<h3>Setting up the remote</h3>
<p>The remote is just another input device to the system, just like the extra buttons on newer keyboards, so I decided to use lineak for the task.</p>
<p>I used xev to get the different key codes the buttons on the remote are sending, unfortunately not all of them sent anything. I don&#8217;t know if this is just something that&#8217;s wrong with my remote, or a &#8220;feature&#8221;.</p>
<p>Anyway, here is the section to that I added to /etc/lineakkb.def:</p>
<pre>#### Pinnacle PCTV USB Stick Remote ####

[PCTV]

  brandname = "Pinnacle"

  modelname = "PCTV USB Stick Remote Control"

  [KEYS]

    Mute             = 160

    Record           = 177

    Power            = 222

    Rewind           = 152

    Stop             = 232

    Play|Pause       = 110

    Forward          = 233

    VolumeUp         = 176

    VolumeDown       = 174

  [END KEYS]

[END PCTV]

#### END Pinnacle PCTV USB Stick Remote ####</pre>
<p>If you find the missing key codes, please leave a comment and I&#8217;ll update this.</p>
<p>Save the lineakkb.def file and as a regular user type:</p>
<pre>lineakd -c PCTV</pre>
<p>It will create a configuration file for your keyboard in ~/.lineak/ named lineakd.conf</p>
<p>In this file you can set up what you want all the buttons to do, below is a mine as a sample:</p>
<pre> # LinEAK - Linux support for Easy Access and Internet Keyboards

#  Copyright (c) 2001,2002, 2003

#     Sheldon Lee Wen &lt;leewsb@hotmail.com&gt; (Current Maintainer)

#      and Mark Smulders &lt;Mark@PIRnet.nl&gt;

#  http://lineak.sourceforge.net

#

# lineakd configuration file

#

# example key configuration:

#     play    = "xmms --play-pause"

#     eject    = EAK_EJECT

#

# Lineakd supports the following modifier keys:

#    control alt shift mod2 mod3 mod4 mod5

CdromDevice = /dev/cdrom

Display_align = center

Display_color = 0aff00

Display_font = -adobe-helvetica-bold-r-normal-*-*-240-*-*-p-*-*-*

Display_hoffset = 0

Display_plugin = internal

Display_pos = bottom

Display_soffset = 1

Display_timeout = 3

Display_voffset = 50

KeyboardType = PCTV

MixerDevice = /dev/mixer

RAWCommands = 

Screensaver = 

conffilename = /home/marcus/.lineak/lineakd.conf

keystate_capslock = 

keystate_numlock = 

keystate_scrolllock = 

Forward = "dcop kaffeine KaffeineIface posPlus"

Mute = "KMIX_MUTE"

Play|Pause = "dcop kaffeine KaffeineIface pause"

Power = "kaffeine DVB"

Record = "dcop kaffeine KaffeineIface fullscreen"

Rewind = "dcop kaffeine KaffeineIface posMinus"

Stop = "dcop kaffeine KaffeineIface stop"

VolumeDown = "KMIX_VOLDOWN"

VolumeUp = "KMIX_VOLUP"</pre>
<p>As you see, I had to put the record button to control full screen toggling, as I couldn&#8217;t get the key code for the real full screen button. Please check the <a href="http://lineak.sourceforge.net/index.php?nav=docs">lineak documentation</a> for additional commands, as well as typing &#8216;dcop kaffeine KaffeineIface&#8217; to get a list of all the commands you can send to kaffeine.</p>
<p>To start type</p>
<pre> lineakd&amp;</pre>
<p>To start lineak automatically with KDE make a symbolic link like this:</p>
<pre> ln -s /usr/bin/lineakd /home/marcus/.kde/Autostart/</pre>
<p>So that&#8217;s it, now you should be able to enjoy your favorite tv shows on your computer and control it with the remote (although the effective distance on the remote is probably less than the length of your arm <img src='http://www.marcushellberg.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h3>References</h3>
<p><a href="http://wiki.ubuntu.com/em28xx">The em28xx wiki</a> check this wiki if you have any problems, they are probably solved there.</p>
<p><a href="http://lineak.sourceforge.net/index.php?nav=docs">Lineak documentation</a></p>


<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand">
<ul class="socials">
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.marcushellberg.com/2009/12/23/digital-tv-in-linux/&amp;title=Digital+TV+in+Linux" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.marcushellberg.com/2009/12/23/digital-tv-in-linux/&amp;title=Digital+TV+in+Linux" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.marcushellberg.com/2009/12/23/digital-tv-in-linux/&amp;t=Digital+TV+in+Linux" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=Digital+TV+in+Linux+-+http://b2l.me/b4bj5+(via+@marcushellberg)" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.marcushellberg.com/2009/12/23/digital-tv-in-linux/&amp;title=Digital+TV+in+Linux&amp;summary=Watching%20digital%20tv%20in%20Linux%20with%20em2880%20devices%0D%0ANote%3A%20This%20post%20is%20from%20my%20earlier%20site.%20I%20moved%20it%20over%20here%20because%20I%20see%20that%20a%20lot%20of%20people%20are%20trying%20to%20access%20it%20without%20finding%20it.%20It%20is%20written%20in%202007%2C%20so%20all%20content%20may%20not%20be%20up%20to%20date.%20You%20can%20report%20successes%2Ffailures%20in%20the%20comment&amp;source=Marcus Hellberg" rel="nofollow" class="external" title="Share this on Linkedin">Share this on Linkedin</a>
		</li>
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://www.marcushellberg.com/2009/12/23/digital-tv-in-linux/&amp;title=Digital+TV+in+Linux" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-myspace">
			<a href="http://www.myspace.com/Modules/PostTo/Pages/?u=http://www.marcushellberg.com/2009/12/23/digital-tv-in-linux/&amp;t=Digital+TV+in+Linux" rel="nofollow" class="external" title="Post this to MySpace">Post this to MySpace</a>
		</li>
		<li class="sexy-blogger">
			<a href="http://www.blogger.com/blog_this.pyra?t&amp;u=http://www.marcushellberg.com/2009/12/23/digital-tv-in-linux/&amp;n=Digital+TV+in+Linux&amp;pli=1" rel="nofollow" class="external" title="Blog this on Blogger">Blog this on Blogger</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->

]]></content:encoded>
			<wfw:commentRss>http://www.marcushellberg.com/2009/12/23/digital-tv-in-linux/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
