Difference between revisions of "XBMC"

From Amahi Wiki
Jump to: navigation, search
 
(16 intermediate revisions by 5 users not shown)
Line 1: Line 1:
Here's a great quote to start this out on.
+
{{NeedsUpdate}}
sabat: ya, I'll never forget the name vail. :) when I was reading the suprised and annoyed peoples comments, I was thinking of walking down the aisle, lifting the womans vail, and seeing some ugly chick that isn't what you expected. I thought the analogy fit.
+
<br />
 +
[http://www.amahi.org/apps/xbmc-media-center-retired XBMC Media Center] has been packaged for Amahi (Fedora 14).
  
When I got my hands on amahi, the first thing I wanted was for it to not only store my movies, but also play them! I've done this for years using an xbox running xbmc, so I figured why not on my amahi server! Well, it worked, and here's how I did it. Currently I have been unable to get the webserver to work. I saw no reason to go through the full compile process, seeing that the only thing it adds is the webserver, which is broken. This method uses a RPM from rpmfusion, and takes about 1% of the time that the compiling method takes. Also this is based on nvidia video cards, I'll try to get to ATI and intel later. I know the average joe won't be able to install video drivers easily, so I am attempting to include the info on the video drivers, specially because fedora 12 is aging and documentation is starting to get somewhat stale for it on other websites. I literally had to use 5 or more websites to get this to work.
+
This was mainly tested on a fairly basic test system, HP a282n, 2gb ram, 40gb hd, nvidia mx-440 8xAGP using the Fedora 12 based, 32bit Amahi express cd.
 
This was mainly tested on a fairly basic test system, HP a282n, 2gb ram, 40gb hd, nvidia mx-440 8xAGP using the Fedora 12 based, 32bit amahi express cd.
 
  
 
=== Initial system setup with Gnome ===
 
=== Initial system setup with Gnome ===
#install amahi (via express cd)
+
#Install Amahi (via express cd)
#once you get a login prompt, login as admin/admin
+
#Once you get a login prompt, login as admin/admin
 
     su -
 
     su -
 
     yum -y groupinstall "GNOME Desktop Environment"
 
     yum -y groupinstall "GNOME Desktop Environment"
Line 15: Line 14:
 
=== Adding XBMC to the system ===
 
=== Adding XBMC to the system ===
 
#From another pc, open the hda webpage http://hda, and add the user xbmcuser:xbmcuser and check to enable admin[I haven't tried doing this without admin yet on the xbmcuser account]
 
#From another pc, open the hda webpage http://hda, and add the user xbmcuser:xbmcuser and check to enable admin[I haven't tried doing this without admin yet on the xbmcuser account]
#goto the webapps section on the hda page http://hda/setup?sub=available&tab=app and add rpmfusion and rpmfusion nonfree in the web apps secion
+
#Go to the webapps section on the hda page http://hda/setup?sub=available&tab=app and add rpmfusion and rpmfusion nonfree in the web apps secion
 
#Back to the console
 
#Back to the console
 
     yum -y install xbmc
 
     yum -y install xbmc
#xbmc also needs an addition to the xorg server, otherwise it crashes every time you run it.
+
#XBMC also needs an addition to the Xorg server, otherwise it crashes every time you run it.
 
     yum -y install xorg-x11-utils
 
     yum -y install xorg-x11-utils
  
Line 32: Line 31:
 
     links www.nvidia.com  
 
     links www.nvidia.com  
 
     chmod +x nvidiadrivername
 
     chmod +x nvidiadrivername
you may have to reboot after disabling the nouveau driver before installing the driver
+
You may have to reboot after disabling the nouveau driver before installing the driver
 
     ./nvidiadrivername
 
     ./nvidiadrivername
  
Line 38: Line 37:
 
This line will add rdblacklist=nouveau to the kernel line in grub.conf
 
This line will add rdblacklist=nouveau to the kernel line in grub.conf
 
     sed -i '/root=/s|$| rdblacklist=nouveau|' /boot/grub/grub.conf
 
     sed -i '/root=/s|$| rdblacklist=nouveau|' /boot/grub/grub.conf
add blacklist nouveau to /etc/modprobe.d/blacklist, I'm sure there is a sed command for this, will get to it later, I used this next command and added it manually.
+
Add blacklist nouveau to /etc/modprobe.d/blacklist, I'm sure there is a sed command for this, will get to it later, I used this next command and added it manually.
     nano /etc/modprobe.d/blacklist
+
     nano /etc/modprobe.d/blacklist.conf
  
 
=== If the nouveau driver still causes problems ===
 
=== If the nouveau driver still causes problems ===
Line 47: Line 46:
 
     mv /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname  -r)-nouveau.img
 
     mv /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname  -r)-nouveau.img
 
     dracut /boot/initramfs-$(uname -r).img $(uname -r)
 
     dracut /boot/initramfs-$(uname -r).img $(uname -r)
 +
 +
