[GUIDE] Simplified Guide for a perfect minimal HTPC on INTEL platforms - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33) +--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111) +---- Forum: Linux (https://forum.kodi.tv/forumdisplay.php?fid=52) +---- Thread: [GUIDE] Simplified Guide for a perfect minimal HTPC on INTEL platforms (/showthread.php?tid=114368) |
[GUIDE] Simplified Guide for a perfect minimal HTPC on INTEL platforms - alanwww1 - 2011-11-11 I wrote this guide for having a minimal xbmc system based on Ubuntu minimal. Please note that I really recommend and support with donations the OpenELEC project which provides a clean, simple minimal system with blazing fast boot-times. This guide is for people who want to have more control over their system and want an Ubuntu based minimal system with the advantage of the Ubuntu package system. Since my last guide a lot of great improvements were made in the Linux Kernel and Ubuntu which result an almost perfect htpc experience on Intel Platforms (tested on Sandy Bridge, but probably works on first gen Core i3, i5 and the upcoming Ivy Bridge) Warning: Please don't combine my guides because it could cause problems and confusion. Use this guide only on a clean system. THIS will be the guide, what I'll always update with the new stuff if they will be available. Also note that I am NOT using the xorg edgers ppa here. The reason is that mesa 7.12 has some glsl problems which cause color distortions in xbmc. Let me thank the Intel developers who are really devoted to have perfect open source support for their hardware. What works: Smooth VAAPI acceleration for mpeg2, h264, vc1 Auto refresh rate and smoothvideo function out of the box ProjectM with > 60fps Shader based HQ upscalers Multichannel LPCM sound (with a workaround) Incredibly fast Suspend - resume VAAPI Deinterlacing (experimental) What is not working yet: Nothing which does not have a solution So let's get to the steps: 1. Install OS Get the netboot image for Ubuntu Oneiric 11.11 from here. Burn, choose Command-line-install and use xbmc for username. 2. Install basic packages After reboot, install ssh so you can continue work with Putty (for win) or with the "ssh -l xbmc your.IP.address" from a linux terminal. Also we install py-properties to easy add ppas. But before you ca do it remotely you need to install these packages. So get a terminal with crtl+alt+f1, than Code: sudo apt-get update Let's install some basic packages: Code: sudo apt-get install udisks upower xorg alsa-utils mesa-utils Let's add xbmc user to important groups than reboot Code: sudo adduser xbmc video Now we will set the system that we can run Xorg without root privilages. Code: sudo dpkg-reconfigure x11-common Note that Intel EDID parsing for CEA Short Video Descriptors is still not ready, although a patch is available here, but this is not in mainline kernel yet. So we need to manually add the standard HDTV modes if they were in the CEA section of the EDID data. Let's get a working xorg.conf now. Note that this file is for a specific display system and includes custom modelines which only work on full 1080p HDTV-s. If you have a lower resolution TV, you have to adjust the settings with "sudo nano /etc/X11/xorg.conf" or just leave out this step (this will result a default resolution for your TV, but you will loose the ability to have the adjust refresh rate function working) Code: sudo wget http://paste.kde.org/6966/raw/ -O /etc/X11/xorg.conf Luckily we don't have to compile anything now as Ubuntu Oneiric has support for libbluray and libva out of the box. We just have to install these packages and xbmc. Let's add xbmc ppa: Code: sudo add-apt-repository ppa:team-xbmc/unstable Now we can install xbmc and other needed packages. Code: sudo apt-get update After this you can check if libva installed ok. with a command "vainfo" you should see something like this after you start the X server with "startx" and use vainfo there: Code: vainfo: VA API version: 0.32 Note that when you run startx on a minimal system only an xterm terminal shows on your top-left corner of screen. You have to make it active with a mouse click. If you can't see it, you can try to adjust your TV's overscan settings. Please verify that your output is HDMI2 (like at my case) because i created the xorg.conf file for that. To check, run the X server and than run: Code: export DISPLAY=:0 # if you are doing this using ssh If it is not HDMI2 at your system, you have to edit the downloaded xorg.conf with Code: sudo nano /etc/X11/xorg.conf 3. Various settings, autostart xbmc For autostart xbmc we create an upstart init script: Code: sudo wget http://pastebin.com/raw.php?i=z2Ya7sAh -O /etc/init/xbmc.conf In alsamixer unmute the spdif devices. Than we store this setting. Code: alsamixer Let's install lirc. After that we need to create an udev rule to enable remotes to wakeup the machine. I created an udev rule that contains most of the remotes' Vendor ID and Product ID. I used the kernel driver database and some info from OpenELEC's udev rule. If your remote is not listed you can check the Ids with lsusb. After that add the Ids to the udev rule file. I'd be glad if you can write me the ones which are not included in my rules file so i can add them later. Also we need to enable the USB hubs to wake up the machine. I made this in the init script xbmc.conf where we enable all USBx, EUSB, CIRx ports. You can check your remote ID with lsusb. You get something like this: Code: Bus 001 Device 003: ID 1784:0008 TopSeed Technology Corp. eHome Infrared Transceiver Code: sudo apt-get install lirc Note that for MCE remote you have to choose "Windows Media Center Transceivers" after choose none, when install lirc. To grant permission for user xbmc to do suspend, reboot, mount, eject etc: Code: sudo wget http://paste.kde.org/200066/raw/ -O /etc/polkit-1/localauthority/50-local.d/xbmc_rule.pkla After reboot you should be able to use xbmc. 4. Some remarks and experiences For suspend to work you might need a BIOS upgrade. I had problems with some boards, some worked out of the box. You can always start (and stop) xbmc even remotely with Code: sudo start xbmc Multichannel lpcm only works with a workaround. There is already a mainline kernel patch that enables ELD parsing from EDID data which automatically checks your av receiver capabilities. Here is the patch that implements this functionality. It will be included in the 3.2 Kernel release and in Ubuntu 12.04 LTS. There is a workaround until automatic eld parsing works, that triggers the available soundmodes manually. Just insert this into the /etc/init/xbmc.conf upstart script at the end of the "pre-start script" section (you might have to tune the values to your available configuration): Code: echo sad0_rates 0x1ee0 > /proc/asound/card0/eld#3.0 vc1 decoding only works in Oneiric. If you partially testing this guide with Natty installed, you won't be able to decode vc1 files properly. The guide was tested on a H67 motherboard and a core i5-2500K CPU. 5. VAAPI DEINTERLACING This is experimental. We need to install libva and intel vaapi driver from the vaapi-ext branch for that. Also you need to install xbmc > git 10.01.2011. Eden beta2 will already have it. After you installed/compiled the needed xbmc version do the following: Code: cd ~ That is it. The last line should show the version 1.0.17-pre1 Restart xbmc. Play a file with vaapi, choose deinterlacing on, deinterlacer: bob. - alanwww1 - 2011-11-11 History: - 10.11.2011: Release date - 11.11.2011: Added libgtk2.0, libmad0 to the installed packages - 13.11.2011: Added gtk2-engines-pixbuf to the installable packages. Eliminates some CLI error messages. - 23.11.2011: Add ppa and install libcec - 24.11.2011: VC1 decoding patch commited into xbmc trunk - 30.11.2011: Oneiric builds were enabled in the unstable ppa. This means we can clear some of the workarounds:
- 10.01.2012: Added VAAPI Deinterlacing - 04.02.2012: Fix for permission problems with suspend, reboot, mount, eject etc, other Polkit actions - 01.03.2012: Mesa 7.12-8.0 Color distortion shader bug was resolved in Mesa 8.0.1. Known problems:
- Hack_kid - 2011-11-11 ok only problem i have is the xong.conf i'm using VGA not hdmi how do i edit it accordingly? - Hack_kid - 2011-11-11 ok when i enter vainfo there arent as many profiles as yours just mpeg2 do you have any idea whats going on do i need to add a symbolic link or something? - alanwww1 - 2011-11-11 Hack_kid Wrote:ok when i enter vainfo there arent as many profiles as yours just mpeg2 do you have any idea whats going on do i need to add a symbolic link or something? You probably have G45 Intel hardware. That only supports mpeg2 hardware decoding. There is some work by Intel developers to support h264 decoding. Just check out these git repos. They are not in mainline libva yet: http://cgit.freedesktop.org/vaapi/intel-driver/log/?h=g45-h264 http://cgit.freedesktop.org/vaapi/libva/log/?h=g45-h264 If you have a VGA system you wont be using auto refresh rate change i think. So don't even download the xorg.conf. The driver will choose the default resolution to your display. Also VGA resolutions are not in the CEA SVD area fo the EDID code so they are parsed well. So once again, don't download the xorg.conf. - gollumscave - 2011-11-11 Followed this guide to the letter, everything seems to work but music As soon as I want to playback an mp3 or flac file, from either library or file mode, it reboots. Any ideas? - Mixerious - 2011-11-11 gollumscave Wrote:Followed this guide to the letter, everything seems to work but music maybe you are missing the libmad0 package! Please try this: Code: apt-get install libmad0 - alanwww1 - 2011-11-11 Mixerious Wrote:maybe you are missing the libmad0 package! Please try this: Yes i forgot this package. I updated the guide. Thanks ! - Loki688 - 2011-11-11 Hi Alan, thanks man! This is EXACT what I'm looking for. I'll try it next week on my HTPC. (ASRock Core 100HT with Ubuntu Server - Oneiric 11.11) (although I think libva won't accelerate VC1 on my hardware...) root@theatro:~# lshw -short H/W path Device Class Description ======================================================= system ASRock Core 100HT-BD/B3 /0 bus HM55-HT /0/0 memory 64KiB BIOS /0/4 processor Intel® Core i5 CPU M560 @ 2.67GHz /0/4/5 memory 128KiB L1 cache /0/4/6 memory 512KiB L2 cache /0/4/7 memory 3MiB L3 cache /0/b memory 8GiB System Memory /0/b/0 memory 4GiB DIMM SDRAM Synchronous /0/b/1 memory 4GiB DIMM SDRAM Synchronous /0/100 bridge Core Processor DRAM Controller /0/100/2 display Core Processor Integrated Graphics Controller /0/100/4 generic Core Processor Thermal Management Controller /0/100/16 communication 5 Series/3400 Series Chipset HECI Controller /0/100/1a bus 5 Series/3400 Series Chipset USB2 Enhanced Host Controller /0/100/1b multimedia 5 Series/3400 Series Chipset High Definition Audio /0/100/1c bridge 5 Series/3400 Series Chipset PCI Express Root Port 1 /0/100/1c/0 eth0 network RTL8111/8168B PCI Express Gigabit Ethernet controller /0/100/1c.1 bridge 5 Series/3400 Series Chipset PCI Express Root Port 2 /0/100/1c.1/0 bus uPD720200 USB 3.0 Host Controller /0/100/1d bus 5 Series/3400 Series Chipset USB2 Enhanced Host Controller /0/100/1e bridge 82801 Mobile PCI Bridge /0/100/1f bridge Mobile 5 Series Chipset LPC Interface Controller /0/100/1f.2 scsi0 storage 5 Series/3400 Series Chipset 4 port SATA AHCI Controller /0/100/1f.2/0 /dev/sda disk 120GB OCZ-AGILITY3 /0/100/1f.2/0/1 /dev/sda1 volume 103GiB EXT4 volume /0/100/1f.2/0/2 /dev/sda2 volume 8GiB Linux swap / Solaris partition /0/100/1f.2/1 /dev/cdrom disk BD E DS4E1S /0/100/1f.3 bus 5 Series/3400 Series Chipset SMBus Controller /0/100/1f.6 generic 5 Series/3400 Series Chipset Thermal Subsystem /0/101 bridge Core Processor QuickPath Architecture Generic Non-core Registers /0/102 bridge Core Processor QuickPath Architecture System Address Decoder /0/103 bridge Core Processor QPI Link 0 /0/104 bridge Core Processor QPI Physical 0 /0/105 bridge Core Processor Reserved /0/106 bridge Core Processor Reserved - Hack_kid - 2011-11-11 alanwww1 Wrote:You probably have G45 Intel hardware. That only supports mpeg2 hardware decoding. There is some work by Intel developers to support h264 decoding. Just check out these git repos. They are not in mainline libva yet: how do i go about compiling them? - generious - 2011-11-11 thanks for the guide very handy! Just one question have you tried running zsnes or any other type of emulators on it yet? - alanwww1 - 2011-11-11 generious Wrote:thanks for the guide very handy! Not at all. Sorry. Everything should work, which works in ubuntu. blargh!!!! - digitalAir - 2011-11-12 Allan, I followed your guide to install on my Gigabyte GA-Z68MA-D2H-B3 motherboard. Thanks! It's working, but I'm having some driver problems that are driving me nuts. First, I couldn't install Ubuntu 11.10 directly, because it would hang on the dhcp request... eventually I figured out that I could do a bare 11.04 install and an immediate upgrade to 11.10 which worked! now I'm having a framebuffer issue or something. immediately after the plymouth splash screen, the system goes to a blank screen with a cursor in the top left corner... It still works, however... ctrl-alt-F1 takes me over to the console terminal where I can log in. this was occuring before I installed xbmc and xorg, btw. after logging into the console (or ssh), ps ax shows me that x and xbmc are running, but I get no output on tty7 or 8. however, if I perform a "sudo stop xbmc" to kill the running process, I can then do a "startx" and xbmc cranks right up... Anyone with a Z68 motherboard experiencing any of these symptoms? any insight would be GREATLY appreciated. Thanks, digitalAir - rossmohax - 2011-11-12 Why does XBMC dont allow to adjust brightness and contrast when it uses VAAPI? I checked source and it explicitly disabled there. - alanwww1 - 2011-11-13 rossmohax Wrote:Why does XBMC dont allow to adjust brightness and contrast when it uses VAAPI? I checked source and it explicitly disabled there. That is post processing. Along with deinterlacing it is just being lmplemented in va api. Anyway has the guide worked for you? |