https://wiki.archlinux.org/api.php?action=feedcontributions&user=Ptk&feedformat=atomArchWiki - User contributions [en]2024-03-28T10:32:04ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Kodi&diff=255719Kodi2013-04-30T07:44:57Z<p>Ptk: </p>
<hr />
<div>[[Category:Player]]<br />
XBMC (formerly "Xbox Media Center") is a free, [http://www.gnu.org/copyleft/gpl.html open source (GPL)] multimedia player that originally ran on the first-generation [[Wikipedia:Microsoft Xbox|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: <br />
<br />
* Video - DVD-Video, VCD/SVCD, MPEG-1/2/4, DivX, XviD, Matroska <br />
* Audio - MP3, AAC. <br />
* Picture - JPG, GIF, PNG. <br />
<br />
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].<br />
<br />
==Installation==<br />
<br />
{{Note|These instructions assume you have a working X installation. If you have not done this yet, please consult [[Beginners_Guide#Graphical_User_Interface]].}}<br />
<br />
The stable version of XBMC is available in the community repo:<br />
<br />
{{bc|# pacman -Syu xbmc}}<br />
<br />
The SVN (testing) version of XBMC can be downloaded from the [[AUR]] ([https://aur.archlinux.org/packages.php?ID=45036 XBMC-git]), e.g. using yaourt:<br />
<br />
{{bc|# yaourt -Syua xbmc-git}}<br />
<br />
{{Warning|This is not the recommended way of using XBMC, as svn versions are always on the bleeding edge of development and thus can break sometimes. If you want a stable media center experience, go with the stable releases.}}<br />
<br />
If you plan to use the pvr extensions of xbmc you will need to install the addons separately. <br />
<br />
{{bc|# pacman -S xbmc-pvr-addons}}<br />
<br />
==Configuration==<br />
<br />
===Autostarting at boot===<br />
<br />
To use XBMC on HTPC you may want to start XBMC automatically on boot. Since version 11.0-11 {{ic|xbmc}} package includes the xbmc group, user, and service file necessary to do this.<br />
<br />
To make XBMC start at system boot you should simply enable the service:<br />
<br />
{{bc|# systemctl enable xbmc}}<br />
<br />
===Enabling shutdown, restart, hibernate and suspend===<br />
<br />
Since version 12 XBMC supports power management via systemd logind daemon. To enable it you should have {{ic|polkit}} and {{ic|upower}} installed on your system.<br />
<br />
{{bc|# pacman -S polkit upower}}<br />
<br />
Add the following rule file which will allow users added to ''power'' group shutdown, restart, hibernate and suspend computer.<br />
<br />
{{hc|/etc/polkit-1/rules.d/10-xbmc.rules|2=<br />
polkit.addRule(function(action, subject) {<br />
if(action.id.match("org.freedesktop.login1.") && subject.isInGroup("power")) {<br />
return polkit.Result.YES;<br />
}<br />
});<br />
}}<br />
<br />
===Using a Remote===<br />
<br />
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.<br />
<br />
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: <br />
<br />
{{bc|1=<lircmap><br />
<remote device="devicename"><br />
<XBMC_button>LIRC_button</XBMC_button><br />
...<br />
</remote><br />
</lircmap>}}<br />
<br />
* '''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.<br />
<br />
* '''XBMC_button''' is the name of the button as defined in [http://wiki.xbmc.org/index.php?title=Keymap.xml keymap.xml].<br />
<br />
* '''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.<br />
<br />
* 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.<br />
<br />
==== MCE Remote with Lirc and Systemd ====<br />
<br />
Install lirc-utils and link the mce config:<br />
<br />
{{bc|pacman -S lirc-utils<br />
ln -s /usr/share/lirc/remotes/mceusb/lircd.conf.mceusb /etc/lirc/lircd.conf}}<br />
<br />
Then, make sure the remote is using the lirc protocol.<br />
<br />
{{bc|cat /sys/class/rc/rc0/protocols # [lirc] should be selected<br />
echo lirc > /sys/class/rc/rc0/protocols # manually set lirc}}<br />
<br />
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.<br />
<br />
{{hc|/etc/udev/rules.d/99-lirc.rules|2=<br />
KERNEL=="rc*", SUBSYSTEM=="rc", ATTR{protocols}=="*lirc*", RUN+="/bin/sh -c 'echo lirc > $sys$devpath/protocols'"}}<br />
<br />
Next, specify the lirc device. This varies with kernel version. As of 3.6.1 {{ic|/dev/lirc0}} should work with the default driver.<br />
<br />
{{hc|/etc/conf.d/lircd.conf|2=<br />
#<br />
# Parameters for lirc daemon<br />
#<br />
<br />
LIRC_DEVICE="/dev/lirc0"<br />
LIRC_DRIVER="default"<br />
LIRC_EXTRAOPTS=""<br />
LIRC_CONFIGFILE=""}}<br />
<br />
The default service file for lirc ignores this conf file. So we need to create a custom one.<br />
<br />
{{hc|/etc/systemd/system/lirc.service|2=<br />
[Unit]<br />
Description=Linux Infrared Remote Control<br />
<br />
[Service]<br />
EnvironmentFile=/etc/conf.d/lircd.conf<br />
ExecStartPre=/usr/bin/ln -sf /run/lirc/lircd /dev/lircd<br />
ExecStart=/usr/sbin/lircd --pidfile=/run/lirc/lircd.pid --device=${LIRC_DEVICE} --driver=${LIRC_DRIVER}<br />
Type=forking<br />
PIDFile=/run/lirc/lircd.pid<br />
<br />
[Install]<br />
WantedBy=multi-user.target}}<br />
<br />
Finally, enable and start the lirc service.<br />
<br />
{{bc|systemctl enable lirc<br />
systemctl start lirc}}<br />
<br />
This should give a fully working mce remote.<br />
<br />
===Fullscreen mode stretches XBMC accross multiple displays===<br />
<br />
If you have got a multi-monitor setup and don't want XBMC to stretch accross 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]]:<br />
<br />
{{bc|1=SDL_VIDEO_FULLSCREEN_HEAD=0}}<br />
<br />
{{Note|Mouse corsor will be hold inside screen with XBMC.}}<br />
<br />
===Slowing down CD/DVD drive speed===<br />
The {{ic|eject}} program from the {{ic|util-linux}} package does a nice job for this, but its setting is cleared as soon as the media is changed.<br />
<br />
This udev-rule reduces the speed permanently:<br />
<br />
{{hc|/etc/udev/rules.d/dvd-speed.rules|2=<br />
KERNEL=="sr0", ACTION=="change", ENV{DISK_MEDIA_CHANGE}=="1", RUN+="/usr/bin/eject -x 2 /dev/sr0"<br />
}}<br />
<br />
Replace {{ic|sr0}} with the device name of your optical drive. Replace {{ic|-x 2}} with {{ic|-x 4}} if you prefer 4x-speed instead of 2x-speed.<br />
<br />
After creating the file, reload the udev rules with<br />
{{bc|udevadm control --reload}}<br />
<br />
==Resources==<br />
<br />
* [http://wiki.xbmc.org/index.php?title=Main_Page XBMC Wiki]: An excellent resource with much information about Arch Linux specifically (upon which the original version of this article was largely based).</div>Ptkhttps://wiki.archlinux.org/index.php?title=Kodi&diff=255718Kodi2013-04-30T07:37:28Z<p>Ptk: /* Enabling shutdown, restart, hibernate and suspend */</p>
<hr />
<div>[[Category:Player]]<br />
XBMC (formerly "Xbox Media Center") is a free, [http://www.gnu.org/copyleft/gpl.html open source (GPL)] multimedia player that originally ran on the first-generation [[Wikipedia:Microsoft Xbox|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: <br />
<br />
* Video - DVD-Video, VCD/SVCD, MPEG-1/2/4, DivX, XviD, Matroska <br />
* Audio - MP3, AAC. <br />
* Picture - JPG, GIF, PNG. <br />
<br />
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].<br />
<br />
==Installation==<br />
<br />
{{Note|These instructions assume you have a working X installation. If you have not done this yet, please consult [[Beginners_Guide#Graphical_User_Interface]].}}<br />
<br />
The stable version of XBMC is available in the community repo:<br />
<br />
{{bc|# pacman -Syu xbmc}}<br />
<br />
The SVN (testing) version of XBMC can be downloaded from the [[AUR]] ([https://aur.archlinux.org/packages.php?ID=45036 XBMC-git]), e.g. using yaourt:<br />
<br />
{{bc|# yaourt -Syua xbmc-git}}<br />
<br />
{{Warning|This is not the recommended way of using XBMC, as svn versions are always on the bleeding edge of development and thus can break sometimes. If you want a stable media center experience, go with the stable releases.}}<br />
<br />
If you plan to use the pvr extensions of xbmc you will need to install the addons separately. <br />
<br />
{{bc|# pacman -S xbmc-pvr-addons}}<br />
<br />
==Configuration==<br />
<br />
===Autostarting at boot===<br />
<br />
To use XBMC on HTPC you may want to start XBMC automatically on boot. Since version 11.0-11 {{ic|xbmc}} package includes the xbmc group, user, and service file necessary to do this.<br />
<br />
To make XBMC start at system boot you should simply enable the service:<br />
<br />
{{bc|# systemctl enable xbmc}}<br />
<br />
===Enabling shutdown, restart, hibernate and suspend===<br />
<br />
Since version 12 XBMC supports power management via systemd logind daemon. To enable it you should have {{ic|polkit}} and {{ic|upower}} installed on your system.<br />
<br />
Add the following rule file which will allow users added to ''power'' group shutdown, restart, hibernate and suspend computer.<br />
<br />
{{hc|/etc/polkit-1/rules.d/10-xbmc.rules|2=<br />
polkit.addRule(function(action, subject) {<br />
if(action.id.match("org.freedesktop.login1.") && subject.isInGroup("power")) {<br />
return polkit.Result.YES;<br />
}<br />
});<br />
}}<br />
<br />
===Using a Remote===<br />
<br />
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.<br />
<br />
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: <br />
<br />
{{bc|1=<lircmap><br />
<remote device="devicename"><br />
<XBMC_button>LIRC_button</XBMC_button><br />
...<br />
</remote><br />
</lircmap>}}<br />
<br />
* '''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.<br />
<br />
* '''XBMC_button''' is the name of the button as defined in [http://wiki.xbmc.org/index.php?title=Keymap.xml keymap.xml].<br />
<br />
* '''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.<br />
<br />
* 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.<br />
<br />
==== MCE Remote with Lirc and Systemd ====<br />
<br />
Install lirc-utils and link the mce config:<br />
<br />
{{bc|pacman -S lirc-utils<br />
ln -s /usr/share/lirc/remotes/mceusb/lircd.conf.mceusb /etc/lirc/lircd.conf}}<br />
<br />
Then, make sure the remote is using the lirc protocol.<br />
<br />
{{bc|cat /sys/class/rc/rc0/protocols # [lirc] should be selected<br />
echo lirc > /sys/class/rc/rc0/protocols # manually set lirc}}<br />
<br />
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.<br />
<br />
{{hc|/etc/udev/rules.d/99-lirc.rules|2=<br />
KERNEL=="rc*", SUBSYSTEM=="rc", ATTR{protocols}=="*lirc*", RUN+="/bin/sh -c 'echo lirc > $sys$devpath/protocols'"}}<br />
<br />
Next, specify the lirc device. This varies with kernel version. As of 3.6.1 {{ic|/dev/lirc0}} should work with the default driver.<br />
<br />
{{hc|/etc/conf.d/lircd.conf|2=<br />
#<br />
# Parameters for lirc daemon<br />
#<br />
<br />
LIRC_DEVICE="/dev/lirc0"<br />
LIRC_DRIVER="default"<br />
LIRC_EXTRAOPTS=""<br />
LIRC_CONFIGFILE=""}}<br />
<br />
The default service file for lirc ignores this conf file. So we need to create a custom one.<br />
<br />
{{hc|/etc/systemd/system/lirc.service|2=<br />
[Unit]<br />
Description=Linux Infrared Remote Control<br />
<br />
[Service]<br />
EnvironmentFile=/etc/conf.d/lircd.conf<br />
ExecStartPre=/usr/bin/ln -sf /run/lirc/lircd /dev/lircd<br />
ExecStart=/usr/sbin/lircd --pidfile=/run/lirc/lircd.pid --device=${LIRC_DEVICE} --driver=${LIRC_DRIVER}<br />
Type=forking<br />
PIDFile=/run/lirc/lircd.pid<br />
<br />
[Install]<br />
WantedBy=multi-user.target}}<br />
<br />
Finally, enable and start the lirc service.<br />
<br />
{{bc|systemctl enable lirc<br />
systemctl start lirc}}<br />
<br />
This should give a fully working mce remote.<br />
<br />
===Fullscreen mode stretches XBMC accross multiple displays===<br />
<br />
If you have got a multi-monitor setup and don't want XBMC to stretch accross 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]]:<br />
<br />
{{bc|1=SDL_VIDEO_FULLSCREEN_HEAD=0}}<br />
<br />
{{Note|Mouse corsor will be hold inside screen with XBMC.}}<br />
<br />
===Slowing down CD/DVD drive speed===<br />
The {{ic|eject}} program from the {{ic|util-linux}} package does a nice job for this, but its setting is cleared as soon as the media is changed.<br />
<br />
This udev-rule reduces the speed permanently:<br />
<br />
{{hc|/etc/udev/rules.d/dvd-speed.rules|2=<br />
KERNEL=="sr0", ACTION=="change", ENV{DISK_MEDIA_CHANGE}=="1", RUN+="/usr/bin/eject -x 2 /dev/sr0"<br />
}}<br />
<br />
Replace {{ic|sr0}} with the device name of your optical drive. Replace {{ic|-x 2}} with {{ic|-x 4}} if you prefer 4x-speed instead of 2x-speed.<br />
<br />
After creating the file, reload the udev rules with<br />
{{bc|udevadm control --reload}}<br />
<br />
==Resources==<br />
<br />
* [http://wiki.xbmc.org/index.php?title=Main_Page XBMC Wiki]: An excellent resource with much information about Arch Linux specifically (upon which the original version of this article was largely based).</div>Ptk