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 install - Ubuntu 12.10/13.04 mini based - Sevennl - 2013-05-04

@cw-kid,

you also triggered a upgrade ( sudo apt-get upgrade ) of system software, drivers and libraries.
that is the long list of extra;s you downloaded ( mostly )


RE: HOW-TO: Automated efficient XBMC install - Ubuntu 12.10/13.04 mini based - Sevennl - 2013-05-06

Hi,

I know it doesn't belong here but maybe someone has a clue why this happens.

Every hour or so xbmc.bin (watched activity with iotop) does a major impact on the system by having a 5 minute disc access which distort TV playback in a bad bad way (Hickups, artifacts)
Does anyone know why this is happening, i looked through my settings and could not find anything out of the ordinary, but it runes the enjoyment of watching TV completely.
Using XBMC 12.2


RE: HOW-TO: Automated efficient XBMC install - Ubuntu 12.10/13.04 mini based - evanroheff21 - 2013-05-07

Sevennl,

This is just off the top of my head, but did you install the XBMC Auto Library Updater plugin? I believe it defaults to scan once every 4 hours, but can be changed to every hour. I use it on my systems, and I know there is an option in there to tell it to NOT run if there is active playback. Depending on your system specs, running a scan while playing media may impact the playback like you mentioned. Could be worth taking a look at.


RE: HOW-TO: Automated efficient XBMC install - Ubuntu 12.10/13.04 mini based - Morrtin - 2013-05-07

I used this script to set up XBMC on my Ubuntu Server 12.04 LTS and had problems with Airplay. At it seemed only I had the problem and therefore I took a closer look into the script. First of all I learned a lot just by analyzing the steps in the script Big Grin

I am not a Linux pro but I know programming so it was quite easy to understand the language and the rest was provided by google. As I got deeper into the script I started to modify it for my needs but I tried to keep the bigger idea behind it intact.

I did following changes to script 2.6.1:
  • Added python-software-properties to dependencies to get add-apt-repository support back for Ubuntu 12.04
  • Changed variable “AUTO_MOUNT_RULES_FILE” to "/etc/udev/rules.d/11-media-by-label-auto-mount.rules" because dev rule files have to start with 2 digits.
  • Commented adding group “dialout” to user xmbc out because I don't think I (we) need modem / serial support
  • Added a PPA selection, where I can choose between 4 different XBMC PPA's
  • Removed “installXbmcRunFile” function as it was not used in the script
  • Changed Screen Resolution preselect option to Full HD
  • Added installation of Airplay service (avahi-daemon)
  • Changed Addon Repositories installer preselect option to off

I didn't look at additional packages, remote wakeup and installation optimization as I don't need them.

But some topics are still not so clear for me and maybe somebody can enlighten me Big Grin

  1. Why other minimal installation have xbmc and xbmc-bin for apt-get install? xbmc depends on xbmc-bin and therefore xbmc-bin should get installed automaticaly or?
  2. I have a INTEL system and I can't see a benefit to install INTEL video driver? In my opinion Ubuntu supports intel driver quite good, or? (AMD/ATI is an other topic)
  3. The same with audio driver. I didn't install any extra Audio stuff and my Frodo systems runs nearly perfect. Only DTS-HD is not working but I think I remember that this is rather a kernel problem and not a driver problem.
  4. If I install driver (audio and video) along with enabling temperature monitoring in the XBMC advance settings I see no temperature for GPU and CPU, without all this I see at least CPU temperature. This behavior strengthen me in my believe that I don't need the driver.
By the way this is my system:

Hardware
  • PSU: Enermax ErPro80+ 350W ATX 2.3
  • Case: Lian Li PC-Q08B schwarz, Mini-DTX/Mini-ITX
  • CPU: Intel Core i3-2105, 2x 3.10GHz, HD Graphics 3000
  • RAM: Corsair XMS3 DIMM Kit 8GB PC3-10667U CL9-9-9-24 (DDR3-1333)
  • Mobo: ASUS P8H77-I, H77 (Sockel-1155, dual PC3-12800U DDR3)
  • SSD: Crucial m4 SSD 64GB, 2.5", SATA 6Gb/s
  • HDD: 4x Seagate Barracuda Green 5900.3 2000GB, SATA 6Gb/s
Operating System
Ubuntu Server 12.04.01 LTS
Kernel: 3.2.0.41

Updated Script
Code:
#!/bin/bash
#
# @author   Bram van Oploo
# @date     2013-02-12
# @version  2.6.1
#

XBMC_USER="xbmc"
THIS_FILE=$0
SCRIPT_VERSION="2.6.1"
VIDEO_DRIVER=""
HOME_DIRECTORY="/home/$XBMC_USER/"
TEMP_DIRECTORY=$HOME_DIRECTORY"temp/"
ENVIRONMENT_FILE="/etc/environment"
CRONTAB_FILE="/etc/crontab"
DIST_UPGRADE_FILE="/etc/cron.d/dist_upgrade.sh"
DIST_UPGRADE_LOG_FILE="/var/log/updates.log"
XBMC_INIT_FILE="/etc/init.d/xbmc"
XBMC_ADDONS_DIR=$HOME_DIRECTORY".xbmc/addons/"
XBMC_USERDATA_DIR=$HOME_DIRECTORY".xbmc/userdata/"
XBMC_KEYMAPS_DIR=$XBMC_USERDATA_DIR"keymaps/"
XBMC_ADVANCEDSETTINGS_FILE=$XBMC_USERDATA_DIR"advancedsettings.xml"
XBMC_INIT_CONF_FILE="/etc/init/xbmc.conf"
XBMC_XSESSION_FILE="/home/xbmc/.xsession"
UPSTART_JOB_FILE="/lib/init/upstart-job"
XWRAPPER_FILE="/etc/X11/Xwrapper.config"
GRUB_CONFIG_FILE="/etc/default/grub"
GRUB_HEADER_FILE="/etc/grub.d/00_header"
SYSTEM_LIMITS_FILE="/etc/security/limits.conf"
INITRAMFS_SPLASH_FILE="/etc/initramfs-tools/conf.d/splash"
INITRAMFS_MODULES_FILE="/etc/initramfs-tools/modules"
XWRAPPER_CONFIG_FILE="/etc/X11/Xwrapper.config"
MODULES_FILE="/etc/modules"
REMOTE_WAKEUP_RULES_FILE="/etc/udev/rules.d/90-enable-remote-wakeup.rules"
AUTO_MOUNT_RULES_FILE="/etc/udev/rules.d/11-media-by-label-auto-mount.rules"
SYSCTL_CONF_FILE="/etc/sysctl.conf"
RSYSLOG_FILE="/etc/init/rsyslog.conf"
POWERMANAGEMENT_DIR="/var/lib/polkit-1/localauthority/50-local.d/"
DOWNLOAD_URL="https://github.com/Bram77/xbmc-ubuntu-minimal/raw/master/12.10/download/"
#XBMC_PPA="ppa:wsnipex/xbmc-xvba"
HTS_TVHEADEND_PPA="ppa:jabbors/hts-stable"
OSCAM_PPA="ppa:oscam/ppa"

