The system runs Arch Linux with Kodi and Chrome to view Netflix. The post will not go into detail on how to configure Kodi, but rather getting the other pieces of the puzzle setup. Read part 1 here: HTPC/NAS for watching Netflix on Linux part 1: the hardware
Originally the setup used Pipelight to watch Netflix, but I have moved away from that, because Chrome for Linux has native support for Netflix playback since version 42.
Xorg setup
The system uses integrated Intel HD 4400 Graphics, and works without any configuration, but to tweak driver settings I created the file /etc/X11/xorg.conf.d/40-device.conf
and added:
Section "Device" Identifier "Card0" Driver "intel" Option "TearFree" "on" Option "TripleBuffer" "on" Option "Tiling" "on" Option "monitor-HDMI1" "HDMI1" EndSection
Refer to the Arch Linux wiki entry on Xorg for more information
Auto login
As Arch Linux uses systemd I just followed the instructions for setting up auto login to console.
Create the directory /etc/systemd/system/getty@tty1.service.d
and add the following content to the file: /etc/systemd/system/getty@tty1.service.d/autologin.conf
[Service] ExecStart= ExecStart=-/usr/bin/agetty --autologin YOUR_USERNAME --noclear %I 38400 linux
Remember to change YOUR_USERNAME
Auto start Xorg
I have this in ~/.bash_profile
which gets sourced when auto login runs.
source /etc/profile
umask 007
setterm -blank 0
export PATH=$HOME/bin:$PATH:/usr/local/bin
if [[ x$DISPLAY == 'x' ]]; then
# Do not redirect output if you want to run xorg as rootless
exec startx
fi
Openbox
The startx command executes ~/.xinitrc
which contains:
#!/bin/sh
exec openbox-session
Then Openbox executes: ~/.config/openbox/autostart
#!/bin/bash
xrdb -load ~/.Xresources
# If colors looks "off", try to enable the following, my problem has disappeared in newer versions of the Intel driver
# xrandr --output HDMI2 --set "Broadcast RGB" "Full"
# Hide cursor
unclutter &
xset -dpms s off
setxkbmap dk
/usr/bin/kodi --standalone -fs &
Kodi tweaks
Hardware accelerated playback on Intel
I have installed libva-intel-driver, libva-vdpau-driver, libvdpau and libva and enabled hardware accelerated playback in Kodi's settings. The Intel HD Graphics can handle 1080p without problems.
Idle CPU usage
Depending on the Intel driver version, Kodi might use about 15% CPU when idle, but by editing ~/.kodi/userdata/advancedsettings.xml
I was able to reduce it to 3%
<advancedsettings>
<gui>
<algorithmdirtyregions>3</algorithmdirtyregions>
<nofliptimeout>1000</nofliptimeout>
</gui>
</advancedsettings>
Mouse pointer
To get a decent size cursor in Chrome I have these settings in ~/.Xresources
(Requires the DMZ mouse cursor theme installed)
Xcursor.theme: DMZ Xcursor.size: 32
Plugins
I created two simple addons that launches Chromium in fullscreen mode and opens a website like Rdio or Netflix. You can find them in my XBMC addons repository
CEC (Consumer Electronics Control) over HDMI
I also added a USB - CEC Adapter from PulseEight so it is possible to control Kodi using the TVs remote control.
If you wish to remap some of the buttons on your remote here is an excellent guide: How To remap CEC buttons on a Sony TV Remote for XBMC under Xbian 1.0.5a