Sunday, July 8, 2012

XBMC PVR How-to : Enhance your XBMC Media Center Experience with Live TV


*** Updated August 2012:  ***
- Debian/Ubuntu package 3.0
************************

The Goal:


Configuring Live TV on XBMC is a great way to complete your Media Center Experience, that's called "PVR" and will allow you to watch real Live TV on your XBMC Box!

For now, XBMC does not take in charge TV Backend functionality, it will only act as a frontend to a backend software that will manage the TV Tuner.

Please take a look on my Full XBMC post to help you installing and configuring XBMC:
xbmc-install-and-config-howto-for-linux

What you need:


  • A working XBMC installation embedded with PVR (if you used my post, PVR is part of XBMC compilation)
  • A TV Tuner: USB Tv tuner, PCI, HD HomeRun... I used an "Elgato Eye TV Diversity"
  • A Backend software to manage TV flow, i recommend you to use tvheadend

Step 1: Install the TV Tuner and check configuration

First, plug the TV Tuner to your Linux Box and check kernel log, if everything are right you should get this kind of message:

[30943.681707] dvb-usb: found a 'Elgato EyeTV Diversity' in cold state, will try to load a firmware
[30943.690351] dvb-usb: downloading firmware from file 'dvb-usb-dib0700-1.20.fw'
[30943.929564] dib0700: firmware started successfully.
[30944.432325] dvb-usb: found a 'Elgato EyeTV Diversity' in warm state.
[30944.432550] dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer.
[30944.432693] DVB: registering new adapter (Elgato EyeTV Diversity)
[30944.700631] DVB: registering adapter 0 frontend 0 (DiBcom 7000PC)...
[30944.936519] DiB0070: successfully identified
[30944.936530] dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer.
[30944.936749] DVB: registering new adapter (Elgato EyeTV Diversity)
[30945.106998] DVB: registering adapter 1 frontend 0 (DiBcom 7000PC)...
[30945.348653] DiB0070: successfully identified
[30945.348689] Registered IR keymap rc-dib0700-nec
[30945.349030] input: IR-receiver inside an USB DVB receiver as /devices/pci0000:00/0000:00:12.2/usb1/1-1/rc/rc1/input8
[30945.349535] rc1: IR-receiver inside an USB DVB receiver as /devices/pci0000:00/0000:00:12.2/usb1/1-1/rc/rc1
[30945.349911] dvb-usb: schedule remote query interval to 50 msecs.
[30945.349924] dvb-usb: Elgato EyeTV Diversity successfully initialized and connected.

You can see here that the kernel successfully identified the USB TV Tuner ind installed appropriated driver, i recommend you to double check Linux compatibility before buying your TV Tuner.

Step 2: Install tvheadend as the Backend for Live TV


Download and install the backend, we will use "tvheadend".
In my opinion, this a very good TV Backend that comes with a nice web interface.

So we will use the last version which is still running underdevelopment to get all tvheadend functionalities. Tvheadend is small and does not have much dependencies, so compilation will be easy.

(You can also install the version provided by your package system, on Debian derived systems: sudo apt-get install tvheadend)

Install tvheadend:

Source:
$ wget https://github.com/downloads/tvheadend/tvheadend/tvheadend_3.0_amd64.deb
$ sudo dpkg -i tvheadend_3.0_amd64.deb

Answer to installation questions, admin username and password.

After installation, you should find the process up (ps -ef - grep tvheadend) and an init script in "/etc/init.d/tvheadend".

Configuration files will be located in "/home/hts/.hts" and "/home/hts/.xmltv".

Step 3: Configure tvheadend

Connect to tvheadend web interface using your localhost URL (change localhost by appropriated backend IP or Hostname if required) :



Click on "Configuration" then "TVAdapters" and choose your adapter:


Scan for channels:

Select "Add DVB Networks By Location" and add your country and/or city, in my case i choosed defaults and my country to ensure i would get all channels.

Immediately after that, tvheadend will start to scan for channels.
Be patient, this will required a long time to end.
In "General" screen (middle right page), you will see the scan result and running "services". (which mean channels found by the adapter)

Take a look on "Multiplexes", if your antenna and your TV Tuner works fine you should see something like that:



When the scan process will be over, you will see channels in "Services":



Wait for the full process to end, then in "General", click "Map DB services to channels".

Additionally, edit others services and map them manually to channels.

Edit channels to end configuration:

Go in "Channels" panel and edit any channel to set channel number and so on.