=== Setup XBMC to use MySQL ===
 +
'''Note''' Before using this create an export of the all the media you have imported/scanned/etc. We'll be importing it when we're done.
 +
 +
First we need to create a user and 2 databases which will hold the indexed media (video and music):
 +
 +
Log into the MySQL core using the root account (it will ask you for the password, which is "hda" in Amahi 7)
 +
mysql -uroot -p
 +
 +
Create the user "xbmc"
 +
CREATE USER 'xbmc' IDENTIFIED BY 'xbmc';
 +
 +
Create the databases "xbmc_video" and "xbmc_music"
 +
CREATE database xbmc_video;
 +
CREATE database xbmc_music;
 +
 +
Grant the user "xbmc" access to these databases
 +
GRANT ALL ON xbmc_music.* TO 'xbmc'@'localhost' identified by 'xbmc';
 +
GRANT ALL ON xbmc_video.* TO 'xbmc'@'localhost' identified by 'xbmc';
 +
 +
Make sure the MySQL knows the changes made
 +
flush privileges;
 +
 +
Now to have XMBC make use of the MySQL databases:
 +
 +
<pre>cat > /home/xbmcuser/.xbmc/userdata/advancedsettings.xml << 'EOF'
 +
<advancedsettings>
 +
  <videodatabase>
 +
    <type>mysql</type>
 +
    <host>localhost</host>
 +
    <port>3306</port>
 +
    <user>xbmc</user>
 +
    <pass>xbmc</pass>
 +
    <name>xbmc_video</name>
 +
  </videodatabase>
 +
 +
  <musicdatabase>
 +
    <type>mysql</type>
 +
    <host>localhost</host>
 +
    <port>3306</port>
 +
    <user>xbmc</user>
 +
    <pass>xbmc</pass>
 +
    <name>xbmc_music</name>
 +
  </musicdatabase>
 +
</advancedsettings>
 +
EOF</pre>
 +
 +
Done! Restart XBMC to enable the new settings.
 +
Import the media export you have made before implementing this.
  
 
=== Setup autologin for the xbmcuser ===
 
=== Setup autologin for the xbmcuser ===
Line 71: Line 119:
  
 
=== A Few Suggestions ===
 
=== A Few Suggestions ===
# Install the DLNA server, it works perfectly with any movies you put in the movies share, photos you put in the pictures share, and any music in the music folder.
+
# Install the DLNA server, it works perfectly with any movies you put in the movies share, photos you put in the pictures share, and any music in the music folder. I've heard mention that mkv files might not work with dlna, but I have not verified this.
# if you have a noisy server, remember you don't have to have the pc in the same room as the tv, I don't and it works great, or put the server in a closet or something on the other side of the wall and run a cable to the back of the tv.
+
# If you have a noisy server, remember you don't have to have the pc in the same room as the TV, I don't and it works great, or put the server in a closet or something on the other side of the wall and run a cable to the back of the tv.
 
# Setup VNC on your Amahi server, it really is nice to have remote control of xbmc, I don't ever actually try to watch movies through vnc, but It's a great remote until we get the webserver working
 
# Setup VNC on your Amahi server, it really is nice to have remote control of xbmc, I don't ever actually try to watch movies through vnc, but It's a great remote until we get the webserver working
  
Line 80: Line 128:
 
One file that can easily make or break your video, is /etc/X11/xorg.conf and one of the most common things to have to edit is the vertical refresh, or the resolution lines. for instance my tv doesn't like 1600x1200, and every time I did this how-to on this particular pc, I had to remove the 1600x1200 from the xorg.conf before it would work right, but this is not going to happen to everyone.
 