LOG_FILE=$HOME_DIRECTORY"xbmc_installation.log"
DIALOG_WIDTH=70
SCRIPT_TITLE="XBMC installation script v$SCRIPT_VERSION for Ubuntu 12.10 by Bram van Oploo :: [email protected] :: www.sudo-systems.com"

GFX_CARD=$(lspci |grep VGA |awk -F: {' print $3 '} |awk {'print $1'} |tr [a-z] [A-Z])

## ------ START functions ---------

function showInfo()
{
    CUR_DATE=$(date +%Y-%m-%d" "%H:%M)
    echo "$CUR_DATE - INFO :: $@" >> $LOG_FILE
    dialog --title "Installing & configuring..." --backtitle "$SCRIPT_TITLE" --infobox "\n$@" 5 $DIALOG_WIDTH
}

function showError()
{
    CUR_DATE=$(date +%Y-%m-%d" "%H:%M)
    echo "$CUR_DATE - ERROR :: $@" >> $LOG_FILE
    dialog --title "Error" --backtitle "$SCRIPT_TITLE" --msgbox "$@" 8 $DIALOG_WIDTH
}

function showDialog()
{
    dialog --title "XBMC installation script" \
        --backtitle "$SCRIPT_TITLE" \
        --msgbox "\n$@" 12 $DIALOG_WIDTH
}

function update()
{
    sudo apt-get update > /dev/null 2>&1
}

function createFile()
{
    FILE="$1"
    IS_ROOT="$2"
    REMOVE_IF_EXISTS="$3"
    
    if [ -e "$FILE" ] && [ "$REMOVE_IF_EXISTS" == "1" ]; then
        sudo rm "$FILE" > /dev/null
    else
        if [ "$IS_ROOT" == "0" ]; then
            touch "$FILE" > /dev/null
        else
            sudo touch "$FILE" > /dev/null
        fi
    fi
}

function createDirectory()
{
    DIRECTORY="$1"
    GOTO_DIRECTORY="$2"
    IS_ROOT="$3"
    
    if [ ! -d "$DIRECTORY" ];
    then
        if [ "$IS_ROOT" == "0" ]; then
            mkdir -p "$DIRECTORY" > /dev/null 2>&1
        else
            sudo mkdir -p "$DIRECTORY" > /dev/null 2>&1
        fi
    fi
    
    if [ "$GOTO_DIRECTORY" == "1" ];
    then
        cd $DIRECTORY
    fi
}

function handleFileBackup()
{
    FILE="$1"
    BACKUP="$1.bak"
    IS_ROOT="$2"
    DELETE_ORIGINAL="$3"

    if [ -e "$BACKUP" ];
    then
        if [ "$IS_ROOT" == "1" ]; then
            sudo rm "$FILE" > /dev/null 2>&1
            sudo cp "$BACKUP" "$FILE" > /dev/null 2>&1
        else
            rm "$FILE" > /dev/null 2>&1
            cp "$BACKUP" "$FILE" > /dev/null 2>&1
        fi
    else
        if [ "$IS_ROOT" == "1" ]; then
            sudo cp "$FILE" "$BACKUP" > /dev/null 2>&1
        else
            cp "$FILE" "$BACKUP" > /dev/null 2>&1
        fi
    fi
    
    if [ "$DELETE_ORIGINAL" == "1" ]; then
        sudo rm "$FILE" > /dev/null 2>&1
    fi
}

function appendToFile()
{
    FILE="$1"
    CONTENT="$2"
    IS_ROOT="$3"
    
    if [ "$IS_ROOT" == "0" ]; then
        echo "$CONTENT" | tee -a "$FILE" > /dev/null 2>&1
    else
        echo "$CONTENT" | sudo tee -a "$FILE" > /dev/null 2>&1
    fi
}

function addRepository()
{
    REPOSITORY=$@
    KEYSTORE_DIR=$HOME_DIRECTORY".gnupg/"
    createDirectory "$KEYSTORE_DIR" 0 0
    sudo add-apt-repository -y $REPOSITORY > /dev/null 2>&1

    if [ "$?" == "0" ]; then
        update
        showInfo "$REPOSITORY repository successfully added"
        echo 1
    else
        showError "Repository $REPOSITORY could not be added (error code $?)"
        echo 0
    fi
}

function isPackageInstalled()
{
    PACKAGE=$@
    sudo dpkg-query -l $PACKAGE > /dev/null 2>&1
    
    if [ "$?" == "0" ]; then
        echo 1
    else
        echo 0
    fi
}

function aptInstall()
{
    PACKAGE=$@
    IS_INSTALLED=$(isPackageInstalled $PACKAGE)

    if [ "$IS_INSTALLED" == "1" ]; then
        showInfo "Skipping installation of $PACKAGE. Already installed."
        echo 1
    else
        sudo apt-get -f install > /dev/null 2>&1
        sudo apt-get -y install $PACKAGE > /dev/null 2>&1
        
        if [ "$?" == "0" ]; then
            showInfo "$PACKAGE successfully installed"
            echo 1
        else
            showError "$PACKAGE could not be installed (error code: $?)"
            echo 0
        fi
    fi
}

function download()
{
    URL="$@"
    wget -q "$URL" > /dev/null 2>&1
}

function move()
{
    SOURCE="$1"
    DESTINATION="$2"
    IS_ROOT="$3"
    
    if [ -e "$SOURCE" ];
    then
        if [ "$IS_ROOT" == "0" ]; then
            mv "$SOURCE" "$DESTINATION" > /dev/null 2>&1
        else
            sudo mv "$SOURCE" "$DESTINATION" > /dev/null 2>&1
        fi
        
        if [ "$?" == "0" ]; then
            echo 1
        else
            showError "$SOURCE could not be moved to $DESTINATION (error code: $?)"
            echo 0
        fi
    else
        showError "$SOURCE could not be moved to $DESTINATION because the file does not exist"
        echo 0
    fi
}

------------------------------

function installDependencies()
{
    echo "-- Installing installation dependencies..."
    echo ""

    # python-software-properties for add-apt-repository (Ubuntu 12.04)
    # software-properties-common for add-apt-repository (Ubuntu 12.10 and above)
    sudo apt-get -y install dialog python-software-properties software-properties-common > /dev/null 2>&1
}

function fixLocaleBug()
{
    createFile $ENVIRONMENT_FILE
    handleFileBackup $ENVIRONMENT_FILE 1
    appendToFile $ENVIRONMENT_FILE "LC_MESSAGES=\"C\""
    appendToFile $ENVIRONMENT_FILE "LC_ALL=\"en_US.UTF-8\""
    showInfo "Locale environment bug fixed"
}

