Kodi Community Forum

Full Version: pvr.mythtv add-on
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
If anyone is interested, here is how I cross compiled the addon on Mythbuntu 14.04 64bit for Raspberry pi running raspbmc (debian wheezy). Bulding on the pi took around an hour, building on my laptop using the cross compile is around 2 minutes (Intel core i7).

sudo apt-get update
sudo apt-get install git automake libtool zip
cd ~
git clone https://github.com/raspberrypi/tools.git --depth 1
export PATH=~/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin:$PATH
cd to the source xbmc-pvr-addons
./bootstrap
./configure --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf
make -C lib/cppmyth -j n (n is the number of cpu cores)
make clean zip -C addons/pvr.mythtv


Now transfer the addon pvr.mythtv-linux-arm.zip to the Raspberry pi and unzip in .xmbc/addons, I used gftp.

Note: you might want to put the "export PATH...." line in your .bashrc file

Mike
(2014-07-29, 19:31)puithove Wrote: [ -> ]Have been using this for the past couple weeks in Gotham on Ubuntu and Arch. Most things seem to be working as well as the cmyth add-on. However, skipping forward / back seem completely broken for both LiveTV (was never totally reliable with cmyth, but mostly works) and for completed recordings (always reliable with cmyth). With this new add-on, if I try to skip forward into a recording, it just dumps me out to the recordings list. If I skip backwards it freezes the video and the audio plays from the start of the recording. This is true for both SmallStep & BigStep functions.

Am I alone in this, or is it known?

I am testing it with recordings, and you are right Confused. I swear my code is correct. Enabling the demuxer i can jump back and forward watching livetv. I will check that as soon as possible. Thanks.
(2014-07-28, 19:25)mcgski Wrote: [ -> ]FYI and update on running this addon with a Raspberry Pi. I was able to watch a few recordings with no problems (glitches or pixelation). LiveTV is still a problem though. I suspect if recordings work than it might have to do with a timing issue with requesting data from the backend vs. how quickly the backend can serve it up. As I mentioned, I get the same on a VM on a Mac Pro so I'm not sure it's a Myth issue. I may try running mythfrontend from a VM on the Mac Pro to see if I get LiveTV with similar issues.

Janbar, I had a few questions on your build comments earlier. Not sure if I should be doing anything differently or I'm good for now. I got the impression you may have updated the make file to use the right version of dependencies on the build. Let me know otherwise.

I had reverted the patch to check xbmc-pvr api 1.9.1 which is the new version available for xbmc 14.0. So currently i keep the master branch for xbmc gotham using xbmc-pvr api 1.9.0, because lot of us test with gotham. Later (few months...) i will switch again to the api 1.9.1.

(2014-07-29, 21:08)MikeB2013 Wrote: [ -> ]If anyone is interested, here is how I cross compiled the addon on Mythbuntu 14.04 64bit for Raspberry pi running raspbmc (debian wheezy). Bulding on the pi took around an hour, building on my laptop using the cross compile is around 2 minutes (Intel core i7).

sudo apt-get update
sudo apt-get install git automake libtool zip
cd ~
git clone https://github.com/raspberrypi/tools.git --depth 1
export PATH=~/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin:$PATH
cd to the source xbmc-pvr-addons
./bootstrap
./configure --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf
make -C lib/cppmyth -j n (n is the number of cpu cores)
make clean zip -C addons/pvr.mythtv


Now transfer the addon pvr.mythtv-linux-arm.zip to the Raspberry pi and unzip in .xmbc/addons, I used gftp.

Note: you might want to put the "export PATH...." line in your .bashrc file

Mike

+1
(2014-07-31, 00:12)janbar Wrote: [ -> ]
(2014-07-29, 19:31)puithove Wrote: [ -> ]Have been using this for the past couple weeks in Gotham on Ubuntu and Arch. Most things seem to be working as well as the cmyth add-on. However, skipping forward / back seem completely broken for both LiveTV (was never totally reliable with cmyth, but mostly works) and for completed recordings (always reliable with cmyth). With this new add-on, if I try to skip forward into a recording, it just dumps me out to the recordings list. If I skip backwards it freezes the video and the audio plays from the start of the recording. This is true for both SmallStep & BigStep functions.