One file that can easily make or break your video, is /etc/X11/xorg.conf and one of the most common things to have to edit is the vertical refresh, or the resolution lines. for instance my tv doesn't like 1600x1200, and every time I did this how-to on this particular pc, I had to remove the 1600x1200 from the xorg.conf before it would work right, but this is not going to happen to everyone.
  
== Janjacobs how-to ==
+
[[image:xbmc-logo.png]]
Janjacobs wrote this a while before I made mine.
+
 
XBMC by default has no rpm's, and compiling doesnt work due to some error in the python library.
+
[[image:xbmc-ss.png]]
however, someone was kind enough to compile working rpm's out of the SVN branch, making XBMC a nice piece of quality software to add to your HDA expirience.
+
 
 +
=== Synchronize XBMC library with devices (Raspberry)===
 +
 
 +
First the starting point:
 +
 
 +
I have OpenELEC mainly running on my RPi (version is r13078 from http://openelec.thestateofme.com/) and wanted other devices, e.g. a tablet, to pick up at the same position where I stopped watching on the RPi. Usually XBMC stores this information locally so you could potentially run into a big mess and unsynchronized XBMC installations. So I wanted to get a neat setup where I would not have to worry about which device I now need to use to start at the same part where I left. For this I wanted to use the built-in MySQL server that comes with Amahi and store the media related information there.
 +
 
 +
In order to do so we just need to modify/ create the advancedsettings.xml file in the XBMC installation(s). They all need to be the same though, i.e. a Frodo installation cannot work on the same database as an Eden installation.
 +
 
 +
This is what you need to do:
 +
 
 +
1. SSH into the server or via Terminal and create a MySQL user and database (this will be the user for the XBMC installations)
 +
 
 +
hda-create-user-and-db xbmc
 +
<!--1. SSH into the server or via Terminal and access the MySQL environment in order to create a user (this will be the user for the XBMC installations)
 +
 
 +
Code =  mysql -u root -p
 +
}}
 +
 
 +
The standard password used by Amahi is "hda".
 +
 
 +
2. Paste the SQL command to create the user, set permissions, and update everything
 +
{{Code|
 +
Code =  CREATE USER 'xbmc' IDENTIFIED BY 'xbmc';
 +
GRANT ALL ON *.* TO 'xbmc'; FLUSH PRIVILEGES;
 +
}}-->
 +
 
 +
2. Now we need to make the adjustments on the OpenELEC installation in order to have OpenELEC connect and use the MySQL database
 +
 
 +