function fixUsbAutomount()
{
# Program usbmount is not used because it is not maintent anymore and dev rule solution is the nativ one
# User xbmc has to be added to group users - see section addUserToRequiredGroups
# Also udisks has to be installed and user xbmc has to get permissions to handle udisks policies - see section installPowerManagement
    handleFileBackup "$MODULES_FILE" 1 1
    appendToFile $MODULES_FILE "usb-storage"
    createDirectory "$TEMP_DIRECTORY" 1 0
    download $DOWNLOAD_URL"media-by-label-auto-mount.rules"

    if [ -e $TEMP_DIRECTORY"media-by-label-auto-mount.rules" ]; then
        IS_MOVED=$(move $TEMP_DIRECTORY"media-by-label-auto-mount.rules" "$AUTO_MOUNT_RULES_FILE")
        showInfo "USB automount successfully fixed"
    else
        showError "USB automount could not be fixed"
    fi
}

function applyXbmcNiceLevelPermissions()
{
    createFile $SYSTEM_LIMITS_FILE
    appendToFile $SYSTEM_LIMITS_FILE "$XBMC_USER             -       nice            -1"
    showInfo "Allowed XBMC to prioritize threads"
}

function addUserToRequiredGroups()
{
    sudo adduser $XBMC_USER video > /dev/null 2>&1                # to use video devices
    sudo adduser $XBMC_USER audio > /dev/null 2>&1                # to use audio devices
    sudo adduser $XBMC_USER users > /dev/null 2>&1                # for USB automount
    sudo adduser $XBMC_USER fuse > /dev/null 2>&1                # to use FUSE File system
    sudo adduser $XBMC_USER cdrom > /dev/null 2>&1                # to use CD-ROM
    sudo adduser $XBMC_USER plugdev > /dev/null 2>&1            # to access external storage devices
        sudo adduser $XBMC_USER dialout > /dev/null 2>&1            # to use modems / serial ports
    showInfo "XBMC user added to required groups"
}

function addXbmcPpa()
{
    XBMC_PPA="$1"

    showInfo "Adding repository $XBMC_PPA ..."
    addRepository "$XBMC_PPA"
}

function distUpgrade()
{
    showInfo "Updating Ubuntu with latest packages (may take a while)..."
    update
    sudo apt-get -y dist-upgrade > /dev/null 2>&1
    showInfo "Ubuntu installation updated"
}

function installXinit()
{
    showInfo "Installing xinit..."
    IS_INSTALLED=$(aptInstall xinit)
}

function installPowerManagement()
{
    showInfo "Installing power management packages..."
    createDirectory "$TEMP_DIRECTORY" 1 0
    IS_INSTALLED=$(aptInstall policykit-1)            # for managing administrative policies and privileges - e.g. shut down computer without amdin rights
    IS_INSTALLED=$(aptInstall upower)                # Hibernate / Suspend computer
    IS_INSTALLED=$(aptInstall udisks)                # for D-Bus interfaces that can be used to query and manipulate storage devices. e.g. Airplay
    IS_INSTALLED=$(aptInstall acpi-support)
    download $DOWNLOAD_URL"custom-actions.pkla"
    createDirectory "$POWERMANAGEMENT_DIR"
    IS_MOVED=$(move $TEMP_DIRECTORY"custom-actions.pkla" "$POWERMANAGEMENT_DIR")
}

function installAudio()
{
    showInfo "Installing audio packages....\n!! Please make sure no used channels are muted !!"
    IS_INSTALLED=$(aptInstall linux-sound-base)
    IS_INSTALLED=$(aptInstall alsa-base)
    IS_INSTALLED=$(aptInstall alsa-utils)
    IS_INSTALLED=$(aptInstall libasound2)
    sudo alsamixer
}

function installAirplay()
{
    showInfo "Installing Airplay Service..."
    IS_INSTALLED=$(aptInstall avahi-daemon)
}

function installLirc()
{
    clear
    echo ""
    echo "Installing lirc..."
    echo ""
    echo "------------------"
    echo ""
    
    sudo apt-get -y install lirc
    
    if [ "$?" == "0" ]; then
        showInfo "Lirc successfully installed"
    else
        showError "Lirc could not be installed (error code: $?)"
    fi
}

function allowRemoteWakeup()
{
    showInfo "Allowing for remote wakeup (won't work for all remotes)..."
    createDirectory "$TEMP_DIRECTORY" 1 0
    handleFileBackup "$REMOTE_WAKEUP_RULES_FILE" 1 1
    download $DOWNLOAD_URL"remote_wakeup_rules"
    
    if [ -e $TEMP_DIRECTORY"remote_wakeup_rules" ]; then
        sudo mv $TEMP_DIRECTORY"remote_wakeup_rules" "$REMOTE_WAKEUP_RULES_FILE" > /dev/null 2>&1
        showInfo "Remote wakeup rules successfully applied"
    else
        showError "Remote wakeup rules could not be downloaded"
    fi
}

function installTvHeadend()
{
    showInfo "Adding jabbors hts-stable PPA..."
    addRepository "$HTS_TVHEADEND_PPA"

    clear
    echo ""
    echo "Installing tvheadend..."
    echo ""
    echo "------------------"
    echo ""

    sudo apt-get -y install tvheadend
    
    if [ "$?" == "0" ]; then
        showInfo "TvHeadend successfully installed"
    else
        showError "TvHeadend could not be installed (error code: $?)"
    fi
}

function installOscam()
{
    showInfo "Adding oscam PPA..."
    addRepository "$OSCAM_PPA"

    showInfo "Installing oscam..."
    IS_INSTALLED=$(aptInstall oscam-svn)
}

function installXbmc()
{
    showInfo "Installing XBMC..."
    IS_INSTALLED=$(aptInstall xbmc)
#    IS_INSTALLED=$(aptInstall xbmc-bin)   #should be not necessary as xbmc depends on xbmc-bin
}

function enableDirtyRegionRendering()
{
    showInfo "Enabling XBMC dirty region rendering..."
    createDirectory "$TEMP_DIRECTORY" 1 0
    handleFileBackup $XBMC_ADVANCEDSETTINGS_FILE 0 1
    download $DOWNLOAD_URL"dirty_region_rendering.xml"
    createDirectory "$XBMC_USERDATA_DIR" 0 0
    IS_MOVED=$(move $TEMP_DIRECTORY"dirty_region_rendering.xml" "$XBMC_ADVANCEDSETTINGS_FILE")

    if [ "$IS_MOVED" == "1" ]; then
        showInfo "XBMC dirty region rendering enabled"
    else
        showError "XBMC dirty region rendering could not be enabled"
    fi
}