Am I alone in this, or is it known?

I am testing it with recordings, and you are right Confused. I swear my code is correct. Enabling the demuxer i can jump back and forward watching livetv. I will check that as soon as possible. Thanks.

Hi, i found the bug Big Grin. It is a side effect since i changed the code about buffering. Unreaded bytes still in the buffer before seeking and then the player is entangled. I will push the patch tomorrow.

EDIT: pushed with new version 1.9.19
(2014-07-31, 00:54)janbar Wrote: [ -> ]Hi, i found the bug Big Grin. It is a side effect since i changed the code about buffering. Unreaded bytes still in the buffer before seeking and then the player is entangled. I will push the patch tomorrow.

Awesome, thanks for checking that out. I'll update tomorrow and give it another try.
Updated, and now seeking seems to work just like the cmyth add-on.
(2014-07-29, 21:08)MikeB2013 Wrote: [ -> ]If anyone is interested, here is how I cross compiled the addon on Mythbuntu 14.04 64bit for Raspberry pi running raspbmc (debian wheezy). Bulding on the pi took around an hour, building on my laptop using the cross compile is around 2 minutes (Intel core i7).

sudo apt-get update
sudo apt-get install git automake libtool zip
cd ~
git clone https://github.com/raspberrypi/tools.git --depth 1
export PATH=~/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin:$PATH
cd to the source xbmc-pvr-addons
./bootstrap
./configure --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf
make -C lib/cppmyth -j n (n is the number of cpu cores)
make clean zip -C addons/pvr.mythtv


Now transfer the addon pvr.mythtv-linux-arm.zip to the Raspberry pi and unzip in .xmbc/addons, I used gftp.

Note: you might want to put the "export PATH...." line in your .bashrc file

Mike

Thanks Mike! This worked on an Ubuntu 14.04 64-bit LTS install (not Mythbuntu) as well. I'm running it in a VM on a Macbook Pro and it's fast. Maybe not 2 minutes but not much more than that. I use the following scripts to make sure I can repeat my steps and includes some of the steps I use to build on the Raspberry Pi.

This makes sure all basic tools and libs are in place to build. There may be some redundancy here but it's what worked so....
Code:
#!/bin/bash

sudo apt-get update
sudo apt-get install ubuntu-restricted-extras autoconf git
sudo apt-get install build-essential automake checkinstall
sudo apt-get install autoconf automake bison flex libtool intltool zip
sudo apt-get install libmysqlclient-dev libboost-filesystem-dev

I split apart your process to make sure the right tool chain is in place for cross compiling so I only need to do it once:
Code:
sudo apt-get update
sudo apt-get install git automake libtool zip
cd ~
git clone https://github.com/raspberrypi/tools.git --depth 1

These I run once before my first build.

I then create a directory 'source' and run this script to pull down janbar's code...:
Code:
#!/bin/bash

cd source
git clone git://github.com/janbar/xbmc-pvr-addons.git

...and now I run this script to make the addon:
Code:
#!/bin/bash

export PATH=~/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin:$PATH
cd source
cd xbmc-pvr-addons
./bootstrap
./configure --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf
make -C lib/cppmyth -j 2
make clean zip -C addons/pvr.mythtv

I then copied the .zip file to the home directory of the Pi using Filezilla.

A few things to note:
1. The first run of the addon on the Pi gave me an error on loading DLL. I'd assumed it wasn't using the right tools to cross compile so I took your advice and added the 'export $PATH..." to the .bashrc file and the second run on the Pi was fine. I left the export in the script above though just so I remember it's there.
2. Installing via the GUI doesn't seem to work too well so I wound up unzipping on the Pi to the addons directory directly. I needed to restart the Pi to force it to "see" the addon.
3. The last two scripts above can be run as many times as needed to get it right. I suppose the right thing to do is update the libraries, tools, etc. as well, but thought it better to keep as many variables the same for each build. I would love to hear recommendations from those more in the know.