2.1 Open the OpenELEC SMB Share "Userdata" and in it create a file called "advancedsettings.xml" (or edit it if it's already created; DO NOT delete the content already written in it, just add the following code). The following needs to be entered (replace 'x.x.x.x' with the IP of the HDA):
 +
<pre>
 +
Code =  <advancedsettings>
 +
<videodatabase>
 +
<type>mysql</type>
 +
<host>x.x.x.x</host>
 +
<port>3306</port>
 +
<user>xbmc</user>
 +
<pass>xbmc</pass>
 +
</videodatabase>
 +
<musicdatabase>
 +
<type>mysql</type>
 +
<host>x.x.x.x</host>
 +
<port>3306</port>
 +
<user>xbmc</user>
 +
<pass>xbmc</pass>
 +
</musicdatabase>
 +
</advancedsettings>
 +
</pre>
 +
 
 +
2.2 Save the file.
 +
 
 +
2.3 In the same SMB share on your OpenELEC installation please go into the "Database" folder to delete "MyVideosXX.db" & "MyMusicXX.db". XX seem to be random numbers.
 +
 
 +
3. Reboot the Raspberry
 +
 
 +
=== XBMC Gotham MySQL Database===
 +
 
 +
<ins>'''Configure MySQL for XBMC'''</ins>
 +
 
 +
In previous XBMC versions, we manually created the SQL databases for XBMC, with version 12.0 and up, the databases will automatically created by XMBC. The only thing we need to do is create a user account  Open phpMyAdmin from the HDA app page (or install it).
 +
 
 +
Click on the 'Add user' link at the 'Users' tab.
 +
 
 +
[http://www.robvanhamersveld.nl/wp-content/uploads/2013/02/phpMyAdmin01.png ''<ins>phpMyAdmin Users</ins>'']
 +
 
 +
Fill in the user details, I'm using username 'xbmc' with password 'xbmc'. Click at 'Global privileges' on 'Check All', by doing this the account is capable to create and alter databases on the MySQL server. In a production setup you probably don't want to do this but in a home network it's fine.
 +
 
 +
[http://www.robvanhamersveld.nl/wp-content/uploads/2013/02/phpMyAdmin02.png ''<ins>phpMyAdmin User Details</ins>'']
 +
 
 +
That's it, your database server is ready to serve XBMC.
 +
 
 +
<ins>'''Connect XBMC to your shared database'''</ins>
  
===Installing the required repository's===
+
OK, the database is up, only thing left is to connect XBMC to it. There is no fancy configuration option in the GUI so we have to edit/create a .xml file again. Don't worry, it isn't that hard.
First, we have to create 2 files:
 
  
*/etc/yum.repos.d/spotnet.repo
+
The file we need to create (not default present after the installation of XBMC) is advancedsettings.xml and place it into the XBMC userdata folder. In this file we define the MySQL database connection. It should look like this;
the contents of this file should be:<br>
 
[spotnet]<br>
 
name=Fedora Core $releasever - $basearch - SpotNet<br>
 
baseurl=http://fedora.spot.net.id/yum/fedora/$releasever/$basearch/<br>
 
gpgcheck=0
 
  
*/etc/yum.repos.d/atrpms.repo
+
[http://www.robvanhamersveld.nl/wp-content/uploads/2012/03/advancedsettings.png ''<ins>Advanced Settings</ins>'']
the contents of this file should be:<br>
 
[atrpms]<br>
 
name=Fedora Core $releasever - $basearch - ATrpms<br>
 
baseurl=http://dl.atrpms.net/f$releasever-$basearch/atrpms/stable<br>
 
gpgkey=http://ATrpms.net/RPM-GPG-KEY.atrpms<br>
 
gpgcheck=1
 
  
*run yum update to have yum update its packages lists.
+
You must replace ***.***.***.*** with the IP-address of your MySQL database server.
  
===Installing XBMC===
+
That's all, your centralized library and media files are ready to use.
To install XBMC we open up a terminal, su to root and execute the following command:
 
yum install xbmc xbmc-skin-*
 
  
This should install xbmc, its required dependencies, and all the skins currently available in the main package!
+
For further information, please visit: http://www.robvanhamersveld.nl/2013/02/05/share-your-xbmc-12-0-library-on-a-synology-ds-or-other-nas/
once you're done, XBMC is located inside the GNOME Menu, and you can start adding files to your library
 
  
[[User:Janjacobs|janjacobs]] 20:08, 12 December 2009 (UTC)
+
[[Category:Apps]]

Latest revision as of 02:27, 1 February 2019

Msgbox.update.png Update Needed
The contents of this page have become outdated or irrelevant. Please consider updating it.


XBMC Media Center has been packaged for Amahi (Fedora 14).

This was mainly tested on a fairly basic test system, HP a282n, 2gb ram, 40gb hd, nvidia mx-440 8xAGP using the Fedora 12 based, 32bit Amahi express cd.

Initial system setup with Gnome

  1. Install Amahi (via express cd)
  2. Once you get a login prompt, login as admin/admin
   su -
   yum -y groupinstall "GNOME Desktop Environment"
   yum -y install Xorg

Adding XBMC to the system

  1. From another pc, open the hda webpage http://hda, and add the user xbmcuser:xbmcuser and check to enable admin[I haven't tried doing this without admin yet on the xbmcuser account]
  2. Go to the webapps section on the hda page http://hda/setup?sub=available&tab=app and add rpmfusion and rpmfusion nonfree in the web apps secion
  3. Back to the console
   yum -y install xbmc
  1. XBMC also needs an addition to the Xorg server, otherwise it crashes every time you run it.
   yum -y install xorg-x11-utils

Required for nvidia driver

   yum -y install kernel-devel
   yum -y install kernel-headers
   yum -y install kernel
   yum -y install gcc

Obtaining and installing the driver

Download the nvidia driver, in my case, I used used the links text based web browser, however this method is a bit tricky, I would suggest you do not disable the nouveau driver and use 'yum -y install firefox' and goto the nvidia web page, skipping this section and saving it for later. I also needed the older 96.xx driver because I was using an older video card.

   yum -y install links
   links www.nvidia.com 
   chmod +x nvidiadrivername

You may have to reboot after disabling the nouveau driver before installing the driver

   ./nvidiadrivername

Removing the nouveau driver completely

This line will add rdblacklist=nouveau to the kernel line in grub.conf

   sed -i '/root=/s|$| rdblacklist=nouveau|' /boot/grub/grub.conf

Add blacklist nouveau to /etc/modprobe.d/blacklist, I'm sure there is a sed command for this, will get to it later, I used this next command and added it manually.

   nano /etc/modprobe.d/blacklist.conf

If the nouveau driver still causes problems

This line failed for me, so I rebooted and logged back in, then it worked fine. maybe the nouveau has to be disabled before it's possible to remove it. also, this is the section I suggest you skip if you were unable to download the proper driver using links.

   yum erase xorg-x11-drv-nouveau
   mv /lib/modules/$(uname -r)/kernel/drivers/gpu/drm/nouveau/nouveau.ko /lib/modules/$(uname -r)/kernel/drivers/gpu/drm/nouveau/nouveau.txt
   mv /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname  -r)-nouveau.img
   dracut /boot/initramfs-$(uname -r).img $(uname -r)

Setup XBMC to use MySQL

Note Before using this create an export of the all the media you have imported/scanned/etc. We'll be importing it when we're done.

First we need to create a user and 2 databases which will hold the indexed media (video and music):

Log into the MySQL core using the root account (it will ask you for the password, which is "hda" in Amahi 7)

mysql -uroot -p

Create the user "xbmc"

CREATE USER 'xbmc' IDENTIFIED BY 'xbmc';

Create the databases "xbmc_video" and "xbmc_music"

CREATE database xbmc_video;
CREATE database xbmc_music;

Grant the user "xbmc" access to these databases

GRANT ALL ON xbmc_music.* TO 'xbmc'@'localhost' identified by 'xbmc';
GRANT ALL ON xbmc_video.* TO 'xbmc'@'localhost' identified by 'xbmc';

Make sure the MySQL knows the changes made

flush privileges;

Now to have XMBC make use of the MySQL databases:

cat > /home/xbmcuser/.xbmc/userdata/advancedsettings.xml << 'EOF'
<advancedsettings>
  <videodatabase>
    <type>mysql</type>
    <host>localhost</host>
    <port>3306</port>
    <user>xbmc</user>
    <pass>xbmc</pass>
    <name>xbmc_video</name>
  </videodatabase>

  <musicdatabase>
    <type>mysql</type>
    <host>localhost</host>
    <port>3306</port>
    <user>xbmc</user>
    <pass>xbmc</pass>
    <name>xbmc_music</name>
  </musicdatabase>
</advancedsettings> 
EOF

Done! Restart XBMC to enable the new settings. Import the media export you have made before implementing this.

Setup autologin for the xbmcuser

   cat >> /etc/gdm/custom.conf <<EOF
   [daemon]
   TimedLoginEnable=true
   TimedLogin=xbmcuser
   TimedLoginDelay=5
   EOF

Change initial runlevel to 5

This is what tells Amahi to boot into X instead of console.

   sed -i 's/^id:3:/id:5:/' /etc/inittab

Add xbmc to X startup

   echo xinit /usr/bin/xbmc >/home/xbmcuser/xbmcstartup
   chmod a+x /home/xbmcuser/xbmcstartup
   chown xbmcuser:users /home/xbmcuser/xbmcstartup

Now just reboot, it should come up to the normal desktop. Log out of the system using the top left button, then hit escape a few times to cancel the auto login. Now click on xbmcuser, then at the bottom of the screen it has "sessions", select xbmc instead of gnome, then type in your xmbcuser password and click login.

You're done. The next time you reboot, it should come right back up in xbmc.

A Few Suggestions

  1. Install the DLNA server, it works perfectly with any movies you put in the movies share, photos you put in the pictures share, and any music in the music folder. I've heard mention that mkv files might not work with dlna, but I have not verified this.
  2. If you have a noisy server, remember you don't have to have the pc in the same room as the TV, I don't and it works great, or put the server in a closet or something on the other side of the wall and run a cable to the back of the tv.
  3. Setup VNC on your Amahi server, it really is nice to have remote control of xbmc, I don't ever actually try to watch movies through vnc, but It's a great remote until we get the webserver working

Troubleshooting

If you lose video, try hitting CTRL+ALT+F2, CTRL+ALT+backspace, or ssh into the amahi server and change /etc/inittab back to runlevel 3.

One file that can easily make or break your video, is /etc/X11/xorg.conf and one of the most common things to have to edit is the vertical refresh, or the resolution lines. for instance my tv doesn't like 1600x1200, and every time I did this how-to on this particular pc, I had to remove the 1600x1200 from the xorg.conf before it would work right, but this is not going to happen to everyone.

Xbmc-logo.png

Xbmc-ss.png

Synchronize XBMC library with devices (Raspberry)

First the starting point:

I have OpenELEC mainly running on my RPi (version is r13078 from http://openelec.thestateofme.com/) and wanted other devices, e.g. a tablet, to pick up at the same position where I stopped watching on the RPi. Usually XBMC stores this information locally so you could potentially run into a big mess and unsynchronized XBMC installations. So I wanted to get a neat setup where I would not have to worry about which device I now need to use to start at the same part where I left. For this I wanted to use the built-in MySQL server that comes with Amahi and store the media related information there.

In order to do so we just need to modify/ create the advancedsettings.xml file in the XBMC installation(s). They all need to be the same though, i.e. a Frodo installation cannot work on the same database as an Eden installation.

This is what you need to do:

1. SSH into the server or via Terminal and create a MySQL user and database (this will be the user for the XBMC installations)

hda-create-user-and-db xbmc

2. Now we need to make the adjustments on the OpenELEC installation in order to have OpenELEC connect and use the MySQL database

2.1 Open the OpenELEC SMB Share "Userdata" and in it create a file called "advancedsettings.xml" (or edit it if it's already created; DO NOT delete the content already written in it, just add the following code). The following needs to be entered (replace 'x.x.x.x' with the IP of the HDA):

Code =  <advancedsettings>
<videodatabase>
<type>mysql</type>
<host>x.x.x.x</host>
<port>3306</port>
<user>xbmc</user>
<pass>xbmc</pass>
</videodatabase>
<musicdatabase>
<type>mysql</type>
<host>x.x.x.x</host>
<port>3306</port>
<user>xbmc</user>
<pass>xbmc</pass>
</musicdatabase>
</advancedsettings>

2.2 Save the file.

2.3 In the same SMB share on your OpenELEC installation please go into the "Database" folder to delete "MyVideosXX.db" & "MyMusicXX.db". XX seem to be random numbers.

3. Reboot the Raspberry

XBMC Gotham MySQL Database

Configure MySQL for XBMC

In previous XBMC versions, we manually created the SQL databases for XBMC, with version 12.0 and up, the databases will automatically created by XMBC. The only thing we need to do is create a user account Open phpMyAdmin from the HDA app page (or install it).

Click on the 'Add user' link at the 'Users' tab.

phpMyAdmin Users

Fill in the user details, I'm using username 'xbmc' with password 'xbmc'. Click at 'Global privileges' on 'Check All', by doing this the account is capable to create and alter databases on the MySQL server. In a production setup you probably don't want to do this but in a home network it's fine.

phpMyAdmin User Details

That's it, your database server is ready to serve XBMC.

Connect XBMC to your shared database

OK, the database is up, only thing left is to connect XBMC to it. There is no fancy configuration option in the GUI so we have to edit/create a .xml file again. Don't worry, it isn't that hard.

The file we need to create (not default present after the installation of XBMC) is advancedsettings.xml and place it into the XBMC userdata folder. In this file we define the MySQL database connection. It should look like this;

Advanced Settings

You must replace ***.***.***.*** with the IP-address of your MySQL database server.

That's all, your centralized library and media files are ready to use.

For further information, please visit: http://www.robvanhamersveld.nl/2013/02/05/share-your-xbmc-12-0-library-on-a-synology-ds-or-other-nas/