function installXbmcAddonRepositoriesInstaller()
{
    showInfo "Installing Addon Repositories Installer addon..."
    createDirectory "$TEMP_DIRECTORY" 1 0
    download $DOWNLOAD_URL"plugin.program.repo.installer-1.0.5.tar.gz"
    createDirectory "$XBMC_ADDONS_DIR" 0 0

    if [ -e $TEMP_DIRECTORY"plugin.program.repo.installer-1.0.5.tar.gz" ]; then
        tar -xvzf $TEMP_DIRECTORY"plugin.program.repo.installer-1.0.5.tar.gz" -C "$XBMC_ADDONS_DIR" > /dev/null 2>&1
        
        if [ "$?" == "0" ]; then
            showInfo "Addon Repositories Installer addon successfully installed"
        else
            showError "Addon Repositories Installer addon could not be installed (error code: $?)"
        fi
    else
        showError "Addon Repositories Installer addon could not be downloaded"
    fi
}

function configureAtiDriver()
{
    sudo aticonfig --initial -f > /dev/null 2>&1
    sudo aticonfig --sync-vsync=on > /dev/null 2>&1
    sudo aticonfig --set-pcs-u32=MCIL,HWUVD_H264Level51Support,1 > /dev/null 2>&1
}

function disbaleAtiUnderscan()
{
    sudo kill $(pidof X) > /dev/null 2>&1
    sudo aticonfig --set-pcs-val=MCIL,DigitalHDTVDefaultUnderscan,0 > /dev/null 2>&1
    showInfo "Underscan successfully disabled"
}

function enableAtiUnderscan()
{
    sudo kill $(pidof X) > /dev/null 2>&1
    sudo aticonfig --set-pcs-val=MCIL,DigitalHDTVDefaultUnderscan,1 > /dev/null 2>&1
    showInfo "Underscan successfully enabled"
}

function installVideoDriver()
{
    showInfo "Installing $GFX_CARD video drivers (may take a while)..."
    
    if [[ $GFX_CARD == NVIDIA ]]; then
        VIDEO_DRIVER="nvidia-current"
    elif [[ $GFX_CARD == ATI ]] || [[ $GFX_CARD == AMD ]] || [[ $GFX_CARD == ADVANCED ]]; then
        VIDEO_DRIVER="fglrx"
    elif [[ $GFX_CARD == INTEL ]]; then
        VIDEO_DRIVER="i965-va-driver"
    elif [[ $GFX_CARD == VMWARE ]]; then
        VIDEO_DRIVER="i965-va-driver"
    else
        cleanUp
        clear
        echo ""
        echo "$(tput setaf 1)$(tput bold)Installation aborted...$(tput sgr0)"
        echo "$(tput setaf 1)Only NVIDIA, ATI/AMD or INTEL videocards are supported. Please install a compatible videocard and run the script again.$(tput sgr0)"
        echo ""
        echo "$(tput setaf 1)You have a $GFX_CARD videocard.$(tput sgr0)"
        echo ""
        exit
    fi
    
    IS_INSTALLED=$(aptInstall $VIDEO_DRIVER)

    if [ "$IS_INSTALLED" == "1"]; then
        if [ "$GFX_CARD" == "ATI" ] || [ "$GFX_CARD" == "AMD" ]; then
            configureAtiDriver

            dialog --title "Disable underscan" \
                --backtitle "$SCRIPT_TITLE" \
                --yesno "Do you want to disable underscan (removes black borders)? Do this only if you're sure you need it!" 7 $DIALOG_WIDTH

            RESPONSE=$?
            case ${RESPONSE//\"/} in
                0)
                    disbaleAtiUnderscan
                    ;;
                1)
                    enableAtiUnderscan
                    ;;
                255)
                    showInfo "ATI underscan configuration skipped"
                    ;;
            esac
        fi
        
        showInfo "$GFX_CARD video drivers successfully installed and configured"
    fi
}

function installAutomaticDistUpgrade()
{
    showInfo "Enabling automatic system upgrade..."
    createDirectory "$TEMP_DIRECTORY" 1 0
    download $DOWNLOAD_URL"dist_upgrade.sh"
    IS_MOVED=$(move $TEMP_DIRECTORY"dist_upgrade.sh" "$DIST_UPGRADE_FILE" 1)
    
    if [ "$IS_MOVED" == "1" ]; then
        IS_INSTALLED=$(aptInstall cron)
        sudo chmod +x "$DIST_UPGRADE_FILE" > /dev/null 2>&1
        handleFileBackup "$CRONTAB_FILE" 1
        appendToFile "$CRONTAB_FILE" "0 */4  * * * root  $DIST_UPGRADE_FILE >> $DIST_UPGRADE_LOG_FILE"
    else
        showError "Automatic system upgrade interval could not be enabled"
    fi
}

function removeAutorunFiles()
{
    if [ -e "$XBMC_INIT_FILE" ]; then
        showInfo "Removing existing autorun script..."
        sudo update-rc.d xbmc remove > /dev/null 2>&1
        sudo rm "$XBMC_INIT_FILE" > /dev/null 2>&1

        if [ -e "$XBMC_INIT_CONF_FILE" ]; then
            sudo rm "$XBMC_INIT_CONF_FILE" > /dev/null 2>&1
        fi
        
        if [ -e "$XBMC_CUSTOM_EXEC" ]; then
            sudo rm "$XBMC_CUSTOM_EXEC" > /dev/null 2>&1
        fi
        
        if [ -e "$XBMC_XSESSION_FILE" ]; then
            sudo rm "$XBMC_XSESSION_FILE" > /dev/null 2>&1
        fi
        
        showInfo "Old autorun script successfully removed"
    fi
}

function installXbmcInitScript()
{
    removeAutorunFiles
    showInfo "Installing XBMC init.d autorun support..."
    createDirectory "$TEMP_DIRECTORY" 1 0
    download $DOWNLOAD_URL"xbmc_init_script"
    
    if [ -e $TEMP_DIRECTORY"xbmc_init_script" ]; then
        if [ -e $XBMC_INIT_FILE ]; then
            sudo rm $XBMC_INIT_FILE > /dev/null 2>&1
        fi
        
        IS_MOVED=$(move $TEMP_DIRECTORY"xbmc_init_script" "$XBMC_INIT_FILE")

        if [ "$IS_MOVED" == "1" ]; then
            sudo chmod a+x "$XBMC_INIT_FILE" > /dev/null 2>&1
            sudo update-rc.d xbmc defaults > /dev/null 2>&1
            
            if [ "$?" == "0" ]; then
                showInfo "XBMC autorun succesfully configured"
            else
                showError "XBMC autorun script could not be activated (error code: $?)"
            fi
        else
            showError "XBMC autorun script could not be installed"
        fi
    else
        showError "Download of XBMC autorun script failed"
    fi
}