I'm still seeing pixellation on LiveTV but now seeing it on the recordings a bit more than before. I still think it's a horsepower thing with the Pi and maybe a codec thing with MythTV. If anyone can point me to a possible solution please do so. My Hummingboard is shipping this week and it's coming from overseas so it may be a while before I can get a more powerful system under XBMC to test the theory.

Oh, and thank you to everyone who's helped me (and others) out on this forum. It's been a great learning experience for me and very helpful with all of your suggestions and comments.
(2014-07-31, 18:10)mcgski Wrote: [ -> ]
(2014-07-29, 21:08)MikeB2013 Wrote: [ -> ]If anyone is interested, here is how I cross compiled the addon on Mythbuntu 14.04 64bit for Raspberry pi running raspbmc (debian wheezy). Bulding on the pi took around an hour, building on my laptop using the cross compile is around 2 minutes (Intel core i7).

sudo apt-get update
sudo apt-get install git automake libtool zip
cd ~
git clone https://github.com/raspberrypi/tools.git --depth 1
export PATH=~/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin:$PATH
cd to the source xbmc-pvr-addons
./bootstrap
./configure --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf
make -C lib/cppmyth -j n (n is the number of cpu cores)
make clean zip -C addons/pvr.mythtv


Now transfer the addon pvr.mythtv-linux-arm.zip to the Raspberry pi and unzip in .xmbc/addons, I used gftp.

Note: you might want to put the "export PATH...." line in your .bashrc file

Mike

Thanks Mike! This worked on an Ubuntu 14.04 64-bit LTS install (not Mythbuntu) as well. I'm running it in a VM on a Macbook Pro and it's fast. Maybe not 2 minutes but not much more than that. I use the following scripts to make sure I can repeat my steps and includes some of the steps I use to build on the Raspberry Pi.

This makes sure all basic tools and libs are in place to build. There may be some redundancy here but it's what worked so....
Code:
#!/bin/bash

sudo apt-get update
sudo apt-get install ubuntu-restricted-extras autoconf git
sudo apt-get install build-essential automake checkinstall
sudo apt-get install autoconf automake bison flex libtool intltool zip
sudo apt-get install libmysqlclient-dev libboost-filesystem-dev

I split apart your process to make sure the right tool chain is in place for cross compiling so I only need to do it once:
Code:
sudo apt-get update
sudo apt-get install git automake libtool zip
cd ~
git clone https://github.com/raspberrypi/tools.git --depth 1

These I run once before my first build.

I then create a directory 'source' and run this script to pull down janbar's code...:
Code:
#!/bin/bash

cd source
git clone git://github.com/janbar/xbmc-pvr-addons.git

...and now I run this script to make the addon:
Code:
#!/bin/bash

export PATH=~/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin:$PATH
cd source
cd xbmc-pvr-addons
./bootstrap
./configure --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf
make -C lib/cppmyth -j 2
make clean zip -C addons/pvr.mythtv

I then copied the .zip file to the home directory of the Pi using Filezilla.

A few things to note:
1. The first run of the addon on the Pi gave me an error on loading DLL. I'd assumed it wasn't using the right tools to cross compile so I took your advice and added the 'export $PATH..." to the .bashrc file and the second run on the Pi was fine. I left the export in the script above though just so I remember it's there.
2. Installing via the GUI doesn't seem to work too well so I wound up unzipping on the Pi to the addons directory directly. I needed to restart the Pi to force it to "see" the addon.
3. The last two scripts above can be run as many times as needed to get it right. I suppose the right thing to do is update the libraries, tools, etc. as well, but thought it better to keep as many variables the same for each build. I would love to hear recommendations from those more in the know.

I'm still seeing pixellation on LiveTV but now seeing it on the recordings a bit more than before. I still think it's a horsepower thing with the Pi and maybe a codec thing with MythTV. If anyone can point me to a possible solution please do so. My Hummingboard is shipping this week and it's coming from overseas so it may be a while before I can get a more powerful system under XBMC to test the theory.

Oh, and thank you to everyone who's helped me (and others) out on this forum. It's been a great learning experience for me and very helpful with all of your suggestions and comments.

