These can all be played directly from a CD/DVD, or from the hard-drive. XBMC can also play multimedia from a computer over a local network (LAN), or play media streams directly from the Internet. For more information, see the [http://wiki.xbmc.org/index.php?title=XBMC_FAQ XBMC FAQ].

These can all be played directly from a CD/DVD, or from the hard-drive. XBMC can also play multimedia from a computer over a local network (LAN), or play media streams directly from the Internet. For more information, see the [http://wiki.xbmc.org/index.php?title=XBMC_FAQ XBMC FAQ].

+

+

As of version 12, it can also be used to play and record live TV using a tuner, a backend server and a PVR plugin; more information about this can be found on the [http://wiki.xbmc.org/?title=PVR XBMC wiki].

== Installation ==

== Installation ==

−

−

{{Note|These instructions assume you have a working X installation. If you have not done this yet, please consult [[Beginners_Guide#Graphical_User_Interface]].}}

−

[[pacman|Install]] {{Pkg|xbmc}} from the [[official repositories]].

[[pacman|Install]] {{Pkg|xbmc}} from the [[official repositories]].

−

If you plan to use the pvr extensions of xbmc you will need to install {{Pkg|xbmc-pvr-addons}}.

+

Optionally install {{Pkg|xbmc-pvr-addons}} if users wish to use the pvr extensions of xbmc.

== Configuration ==

== Configuration ==

=== Autostarting at boot ===

=== Autostarting at boot ===

+

It is desirable to start XBMC automatically on boot. Since version 11.0-11, the '''xbmc''' package will automatically create the xbmc group, user, and provide an xbmc.service so systemd can manage xbmc without the need for a DE.

−

To use XBMC on HTPC you may want to start XBMC automatically on boot. Since version 11.0-11 '''xbmc''' package includes the xbmc group, user, and service file necessary to do this.

+

To make XBMC start at system boot, enable the service:

−

+

−

To make XBMC start at system boot you should simply enable the service:

+

# systemctl enable xbmc

# systemctl enable xbmc

−

=== Enabling shutdown, restart, hibernate and suspend ===

+

=== Sharing a Database Between Multiple XBMC PCs ===

+

Provided that a box on the network is running mariadb, one can easily configure multiple xbmc boxes to share a database. The advantage of this is that key meta are stored in one place, a show can be paused on one box and then resumed on another seamlessly, and the record of what has been watched is unified.

−

Since version 12 XBMC supports power management via systemd logind daemon. To enable it you should have {{Pkg|polkit}}, {{Pkg|upower}} and {{Pkg|udisks}} installed on your system.

+

Setup of this is beyond the scope of this article. Consult [http://wiki.xbmc.org/index.php?title=HOW-TO:Share_libraries_using_MySQL/Setting_up_MySQL#tab=Arch_Linux the Setting up MySQL for Arch Linux] hosted by the XBMC project wiki.

−

+

−

In case XBMC is started using the systemd service, the session might not get initialzed properly and therefore polkit may not allow the shutdown or reboot of the system. If this happens, adding the following rule file will allow users in the ''power'' and ''storage'' group to shutdown, restart, hibernate and suspend computer.

As XBMC is geared toward being a remote-controlled media center, if your computer has an IR receiver, you will probably want to set up a remote using [[LIRC]]. Once you are sure your remote is working properly (tested with {{ic|$ irw}}), add '''lircd''' to your [[Daemons#Starting_on_Boot|DAEMONS Array]] and you'll be ready to create an Lircmap.xml file for it.

+

As XBMC is geared toward being a remote-controlled media center; any PC with a supported IR receiver/remote, can use remote using [[LIRC]] or using the native kernel supported modules. To work properly with xbmc, a file will be required that maps the lirc events to xbmc keypresses. Create an [[Wikipedia:XML|XML]] file at {{ic|~/.xbmc/userdata/Lircmap.xml}} (note the capital 'L').

−

Using your favorite text editor, you'll need to go in and create an [[Wikipedia:XML|XML]] file at {{ic|~/.xbmc/userdata/Lircmap.xml}} (note the capital 'L'). Lircmap.xml format is as follows:

+

{{Note|Users running xbmc from the included service file will find the xbmc home (~) under {{ic|/var/lib/xbmc}} and should substitute this in for the shortcut above. Also make sure that if creating this file as the root user, it gets proper ownership as xbmc:xbmc when finished.}}

+

Lircmap.xml format is as follows:

{{bc|1=<lircmap>

{{bc|1=<lircmap>

Line 58:

Line 42:

</lircmap>}}

</lircmap>}}

−

* '''Device Name''' is whatever LIRC calls your remote. This is set using the '''Name''' directive in lircd.conf and can be viewed by running {{ic|$ irw}} and pressing a few buttons on the remote. IRW will report the name of the button pressed and the name of the remote will appear on the end of the line.

+

* '''Device Name''' is whatever LIRC calls the remote. This is set using the '''Name''' directive in lircd.conf and can be viewed by running {{ic|$ irw}} and pressing a few buttons on the remote. IRW will report the name of the button pressed and the name of the remote will appear on the end of the line.

* '''XBMC_button''' is the name of the button as defined in [http://wiki.xbmc.org/index.php?title=Keymap.xml keymap.xml].

* '''XBMC_button''' is the name of the button as defined in [http://wiki.xbmc.org/index.php?title=Keymap.xml keymap.xml].

−

* '''LIRC_button''' is the name as defined in {{ic|lircd.conf}}. If you automatically generated your lircd.conf using {{ic|# irrecord}}, these are the names you selected for your button then. Refer back to [[LIRC]] for more information.

+

* '''LIRC_button''' is the name as defined in {{ic|lircd.conf}}. If lircd.conf was autogenerated using {{ic|# irrecord}}, these are the names selected for the buttons. Refer back to [[LIRC]] for more information.

−

* You may want to check out the very thorough [http://wiki.xbmc.org/index.php?title=Lircmap.xml Lircmap.xml] page over at the [http://wiki.xbmc.org/index.php?title=Main_Page XBMC Wiki] for more help and information on this subject.

+

* A very thorough [http://wiki.xbmc.org/index.php?title=Lircmap.xml Lircmap.xml] page over at the [http://wiki.xbmc.org/index.php?title=Main_Page XBMC Wiki] should be consulted for more help and information on this subject as this is out of scope of this article.

==== MCE remote with Lirc and Systemd ====

==== MCE remote with Lirc and Systemd ====

Line 77:

Line 61:

# echo lirc > /sys/class/rc/rc0/protocols

# echo lirc > /sys/class/rc/rc0/protocols

−

A udev rule can be added to make lirc the default. A write rule doesn't seem to work, so a simple RUN command can be executed instead.

+

A udev rule can be added to make lirc the default. A write rule does not seem to work, so a simple RUN command can be executed instead.

{{Note|If this does not work, follow the suggestion to use tmpfiles.d as specified in the [[LIRC#Kernel_module_change|LIRC wiki]] to set the remote to the lirc protocol at boot time.}}

Next, specify the lirc device. This varies with kernel version. As of 3.6.1 {{ic|/dev/lirc0}} should work with the default driver.

Next, specify the lirc device. This varies with kernel version. As of 3.6.1 {{ic|/dev/lirc0}} should work with the default driver.

Line 120:

Line 106:

=== Fullscreen mode stretches XBMC across multiple displays ===

=== Fullscreen mode stretches XBMC across multiple displays ===

−

If you have got a multi-monitor setup and don't want XBMC to stretch across all screens, you can restrict the fullscreen mode to one display, by setting the environment variable SDL_VIDEO_FULLSCREEN_HEAD to the number of the desired target display. For example if you want XBMC to show up on display 0 you can add the following line to your [[Bashrc]]:

+

For a multi-monitor setup, XBMC may default to stretching across all screens. One can restrict the fullscreen mode to one display by setting the environment variable SDL_VIDEO_FULLSCREEN_HEAD to the number of the desired target display. For example, having xbmc show up on display 0, add the following line to the xbmc user's [[Bashrc]]:

SDL_VIDEO_FULLSCREEN_HEAD=0

SDL_VIDEO_FULLSCREEN_HEAD=0

Revision as of 14:49, 28 November 2013

XBMC (formerly "Xbox Media Center") is a free, open source (GPL) multimedia player that originally ran on the first-generation XBox, (not the newer Xbox 360), and now runs on computers running Linux, Mac OS X, Windows, and iOS. XBMC can be used to play/view the most popular video, audio, and picture formats, and many more lesser-known formats, including:

Video - DVD-Video, VCD/SVCD, MPEG-1/2/4, DivX, XviD, Matroska

Audio - MP3, AAC.

Picture - JPG, GIF, PNG.

These can all be played directly from a CD/DVD, or from the hard-drive. XBMC can also play multimedia from a computer over a local network (LAN), or play media streams directly from the Internet. For more information, see the XBMC FAQ.

As of version 12, it can also be used to play and record live TV using a tuner, a backend server and a PVR plugin; more information about this can be found on the XBMC wiki.

Installation

Configuration

Autostarting at boot

It is desirable to start XBMC automatically on boot. Since version 11.0-11, the xbmc package will automatically create the xbmc group, user, and provide an xbmc.service so systemd can manage xbmc without the need for a DE.

To make XBMC start at system boot, enable the service:

# systemctl enable xbmc

Sharing a Database Between Multiple XBMC PCs

Provided that a box on the network is running mariadb, one can easily configure multiple xbmc boxes to share a database. The advantage of this is that key meta are stored in one place, a show can be paused on one box and then resumed on another seamlessly, and the record of what has been watched is unified.

Using a remote controller

As XBMC is geared toward being a remote-controlled media center; any PC with a supported IR receiver/remote, can use remote using LIRC or using the native kernel supported modules. To work properly with xbmc, a file will be required that maps the lirc events to xbmc keypresses. Create an XML file at ~/.xbmc/userdata/Lircmap.xml (note the capital 'L').

Note: Users running xbmc from the included service file will find the xbmc home (~) under /var/lib/xbmc and should substitute this in for the shortcut above. Also make sure that if creating this file as the root user, it gets proper ownership as xbmc:xbmc when finished.

Device Name is whatever LIRC calls the remote. This is set using the Name directive in lircd.conf and can be viewed by running $ irw and pressing a few buttons on the remote. IRW will report the name of the button pressed and the name of the remote will appear on the end of the line.

Fullscreen mode stretches XBMC across multiple displays

For a multi-monitor setup, XBMC may default to stretching across all screens. One can restrict the fullscreen mode to one display by setting the environment variable SDL_VIDEO_FULLSCREEN_HEAD to the number of the desired target display. For example, having xbmc show up on display 0, add the following line to the xbmc user's Bashrc:

SDL_VIDEO_FULLSCREEN_HEAD=0

Note: Mouse cursor will be held inside screen with XBMC.

Slowing down CD/DVD drive speed

The eject program from the util-linux package does a nice job for this, but its setting is cleared as soon as the media is changed.