function installXbmcUpstartScript()
{
    removeAutorunFiles
    showInfo "Installing XBMC upstart autorun support..."
    createDirectory "$TEMP_DIRECTORY" 1 0
    download $DOWNLOAD_URL"xbmc_upstart_script_2"

    if [ -e $TEMP_DIRECTORY"xbmc_upstart_script_2" ]; then
        IS_MOVED=$(move $TEMP_DIRECTORY"xbmc_upstart_script_2" "$XBMC_INIT_CONF_FILE")

        if [ "$IS_MOVED" == "1" ]; then
            sudo ln -s "$UPSTART_JOB_FILE" "$XBMC_INIT_FILE" > /dev/null 2>&1
        else
            showError "XBMC upstart configuration failed"
        fi
    else
        showError "Download of XBMC upstart configuration file failed"
    fi
}

function installNyxBoardKeymap()
{
    showInfo "Applying Pulse-Eight Motorola NYXboard advanced keymap..."
    createDirectory "$TEMP_DIRECTORY" 1 0
    download $DOWNLOAD_URL"nyxboard.tar.gz"
    createDirectory "$XBMC_KEYMAPS_DIR" 0 0

    if [ -e $XBMC_KEYMAPS_DIR"keyboard.xml" ]; then
        handleFileBackup $XBMC_KEYMAPS_DIR"keyboard.xml" 0 1
    fi

    if [ -e $TEMP_DIRECTORY"nyxboard.tar.gz" ]; then
        tar -xvzf $TEMP_DIRECTORY"nyxboard.tar.gz" -C "$XBMC_KEYMAPS_DIR" > /dev/null 2>&1
        
        if [ "$?" == "0" ]; then
            showInfo "Pulse-Eight Motorola NYXboard advanced keymap successfully applied"
        else
            showError "Pulse-Eight Motorola NYXboard advanced keymap could not be applied (error code: $?)"
        fi
    else
        showError "Pulse-Eight Motorola NYXboard advanced keymap could not be downloaded"
    fi
}

function installXbmcBootScreen()
{
    showInfo "Installing XBMC boot screen (please be patient)..."
    #IS_INSTALLED=$(aptInstall v86d)
    #IS_INSTALLED=$(aptInstall plymouth-label)
    sudo apt-get install -y plymouth-label v86d > /dev/null
    createDirectory "$TEMP_DIRECTORY" 1 0
    download $DOWNLOAD_URL"plymouth-theme-xbmc-logo.deb"
    
    if [ -e $TEMP_DIRECTORY"plymouth-theme-xbmc-logo.deb" ]; then
        sudo dpkg -i $TEMP_DIRECTORY"plymouth-theme-xbmc-logo.deb" > /dev/null 2>&1
        update-alternatives --install /lib/plymouth/themes/default.plymouth default.plymouth /lib/plymouth/themes/xbmc-logo/xbmc-logo.plymouth 100 > /dev/null 2>&1
        handleFileBackup "$INITRAMFS_SPLASH_FILE" 1 1
        createFile "$INITRAMFS_SPLASH_FILE" 1 1
        appendToFile "$INITRAMFS_SPLASH_FILE" "FRAMEBUFFER=y"
        showInfo "XBMC boot screen successfully installed"
    else
        showError "Download of XBMC boot screen package failed"
    fi
}

function applyScreenResolution()
{
    RESOLUTION="$1"
    
    showInfo "Applying bootscreen resolution (will take a minute or so)..."
    handleFileBackup "$GRUB_HEADER_FILE" 1 0
    sudo sed -i '/gfxmode=/ a\  set gfxpayload=keep' "$GRUB_HEADER_FILE" > /dev/null 2>&1
    GRUB_CONFIG="nomodeset usbcore.autosuspend=-1 video=uvesafb:mode_option=$RESOLUTION-24,mtrr=3,scroll=ywrap"
    
    if [[ $GFX_CARD == INTEL ]]; then
        GRUB_CONFIG="usbcore.autosuspend=-1 video=uvesafb:mode_option=$RESOLUTION-24,mtrr=3,scroll=ywrap"
    fi
    
    handleFileBackup "$GRUB_CONFIG_FILE" 1 0
    appendToFile "$GRUB_CONFIG_FILE" "GRUB_CMDLINE_LINUX=\"$GRUB_CONFIG\""
    appendToFile "$GRUB_CONFIG_FILE" "GRUB_GFXMODE=$RESOLUTION"
    
    handleFileBackup "$INITRAMFS_MODULES_FILE" 1 0
    appendToFile "$INITRAMFS_MODULES_FILE" "uvesafb mode_option=$RESOLUTION-24 mtrr=3 scroll=ywrap"
    
    sudo update-grub > /dev/null 2>&1
    sudo update-initramfs -u > /dev/null
    
    if [ "$?" == "0" ]; then
        showInfo "Bootscreen resolution successfully applied"
    else
        showError "Bootscreen resolution could not be applied"
    fi
}

function installLmSensors()
{
    showInfo "Installing temperature monitoring package (apply all defaults)..."
    aptInstall lm-sensors
    clear
    echo ""
    echo "$(tput setaf 2)$(tput bold)INSTALLATION INFO: Please confirm all questions with ENTER (applying the suggested option)."
    echo "$(tput setaf 2)The XBMC installation will continue automatically when finished.$(tput sgr0)"
    echo ""
    echo ""
    
    sudo sensors-detect
    
    if [ ! -e "$XBMC_ADVANCEDSETTINGS_FILE" ]; then
        createDirectory "$TEMP_DIRECTORY" 1 0
        download $DOWNLOAD_URL"temperature_monitoring.xml"
        createDirectory "$XBMC_USERDATA_DIR" 0 0
        IS_MOVED=$(move $TEMP_DIRECTORY"temperature_monitoring.xml" "$XBMC_ADVANCEDSETTINGS_FILE")

        if [ "$IS_MOVED" == "1" ]; then
            showInfo "Temperature monitoring successfully enabled in XBMC"
        else
            showError "Temperature monitoring could not be enabled in XBMC"
        fi
    fi
    
    showInfo "Temperature monitoring successfully configured"
}

function reconfigureXServer()
{
    showInfo "Configuring X-server..."
    handleFileBackup "$XWRAPPER_FILE" 1
    createFile "$XWRAPPER_FILE" 1 1
    appendToFile "$XWRAPPER_FILE" "allowed_users=anybody"
    showInfo "X-server successfully configured"
}

function selectXbmcPpa()
{
    cmd=(dialog --backtitle "Select PPA to add"
        --radiolist "Please select the PPA you like to add and install XBMC from:"
        15 $DIALOG_WIDTH 6)
        
    options=(1 "Team XBMC (stable)" on
            2 "Team XBMC (UNstable)" off
            3 "Wsnipex - Frodo (stable)" off
            4 "Wsnipex - Git Builds (tested)" off)
        
    choice=$("${cmd[@]}" "${options[@]}" 2>&1 >/dev/tty)

    case ${choice//\"/} in
        1)
            addXbmcPpa "ppa:team-xbmc/ppa"
            ;;
        2)
            addXbmcPpa "ppa:team-xbmc/unstable"
            ;;
        3)
            addXbmcPpa "ppa:wsnipex/xbmc-xvba-frodo"
            ;;
        4)
            addXbmcPpa "ppa:wsnipex/xbmc-xvba"
            ;;
        *)
            addXbmcPpa
            ;;
    esac
}

