Koozali.org formerly Contribs.org

HOW-TO (draft): Mythtv as a backend on sme server

HOW-TO (draft): Mythtv as a backend on sme server
« on: December 02, 2007, 06:44:49 PM »
A number of people have been struggling with this so I thought I would start to document what I did to get this working. It is cumbersome but do-able. I also strongly suggest you also use the sme server as a backend and don't implement the frontend on it as i have little confidence in the security of it.

I would suggest moderate and more expert users check this out first to see if I have some errors or holes. If it's close then we can update the wiki. I just didn't want to muck it up before some sanity was applied. In particular, I would like to see if there is any minimization we can do say by removing unnecessary steps or packages.

I had to draw on many sources including: Duncan's how-to (link currently dead); the contrib wiki; mythtv.org (and it's wiki); knoppmythwiki.org; and many more that I have forgotten.

Here goes and good luck.

============
Set up repositories

Set up atrpms per the wiki (http://wiki.contribs.org/ATrpms) - IMPORTANT to use this method to avoid including unwanted items

Set up dag as follows:
Code: [Select]
/sbin/e-smith/db yum_repositories set dag repository BaseURL http://apt.sw.be/redhat/el4/en/i386/dag EnableGroups
1 GPGCheck 1 Name Dag-repository status disabled

expand-template /etc/yum.conf

Install a few dependencies:
You will likely need the following (based on Duncan's How to). I know some are needed but have not confirmed if all are needed.I suspect some of it is only needed if you wish to load up the myth source and use their "config" tool.

Code: [Select]
yum install gcc-c++ qt qt-MySQL qt-devel ncurses-devel
yum install python-devel zlib-devel dialog subversion


Now itstall the Myth bits:

** Note I had to install the ivtv-kmdl separately as the non-smp won't install if you are running in smp. I believe smp is the default for sme server.


Code: [Select]
yum install mythtv-mythweb --enablerepo=atrpms --enablerepo=dag
yum install mythtv-setup  --enablerepo=atrpms --enablerepo=dag
yum install ivtv-kmdl-2.6.9-55.0.6.ELsmp-0.4.10-114.el4   --enablerepo=atrpms --enablerepo=dag
yum install ivtv  --enablerepo=atrpms --enablerepo=dag
yum install mythtv-frontend  --enablerepo=atrpms --enablerepo=dag


Setting up mysql:

You will need to set up mysql. The required mc.sql file I would recommend you get from Mythtv's web set just to ensure it is accurate for your version. The following is over kill but you will find it there.

Download the mythtv software to a directory of your choice from:
http://www.mythtv.org/modules.php?name=Downloads

You should just need the main load not the plugins.

if it downloads as a ".tar.tar" file then change the name to end in ".tar.bz2"

then
Code: [Select]
bunzip2 mythtv-0.20.2.tar.bz2
tar -xvf mythtv-0.20.2.tar
cd mythtv-0.20.2/database
mysql < mc.sql

Now grant access to your box and remote front ends within subnet 192.168.1 (change to suit you) to access mysql

Code: [Select]
mysql

mysql> grant all on mythconverg.* to mythtv@'192.168.1.%' identified by 'mythtv';
mysql> flush privileges;
mysql> quit

/sbin/e-smith/config setprop mysqld LocalNetworkingOnly no
/sbin/e-smith/expand-template /etc/my.cnf
service mysqld restart

From the shell window of your front end, verify that the access worked:
Code: [Select]
mysql -h smeserveraddress -u mythtv -pmythtv mythconverg
** Note smeserveraddress should be an IP address or FQDN
if you have no error then quit. If you do then it is likely a permission or grant error to be resolved.


ALMOST there!!

X11 Forwarding:

You need to set up X11 forwarding to another Linux machine (I targeted a CentOS release running on a virtual machine (VirtualBox) on

my XP Home machine.
X11 Forwarding is described here:
http://wiki.contribs.org/X11_Forwarding_on_SME

then go to your shell window on another machine (which has X running) and do:

Code: [Select]
ssh -X root@smeserveraddress /usr/bin/mythtv-setup
and follow the instructions to set up your environment for the backend.


To set up Knoppmyth as front end only:

I decided to use Knoppmyth as my front ends as there seems to be good support including HOW-To's to link things together.

Install Knoppmyth  from "http://www.knoppmythwiki.org/?id=KnoppmythDownloads" onto a front end PC.

Follow this HOW TO
http://www.knoppmythwiki.org/index.php?page=FrontendOnlyInstall

I would also recommend defining a common file structure for your frontends and backends. I used the SME as my common file store. In theory, the next version of myth will allow you to more easily share directories but for now you will need to follow the following HOW-TO's

HOWEVER, you won't have much joy using NFS (per their suggestion) and rather than samba you may wish to consider using sshfs as described in: http://ubuntu.wordpress.com/2005/10/28/how-to-mount-a-remote-ssh-filesystem-using-sshfs/

After you make your mounts, adjust your directory structure in the myth frontend to suit your mount structure.


SME since 2003

Offline cactus

  • *
  • 4,880
    • http://www.snetram.nl
Re: HOW-TO (draft): Mythtv as a backend on sme server
« Reply #1 on: December 02, 2007, 07:29:16 PM »
Be sure to include the dag repository as described in the wiki as well as, for the same reason, it ensures you you will not drag in unwanted packages or upgrades.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline cactus

  • *
  • 4,880
    • http://www.snetram.nl
Re: HOW-TO (draft): Mythtv as a backend on sme server
« Reply #2 on: December 02, 2007, 07:40:43 PM »
I would suggest moderate and more expert users check this out first to see if I have some errors or holes. If it's close then we can update the wiki. I just didn't want to muck it up before some sanity was applied. In particular, I would like to see if there is any minimization we can do say by removing unnecessary steps or packages.
I would suggest to add it to the wiki as this would make corrections and additions much easier as compared to posting replies in this forum thread.

I had to install the ivtv-kmdl separately
It depends on the brand of TV card you use if you need the ivtv or perhaps the bttv drivers, analogue Hauppauge cards use th ivtv driver.

I believe smp is the default for sme server.
The SMP kernel is the multi processor kernel.

Code: [Select]
yum install ivtv-kmdl-2.6.9-55.0.6.ELsmp-0.4.10-114.el4   --enablerepo=atrpms --enablerepo=dag
Be sure to install the ivtv-kmdl package that matches the installed kernel, perhaps it is easier to use a $KVER variabel in the howto as used in the MythTV for Fedora howto as well:
Code: [Select]
echo "export KVER=\`uname -r\`" >> /etc/profile.d/kver.shYou could than install the ivtv module like this:
Code: [Select]
yum install ivtv-kmdl-$KVER
« Last Edit: December 02, 2007, 07:42:52 PM by cactus »
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

guest22

Re: HOW-TO (draft): Mythtv as a backend on sme server
« Reply #3 on: December 02, 2007, 09:31:33 PM »
Copied over to the wiki:

http://wiki.contribs.org/MythTV-HowTo

guest

Re: HOW-TO (draft): Mythtv as a backend on sme server
« Reply #4 on: December 02, 2007, 10:25:29 PM »
Thanks HF. Shouldn't we merge it in with the existing Mythtv How-to? I'm not sure on protocol.

I was going to make the changes recommended by Cactus as well but for some reason I can't sign in to the wiki. It tells me my password is wrong. If I create a new account on the wiki, I get an sql error. I've updated an existing bug report http://bugs.contribs.org/show_bug.cgi?id=3540 in regards to this.

The most urgent change is to point to the existing "dag" repository entry instead of entering the code. I note the wiki identifies certain excludes that may be important. Can one of you make that change for me until I get my account with the wiki straightened out?

Christian
SME since 2003

guest22

Re: HOW-TO (draft): Mythtv as a backend on sme server
« Reply #5 on: December 02, 2007, 10:32:30 PM »
If I create a new account on the wiki, I get an sql error.

Christian,

I've linked the 2 howto's. Please read http://wiki.contribs.org/Help:Editing_pages on how to obtain a wiki account.

guest

Re: HOW-TO (draft): Mythtv as a backend on sme server
« Reply #6 on: December 02, 2007, 10:36:40 PM »
Thanks. I just discovered that link and submitted a request. Perhaps the "login/create account" page should have a link to this. I actually found someone elses bug report from Nov 10th in bugzilla first so I assumed it was a problem.
SME since 2003

Offline cactus

  • *
  • 4,880
    • http://www.snetram.nl
Re: HOW-TO (draft): Mythtv as a backend on sme server
« Reply #7 on: December 02, 2007, 10:40:47 PM »
The most urgent change is to point to the existing "dag" repository entry instead of entering the code. I note the wiki identifies certain excludes that may be important. Can one of you make that change for me until I get my account with the wiki straightened out?
Consider it done.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Re: HOW-TO (draft): Mythtv as a backend on sme server
« Reply #8 on: December 02, 2007, 11:00:36 PM »
Thanks cactus. I note you have put them in literally. Would it make sense to point back to the how-to's for those in case they need to change later? My appologies for the public posting but I couldn't find a way to send a personal message (as in other forums).

Also thanks for the general clean up. It is much appreciated.

Christian
SME since 2003

Offline cactus

  • *
  • 4,880
    • http://www.snetram.nl
Re: HOW-TO (draft): Mythtv as a backend on sme server
« Reply #9 on: December 02, 2007, 11:13:08 PM »
Thanks cactus. I note you have put them in literally. Would it make sense to point back to the how-to's for those in case they need to change later? My appologies for the public posting but I couldn't find a way to send a personal message (as in other forums).

Also thanks for the general clean up. It is much appreciated.

Christian
I did not put in the original version, I only modified the repository section (at first) and then did some major overhaul, added an easier way to import the database, configure user privileges and some more stuff.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Re: HOW-TO (draft): Mythtv as a backend on sme server
« Reply #10 on: December 02, 2007, 11:27:45 PM »
It looks like it was done in your first batch of edits "Revision as of 21:40, 2 December 2007" according to the wiki; I may be reading it wroing. In case my note was not clear (which I don't think it was), I thought it might be better to have a link to the repository how-to's instead of copying the code into this how-to. Thus if the dag and atrpms how-to's need to change in the future we won't have an error on this page.

Otherwise, I really like the clean up you have done to this. Good call on going straight to wiki.

Christian
« Last Edit: December 02, 2007, 11:37:13 PM by christian »
SME since 2003

Offline cactus

  • *
  • 4,880
    • http://www.snetram.nl
Re: HOW-TO (draft): Mythtv as a backend on sme server
« Reply #11 on: December 02, 2007, 11:31:57 PM »
It looks like it was done in your first batch of edits "Revision as of 21:40, 2 December 2007" according to the wiki; I may be reading it wroing. In case my note was not clear (which I don't think it was), I thought it might be better to have a link to the repository how-to's instead of copying the code into this how-to. Thus if the dag and atrpms how-to's need to change in the future we won't have an error on this page.

Therefore the Template system is used, the only page that need to be changed if something is changed to either of the repositories is the template location, all referrals to the Dag or ATRpms page in the wiki will be changes at once, immediately when the template is changed. I have implemented them for this purpose some time ago already.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Re: HOW-TO (draft): Mythtv as a backend on sme server
« Reply #12 on: December 02, 2007, 11:40:06 PM »
ok. got it. I can't see the code level without a username so assumed it was a strict cut and paste. I suppose the X11 section could be done similarly.
SME since 2003

guest22

Mythweb
« Reply #13 on: January 03, 2008, 01:31:30 PM »
Guys,

I've been fiddling with mythweb for a while, but can't seem to 'run' it. Backend works like a charm.

- Created a ibays called 'tvoverview'
- Copied over mythweb pages and dirs installed by the rpm, to ../tvoverview/html
- Chown -R www:www the files
- Adapted the .htaccess to the real values
- Applied 'AllowOverride all' emporarily in httpd.conf
- created .htaccess user adn pass

No luck.... I get the _db not set right warning or access not allowed (again fiddling)

Did you had any luck with this? Especially the custom template fragment to adapt httpd.conf entry for this ibay.

Thanks,
guest

Offline cactus

  • *
  • 4,880
    • http://www.snetram.nl
Re: Mythweb
« Reply #14 on: January 03, 2008, 09:42:49 PM »
Guys,

I've been fiddling with mythweb for a while, but can't seem to 'run' it. Backend works like a charm.

- Created a ibays called 'tvoverview'
- Copied over mythweb pages and dirs installed by the rpm, to ../tvoverview/html
- Chown -R www:www the files
- Adapted the .htaccess to the real values
- Applied 'AllowOverride all' emporarily in httpd.conf
- created .htaccess user adn pass

No luck.... I get the _db not set right warning or access not allowed (again fiddling)

Did you had any luck with this? Especially the custom template fragment to adapt httpd.conf entry for this ibay.
First off all: what do your log files state? Did you have a look there? Are there any error messages or indications to what could be going wrong?

I did not try to set it up on SME Server, but I know it relies heavily on rewrites... perhaps it is easier to place all mythweb source in /opt and create a custom template to add the mythweb configuration to the configuration file by copying the content of the mythweb.apache.conf (I believe it is called that) to this fragment,perhaps you could even copy the file to a template in /etc/e-smith/templates-custom/etc/httpd/conf/httpd/conf/92mythweb and regenerate your configuration file, restart your webserver and have a try again.

Also are you running MySQL at port 3306 or at a socket (defaul configuration) only? It might well be that mythweb tries to access the MySQL database at a port only...
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)