Archive:HOW-TO:Install XBMC 9.11(SVN) on Mythbuntu 9.10 with JYA repos and Asus AT3N7A-I Mainboard
Difficulty: (Beginner to Intermediate)
Mythbuntu Release: (9.10)
MythTV Release: (0.22)
XBMC Release: (Camelot 9.11 SVN)
Author: rodercot
Last Updated: Jan. 15th, 2010
Introduction
I want to first say thanks to all the xbmc-team for a great piece of software, I would also like to thank the countless posters to the various web-sites in some of the resource links I will post later in the guide, without some of your tips or guides I would not have the system running as well as it is - So Thanks to You All. On with the guide.
This guide will explain how to install & configure Mythbuntu 9.10 Front-end Only, update & configure the frontend, add the JY Avenard Repos, update your nvidia-glx drivers with vdpau enabled and finally install XBMC Camelot 9.11 Final from SVN using the Asus AT3N7A-I ION330 Mini-Itx mainboard. This will work with the standard M$ 1039 Rev2 Remote Control and USB Dongle as well. I will include some tips and caveats that I used along the way. The system will also resume and suspend fine within XBMC when complete.
Resources
Hardware
- Mainboard - http://asus.com/product.aspx?P_ID=xrR7wto9Z5BL42aU&templete=2
- Chassis - http://usa.aopen.com/products_detail.aspx?Auno=2864
- Slim-DVD - http://us.liteonit.com/us/index.php?option=com_content&task=view&id=270&Itemid=88
- Remote - http://www.mythtv.org/wiki/File:MCE-Remote-2-alt.jpg
Software
- Mythbuntu - http://www.mythbuntu.org/9.10/release
- JYA Repos - http://avenard.org/media/Ubuntu_Repository/Ubuntu_Repository.html
- Appswitch - http://www.xpmediacentre.com.au/community/linux-tutorials-guides/33370-myth-tweak-switch-between-myth-xbmc-via-remote.html
- XBMC - https://xbmc.svn.sourceforge.net/svnroot/xbmc/branches/9.11_Camelot/
- Alsa-Script - http://ubuntuforums.org/showthread.php?p=6589810#post6589810
Caveats
- USB Autoresume fix - http://ubuntuforums.org/showthread.php?t=1359382
- HDD not-detected workaround - http://ubuntuforums.org/showthread.php?t=1349898
- Bluetooth possible fix - Post 17 - http://ubuntuforums.org/showthread.php?t=1264532
- wake on device help - Enable_Wake-On-Device Thanks Outleradam
- xorg configuration - http://ubuntuforums.org/showthread.php?t=1003099&page=2
My Configuration
- Myth1 - dedicated myth 8.10 backend with 3 pvr-150 and Q950 OTA HD Tuner. Schedules direct for guide information
- Myth2 - Asrock ION330 - Myth 9.10, XBMC 9.11, MCE Remote, 52" Aquos, Denon AVR-988, HDMI (5.1) 195-glx
- Myth3 - Asus AT3N7A-I ION330 - Myth 9.10, XBMC 9.11, MCE Remote, 32" 1080p LG, HDMI (Stereo) 195-glx
- Serv1 - Unraid Media Server for all Media
- Serv2 - Unraid Data Server for all Data
- SD Movies are all Movies1/Movie_Name/Video_TS/file.vob (No Compression)
- HD Movies are all HDMovies1/Movie_Name/file.ts in VC1 or H264 all converted to dts-hd audio
- TVshows are all TVShows1/TVShow_Name/Season/show.name.sxxexx.epname.avi
- Music is all Music1/Artist/Album/song.flac
- NFO's are all handled by Media Companion Gen2 - Thanks Billy
Step 1 Setup Motherboard & Install Mythbuntu 9.10
Bios
Mythbuntu
Click on the resource link above for mythbuntu, dwnld the latest 9.10 iso, then burn it to a dvd with your favourite iso burning tool. Once you have the ISO on the dvd place the dvd in your ion system and power it up. It will boot from your ISO and give a menu with a few options like run mythbuntu livecd, install mythbuntu, memtest etc... I always like to run memtest for a couple passes on a new machine just to make sure things are happy, NOTE that a memtest pass will usually take a minimum of 30 Minutes.
sudo apt-get remove dmraidOnce that has done it's thing close the terminal window and you will be back at the desktop. End TIP
Ok! your live session is running - click on the install mythbuntu icon on the desktop. This will start the install program.
Choose your time zone, language and keyboard layout. now the parition manager will start choose the guided option and let myth create your main (ext4) and swap partitions.
if you prefer your own partition structure then you can choose manual and setup your drive as you like, that is beyond the scope of this guide.
Continue by clicking on forward and answer the next few questions.
You will be asked for your user information.
type in your name, computer name(this is your local host later) type your user name and password (I suggest you use xbmc|xbmc)for easier editing later) It will ask if you want to setup your remote and transmitter(for a specific cable box or satellite) I suggest you do as this will populate your ~/.mythtv/lircrc file which you can later edit. Next is to enable restricted drivers choose yes and this will install nvidia-glx-185.
Finally it will ask you for your mythdatabase information enter that information with the backends ip address, the user and database name should remain unless you changed it on your backend and finally the db password.
(you can get these details from the ~/.mythtv/mysql.txt file on your backend.)Password is CASE sensitive so type it in as per After you enter the details click on the test connection and it will either give you a success or fail notification.
Sample mysql.txt file for reference(I marked the info you need with an > sign) from a terminal or putty login to your backend and type
# cat ~/.mythtv/mysql.txt
>DBHostName=192.168.1.xxx # By default, Myth tries to ping the DB host to see if it exists. # If your DB host or network doesn't accept pings, set this to no: # DBHostPing=no >DBUserName=mythtv >DBPassword=D2ABFbE >DBName=mythconverg DBType=QMYSQL3 # Set the following if you want to use something other than this # machine's real hostname for identifying settings in the database. # This is useful if your hostname changes often, as otherwise you # will need to reconfigure mythtv (or futz with the DB) every time. # TWO HOSTS MUST NOT USE THE SAME VALUE # #LocalHostName=my-unique-identifier-goes-here # If you want your frontend to be able to wake your MySQL server # using WakeOnLan, have a look at the following settings: # "mysql.txt" 39L, 1126C
If All is good then hit forward, myth will supply you with a summary of everything the install will perform.
Press ok and let it install.
Once completed it will ask you to reboot, go ahead and do that. Myth will pop the dvd out of the drive and ask you to hit enter to continue and then restart the system for you.
Mythbuntu Configuration
Now you have a clean install of Mythbuntu up and running, by default your mythfrontend will launch you need to choose your language, then it will show you the general screen for setup just click the next icon through and click finish now at the mythfrontend main screen press the left arrow on your keyboard and choose exit mythtv, now you will see a carbon like desktop with a toolbar at the top, on the toolbar left will say applications and on the right will show your wired ethernet connection icon and the clock; Congrats you installed Mythbuntu. The First thing I like to do is right click on the desktop anywhere and choose open terminal here the system will launch a terminal window, in the window type:
ifconfig
This will give you your ip address for this machine as well as your details about your e-net connection. pay close attention to the RX, TX Packet lines as well as the collisions line, these will tell you alot about your home networks cabling and connections, all my machines are zero except for the txqueuelen which is usually 1000. In the Words of Van Wilder "Write that down." LOL, seriously though just make a note of your ip address if your router supplies dhcp you can reserve the address on it later.
next in your terminal let's clean the terminal window by typing:
clear
at the command prompt and that will give us a nice clean terminal window. Next we a gonna update your operating system for the first time, this will likely take about 20 minutes so get some water, make some coffee and lets go. In your clean terminal window type
sudo apt-get update
then type in your password (if you followed my instructions from above this will be)
xbmc
The system will run through the existing repos in your /etc/apt/sources.list file and return you to the prompt. Now type in
sudo apt-get dist-upgrade
It will list about 200+ upgrades for this first updgrade that is normal go ahead and say Y or n (note the the capital Y) and let it run it's course. When your update is complete it will return you to the command prompt unless there are errors which are not too common on the initial update. go ahead and type
sudo reboot
The will restart your system and return you to the mythbuntu desktop. OK let make sure the nvidia glx drivers are installed OK, right click on your desktop and choose - applications - System - Nvidia X server settings and left click on it. It will open the program if the drivers are loaded OK, you will see a penguin with the nv logo and under that details about the installed driver, it should be 185.xx.xx. If it is not loaded you will not see that screen and it will tell you that there is a problem with your x-drivers - if that is the case head over to the forum and find the thread supporting this guide and we will help you get it sorted out.
Myth Control Center
The Mythbuntu control center is the greatest tool, it allows you to change your Myth setup from a GUI without all the work from the command line editing. So let's open it up and get started. Right click on your desktop and choose - applications - System - Mythbuntu Control Centre - click on it and it will open up (it may ask you for your password the first time). You will see a window with a bunch of links down the right side of it, including:
Plugins|Proprietary Codecs|Startup Behaviour|System Roles|Themes|Services|Graphics Drivers|Mythexport|Infrared|System Updates|Mysql
I am not going to go into details about all of these as you can investigate each one on your own and find out what they do. Alot of the plugins for weather, video, music etc we are going to disable as they are harder to configure and that is what we use XBMC for and trust me it is much easier with xbmc.
So click on the plugins icon you will have a few of them checked off I remove all of them EXCEPT mytharchive and Mythvideo. Mythvideo will give you optical disk support from the mythfrontend for dvd playback etc..you need this plugin for that option. You will also see Mythweb, that allows you to setup schedules and recordings from a browser, I choose to set this up on my backend as that is the machine that is doing the recording anyhow so instead of making things more complicated by having to log into several machines for recording schedules I do not install Mythweb on the frontends.
Now click on Proprietary Codecs on the right and than click on Enable Medibuntu and click apply (you will need to enter your password a few times here) let it do it's thing, it will also remove your plugins at this point. OK! done, now click on enable GPG Keyring and click apply when that is done click on enable w32 or w64 codecs depending on your installed myth version, click on enable libdvd, ffmpeg should already be checked if not check it off now and click on apply and let that all process when complete you will check marks in all the areas other than the not per verion installed codecs is greyed out.
Click on services, SSH should be enabled - if not enable it this gives you access via putty and other remote apps also enable samba and if you want to run a vnc server on your windows or linux desktop for remote access then enable VNC as well. Click apply and wait to finish. Now click on quit we are done with the control centre setup as i said there are many more tools inside here but I will not be going into those in detail, you can find out about all those features from the mythbuntu wiki. One more thing, if you are not going to be using the frontend currently then you should stop it from loading at start-up to do this click on startup behaviour and uncheck the automatically start Mythtv Frontend.
JY Avenard repos
let's enable the JYA repos. You can use other repos if you like, but you will be installing several repos to achieve the same goals, the Jya repos include, the latest builds for nvidia-glx driver as well as libs for vdpau and then all the mythbuntu updates and finally the latest compiled mplayer with vdpau enabled. There are three separate repos available release, working, and leading edge, I use the release repos and that is what I will include below.
So first we need to open a terminal, so on your desktop right click and choose open terminal here, then in the terminal window type:
cd ~ (enter)
Now we need to get the gpg signing key for the repos you can do that pasting this line into your terminal window hit enter and type in your password.
wget http://www.avenard.org/files/ubuntu-repos/ubuntu-repos.key && sudo apt-key add ubuntu-repos.key && rm ubuntu-repos.key
Now lets add the repository to your local list. THIS REPO IS FOR KARMIC(myth9.10) ONLY so now paste this line in your terminal window
echo "deb http://www.avenard.org/files/ubuntu-repos karmic release" | sudo tee /etc/apt/sources.list.d/avenard.list
Great! you have added the repo. Now we have a little bit of a workaround to perform here. Type into your terminal window
clear (enter)
We currently have nvidia-glx-185, nvidia-185-libvdpau and nvidia-185-kernel-source installed locally, well we need libvdpau1 to upgrade to the newest drivers but libvdpau1 conflicts with a file in nvidia-185-libvdpau. So we need to download libvdpau1 and install manually. So lets do that. First I like to make a directory for all my downloaded files in one location. I would suggest you follow along as we will use this later as well. In the terminal window type
cd ~ (enter) sudo mkdir install (enter) sudo chmod 777 install (enter) cd install
We are now in our newly created install directory go ahead and paste this line into your terminal window.
wget http://www.avenard.org/files/ubuntu-repos/release/libvdpau1_0.3-0ubuntu1_i386.deb
let it download and then in your terminal window paste this making sure you are still in your /install directory.
sudo dpkg --force-all -i libvdpau1_0.3-0ubuntu1_i386.deb
The above package also has a dependendancy that we need to install as well, so to install vdpau-driver-all type or paste
sudo apt-get install -f
OK! lets update the video drivers to the latest. paste this command into your terminal window.
sudo apt-get update (enter) sudo apt-get install nvidia-glx-195 nvidia-195-libvdpau nvidia-195-kernel-source
This will remove the existing 185 version glx drivers and install the newest 195 drivers when completed type:
sudo reboot (enter)
Reboot the system and let it load up exit mythfrontend and then load up the nvidia-settings program to check the driver rev. remember right click - application - system - Nvidia X server setting and click on that. It should list 195.XX as the driver installed. This is Good. OK now let's do an update, this will be a big one as it will update a ton of myth files and possibly your kernel and a few others. right click and launch terminal here and type or paste:
sudo apt-get update (enter) sudo apt-get dist-upgrade (enter)
It will likely take a while, when it finishes installing let reboot again type or paste:
sudo reboot
Congrats, you have finished the second part of the tutorial and your mythfrontend is now .22 with the latest nvidia drivers and all the JYA Updates installed.
Setting USB Ports to Wake-Up the sytem as well as permissions
With my system I had a couple issues here one it would not wakup via the remotes power button and when I got that working it would auto resume the system by itself. I fixed both of these issues as follows. I would suggest that you do the first part and try it and then come back and fix the autoresume later if you run into that problem. I am posting some commands from outleradam's wiki Enable_Wake-On-Device. right click and launch a terminal and we need to be root to perform the following so type or paste
sudo su
Then we need to see if our devices are awake or not,
cat /proc/acpi/wakeup
You will get a list that looks something like the following (Example Only) We are concerned about the USBX devices.
root@zotac-ion:/home/xbmc# cat /proc/acpi/wakeup Device S-state Status Sysfs node SMB0 S4 disabled pci:0000:00:03.2 USB0 S4 disabled pci:0000:00:04.0 USB2 S4 disabled pci:0000:00:04.1 US15 S4 disabled pci:0000:00:06.0 US12 S4 disabled pci:0000:00:06.1 NMAC S5 disabled pci:0000:00:0a.0 PBB0 S4 disabled pci:0000:00:09.0 HDAC S4 disabled pci:0000:00:08.0 XVR0 S4 disabled pci:0000:00:0c.0 XVR1 S4 disabled P0P5 S4 disabled P0P6 S4 disabled pci:0000:00:15.0 P0P7 S4 disabled pci:0000:00:16.0 P0P8 S4 disabled pci:0000:00:17.0 P0P9 S4 disabled pci:0000:00:18.0 PWRB S4 *enabled
We want to enable only one of those USBX devices as enabling both tends to cause problems, we will enable USB0 it tends to be most common, you can also take a look at lspci or dmesg to get at little more information on the devices and what you have hooked up. lets wakeup USB0 by pasting this
echo USB0 > /proc/acpi/wakeup
we will now check that by pasting
cat /proc/acpi/wakeup
again and you will now see that USB0 is enabled but that is for this session only and we need it to happen on every boot so we need to edit our /etc/rc.local file. I use vim to edit my files I like it it is simple and quick if you want to use vim it needs to be installed or you can just use your prefferred editor. skip the next line if you use your own editor
sudo apt-get install vim
Ok lets edit the /etc/rc.local file. You only need 1 exit 0 in this file and it is already there so just add this line and save the file
sudo vim /etc/rc.local
This will open the file for editing. now hit the I button on the keyboard that allows you to enter text with vim. if you make a mistake just hit :q! to escape the file without changes. Allright let past this line into the file above the existing exit 0 line. make sure there is still one line space above the new line and no line space between the line we are pasting and exit0
echo USB0 > /proc/acpi/wakeup
and the file should look like this
root@zotac-ion:/home/xbmc# sudo vim /etc/rc.local #!/bin/sh -e # # rc.local # # This script is executed at the end of each multiuser runlevel. # Make sure that the script will "exit 0" on success or any other # value on error. # # In order to enable or disable this script just change the execution # bits. # # By default this script does nothing. echo USB0 > /proc/acpi/wakeup exit 0
We are done so now hit esc which takes us out of editing mode in VIM (you will notice the INSERT comment goes away at the bottom of the screen) now type :wq (that is shift colon lower case w and q)to save the file. Good Job.
Autoresume
Now lets fix the autoresume issue.NOTE If you do ntt have this problem you should not perform this step until after the system is tested so follow the rest of the guide and then come back here if you have the autoresume issue So the description of this problem is you suspend the system within XBMC and right away it resumes or wakes up again. This is how I fixed my system There is also a link in the above resource section to get some more info from the ubuntu forums. Thanks to the author of that post. We need to edit our grub boot line in order to accomplish this fix and we are now using Grub2 with 9.10 so things are a little different so first lets get out of root by typing
exit
at the command prompt and you should be back at your regular command prompt which will look like this
xbmc@zotac-ion:~$
So we are going to edit out default grub boot line, so paste this into your terminal window
sudo vim /etc/default/grub
The file will now open and the line we want to fix is GRUB_COMMAND_LINE_DEFAULT="quiet splash" we are going to add a couple things in here one is the autoresume fix but there is also a conflict on these ion boards between nvidia SMbus and acpi and we want to fix that so we will do that now as well, this is only a workaround currently and it may be fixed in later kernels so you can find the bug reports on google and track them to know when you'll want to remove this line here is a link to one https://bugs.launchpad.net/ubuntu/+source/linux/+bug/440780. Allright hit the I on your keyboard to get into editing mode in vim. now paste this into that line BETWEEN THE QUOTES and leaving a space after the h in splash.
usbcore.autosuspend=-1 acpi_enforce_resources=lax
Now the line should look like this after editing
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash usbcore.autosuspend=-1 acpi_enforce_resources=lax"
OK that's added let hit esc to exit editing mode and then type :wq to save the file. Now we need to update grub let's do that by pasting this
sudo update-grub
ok now lets reboot to make sure we did not screw anything up - LOL :) The final part of this section is to add some persmissions. We will be using PM-Suspend via XBMC and possibly later on some custom /etc/pm/sleep.d custom scripts to help resume or suspend and in order to do that sudo will need to be used and without adding permissions to run sudo without a password the scripts will fail so let add that permission. Yet again open a terminal window you should know how by now. and type
sudo su
now we are going to edit your /etc/sudoers file this is the root permissions file so take your time. paste this line in your terminal window
visudo
voila! the file opens and looks like this (Sample File Only)
root@zotac-ion:/home/xbmc# visudo GNU nano 2.0.9 File: /etc/sudoers.tmp # /etc/sudoers # # This file MUST be edited with the 'visudo' command as root. # # See the man page for details on how to write a sudoers file. # Defaults env_reset # Host alias specification # User alias specification # Cmnd alias specification # User privilege specification root ALL=(ALL) ALL # Uncomment to allow members of group sudo to not need a password [ Read 25 lines ] ^G Get Help ^O WriteOut ^R Read File ^Y Prev Page ^K Cut Text ^C Cur Pos ^X Exit ^J Justify ^W Where Is ^V Next Page ^U UnCut Text^T To Spell
Scroll down the file & below the %admin ALL=(ALL) ALL line paste this below that line xbmc is YOUR username you use to login with if it is not then change to what yours is
xbmc ALL=(ALL) NOPASSWD: /usr/sbin/pm-suspend
OK now hit ctl-x to exit then shift y for a capital Y for yes and then enter to write to the sudoers file. now type
exit
to leave root mode and we are done with this section.