function selectXbmcStartupMethod()
{
    cmd=(dialog --backtitle "XBMC autorun method"
        --radiolist "Please select the method used to start XBMC (default recommended):"
        15 $DIALOG_WIDTH 3)
        
    options=(1 "init.d" on
            2 "upstart (experimental)" off)
        
    choice=$("${cmd[@]}" "${options[@]}" 2>&1 >/dev/tty)

    case ${choice//\"/} in
        1)
            installXbmcInitScript
            ;;
        2)
            installXbmcUpstartScript
            ;;
        *)
            selectStartupMethod
            ;;
    esac
}

function selectXbmcTweaks()
{
    cmd=(dialog --title "Optional XBMC tweaks and additions"
        --backtitle "$SCRIPT_TITLE"
        --checklist "Plese select to install or apply:"
        15 $DIALOG_WIDTH 6)
        
    options=(1 "Enable dirty region rendering (improved performance)" on
            2 "Enable temperature monitoring (confirm with ENTER)" on
            3 "Install Addon Repositories Installer addon" off
            4 "Apply improved Pulse-Eight Motorola NYXboard keymap" off)
            
    choices=$("${cmd[@]}" "${options[@]}" 2>&1 >/dev/tty)

    for choice in $choices
    do
        case ${choice//\"/} in
            1)
                enableDirtyRegionRendering
                ;;
            2)
                installLmSensors
                ;;
            3)
                installXbmcAddonRepositoriesInstaller
                ;;
            4)
                installNyxBoardKeymap
                ;;
        esac
    done
}

function selectScreenResolution()
{
    cmd=(dialog --backtitle "Select bootscreen resolution (required)"
        --radiolist "Please select your screen resolution, or the one sligtly lower then it can handle if an exact match isn't availabel:"
        15 $DIALOG_WIDTH 6)
        
    options=(1 "720 x 480 (NTSC)" off
            2 "720 x 576 (PAL)" off
            3 "1280 x 720 (HD Ready)" off
            4 "1366 x 768 (HD Ready)" off
            5 "1920 x 1080 (Full HD)" on)
        
    choice=$("${cmd[@]}" "${options[@]}" 2>&1 >/dev/tty)

    case ${choice//\"/} in
        1)
            applyScreenResolution "720x480"
            ;;
        2)
            applyScreenResolution "720x576"
            ;;
        3)
            applyScreenResolution "1280x720"
            ;;
        4)
            applyScreenResolution "1366x768"
            ;;
        5)
            applyScreenResolution "1920x1080"
            ;;
        *)
            selectScreenResolution
            ;;
    esac
}

function selectAdditionalPackages()
{
    cmd=(dialog --title "Other optional packages and features"
        --backtitle "$SCRIPT_TITLE"
        --checklist "Plese select to install:"
        15 $DIALOG_WIDTH 6)
        
    options=(1 "Lirc (IR remote support)" off
            2 "Hts tvheadend (live TV backend)" off
            3 "Oscam (live HDTV decryption tool)" off
            4 "Automatic upgrades (every 4 hours)" off)
            
    choices=$("${cmd[@]}" "${options[@]}" 2>&1 >/dev/tty)

    for choice in $choices
    do
        case ${choice//\"/} in
            1)
                installLirc
                ;;
            2)
                installTvHeadend
                ;;
            3)
                installOscam
                ;;
            4)
                installAutomaticDistUpgrade
                ;;
        esac
    done
}

function optimizeInstallation()
{
    showInfo "Optimizing installation..."
    sudo service apparmor stop > /dev/null &2>1
    sudo service apparmor teardown > /dev/null &2>1
    sudo update-rc.d -f apparmor remove > /dev/null &2>1    
    sudo apt-get remove --purge apparmor -y > /dev/null &2>1
    
    createDirectory "$TEMP_DIRECTORY" 1 0
    handleFileBackup $RSYSLOG_FILE 0 1
    download $DOWNLOAD_URL"rsyslog.conf"
    move $TEMP_DIRECTORY"rsyslog.conf" "$RSYSLOG_FILE" 1
    
    handleFileBackup "$SYSCTL_CONF_FILE" 1 0
    createFile "$SYSCTL_CONF_FILE" 1 0
    appendToFile "$SYSCTL_CONF_FILE" "dev.cdrom.lock=0"
    appendToFile "$SYSCTL_CONF_FILE" "vm.swappiness=10"
}

function cleanUp()
{
    showInfo "Cleaning up..."
    sudo apt-get -y autoremove > /dev/null 2>&1
    sudo apt-get -y autoclean > /dev/null 2>&1
    sudo apt-get -y clean > /dev/null 2>&1
    
    if [ -e "$TEMP_DIRECTORY" ]; then
        sudo rm -R "$TEMP_DIRECTORY" > /dev/null 2>&1
    fi
    
    if [ -e "$HOME_DIRECTORY$THIS_FILE" ]; then
        rm "$HOME_DIRECTORY$THIS_FILE" > /dev/null 2>&1
    fi
}

function rebootMachine()
{
    showInfo "Reboot system..."
    dialog --title "Installation complete" \
        --backtitle "$SCRIPT_TITLE" \
        --yesno "Do you want to reboot now?" 7 $DIALOG_WIDTH

    case $? in
        0)
            showInfo "Installation complete. Rebooting..."
            clear
            echo ""
            echo "Installation complete. Rebooting..."
            echo ""
            sudo reboot now > /dev/null 2>&1
            ;;
        1)
            showInfo "Installation complete. Not rebooting."
            quit
            ;;
        255)
            showInfo "Installation complete. Not rebooting."
            quit
            ;;
    esac
}

function quit()
{
    clear
    exit
}

control_c()
{
    cleanUp
    echo "Installation aborted..."
    quit
}

## ------- END functions -------

clear

createFile "$LOG_FILE" 0 1

echo ""
installDependencies
echo "Loading installer..."
showDialog "Welcome to the XBMC minimal installation script. Some parts may take a while to install depending on your internet connection speed.\n\nPlease be patient..."
trap control_c SIGINT

fixLocaleBug
fixUsbAutomount
applyXbmcNiceLevelPermissions
addUserToRequiredGroups
selectXbmcPpa
distUpgrade
installVideoDriver            # Realy needed for INTEL?
installXinit
installXbmc
selectXbmcStartupMethod
installXbmcBootScreen
selectScreenResolution
reconfigureXServer
installPowerManagement        # DON'T comment this line out -> Air Play won't work
installAudio                # Is Audio installation still needed with frodo?
installAirplay
selectXbmcTweaks            # After install temperatur for CPU and GPU on Intel is not working in XBMC
selectAdditionalPackages
allowRemoteWakeup
optimizeInstallation
cleanUp
rebootMachine



