Kodi Community Forum
Linux HOW-TO: Automated efficient XBMC install - Ubuntu 12.10/13.04 mini based - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Tips, tricks, and step by step guides (https://forum.kodi.tv/forumdisplay.php?fid=110)
+--- Thread: Linux HOW-TO: Automated efficient XBMC install - Ubuntu 12.10/13.04 mini based (/showthread.php?tid=141369)



RE: HOW-TO: Automated efficient XBMC installation on Ubuntu minimal 12.10 - wsnipex - 2012-10-06

nope, lightdm is a desktop manager. It just takes care of starting X and lets you select different X sessions. There is not very much difference to the xinit approach and you certainly won't notice any difference in performance.


RE: HOW-TO: Automated efficient XBMC installation on Ubuntu minimal 12.10 - Bram77 - 2012-10-06

I've been working on the script all day. I did several clean installs and I think I've got it almost completely working now. The only thing I know doesn't work is the boot screen installation. I'll figure out why a bit later.
I'm unable to test the Intel and Ati video driver installations. So please let me know if you run into problem.

Changelog
* Improved error handling
* Made some functionality in the code easier to reuse
* Added option to install a cron job that updates and cleans the machine every 4 hours (dist-upgrade)
* Lots of small bug fixes and improvements overall
* More then 4x the amount of code that was required for v1 :x


RE: HOW-TO: Automated efficient XBMC installation on Ubuntu minimal 12.10 - platinum8317 - 2012-10-07

@Bram77

Great news. I did a full fresh install of your new script on my 2nd htpc with the intel and nvidia graphics. Install went without any hitches and boots right up into xbmc. I tried a few times rebooting and right into xbmc. I didn't install it with lirc so i did apt-get afterwards. Everything is great. I'll try it with my amd e350 with ati graphics tomorrow. Thanks again.


RE: HOW-TO: Automated efficient XBMC installation on Ubuntu minimal 12.10 - un1versal - 2012-10-07

@Bram77

Hello there. I remember using install scripts before and I am glad to see someone still thinks this is a better alternative to XBMCbuntu or Openelec. The last Install I did was still using XCI a magnificent script that did everything and then some.

I have a Asrock ion 330 machine which comes with a internal Remote transceiver (nuovoton nct6775 Which is MCE CIR RC6 compatible) The driver is in kernel space on recent kernels, but It will not work out of the box with something like this. And I dont have knowledge to make the remote work, because it would I expect require LIRC and that is deprecated from recent Ubuntu distros.

I suppose there is a question in here somewhere, regarding the automatic setup of the internal receiver automatically like XCI did it, or something similar. (which does not work for recent Ubuntu's), the question would be, do you think adding support for this would be something you would consider?


RE: HOW-TO: Automated efficient XBMC installation on Ubuntu minimal 12.10 - Hack_kid - 2012-10-07

(2012-10-06, 22:47)Bram77 Wrote: I've been working on the script all day. I did several clean installs and I think I've got it almost completely working now. The only thing I know doesn't work is the boot screen installation. I'll figure out why a bit later.
I'm unable to test the Intel and Ati video driver installations. So please let me know if you run into problem.

Changelog
* Improved error handling
* Made some functionality in the code easier to reuse
* Added option to install a cron job that updates and cleans the machine every 4 hours (dist-upgrade)
* Lots of small bug fixes and improvements overall
* More then 4x the amount of code that was required for v1 :x

To fix the black screen try this script. when prompted set your resolution (you might have to be stuck with 1024x768 i heard other refresh rates (higher ones) dont work due to Xorg not being loaded

Code:
#!/bin/bash
# ----------------------------------
# Author: D0rkye
# Homepage: http://d0rkye.zsenialis.com/
# Most code probably by kyleabaker: http://kyleabaker.com/2010/07/11/how-to-fix-your-ubuntu-boot-screen/
#
# Fix for Ubuntu 11.04, for BURG, and some extra bloat by Paolo Bernardi (http://paolobernardi.wordpress.com/)
# ----------------------------------

# Usage: install_if_not_installed package_name
function install_if_not_installed
{
    PACKAGE="$1"
    INSTALLED=$(dpkg -L "$PACKAGE" > /dev/null 2>&1 && echo OK || echo KO)
    if [ "$INSTALLED" == "KO" ]
    then
        sudo apt-get install "$PACKAGE" -y
    fi
}

# Usage: contains regexp file
function contains
{
    REGEXP="$1"
    FILE="$2"

    grep "$REGEXP" "$FILE" > /dev/null && echo OK || echo KO
}

install_if_not_installed v86d
install_if_not_installed hwinfo

sudo hwinfo --framebuffer
echo "---------------------------------------------------------------"
echo "Please enter the best resolution from the list above"
echo "It usualy looks like this >>Mode 0x0323: 1024x768 (+4096), 24 bits<<"
echo "And you have to enter it like this >>1024x768-24<<"
echo "---------------------------------------------------------------"
read resolution

sed 's/GRUB\_CMDLINE\_LINUX\_DEFAULT\=\"quiet\ splash\"/GRUB\_CMDLINE\_LINUX\_DEFAULT\=\"quiet\ splash\ nomodeset\ video\=uvesafb\:mode\_option\='$resolution'\,mtrr\=3\,scroll\=ywrap\"/g' /etc/default/grub > ./newgrub
sudo cp -f ./newgrub /etc/default/grub
rm ./newgrub

sed 's/GRUB\_CMDLINE\_LINUX\_DEFAULT\=\"quiet\ splash\"/GRUB\_CMDLINE\_LINUX\_DEFAULT\=\"quiet\ splash\ nomodeset\ video\=uvesafb\:mode\_option\='$resolution'\,mtrr\=3\,scroll\=ywrap\"/g' /etc/default/burg > ./newburg
sudo cp -f ./newburg /etc/default/burg
rm ./newburg

sed 's/\#GRUB\_GFXMODE\=640x480/GRUB\_GFXMODE\='$resolution'/g' /etc/default/grub > ./newgrub
sudo cp -f ./newgrub /etc/default/grub
rm ./newgrub

if [ "$(contains uvesafb /etc/initramfs-tools/modules)" == 'KO' ]
then
    sudo echo "uvesafb mode_option=$resolution mtrr=3 scroll=ywrap" | sudo tee -a /etc/initramfs-tools/modules
fi

if [ "$(contains FRAMEBUFFER=y /etc/initramfs-tools/conf.d/splash)" == 'KO' ]
then
    echo FRAMEBUFFER=y | sudo tee /etc/initramfs-tools/conf.d/splash
fi

#sed 's/GRUB\_CMDLINE\_LINUX\_DEFAULT\=\"\(.*\)vt\.handoff\=7\(.*\)\"/GRUB\_CMDLINE\_LINUX\_DEFAULT\=\"\1\2\"/g' /etc/grub.d/10_linux > ./new10linux
sed 's/vt\_handoff\=\(.*\)vt\.handoff\=7\(.*\)/vt\_handoff\=\1\2/g' /etc/grub.d/10_linux > ./new10linux
sudo cp -f ./new10linux /etc/grub.d/10_linux
rm ./new10linux
sudo chmod +x /etc/grub.d/10_linux

sudo update-grub2
which update-burg > /dev/null 2>&1 && sudo update-burg
sudo update-initramfs -u
echo "The resolution should be fixed after a reboot"

Now back to audio card (video card w/hdmi) not initialized before xbmc boots up. is there any way we can write a delay into the exec script but only for the FIRST boot up? i figured out adding a sleep 10 to the start section of the init script it works. it just seems kinda of dumb every time i restart xbmc after ubuntu has been running there is a un-needed 10 sec delay. ONE last request. when using lightdm and xbmc crashes, it automaticly restarts. not with this init script. is that a limitation of using a init script not a windows manager or can we hadd a upson crash=reload to the init script? thanks for all the had work. wish i found this like 3 days ago when i did a reinstall Tongue




RE: HOW-TO: Automated efficient XBMC installation on Ubuntu minimal 12.10 - Sevennl - 2012-10-07

Hi Bram,

After a few days of rest ( had 2 weeks of installing / re-installing behind me ) i did a re-install with the use of your 2.3 script and it works like a charm YAY!
I only added the Samba installation to it as it will be a crucial part in my home theater setup ( all components connected by the network.
Added Lm-sensors for the reading of temps of the CPU and GPU.
I did not install your tvheadend version as i didn't know what version you used, i manually installed 3.2 beta (64 bits version) for the tvheadend site as it wortks really really good.
Still need to configure my remote and oscam and i hope the NOVA HD skin will work on this build.
Everything is running smooth, so far so good.
Love that i finally can install the 64 bits version of tvheadend, under 12.04 the installation could not detect 64 bits and i need to install the 32 bits one.

Just a quick question, is this install running pulse-audio ?
I am a linux newb so no idea how to check that, and i know PA supports multiple audio output.



RE: HOW-TO: Automated efficient XBMC installation on Ubuntu minimal 12.10 - Jbravo - 2012-10-07

Hi Bram,

Really nice guide, in comparsion to all outdated/obsolete guides I found on the Wiki. BTW your bash script is easier to understand than some of the guides I previously followed...

I'm a bit of newbie when it comes to Linux, at least for the X related stuff. After running your install 2.3 script, I had some issue setting the correct resolution and refresh rates from within XBMC. The display (HD ready LCD-tv, connected via HDMI via an AVR) defaulted to 1080i50, and I wanted 720p50 (which I even coulddn't select). Listed the resolution with xrandr and there was a lot of resolutions, but not many that actaully matched what's supported by my LCD-tv.

After searcing the forums I realized that I needed an xorg.conf. None was present on my system. I then found this post; http://forum.xbmc.org/showthread.php?pid=506251%23pid506251

After adding the proposed xorg.conf to my system, I could actually select between the resolutions appropriate for my system (all other unsupported resolutions was removed), note my tv doesn't support 24p so I didn't bother about that part of the guide

There was also a section, specific for setting up the nVidia driver.

After the steps above the XBMC experience was greatly improved!!!

I noticed that you have some special setup related to ATI, could you perhaps add the above for nVidia?

Thanks again for your effort.

PS. Now I need to go and figure how to setup audio over HDMI for my ION2.




RE: HOW-TO: Automated efficient XBMC installation on Ubuntu minimal 12.10 - Bram77 - 2012-10-07

(2012-10-07, 08:13)platinum8317 Wrote: @Bram77

Great news. I did a full fresh install of your new script on my 2nd htpc with the intel and nvidia graphics. Install went without any hitches and boots right up into xbmc. I tried a few times rebooting and right into xbmc. I didn't install it with lirc so i did apt-get afterwards. Everything is great. I'll try it with my amd e350 with ati graphics tomorrow. Thanks again.

Lirc installation should work properly now from within the installer. I'm curious if the Ati installation goes well. Please let me know. Thanks!
(2012-10-07, 11:04)uNiversal Wrote: @Bram77

Hello there. I remember using install scripts before and I am glad to see someone still thinks this is a better alternative to XBMCbuntu or Openelec. The last Install I did was still using XCI a magnificent script that did everything and then some.

I have a Asrock ion 330 machine which comes with a internal Remote transceiver (nuovoton nct6775 Which is MCE CIR RC6 compatible) The driver is in kernel space on recent kernels, but It will not work out of the box with something like this. And I dont have knowledge to make the remote work, because it would I expect require LIRC and that is deprecated from recent Ubuntu distros.

I suppose there is a question in here somewhere, regarding the automatic setup of the internal receiver automatically like XCI did it, or something similar. (which does not work for recent Ubuntu's), the question would be, do you think adding support for this would be something you would consider?

Lirc is still present in the default Ubuntu repo's. To my knowledge it has not been depricated. You can install and configure it during the installation process. I'm pretty sure as good as every IR receiver works out of the box after installing lirc. I don't know how I could automate the lirc configuration, but I'll look into that at some point. Right now it's as easy to configure it as I know is possible.


RE: HOW-TO: Automated efficient XBMC installation on Ubuntu minimal 12.10 - Bram77 - 2012-10-07

@Hack_kid

I actually integrated support for changing the grub and bootscreen resolutions during the development of version 2.3 But I've kept it back because I first want to sort out why the XBMC bootscreen isn't functioning properly. I'll put it back when that's sorted.

That 10 sec. delay seems to be hardware specific. It's not something I need for my hardware (never had to on any of my machines). So I'm not sure what I can do about it. If you've found a solution that fixes the required 10 second delay, please let me know so I can add it to the script. I can only do that if it doesn't affect installations on other hardware negatively of course. Adding a 10 sec delay by default is not an option as you probably understand Smile

I know about the automatic restart after a XBMC crash with lightdm. I haven't had a crash while not using lightdm, so I can't confirm this behavior. I don't know how to make XBMC restart automatically with the init.d script. But I'll have a look at it at some point. Thanks for pointing this out.


RE: HOW-TO: Automated efficient XBMC installation on Ubuntu minimal 12.10 - Bram77 - 2012-10-07

(2012-10-07, 14:46)Sevennl Wrote: Hi Bram,

After a few days of rest ( had 2 weeks of installing / re-installing behind me ) i did a re-install with the use of your 2.3 script and it works like a charm YAY!
I only added the Samba installation to it as it will be a crucial part in my home theater setup ( all components connected by the network.
Added Lm-sensors for the reading of temps of the CPU and GPU.
I did not install your tvheadend version as i didn't know what version you used, i manually installed 3.2 beta (64 bits version) for the tvheadend site as it wortks really really good.
Still need to configure my remote and oscam and i hope the NOVA HD skin will work on this build.
Everything is running smooth, so far so good.
Love that i finally can install the 64 bits version of tvheadend, under 12.04 the installation could not detect 64 bits and i need to install the 32 bits one.

Just a quick question, is this install running pulse-audio ?
I am a linux newb so no idea how to check that, and i know PA supports multiple audio output.

You only need samba if you're hosting files on your HTPC that should be accessible from other machines. And only if these machines can't access the HTPC files using SFTP. SFTP is a little bit slower then samba because the data is moved over the network encrypted. But it still work pretty smooth and fast!

Including lmsensors as an optional component to install during the installation is on my to-do list.

TV-Headend uses installed from this ppa: https://launchpad.net/~jabbors/+archive/hts-stable
This means the installer would have installed version 3.2 . The advantage to using the installers method is that an available update for tvheadend is automatically installed if you're also using the Automatic upgrade option, or do a 'sudo apt-get update && sudo apt-get dist-upgrade'. Unless you've added a tvheadend repository manually yourself, then the same would apply.

Could you point me in the right direction for the Nova HD skin? I don't know it. Always curious for new skins Smile

Pulse audio is no longer being installed. It was in the first version of the script but it's obsolete. To my knowledge multiple audio output is no longer working since the new audio engine is implemented in XBMC. You can't fix this by installing pulse. I like the new audio engine but it's a real shame multiple outputs isn't working anymore. I was using it and a lot more people too.
(2012-10-07, 16:38)Jbravo Wrote: Hi Bram,

Really nice guide, in comparsion to all outdated/obsolete guides I found on the Wiki. BTW your bash script is easier to understand than some of the guides I previously followed...

I'm a bit of newbie when it comes to Linux, at least for the X related stuff. After running your install 2.3 script, I had some issue setting the correct resolution and refresh rates from within XBMC. The display (HD ready LCD-tv, connected via HDMI via an AVR) defaulted to 1080i50, and I wanted 720p50 (which I even coulddn't select). Listed the resolution with xrandr and there was a lot of resolutions, but not many that actaully matched what's supported by my LCD-tv.

After searcing the forums I realized that I needed an xorg.conf. None was present on my system. I then found this post; http://forum.xbmc.org/showthread.php?pid=506251%23pid506251

After adding the proposed xorg.conf to my system, I could actually select between the resolutions appropriate for my system (all other unsupported resolutions was removed), note my tv doesn't support 24p so I didn't bother about that part of the guide

There was also a section, specific for setting up the nVidia driver.

After the steps above the XBMC experience was greatly improved!!!

I noticed that you have some special setup related to ATI, could you perhaps add the above for nVidia?

Thanks again for your effort.

PS. Now I need to go and figure how to setup audio over HDMI for my ION2.

I'll have a look at implementing some optimizations for NVIDIA cards too. I must say my relatively old and not so fast ION1 box runs excellent with the nvidia-current driver from the standard repo's. Without any modifications it just works in every aspect. I think that's great, so I'm skeptical about how much there is to gain. But I'll look into it!


RE: HOW-TO: Automated efficient XBMC installation on Ubuntu minimal 12.10 - Hack_kid - 2012-10-07

(2012-10-07, 19:02)Bram77 Wrote: @Hack_kid

I actually integrated support for changing the grub and bootscreen resolutions during the development of version 2.3 But I've kept it back because I first want to sort out why the XBMC bootscreen isn't functioning properly. I'll put it back when that's sorted.

That 10 sec. delay seems to be hardware specific. It's not something I need for my hardware (never had to on any of my machines). So I'm not sure what I can do about it. If you've found a solution that fixes the required 10 second delay, please let me know so I can add it to the script. I can only do that if it doesn't affect installations on other hardware negatively of course. Adding a 10 sec delay by default is not an option as you probably understand Smile

I know about the automatic restart after a XBMC crash with lightdm. I haven't had a crash while not using lightdm, so I can't confirm this behavior. I don't know how to make XBMC restart automatically with the init.d script. But I'll have a look at it at some point. Thanks for pointing this out.


how is the xbmc bootscreen not functioning properly? is it black? if its black the script i posted will fix it. i'm assuming your using nvidia? this is a known bug with nvidia after installing drivers (plymonth black screen) that script is the fix for it its called fixplymonthblackscreen-precise. simply try it i bet it will fix your xbmc bootscreen issues. unless the issue is something else i'm not aware of



RE: HOW-TO: Automated efficient (dedicated) XBMC installation on Ubuntu minimal 12.10 - Bram77 - 2012-10-07

The default XBMC bootscreen is displaying although a custom XBMC plymouth bootscreen is installed. The installation of the XBMC bootscreen did work properly in v1 of the script. I just haven't figured out what I did to break the installation. It's non-critical. I'll look into it this week.


RE: HOW-TO: Automated efficient (dedicated) XBMC installation on Ubuntu minimal 12.10 - platinum8317 - 2012-10-07

@Bram77

More good news. Did a fresh install on my first htpc today. Has a e350 and with ati graphics. Everything went well except install hung on boot screen install. Had to reboot computer and restart install. went quick through then gave error on boot screen and past it to the next step. Xbmc boots up great. Had to do acouple of my settings changes to get it to work well. Still need to look into sound quality and hdmi through the actual drivers, not the generic ones. But Your script is great thanks so much.




RE: HOW-TO: Automated efficient (dedicated) XBMC installation on Ubuntu minimal 12.10 - Sevennl - 2012-10-07

Hi.

Forget about the skin , it's the AEON NOX one, the first skin in the list for downloadable skins Smile
Still the nicest skin, specially when you use the DVD case view.
I use the XBMC server also as an Media storage, so easy access ( by Samba ) with network browsing is why i use Samba, i have no need to encrypt data on my private network.
Lirc also works for the MCE remote but an issue that it only receives from 50 cm distance.... could be hardware but before it worked over longer distances.

Could you, when you are reworking the bootscreen update, a patch script so i don't have to re-install again Smile

cheers,


RE: HOW-TO: Automated efficient (dedicated) XBMC installation on Ubuntu minimal 12.10 - Bram77 - 2012-10-07

@platinum8317
Thanks! That is good news! I don't think the boot screen installation hangs, it just takes a lot longer then you'd expect because of the grub and initramfs updates. If you've accidentally interrupted the installation the first time you might not be able to install packages again. Run 'sudo apt-get update && sudo apt-get dist-upgrade' to see if you still can. If not, there will be instructions to fix this.

@Sevennl
Run any skin you'd like on the installation. There are no limitations in that respect, just make sure the skin version is compatible with the XBMC version used (daily builds) and that your hardware can handle it. You can run the script over your current installation as many times as you want. Just make sure you enable the same options you used while installing. Sorry if this wasn't clear and you've re-installed Ubuntu unnecessarily.