Whoops,
my build instructions would have been better if I said
put "export PATH.. " line in .basrc file and do
source ~/.bashrc (this makes sure current path is updated)

I think this is the reason you had the "dll problem" on the Raspberry pi ( it probably tried to build for X64, rather than arm on the first run).

The live TV pixellation is something I am also seeing, not just on the Raspberry pi, but also on other PCs including Core i7 with HD 4000 graphics, AMD Phenom x4 with Nvidia GTS450, AMD E450 with Radeon HD 6320. So I am relatively sure it is not a processing power issue.

I am running mythtv 0.28pre, with dual DVB-T/T2 tuners (TBS6280) and dual DVB-S/S2 tuners (TBS 6981) and the live tv pixellation is present on all channels. I am looking at this.

Mike
In live tv,on changing from channel 80 to 82 (in this case) live tv stops and I am dropped back to main xbmc screen.

I have also noticed some pixellation in live tv, does the

"NOTICE: AddOnLog: MythTV PVR Client: (CPPMyth)Read: read position is ahead (8637848)" have anything to do with this?

Mythtv backend version v0.28-pre-2038-gf825a92


Log is here http://xbmclogs.com/show.php?id=257816


Mike
Thanks for mentioning the live tv pixellation. This issue has stopped me from switching from the cable box to xbmc. I have hdhomerun as front end. Playing recording, videos and etc is fine but not livetv.
(2014-07-31, 21:19)MikeB2013 Wrote: [ -> ]In live tv,on changing from channel 80 to 82 (in this case) live tv stops and I am dropped back to main xbmc screen.

I have also noticed some pixellation in live tv, does the

"NOTICE: AddOnLog: MythTV PVR Client: (CPPMyth)Read: read position is ahead (8637848)" have anything to do with this?

Mythtv backend version v0.28-pre-2038-gf825a92


Log is here http://xbmclogs.com/show.php?id=257816


Mike

Problem solved, channel changing and pixellation issues are gone.

I set "Enable demuxing MPEG-TS" in Advanced Options in mythtv pvr addon and restarted xbmc.

I suggest anyone else with pixellation issues tries this. It may well cure the problem.


Mike
Mark as watched does not work on the latest plugin version compiled from git. Nor does it work on the latest ppa either.

It does not mark episodes as watched when I watch them all the way through either. This is really the only feature I miss
from the old plugin, as I currently have no way to tell what I have watched and what I havent.

Its also causing confusion for my 4 year old for his bananas in pyjamas episodes, otherwise love the plugin. Its faster than the old one
Would be happy if this just used xbmc local db as I don't see anything in services api for it.

I dont know c or c++ ( only java php bash and a little Perl ) otherwise I would look at this myself

(2014-08-03, 03:35)JasonPell Wrote: [ -> ]Mark as watched does not work on the latest plugin version compiled from git. Nor does it work on the latest ppa either.

It does not mark episodes as watched when I watch them all the way through either. This is really the only feature I miss
from the old plugin, as I currently have no way to tell what I have watched and what I havent.

Its also causing confusion for my 4 year old for his bananas in pyjamas episodes, otherwise love the plugin. Its faster than the old one
I can that there is code for performing the mark as watched. I enabled debug and get the following when I try to mark as watched in recordings:

13:17:07 T:139876372404160 DEBUG: CPVRRecordings - SetRecordingsPlayCount - will set watched for 1 items
13:17:07 T:139876372404160 DEBUG: CPVRRecordings - SetRecordingsPlayCount - setting watched for item 0
13:17:07 T:139876372404160 DEBUG: AddOnLog: MythTV PVR Client: SetRecordingPlayCount
13:17:07 T:139876372404160 DEBUG: AddOnLog: MythTV PVR Client: SetRecordingPlayCount: Failed setting watched state for: 1010 1406966220

Note the failed setting watched state. Not sure what else to investigate.
Ok so with my limited c++ understanding, I just looked for names that t to make sense. So I think I found my problem. In ccpmyth UpdateRecordedWatchedStatus is only available for myth protocols > 79. I believe that my myth 0.27.3 setup is on an older protocol I think 77.

So I guess I need to update to 0.28pre