RE: HOW-TO: Automated efficient XBMC install - Ubuntu 12.10/13.04 mini based - Bram77 - 2013-05-07

(2013-05-04, 11:51)Sevennl Wrote: Ah ok, i did not know that as i use Nvidia ( i know of the limitations of AMD/ATI HDMI output ).
I still love to use this script for my re-installing as it is much faster ( daily usage ) than all others i tried ( OpenELEC etc. )
I know you don't support the script anymore, which is a shame Smile , but if you find yourself wondering what to do , maybe a pre-select screen would be grand to add to this script.
At the start just tag what you want to install and let the script run so you can grab coffee, sit in the sun.
Pitty i am so bad in writing code, else i would do it myself.

Learning to code can be a lot of fun, but I wouldn't start with bash scripting. It's very hard to keep everything organised. I'm already pushing the limits with this script. That's why it's not very useful to maintain this script. Adding more code will make it even harder to maintain.

I haven't had the time to do a lot for the new python based version lately. It will be a lot easier to maintain, but python also opens up a lot more possibilities. Setting up the core functionalities is quite a lot of work if I want to do it right. By doing it right I'll be able to add new features faster in the future. I love working on projects like these, but I do need to pay the bills so payed work always comes first as you might understand. I happen to have a lot of that work lately and in times of financial crisis (in the Netherlands at least) I'm lucky to be in the position I'm in so I'm making the most of it. At some point in the near future I'll have more spare time and I'll be diving into Xbmc System Tools again. I can't make any promises about release dates though, at this point.
For now this script is still working pretty well Smile. It's not completely bug-free but it still offers a lot of gain compared to a manual installation.


RE: HOW-TO: Automated efficient XBMC install - Ubuntu 12.10/13.04 mini based - Sevennl - 2013-05-09

Cheers Bram for the hard work you put into this project, and i still will use it until you new project hits the beta phase for us to test Smile
On that new project you could incorporate the idea for a pre-select screen ( so the installation could run it's cycle while the user doesn't have to stay at the Pc for manual input.
On the topic of learning programming, i am also very lucky and got me a new job, so all my learning needs to be focused into building and maintaining a server room Smile


Also thanks to Morrtin for the nice upgrades made to the script which i will be using now, if i need a re-install.
Some good idea's implemented there, cheers.


RE: HOW-TO: Automated efficient XBMC install - Ubuntu 12.10/13.04 mini based - un1versal - 2013-05-09

@Morrtin

1) It doesnt hurt to define install xbmc and xbmc.bin even if it depends you dont have to of course but hey.
2) Intel is fine, but the best is Nvidia hands down, if it ever came down to choosing AMD/ATI wouldnt even be in my list, not for Linux anyway. Driver wise, some intel GPUs require a driver especially if they install a gallium gl which is not good for xbmc, I added a fix (2.6.1 was all my updates) so this doesn't happen but tbh I cant tell if it works or not because I have no intel gpu based machines
3) Yes you are correct and need kernel 3.9.0 just to be sure all the fixes are in. see Intel_Linux_Modifications_for_HD_Audio (wiki) It shows you how to upgrade kernel without upgrading distro.
4) Well this is a point I wanted to improve on script since it only adds advancedsettings for nvidia, tbh idk what settings are for intel if any but I already did something towards ATI see https://github.com/uNiversaI/xbmc-ubuntu-minimal/blob/master/12.04/download/amd_temperature_monitoring.xml but never added the code to script to grab that and pull it if it knows its ATI system

The problem are I dont have intel or ATI machines to test this stuff, and what I know about scripting is very little not enough of course to do what it takes to improve and fix script.

Feel free to visit my fork on github https://github.com/uNiversaI/xbmc-ubuntu-minimal I kept it for 12.04lts so it works with all ATI GPU's including legacy but again idk as I cant test it.

Dialout is needed for anyone who apparently has a cec adapter. Some of the other changes are great feel free to PR them to my github.

uNi


RE: HOW-TO: Automated efficient XBMC install - Ubuntu 12.10/13.04 mini based - lacrosse1991 - 2013-05-09

Hello, I apologize ahead of time as it looks like this has already been mentioned in other posts, although i've not been able to track down a clear answer. Would anyone be able to point me in the right direction regarding getting audio to work over hdmi for an nvidia gpu? In case it would be of any help, my setup includes the following at the moment:

CPU: Core 2 Duo 2.66 GHZ (OC'd to 3.15)
GPU: EVGA GTS 450
Motherboard: Asus P5QL-VM EPU (I've included a link for this one as it has it's own audio outputs and video ouputs, although I have the video switched over to the nvidia card) http://www.asus.com/Motherboards/P5QLVM_EPU/
Ram: 6 GB
Storage: 4 hard-drives with the root partition on a raid 1 array, and the storage on a raid 5 array (using mdadm)

also would either of the following links be of any use in this situation?
http://wiki.xbmc.org/index.php?title=How-to:Setup_audio_over_HDMI_on_nVidia_GeForce/nForce_controller
http://wiki.xbmc.org/index.php?title=HOW-TO:Setup_HDMI_audio_on_GeForce_GT210,_GT220,_or_GT240

Any help is much appreciated, thanks!


RE: HOW-TO: Automated efficient XBMC install - Ubuntu 12.10/13.04 mini based - Morrtin - 2013-05-09

@lacrosse1991

I am also quite new to posting here but to point you into the right directions it would be great to know which XBMC version you are
running and on which system (XBMCbuntu, Openelec, Ubuntu minimal, etc.)

@uNiversal

3) is gone due to the help of fritsch. My Audio is working perfectly now
4) I can look into it, if it is only a advanced setting. Because on Openelec Live both temperature are shown. I could start it, ssh and then get the settings from
advanced settings.

Maybe you can pm me a short introduction into Github. Never used a service like that.


RE: HOW-TO: Automated efficient XBMC install - Ubuntu 12.10/13.04 mini based - lacrosse1991 - 2013-05-09

(2013-05-09, 18:23)Morrtin Wrote: @lacrosse1991

I am also quite new to posting here but to point you into the right directions it would be great to know which XBMC version you are
running and on which system (XBMCbuntu, Openelec, Ubuntu minimal, etc.)

@uNiversal

3) is gone due to the help of fritsch. My Audio is working perfectly now
4) I can look into it, if it is only a advanced setting. Because on Openelec Live both temperature are shown. I could start it, ssh and then get the settings from
advanced settings.

Maybe you can pm me a short introduction into Github. Never used a service like that.

oh yep sorry about that, i'm using the version that is included with 2.6.0 of the automatic installer, and for the operating system itself I am using ubuntu 13.04


RE: HOW-TO: Automated efficient XBMC install - Ubuntu 12.10/13.04 mini based - Morrtin - 2013-05-10

@lacrosse1991

