Difference between revisions of "XBMC HTPC"

From MarcsHomepage
 
 
(45 intermediate revisions by the same user not shown)
Line 3: Line 3:
 
= Hardware =
 
= Hardware =
  
I decided to built a PC based on a recommendation from c't Magazine 26/2012 -not the most recent hardware and not the cheapest possible system and also not the most silens sollution, but a good overal setup:
+
I built the PC based on a [http://www.heise.de/ct/projekte/PC-Bauvorschlaege-1375124.html#anchor_2 recommendation from c't Magazine 26/2012] -not the most recent hardware (from a mid-2013 point of view) and not the cheapest possible system and also not the most silent solution, but a good overal setup:
  
* CPU: Celeron G1610 'boxed' (including cooler and fan)
+
* CPU: [http://ark.intel.com/products/71072/ Celeron G1610] 'boxed' (including cooler and fan)
* Motherboard: Gigagbyte GA-Z77MX-D3H
+
* Motherboard: [http://www.gigabyte.com/products/product-page.aspx?pid=4145 Gigagbyte GA-Z77MX-D3H]
 
* RAM: 2x4 GB Transcend JM1333KLN-8GK
 
* RAM: 2x4 GB Transcend JM1333KLN-8GK
* Disk: Samsung 840 Pro 128 GB
+
* Disk: [http://www.samsung.com/us/computer/memory-storage/MZ-7PD128BW Samsung 840 Pro 128 GB]
* BluRay: Pioneer BDR-208DBK
+
* BluRay: [http://www.pioneerelectronics.com/PUSA/Computer/Computer+Drives/BDR-208DBK Pioneer BDR-208DBK]
* Case: Silverstone GD04B
+
* Case: [http://www.silverstonetek.com/product.php?pid=233 Silverstone GD04B]
* Power supply: be quiet! Pure Power L7 350W
+
* Power supply: [http://www.bequiet.com/en/powersupply/45 be quiet! Pure Power L7 350W]
* Case fan: 2x Scythe Slip Stream 120 500rpm (SY1225SL12SL)
+
* Case fan: 2x [http://www.scythe-usa.com/product/acc/026/sy1225sl_detail.html Scythe Slip Stream 120] 500rpm (SY1225SL12SL)
 +
* [http://flirc.tv/ flirc.tv]: IR dongle (shares the remote of my Sony TV)
 +
 
 +
Surprisingly, there are only very few HTPC cases, which fit in a HiFi rack, while having enough space for regular microATX components, a full size BD-ROM player and USB 3 front ports.
 +
 
 +
I had a look at the [http://www.silverstonetek.com/product.php?pid=233 Silverstone GD04B] (the only with USB 3 front connectors AND a full size drive bay), the [http://www.fractal-design.com/?view=product&prod=95 FractalDesign Node605] (only slimline drives) and the [http://www.origenae.com/en/htpc_h6.htm OrigenAE H6] (no front USB 3) which I liked the most, but which was unfortunately too large for my cabinet. Finally I chose the Silverstone case. The aluminium front panel is nice, but the overall built quality is not spectacular given the price (and it has only two "HiFi" feet at the front).
  
 
I had to replace the fans, which came with the Silverstone case, because they are really noisy. The CPU fan is acceptable. Overall, this makes for a very silent (but still audible) system, which -thanks to the SSD- boots in < 20 sec. to XBMC.
 
I had to replace the fans, which came with the Silverstone case, because they are really noisy. The CPU fan is acceptable. Overall, this makes for a very silent (but still audible) system, which -thanks to the SSD- boots in < 20 sec. to XBMC.
 +
 +
All media data is stored on a home NAS, thus only a small system disk had to be installed.
  
 
== Assembly ==
 
== Assembly ==
 +
 +
Straight forward, no surprises -although I can't remember when I last had to dig out a screwdriver to fix drives and case lids in place (no thumb screws on the GD04).
 +
 +
Some Images:
 +
 +
{|
 +
|[[Image:xbmc_htpc_parts.jpg|thumb|XBMC HTPC Parts.|300px]]
 +
|[[Image:xbmc_htpc_assembled.jpg|thumb|XBMC HTPC partly assembled.|300px]]
 +
|}
 +
As you can see, the mainboard and the power supply fit well into the Silverstone chassis. The BD-drive will sit on top of the motherboard, providing some headache in case you want to replace the boxed cooler and fan with a low noise cooler.
 +
 +
There are [http://www.anandtech.com/show/4072/silverstone-gd04-htpc-case-cool-not-quiet quite] [http://www.hardwaresecrets.com/article/857 a few] reviews on the case out there, so no more details.
 +
{{clear}}
  
 
= Software =
 
= Software =
  
== Operating System ==
+
* '''Operating System:''' Had to be Linux if possible. The most mainstream Media Center software seemed to be XBMC, which is developed using Ubuntu, so this decided the flavour of underlying OS. To prevent a reinstall every 9 month or so, I decided to go with the current LTS version [http://releases.ubuntu.com/precise/ 12.04 Precise Pangolin].<br/>In case things would not work out (e.g. unresolvable issues with graphics, sound or BD-playback) I had planned to fail back to Windows 7.
 +
* '''Media Center Software:''' [http://xbmc.org/xbmc-12-0-frodo/ XBMC 12 Frodo].
 +
 
 +
== Installation ==
 +
 
 +
I did a Ubuntu 12.04 minimal install (from CD-RW), basically following the HowTo discussed on http://wiki.xbmc.org/index.php?title=Installing_XBMC_for_Linux#Official_Team_XBMC_repositories. It took me surprisingly long to find out, what the basis for XBMCbuntu is, and which alternatives exist (I considered OpenElec and other distros/other versions of Ubuntu).
 +
 
 +
There are several other HowTos, which are more detailed and apparently there is none covering the most recent version vanilla installation in details (although this is easy to do, it would be nice).
 +
 
 +
 
 +
login as unpriviledged Ubuntu user "xbmc".
 +
 
 +
<pre>
 +
sudo su -
 +
apt-get install python-software-properties pkg-config
 +
apt-get install software-properties-common
 +
add-apt-repository ppa:team-xbmc/ppa
 +
apt-get update
 +
apt-get install xbmc
 +
</pre>
 +
 
 +
First test start (no autostart yet)
 +
 
 +
<pre>
 +
exec su -c "xinit /usr/bin/xbmc --standalone -- -nocursor :0" xbmc
 +
</pre>
  
== Media Center Software ==
+
=== Hardware acceleration ===
 +
It worked (tm), but without hardware acceleration apparently, see Debug settings in XBMC or simply press "o" (see http://wiki.xbmc.org/index.php?title=Keyboard for the XBMC keyboard layout).
  
== Installation ==
+
Hardware acceleration should work, but it does not. Reading XBMC forum entries yielded some hints, that the Intel driver must be above a certain version number.
 +
 
 +
Check version of driver:
 +
<pre>
 +
apt-cache policy xserver-xorg-video-intel
 +
--> [..]2:2.17[..]
 +
</pre>
 +
 
 +
this is too old (e.g. no sna acceleration for Intel 2000), need to install this from yet another ppa
 +
 
 +
<pre>
 +
sudo add-apt-repository ppa:glasen/intel-driver
 +
[..]Installs 2.2:21[..]
 +
</pre>
 +
 
 +
There where some warnings about KMS deactivated in grub with e.g. "i915.modeset=0" in /etc/default/grub
 +
 
 +
<pre>
 +
sudo apt-get update
 +
sudo apt-get dist-upgrade
 +
</pre>
 +
 
 +
This installed mesa et al. and the new Intel driver.But starting xbmc crashed the X server.
 +
 
 +
It seemed that X had been initialized using the correct SNA module:
 +
 
 +
<pre>
 +
xbmc@hollywood:~$ cat /var/log/Xorg.0.log | grep -i sna
 +
[    48.445] (**) intel(0): Option "AccelMethod" "sna"
 +
[    48.776] (II) intel(0): SNA initialized with Ivybridge (gen7, gt1) backend
 +
</pre>
 +
 
 +
It turns out, that the default user does not belong to the video group by default, see: http://ubuntuforums.org/showthread.php?t=2122588, which boils down to
 +
 
 +
<pre>
 +
xbmc@hollywood:/var/log$ sudo usermod -a -G video xbmc
 +
xbmc@hollywood:/var/log$ sudo usermod -a -G audio xbmc
 +
</pre>
 +
 
 +
and we are go.
 +
 
 +
=== HD audio via HDMI ===
 +
 
 +
I skipped HD Audio via HDMI, as this would only work with the TV, but not the amplifier (which is an old Fisher analog stereo amp with analog input only). If you want HD audio, prepare for some trouble: See here as an entry point: http://forum.xbmc.org/showthread.php?tid=156400
 +
See here: http://forum.xbmc.org/showthread.php?tid=34655, and also here (very useful): http://wiki.xbmc.org/index.php?title=AudioEngine/HOW-TO:_Configure_audio, and finaly this: http://wiki.xbmc.org/index.php?title=Intel_Linux_Modifications_for_HD_Audio i.e. it seems we hit the jackpot again, as 12.04 has
 +
 
 +
<pre>
 +
xbmc@hollywood:~$ uname -a
 +
Linux hollywood 3.2.0-48-generic-pae #74-Ubuntu SMP Thu Jun 6 20:05:01 UTC 2013 i686 i686 i386 GNU/Linux
 +
</pre>
 +
 
 +
D'oh!
 +
 
 +
=== Silence the BD drive ===
 +
 
 +
As the BD drive was a bit noisy, I tried to silence it using spindown: http://forum.xbmc.org/showthread.php?pid=523814%23pid523814 with mixed results.
 +
 
 +
=== Auto eject not working ===
 +
 
 +
There where severe issues with auto-ejecting CD-ROMs etc. The only (of the many) solutions, which worked, was this:
 +
 
 +
Edit the udev rule <tt>/etc/udev/rules.d/70-persistent-cd.rules</tt> and add another RUN script, which sets eject -i 0 for all defined drives. Thereby unlocking the open/close button (although it appears to be unlocked already). It did not help to put that extra rule in a custom udev rules file (although it should). If I have more time to dig into this, I may update this section. It works for now, but be aware, that any regular updates may overwrite the file.
 +
 
 +
=== Shutdown ===
 +
 
 +
Tweaked shutdown like this: http://wiki.xbmc.org/index.php?title=HOW-TO:Suspend_and_wake_in_Ubuntu
 +
 
 +
=== Playing BluRay disks ===
 +
 
 +
BluRay info can be found here: https://wiki.archlinux.org/index.php/BluRay
 +
 
 +
Apparently one needs libaacs, as a basis for libbluray. libaacs then needs a KEYDB.file, which may or may not be legal to posses. Follow the links.
 +
 
 +
=== Minor stuff ===
 +
 
 +
I tried to remove the Canonical advertisements (MOTD based) with this
 +
 
 +
http://askubuntu.com/questions/23246/how-do-i-edit-the-ssh-motd
 +
 
 +
and
 +
 
 +
http://manpages.ubuntu.com/manpages/raring/man1/landscape-sysinfo.1.html
 +
 
 +
basically  <tt>landscape-sysinfo --exclude-sysinfo-plugins=LandscapeLink</tt>
 +
 
 +
and we are good.
 +
 
 +
== Things which work ==
 +
* DVD playback and DVD autostart on insert
 +
* CD-ROM playback and CD-ROM autostart on insert, auto eject (either via eject button or hardware button)
 +
* Scanning of media libraries (video, audio)
 +
* mkv and other video formats (including fan-art display etc.)
 +
* mp3 and other audio formats
 +
* Megapixel image display
 +
* Video streaming (Youtube et al)
  
= Things which work ==
+
So all basic functions of XBMC work as advertised using hardware acceleration where possible.
  
 
== Issues ==
 
== Issues ==
* BluRay playback: As advertised. BD+ encrypted discs won't play, the others will work more or less (with menus working halfways).
+
* BluRay playback: As advertised. BD+ encrypted discs won't play, the others will work more or less (with menus working halfways). You can work around that -whether the workaround is legal or not is up to where you live.
* Hanging system.
+
* Hanging system. I had several occasions (while playing audio CD-ROMs and DVDs) when XBMC got stuck. I was able to login via ssh in some cases and e.g. kill the XBMC process or restart the machine. Should not happen.
 +
* flirc.tv. Although a very hassle free solution (insert in USB port at the back (sic!) of the case and go (no direct line of sight needed)) it has an anoying issue with key repeats. If I press and hold a key on the Sony remote, flirc.tv apparently issues lots of key presses, which confuses XBMC at times. To date no solution to this.
 +
* Noisy BD drive. The BD-drive is somewhat resistant to "spindown", it appears to get less noisy, but not really silent. At least not to audio CD player noise level.
 +
* There is a short but anoying cracking sound on the loudspeakers on startup. No workaround yet.
 +
 
 +
The system still feels a bit too much like a PC at times (startup with fans at max speed for a moment, software issues described above, some of the XBMC GUI behaviour).

Latest revision as of 16:35, 26 October 2013

After my old CD-Player broke down I decided that it would be time to replace the 20 year old ancient HiFi rack with something more suitable. Either an universal player or a self built HTPC. The HTPC won obviously...

Hardware

I built the PC based on a recommendation from c't Magazine 26/2012 -not the most recent hardware (from a mid-2013 point of view) and not the cheapest possible system and also not the most silent solution, but a good overal setup:

Surprisingly, there are only very few HTPC cases, which fit in a HiFi rack, while having enough space for regular microATX components, a full size BD-ROM player and USB 3 front ports.

I had a look at the Silverstone GD04B (the only with USB 3 front connectors AND a full size drive bay), the FractalDesign Node605 (only slimline drives) and the OrigenAE H6 (no front USB 3) which I liked the most, but which was unfortunately too large for my cabinet. Finally I chose the Silverstone case. The aluminium front panel is nice, but the overall built quality is not spectacular given the price (and it has only two "HiFi" feet at the front).

I had to replace the fans, which came with the Silverstone case, because they are really noisy. The CPU fan is acceptable. Overall, this makes for a very silent (but still audible) system, which -thanks to the SSD- boots in < 20 sec. to XBMC.

All media data is stored on a home NAS, thus only a small system disk had to be installed.

Assembly

Straight forward, no surprises -although I can't remember when I last had to dig out a screwdriver to fix drives and case lids in place (no thumb screws on the GD04).

Some Images:

XBMC HTPC Parts.
XBMC HTPC partly assembled.

As you can see, the mainboard and the power supply fit well into the Silverstone chassis. The BD-drive will sit on top of the motherboard, providing some headache in case you want to replace the boxed cooler and fan with a low noise cooler.

There are quite a few reviews on the case out there, so no more details.

Software

  • Operating System: Had to be Linux if possible. The most mainstream Media Center software seemed to be XBMC, which is developed using Ubuntu, so this decided the flavour of underlying OS. To prevent a reinstall every 9 month or so, I decided to go with the current LTS version 12.04 Precise Pangolin.
    In case things would not work out (e.g. unresolvable issues with graphics, sound or BD-playback) I had planned to fail back to Windows 7.
  • Media Center Software: XBMC 12 Frodo.

Installation

I did a Ubuntu 12.04 minimal install (from CD-RW), basically following the HowTo discussed on http://wiki.xbmc.org/index.php?title=Installing_XBMC_for_Linux#Official_Team_XBMC_repositories. It took me surprisingly long to find out, what the basis for XBMCbuntu is, and which alternatives exist (I considered OpenElec and other distros/other versions of Ubuntu).

There are several other HowTos, which are more detailed and apparently there is none covering the most recent version vanilla installation in details (although this is easy to do, it would be nice).


login as unpriviledged Ubuntu user "xbmc".

sudo su -
apt-get install python-software-properties pkg-config
apt-get install software-properties-common
add-apt-repository ppa:team-xbmc/ppa
apt-get update
apt-get install xbmc

First test start (no autostart yet)

exec su -c "xinit /usr/bin/xbmc --standalone -- -nocursor :0" xbmc

Hardware acceleration

It worked (tm), but without hardware acceleration apparently, see Debug settings in XBMC or simply press "o" (see http://wiki.xbmc.org/index.php?title=Keyboard for the XBMC keyboard layout).

Hardware acceleration should work, but it does not. Reading XBMC forum entries yielded some hints, that the Intel driver must be above a certain version number.

Check version of driver:

apt-cache policy xserver-xorg-video-intel 
--> [..]2:2.17[..]

this is too old (e.g. no sna acceleration for Intel 2000), need to install this from yet another ppa

sudo add-apt-repository ppa:glasen/intel-driver 
[..]Installs 2.2:21[..] 

There where some warnings about KMS deactivated in grub with e.g. "i915.modeset=0" in /etc/default/grub

sudo apt-get update
sudo apt-get dist-upgrade

This installed mesa et al. and the new Intel driver.But starting xbmc crashed the X server.

It seemed that X had been initialized using the correct SNA module:

xbmc@hollywood:~$ cat /var/log/Xorg.0.log | grep -i sna
[    48.445] (**) intel(0): Option "AccelMethod" "sna"
[    48.776] (II) intel(0): SNA initialized with Ivybridge (gen7, gt1) backend

It turns out, that the default user does not belong to the video group by default, see: http://ubuntuforums.org/showthread.php?t=2122588, which boils down to

xbmc@hollywood:/var/log$ sudo usermod -a -G video xbmc
xbmc@hollywood:/var/log$ sudo usermod -a -G audio xbmc

and we are go.

HD audio via HDMI

I skipped HD Audio via HDMI, as this would only work with the TV, but not the amplifier (which is an old Fisher analog stereo amp with analog input only). If you want HD audio, prepare for some trouble: See here as an entry point: http://forum.xbmc.org/showthread.php?tid=156400 See here: http://forum.xbmc.org/showthread.php?tid=34655, and also here (very useful): http://wiki.xbmc.org/index.php?title=AudioEngine/HOW-TO:_Configure_audio, and finaly this: http://wiki.xbmc.org/index.php?title=Intel_Linux_Modifications_for_HD_Audio i.e. it seems we hit the jackpot again, as 12.04 has

xbmc@hollywood:~$ uname -a
Linux hollywood 3.2.0-48-generic-pae #74-Ubuntu SMP Thu Jun 6 20:05:01 UTC 2013 i686 i686 i386 GNU/Linux

D'oh!

Silence the BD drive

As the BD drive was a bit noisy, I tried to silence it using spindown: http://forum.xbmc.org/showthread.php?pid=523814%23pid523814 with mixed results.

Auto eject not working

There where severe issues with auto-ejecting CD-ROMs etc. The only (of the many) solutions, which worked, was this:

Edit the udev rule /etc/udev/rules.d/70-persistent-cd.rules and add another RUN script, which sets eject -i 0 for all defined drives. Thereby unlocking the open/close button (although it appears to be unlocked already). It did not help to put that extra rule in a custom udev rules file (although it should). If I have more time to dig into this, I may update this section. It works for now, but be aware, that any regular updates may overwrite the file.

Shutdown

Tweaked shutdown like this: http://wiki.xbmc.org/index.php?title=HOW-TO:Suspend_and_wake_in_Ubuntu

Playing BluRay disks

BluRay info can be found here: https://wiki.archlinux.org/index.php/BluRay

Apparently one needs libaacs, as a basis for libbluray. libaacs then needs a KEYDB.file, which may or may not be legal to posses. Follow the links.

Minor stuff

I tried to remove the Canonical advertisements (MOTD based) with this

http://askubuntu.com/questions/23246/how-do-i-edit-the-ssh-motd

and

http://manpages.ubuntu.com/manpages/raring/man1/landscape-sysinfo.1.html

basically landscape-sysinfo --exclude-sysinfo-plugins=LandscapeLink

and we are good.

Things which work

  • DVD playback and DVD autostart on insert
  • CD-ROM playback and CD-ROM autostart on insert, auto eject (either via eject button or hardware button)
  • Scanning of media libraries (video, audio)
  • mkv and other video formats (including fan-art display etc.)
  • mp3 and other audio formats
  • Megapixel image display
  • Video streaming (Youtube et al)

So all basic functions of XBMC work as advertised using hardware acceleration where possible.

Issues

  • BluRay playback: As advertised. BD+ encrypted discs won't play, the others will work more or less (with menus working halfways). You can work around that -whether the workaround is legal or not is up to where you live.
  • Hanging system. I had several occasions (while playing audio CD-ROMs and DVDs) when XBMC got stuck. I was able to login via ssh in some cases and e.g. kill the XBMC process or restart the machine. Should not happen.
  • flirc.tv. Although a very hassle free solution (insert in USB port at the back (sic!) of the case and go (no direct line of sight needed)) it has an anoying issue with key repeats. If I press and hold a key on the Sony remote, flirc.tv apparently issues lots of key presses, which confuses XBMC at times. To date no solution to this.
  • Noisy BD drive. The BD-drive is somewhat resistant to "spindown", it appears to get less noisy, but not really silent. At least not to audio CD player noise level.
  • There is a short but anoying cracking sound on the loudspeakers on startup. No workaround yet.

The system still feels a bit too much like a PC at times (startup with fans at max speed for a moment, software issues described above, some of the XBMC GUI behaviour).