{"id":143,"date":"2014-05-15T23:35:00","date_gmt":"2014-05-15T21:35:00","guid":{"rendered":"http:\/\/www.emperial.dk\/?p=143"},"modified":"2014-05-16T00:14:02","modified_gmt":"2014-05-15T22:14:02","slug":"hdhomerun-hd3-4dc-and-linux-yousee-and-stofa","status":"publish","type":"post","link":"https:\/\/www.emperial.dk\/?p=143","title":{"rendered":"HDHomeRun HD3-4DC and Linux (Yousee and Stofa)"},"content":{"rendered":"<p>A buddy of mine bought 2 <a title=\"https:\/\/www.silicondust.com\/products\/hdhomerun\/hdhomerun-4dc\/\" href=\"https:\/\/www.silicondust.com\/products\/hdhomerun\/hdhomerun-4dc\/\" target=\"_blank\">HDHomeRun HD3-4DC<\/a> and wanted to use this on a Ubuntu 12.04 Server<br \/>\nthe problem with Ubuntu 12.04 is that the DVB kernel headers was removed from the normal header packages.<\/p>\n<p>first make sure that your network has a working DHCP server, and that the HDhomeRun is connected to the network and that the antenna cable is connected.<\/p>\n<p>first we need to add the ppa repository from<br \/>\n<a title=\"https:\/\/launchpad.net\/~tfylliv\/+archive\/dvbhdhomerun\" href=\"https:\/\/launchpad.net\/~tfylliv\/+archive\/dvbhdhomerun\" target=\"_blank\">https:\/\/launchpad.net\/~tfylliv\/+archive\/dvbhdhomerun<\/a><\/p>\n<h1><strong>Adding the PPA repository:<\/strong><\/h1>\n<pre>$ add-apt-repository ppa:tfylliv\/dvbhdhomerun\r\n$ apt-get update\r\n<\/pre>\n<p><strong>Kernel driver:<\/strong><br \/>\nNext we need the kernel headers and the missing headers:<br \/>\ni my case the server was using the following kernel, linux-image-3.8.0-39-generic<br \/>\nthe missing DVB headers i grapped from <a title=\"kernel.org\" href=\"http:\/\/www.kernel.org\" target=\"_blank\">Kernel.org<\/a><\/p>\n<pre># apt-get install linux-headers-3.8.0-39-generic\r\n$ wget https:\/\/www.kernel.org\/pub\/linux\/kernel\/v3.x\/linux-3.8.tar.gz\r\n<\/pre>\n<p>Unpack the headers:<\/p>\n<pre>$ tar zxfv linux-3.8.tar.gz\r\n<\/pre>\n<p>Next copy the missing headers to the Ubuntu headers:<\/p>\n<pre>$ cp -R \/linux-3.8\/drivers\/media\/dvb-core\/* \/usr\/src\/linux-headers-3.8.0-39\/drivers\/media\/dvb-core\/\r\n$ cp -R \/linux-3.8\/drivers\/media\/dvb-frontends\/* \/usr\/src\/linux-headers-3.8.0-39\/drivers\/media\/dvb-frontends\/\r\n<\/pre>\n<p>Installing the hdhomerun dkms and utils:<\/p>\n<pre>$ apt-get install dvbhdhomerun-dkms dvbhdhomerun-utils\r\n<\/pre>\n<p>This should build the dvb_hdhomerun kernel driver and the userhdhomerun userspace and the necessary script to run the userspace service,<\/p>\n<p>try initialize the kernel driver:<\/p>\n<pre>$ modprobe dvb_hdhomerun\r\n<\/pre>\n<p>this should give something like this when looking at dmesg<\/p>\n<pre>[   17.893873] HDHomeRun: Begin init, version 0.0.16\r\n[   17.897220] HDHomeRun: Waiting for userspace to connect\r\n[   17.897228] HDHomeRun: End init\r\n<\/pre>\n<h1>Setup Tuners:<\/h1>\n<p>We need to locate the names of the tuner in my case we actually have 2 of them :).<\/p>\n<pre>$ hdhomerun_config discover\r\nhdhomerun device 141001A7 found at 192.168.1.136\r\nhdhomerun device 14101464 found at 192.168.1.130\r\n<\/pre>\n<p>make a note of the name of the tuners i my case they are named: 141001A7 and 14101464.<br \/>\nnext edit \/etc\/dvbhdhomerun<\/p>\n<pre>$ nano \/etc\/dvbhdhomerun\r\n<\/pre>\n<p>my config file looks like this:<\/p>\n<pre># Remember to exchange the XXXXYYYY-Z with the serial number of your HDHomeRun\r\n# tuner:\r\n\r\n# Auto detect tuner type is not possible in all cases, so you can force it\r\n# DVB-C\r\n# DVB-T\r\n# ATSC\r\n\r\n[141001A7-0]\r\ntuner_type=DVB-C\r\n\r\n[141001A7-1]\r\ntuner_type=DVB-C\r\n\r\n[141001A7-2]\r\ntuner_type=DVB-C\r\n\r\n[141001A7-3]\r\ntuner_type=DVB-C\r\n\r\n[14101464-0]\r\ntuner_type=DVB-C\r\n\r\n[14101464-1]\r\ntuner_type=DVB-C\r\n\r\n[14101464-2]\r\ntuner_type=DVB-C\r\n\r\n[14101464-3]\r\ntuner_type=DVB-C\r\n\r\n# You can use a full name including tuner ID. Meaning the tuner will appear as\r\n# \"HDHomeRun DVB-C 1234EA3D-0\" instead of just \"HDHomeRun DVB-C\" in for example\r\n# TVHeadend.\r\n\r\n[141001A7-0]\r\nuse_full_name=true\r\n\r\n[141001A7-1]\r\nuse_full_name=true\r\n\r\n[141001A7-2]\r\nuse_full_name=true\r\n\r\n[141001A7-3]\r\nuse_full_name=true\r\n\r\n\r\n\r\n[14101464-0]\r\nuse_full_name=true\r\n\r\n[14101464-1]\r\nuse_full_name=true\r\n\r\n[14101464-2]\r\nuse_full_name=true\r\n\r\n[14101464-3]\r\nuse_full_name=true\r\n\r\n\r\n# You can disable certain tuners. As default all detected hdhomeruns are used\r\n\r\n#[XXXXYYYY-2]\r\n#disable=true\r\n\r\n\r\n# Enable additional logging  from libhdhomerun itself\r\n[libhdhomerun]\r\nenable=true\r\nenable=true\r\nlogfile=\/var\/log\/dvbhdhomerun_libhdhomerun.log\r\n<\/pre>\n<p>Now restart the dvbhdhomerun-utils<\/p>\n<pre>$ service dvbhdhomerun-utils restart\r\n<\/pre>\n<p>dmesg should show something like this:<\/p>\n<pre>[   19.050534] hdhomerun: userhdhomerun connected\r\n[   19.050574] hdhomerun: userhdhomerun connected\r\n[   19.050588] hdhomerun: creating dvb device for 141001A7-0\r\n[   19.050688] DVB: registering new adapter (HDHomeRun)\r\n[   19.110568] HDHomeRun HDHomeRun.0: DVB: registering adapter 0 frontend 0 (HDHomeRun DVB-C 141001A7-0)...\r\n[   19.110685] HDHomeRun0: DVB Frontend registered\r\n[   19.110688] HDHomeRun0: Registered DVB adapter0\r\n[   19.110728] hdhomerun: device \/dev\/hdhomerun_data0 created\r\n[   19.110971] hdhomerun: userhdhomerun connected\r\n[   19.110984] hdhomerun: creating dvb device for 141001A7-1\r\n[   19.111065] DVB: registering new adapter (HDHomeRun)\r\n[   19.112681] HDHomeRun HDHomeRun.1: DVB: registering adapter 1 frontend 0 (HDHomeRun DVB-C 141001A7-1)...\r\n[   19.112722] HDHomeRun1: DVB Frontend registered\r\n[   19.112724] HDHomeRun1: Registered DVB adapter1\r\n[   19.112762] hdhomerun: device \/dev\/hdhomerun_data1 created\r\n[   19.112959] hdhomerun: userhdhomerun connected\r\n[   19.112969] hdhomerun: creating dvb device for 141001A7-2\r\n[   19.113058] DVB: registering new adapter (HDHomeRun)\r\n[   19.115142] HDHomeRun HDHomeRun.2: DVB: registering adapter 2 frontend 0 (HDHomeRun DVB-C 141001A7-2)...\r\n[   19.115221] HDHomeRun2: DVB Frontend registered\r\n[   19.115223] HDHomeRun2: Registered DVB adapter2\r\n[   19.115264] hdhomerun: device \/dev\/hdhomerun_data2 created\r\n[   19.115456] hdhomerun: userhdhomerun connected\r\n[   19.115467] hdhomerun: creating dvb device for 141001A7-3\r\n[   19.115558] DVB: registering new adapter (HDHomeRun)\r\n[   19.115904] HDHomeRun HDHomeRun.3: DVB: registering adapter 3 frontend 0 (HDHomeRun DVB-C 141001A7-3)...\r\n[   19.115951] HDHomeRun3: DVB Frontend registered\r\n[   19.115953] HDHomeRun3: Registered DVB adapter3\r\n[   19.115985] hdhomerun: device \/dev\/hdhomerun_data3 created\r\n<\/pre>\n<p>The hdhomerun is now connected.<\/p>\n<p><strong>Scanning for DVB-C channels:<\/strong><br \/>\nAs i live in Denmark, the most common DVB-C providers are <a title=\"Yousee\" href=\"http:\/\/www.yousee.dk\" target=\"_blank\">Yousee<\/a> and <a title=\"Stofa\" href=\"http:\/\/www.stofa.dk\" target=\"_blank\">Stofa<\/a><\/p>\n<p><strong>for Yousee use the following setup:<\/strong><\/p>\n<pre>$ hdhomerun_config XXXXXXXX set \/sys\/dvbc_modulation a8qam64-6875\r\n<\/pre>\n<p><strong>for Stofa use the following setup:<\/strong><\/p>\n<pre>$ hdhomerun_config XXXXXXXX set \/sys\/dvbc_modulation a8qam64-6900\r\n<\/pre>\n<p><strong>Next we need to setup the tuners:<\/strong><\/p>\n<pre>$ hdhomerun_config  XXXXXXXX set \/tuner0\/channelmap eu-cable\r\n$ hdhomerun_config  XXXXXXXX set \/tuner1\/channelmap eu-cable\r\n$ hdhomerun_config  XXXXXXXX set \/tuner2\/channelmap eu-cable\r\n$ hdhomerun_config  XXXXXXXX set \/tuner3\/channelmap eu-cable\r\n<\/pre>\n<p>finally we can scan the muxes for channels:<\/p>\n<pre>$ hdhomerun_config XXXXXXXX scan 0 hdhomerun.log\r\n<\/pre>\n<p>the scan takes some time so be patience<\/p>\n<p>if you are going to install <a title=\"https:\/\/tvheadend.org\/\" href=\"https:\/\/tvheadend.org\/\" target=\"_blank\">TVheadend<\/a> you should do the following to the log file:<\/p>\n<p><strong>For Yousee:<\/strong><\/p>\n<pre>awk '{if ($1 ~ \/SCANNING\/) print \"\\n\" $2; else print $0}' hdhomerun.log | awk 'BEGIN { RS = \"\" ; FS = \"\\n\" } { if (length($4) &gt; 0) print \"C \" $1 \" 6875000 NONE QAM64\" }' &gt; dk-YouSee\r\n<\/pre>\n<p><strong>For Stofa:<\/strong><\/p>\n<pre>awk '{if ($1 ~ \/SCANNING\/) print \"\\n\" $2; else print $0}' hdhomerun.log | awk 'BEGIN { RS = \"\" ; FS = \"\\n\" } { if (length($4) &gt; 0) print \"C \" $1 \" 6875000 NONE QAM64\" }' &gt; dk-Stofa\r\n<\/pre>\n<p>the generated file is readable by TVheadend and should make it more easy to find the channels.<\/p>\n<p><strong>Notes:<\/strong><\/p>\n<p>If you wanne update the firmware for the hdhomerun you can do this with the hdhomerun_config tool by doing:<br \/>\n(check Silicondust&#8217;s homepage for newer releases)<\/p>\n<pre>$ wget http:\/\/download.silicondust.com\/hdhomerun\/hdhomerun3_dvbc_firmware_20140121.bin\r\n$ hdhomerun_config 14101464 upgrade hdhomerun3_dvbc_firmware_20140121.bin\r\n<\/pre>\n<h1>References:<\/h1>\n<p><a title=\"http:\/\/tommy.winther.nu\/wordpress\/2013\/06\/21\/opsaetning-af-hdhomerun-dual\/\" href=\"http:\/\/tommy.winther.nu\/wordpress\/2013\/06\/21\/opsaetning-af-hdhomerun-dual\/\" target=\"_blank\">http:\/\/tommy.winther.nu\/wordpress\/2013\/06\/21\/opsaetning-af-hdhomerun-dual\/<\/a><br \/>\n<a title=\"https:\/\/launchpad.net\/~tfylliv\/+archive\/dvbhdhomerun\" href=\"https:\/\/launchpad.net\/~tfylliv\/+archive\/dvbhdhomerun\" target=\"_blank\">https:\/\/launchpad.net\/~tfylliv\/+archive\/dvbhdhomerun<\/a><br \/>\n<a title=\"http:\/\/sourceforge.net\/apps\/trac\/dvbhdhomerun\/wiki\/FAQ#RebuildkernelmodulesinUbuntu\" href=\"http:\/\/sourceforge.net\/apps\/trac\/dvbhdhomerun\/wiki\/FAQ#RebuildkernelmodulesinUbuntu\" target=\"_blank\">http:\/\/sourceforge.net\/apps\/trac\/dvbhdhomerun\/wiki\/FAQ#RebuildkernelmodulesinUbuntu<\/a><br \/>\n<a href=\"http:\/\/sourceforge.net\/apps\/trac\/dvbhdhomerun\/wiki\/UbuntuPackages\" title=\"http:\/\/sourceforge.net\/apps\/trac\/dvbhdhomerun\/wiki\/UbuntuPackages\" target=\"_blank\">http:\/\/sourceforge.net\/apps\/trac\/dvbhdhomerun\/wiki\/UbuntuPackages<\/a><br \/>\n&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A buddy of mine bought 2 HDHomeRun HD3-4DC and wanted to use this on a Ubuntu 12.04 Server the problem with Ubuntu 12.04 is that the DVB kernel headers was removed from the normal header packages. first make sure that &hellip; <a href=\"https:\/\/www.emperial.dk\/?p=143\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,25],"tags":[27,12,26,9],"class_list":["post-143","post","type-post","status-publish","format-standard","hentry","category-linux","category-ubuntu-linux","tag-hdhomerun","tag-linux-2","tag-tvheadend","tag-ubuntu"],"_links":{"self":[{"href":"https:\/\/www.emperial.dk\/index.php?rest_route=\/wp\/v2\/posts\/143","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.emperial.dk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.emperial.dk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.emperial.dk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.emperial.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=143"}],"version-history":[{"count":21,"href":"https:\/\/www.emperial.dk\/index.php?rest_route=\/wp\/v2\/posts\/143\/revisions"}],"predecessor-version":[{"id":165,"href":"https:\/\/www.emperial.dk\/index.php?rest_route=\/wp\/v2\/posts\/143\/revisions\/165"}],"wp:attachment":[{"href":"https:\/\/www.emperial.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=143"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.emperial.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=143"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.emperial.dk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=143"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}