https://wiki.archlinux.org/api.php?action=feedcontributions&user=Rpeinthor&feedformat=atomArchWiki - User contributions [en]2024-03-29T15:09:06ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Kodi&diff=198850Kodi2012-04-24T16:18:06Z<p>Rpeinthor: ad a hint for suspend, hibernate problems</p>
<hr />
<div>[[Category:Audio/Video]]<br />
{{i18n|Xbmc}}<br />
<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 />
==Starting XBMC==<br />
<br />
First install [[D-Bus]] and add it to your [[Daemons#Starting_on_Boot|DAEMONS Array]] if you have not already:<br />
<br />
{{bc|(... '''dbus''' ...)}}<br />
<br />
Next, you'll probably want to get [[ConsoleKit]] up and running, if you have not already, and add the following line to your {{ic|.xinitrc}}:<br />
<br />
{{bc|exec ck-launch-session xbmc-standalone}}<br />
<br />
Make sure you add your user (or whatever user will run xmbc on your system) to at least groups '''audio''', '''video''', and '''storage'''.<br />
<br />
{{bc|$ for x in audio video storage; do sudo gpasswd -a $USER $x; done}}<br />
<br />
{{Note|If you do not run [[Sudo]], simply run the above command as root. You may also need to swap out $USER for another username if you are not logged in as the xbmc user.}}<br />
<br />
===Autostarting at Boot===<br />
<br />
Using the above method, xbmc should run every time you start your X server, so auto-starting at boot can be configured just like a [[Display Manager]], with one important difference. If you choose to use the {{ic|/etc/inittab}} method, you can skip loading a display manager altogether and autologin XBMC by default. To do this, change your default runlevel to 5 in {{ic|/etc/inittab}} as usual:<br />
<br />
{{bc|## Only one of the following two lines can be uncommented!<br />
# Boot to console<br />
'''#'''id:3:initdefault:<br />
# Boot to X11<br />
id:5:initdefault:}}<br />
<br />
Note the comment (#) in front of {{ic|id:3:initdefault:}} and not {{ic|id:5:initdefault}}. Then, comment out all the default display manager lines at the end of the file:<br />
<br />
{{bc|# Example lines for starting a login manager<br />
#x:5:respawn:/usr/bin/xdm -nodaemon<br />
#x:5:respawn:/usr/sbin/gdm -nodaemon<br />
#x:5:respawn:/usr/bin/kdm -nodaemon<br />
#x:5:respawn:/usr/bin/slim >/dev/null 2>&1}}<br />
<br />
Finally, add this line (toward the end of the file, near where the lines you just commented are):<br />
<br />
{{bc|x:5:wait:login -f <YOUR_XBMC_USERNAME> </dev/tty7 &>/dev/tty7}}<br />
<br />
{{Warning|'''There is a security risk using this method.''' This bypasses login authentication and should only be used if you are sure you know what you are doing!}}<br />
<br />
If you use systemd you can try this:<br />
{{hc|/etc/systemd/system/autologin.service|<nowiki><br />
[Unit]<br />
Description=Direct login to X<br />
Requires=dev-tty7.device<br />
yAfter=dev-tty7.device systemd-user-sessions.service<br />
<br />
[Service]<br />
Restart=always<br />
ExecStart=/sbin/mingetty --autologin <username> tty7 linux<br />
<br />
[Install]<br />
WantedBy=graphical.target<br />
</nowiki>}}<br />
<br />
Save your {{ic|/etc/inittab}} changes and add the following to your {{ic|.bash_profile}}:<br />
<br />
{{bc|<nowiki>[[ $(tty) = "/dev/tty7" ]] && exec startx </dev/null &>/dev/null</nowiki>}}<br />
<br />
You may also add a {{ic|.hushlogin}} to your home directory to further suppress login messages:<br />
<br />
{{bc|touch ~/.hushlogin}}<br />
<br />
==Configuration==<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 />
==Shutdown-Suspend-Hibernate==<br />
<br />
If you have problems with shutdown, suspend or hibernate within XBMC make sure your user is in the ''wheel'' group and also that the upower package is installed.<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>Rpeinthor