If I see this correct then this can get complicated.

Your motherboard is able to provide video and audio through it's own HDMI. And this is Intel.
But you have an "extra" graphic card which is NVIDIA.

My first step would be to make 100% sure that the Intel video and audio (as you like to us the graphic card ) is disabled in the BIOS.
So that you can be sure that Linux only see's the devices you like to use.

Because when all are active I can imagine it will be hard to direct video / audio to the right output.

When you disable something in BIOS you have tow ways to go (in my opinion)

1) Look for help in the NVIDIA threats you posted
2) Start from scratch (install ubuntu 13.04 / install XBMC with script), if it is not working then, go to point 1

Hope this help a little bit.


RE: HOW-TO: Automated efficient XBMC install - Ubuntu 12.10/13.04 mini based - Sevennl - 2013-05-10

Nvidia support of HDMI audio starts at 6xx series, at least out of the box HDMI out.
You older Nvidia card will have a Audio connector which you can connect ot the SPID/IF connector on your motherboard.
I tried that setup and failed as my motherboard and video card audio connection were not compatible.
So i bought a GL610SL, pluged the card in and got HDMI audio.
Without that cable from your motherboard to your videocard you will not get audio, and if you, like me, don't get it to work you are better off with a 35 euro 610 card.


RE: HOW-TO: Automated efficient XBMC install - Ubuntu 12.10/13.04 mini based - Brewster - 2013-05-10

@lacrosse1991

I just ran into a similar issue. On my Nvidia GT210 I could not get the audio to appear in xbmc no matter what I did in Ubuntu 13.04. I decided to upgrade the kernel to 3.9 because of some bugs I read about in the stock 13.04 kernel. These are the steps I followed to upgrade. When done I rebooted and audio appeared right away. No other bugs found so far with the new kernel.

Code:
sudo apt-get update && sudo apt-get dist-upgrade && sudo apt-get autoremove

Code:
cd /tmp

For 32 bit
Code:
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.9-rc8-raring/linux-headers-3.9.0-030900rc8-generic_3.9.0-030900rc8.201304211835_i386.deb http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.9-rc8-raring/linux-headers-3.9.0-030900rc8_3.9.0-030900rc8.201304211835_all.deb http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.9-rc8-raring/linux-image-3.9.0-030900rc8-generic_3.9.0-030900rc8.201304211835_i386.deb

For 64 bit
Code:
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.9-rc8-raring/linux-headers-3.9.0-030900rc8-generic_3.9.0-030900rc8.201304211835_amd64.deb http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.9-rc8-raring/linux-headers-3.9.0-030900rc8_3.9.0-030900rc8.201304211835_all.deb http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.9-rc8-raring/linux-image-3.9.0-030900rc8-generic_3.9.0-030900rc8.201304211835_amd64.deb

Code:
sudo dpkg -i *.deb

Code:
sudo update-grub2

Reboot

Also: make sure you follow @Morrtin suggestion to disable the onboard audio and video in the bios


RE: HOW-TO: Automated efficient XBMC install - Ubuntu 12.10/13.04 mini based - Morrtin - 2013-05-11

@lacrosse1991

If you go the route of updating your kernel to 3.9 then you should update your firmware first. I got this tip from fritsch in an other thread:

Code:
cd ~/
wget http://ubuntu.mirror.cambrium.nl/ubuntu//pool/main/l/linux-firmware/linux-firmware_1.106_all.deb
sudo dpkg -i linux-firmware_1.106_all.deb



RE: HOW-TO: Automated efficient XBMC install - Ubuntu 12.10/13.04 mini based - lacrosse1991 - 2013-05-14

(2013-05-10, 12:39)Morrtin Wrote: @lacrosse1991

If I see this correct then this can get complicated.

Your motherboard is able to provide video and audio through it's own HDMI. And this is Intel.
But you have an "extra" graphic card which is NVIDIA.

My first step would be to make 100% sure that the Intel video and audio (as you like to us the graphic card ) is disabled in the BIOS.
So that you can be sure that Linux only see's the devices you like to use.

Because when all are active I can imagine it will be hard to direct video / audio to the right output.

When you disable something in BIOS you have tow ways to go (in my opinion)

1) Look for help in the NVIDIA threats you posted
2) Start from scratch (install ubuntu 13.04 / install XBMC with script), if it is not working then, go to point 1

Hope this help a little bit.

(2013-05-11, 06:46)Morrtin Wrote: @lacrosse1991

If you go the route of updating your kernel to 3.9 then you should update your firmware first. I got this tip from fritsch in an other thread:

Code:
cd ~/
wget http://ubuntu.mirror.cambrium.nl/ubuntu//pool/main/l/linux-firmware/linux-firmware_1.106_all.deb
sudo dpkg -i linux-firmware_1.106_all.deb


Thanks for the info! Audio worked without any modifications for xbmcbuntu so at least I know its possible haha, although unfortunately xbmcbuntu would not behave with mdadm (at least for me) which made it sort of a no-go for me. The audio and video originally had not worked with xbmcbuntu until I had removed a cable card (wintv-hvr-1800), not sure what is keeping it from working with this setup though as it did not seem to make a difference. With the firmware, would that apply to both x86 and x64?

(2013-05-10, 22:04)Brewster Wrote: @lacrosse1991

I just ran into a similar issue. On my Nvidia GT210 I could not get the audio to appear in xbmc no matter what I did in Ubuntu 13.04. I decided to upgrade the kernel to 3.9 because of some bugs I read about in the stock 13.04 kernel. These are the steps I followed to upgrade. When done I rebooted and audio appeared right away. No other bugs found so far with the new kernel.

Code:
sudo apt-get update && sudo apt-get dist-upgrade && sudo apt-get autoremove

Code:
cd /tmp

For 32 bit
Code:
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.9-rc8-raring/linux-headers-3.9.0-030900rc8-generic_3.9.0-030900rc8.201304211835_i386.deb http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.9-rc8-raring/linux-headers-3.9.0-030900rc8_3.9.0-030900rc8.201304211835_all.deb http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.9-rc8-raring/linux-image-3.9.0-030900rc8-generic_3.9.0-030900rc8.201304211835_i386.deb

For 64 bit
Code:
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.9-rc8-raring/linux-headers-3.9.0-030900rc8-generic_3.9.0-030900rc8.201304211835_amd64.deb http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.9-rc8-raring/linux-headers-3.9.0-030900rc8_3.9.0-030900rc8.201304211835_all.deb http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.9-rc8-raring/linux-image-3.9.0-030900rc8-generic_3.9.0-030900rc8.201304211835_amd64.deb

Code:
sudo dpkg -i *.deb

Code:
sudo update-grub2

Reboot

Also: make sure you follow @Morrtin suggestion to disable the onboard audio and video in the bios
will give this a try, thanks! had you done this before or after running the automated installer? Also with the automated installer, had you used the stable or untested version?