If you want channels logo to appear in XBMC (and you will because that's pretty), we will have to use an apache instance for it, so create an apache instance, download channels logo (use google image) and save them to the root folder of the apache instance.

In a few words:

  • Edit new Apache service (don't forget to add the port if new in ports.conf) and tune to your needs:

<VirtualHost *:10000>
        ServerAdmin webmaster@localhost
        ServerName      xxxxxxxxxxxxxxx
        DocumentRoot /media/xbmc/logo
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
        LogLevel notice
        CustomLog /var/log/apache2/access.log combined
        ErrorLog /var/log/apache2/error.log
        ServerSignature On
</VirtualHost>


  • Restart apache and add channels logo pictures to the apache root folder
  • Ensure it works by get one logo as for an example with your web browser
  • In tvheadend "Channels" panel, configure the logo, configuration example:


You're done with tvheadend configuration, i recommend you to simply add it to your session automatic run. (if your are using a desktop session)

You may also simply write an initrc script shell to start and stop it as a service.

Finally configure the XML Grabber:

On Debian derived systems, install xmltv:

sudo apt-get install xmltv

Go to XML TV panel, select your country and follow instruction.


Step 4: Configure XBMC


Go back in XBMC and activate the PVR addon for tvheadend frontend (system>settings>add-ons>activated addons):


If you don't run tvheadend on same host, or if you wanted to set an admin user in tvheadend, configure it.

If you haven't changed anything, default configuration is fine and will work.



Save, and Go to "Live TV", XBMC will automatically get channels configuration, final result:




Everything works ^^ Take a look on time-shift function or record, some of them are still under improvement and may not be as stable as it should but work.

As a conclusion, your XBMC Media Center is now really complete, enjoy :-)

FAQ and issues:

  • Failing to start tvheadend with message of segmentation fault

I experienced this several time for unknown reasons after reboots, it was always caused by some king o epg file corruption.

I you experience this, just remove the file and restart:


rm ~/.hts/tvheadend/epgdb








27 comments:

  1. Hi,
    I've been setting up xbmc on a Zotac AD02, following the howto on
    http://wiki.xbmc.org/index.php?title=HOW-TO:Install_XBMC_on_Ubuntu_with_AMD_GPU

    I did encounter some problems with a TT-connect® S2-3650 CI usb DVB receiver. I realized after some time that it was related to the usb connection. I've been using the usb 3.0 slots for that device. After connecting it to usb 2.0 it worked fine.
    This is just a hint to whoever might find this helpful.
    But I still have one problem left. HD-channels are not playing fluently. Does anyone have an idea, what this might come from?
    I'd be grateful for any hint.

    Regards

    Thomas

    ReplyDelete
    Replies
    1. Youresuchageek: Xbmc Pvr How-To : Enhance Your Xbmc Media Center Experience With Live Tv >>>>> Download Now

      >>>>> Download Full

      Youresuchageek: Xbmc Pvr How-To : Enhance Your Xbmc Media Center Experience With Live Tv >>>>> Download LINK

      >>>>> Download Now

      Youresuchageek: Xbmc Pvr How-To : Enhance Your Xbmc Media Center Experience With Live Tv >>>>> Download Full

      >>>>> Download LINK Ts

      Delete
  2. Hi,

    My Howto in XBMC Wiki is outdated, please follow this one:
    http://youresuchageek.blogspot.fr/2012/06/xbmc-install-and-config-howto-for-linux.html

    About your sound issue, AMD can't play as for now HD audio, so the stream is automatically downmixed, are you using HDMI or SPDIF output ?

    Ensure you are using xbmc-xvba (not eden, to take advantage of embedded audio engine) with latest Catalyst version (12.10 quantal version recommended) and your are using a sound device without software conversion, when launching XBMC take a look at main log and sound devices the audio engines founds, then try several devices ^^

    Regards

    Guilhem

    ReplyDelete
  3. Thanks for the reply, Guilhem,
    I'll try on Sunday. Regarding the problems with HD channels I'm sorry that I didn't make myself clear. sound is playing fine with hdmi output. It's the picture of those channels that are not showing fluently. I will post the result when I set up the system again.

    Best regards

    Thomas

    ReplyDelete
    Replies
    1. Hi Thomas, ok you're speaking about H264 5.1 Level videos, fro this to work follow my post step by step, install last Catalyst version and set "sudo aticonfig --set-pcs-u32=MCIL,HWUVD_H264Level51Support,1", ensure to stop X11 before running this command. (sudo service lightdm stop)

      Regards,

      Delete
    2. Hey Guilhem, I've finished the new setup and it's working flawlessly. Thank you very much for your help and that fine tutorial.

      Thomas

      Delete
    3. Hi Thomas, you're welcome, i'm glad to hear it :-)

      Guilhem

      Delete
  4. Hi, after download (first instruction) during installation file .deb appear this messagge error :
    dpkg: error processing tvheadend_3.0_amd64.deb (--install):
    package architecture (amd64) does not match system (armhf)
    Errors were encountered while processing:
    tvheadend_3.0_amd64.deb

    Is possible to installa tvheadend per raspbmc in raspberry?

    ReplyDelete
    Replies
    1. Hi,

      You are trying to install an Amd64 (X86 type processor) pre-compiled package under a totally different processor type (Arm) which can't work.

      You have to download tvheadend sources and compile it manually under your Rpi.

      Look at:
      https://www.lonelycoder.com/redmine/projects/tvheadend/wiki/download

      Download last version, untar, run configure and make.

      Extracted from readme:

      How to build for Linux
      ======================

      First you need to configure:

      $ ./configure

      If any dependencies are missing the configure script will complain or attempt
      to disable optional features.

      $ make

      Build the binary, after build the binary resides in 'build.linux/'.
      Thus, to start it, just type:

      $ ./build.linux/tvheadend

      Settings are stored in $HOME/.hts/tvheadend

      Cheers

      Delete
  5. "Add DVB Nertwork by location..." only lists one city in Canada. How can I add my city or region via configuration?

    ReplyDelete
  6. Youresuchageek: Xbmc Pvr How-To : Enhance Your Xbmc Media Center Experience With Live Tv >>>>> Download Now

    >>>>> Download Full

    Youresuchageek: Xbmc Pvr How-To : Enhance Your Xbmc Media Center Experience With Live Tv >>>>> Download LINK

    >>>>> Download Now

    Youresuchageek: Xbmc Pvr How-To : Enhance Your Xbmc Media Center Experience With Live Tv >>>>> Download Full

    >>>>> Download LINK

    ReplyDelete

Please feel free to comment ^^