Tag Archives: HTPC

Resuming from suspend with remote control on XBMC and Ubuntu 9.10

I’m so fucking lazy. I don’t want to have to get up, walk the 3 paces across my living room, open the cupboard door and press the power button on my HTPC to resume it from suspend (sleep). So I must be able to do it with the remote control, right? Well, you can with a little bit of work:

I completed all the steps in this excellent xbmc wiki article about enabling wake-on-device.

When I tested it by sleeping my computer, I had to press the ‘power’ button on my MCE remote to get it to resume, but all worked fine. However, it badgered me for a password. I didn’t want this as I wanted to be able to use it via the MCE remote ONLY. To disable the password nagging screen do this by starting terminal and type the following to bring up the configuration editor:

Navigate to ‘Apps’ – ‘gnome-power-manager’ – ‘lock’ and untick ‘suspend’, as below:

Untick the 'suspend' box in the configuration manager

So there you go, resume your HTPC with the remote and no troublesome nagging password screen.


Fixing Blank Screen if Ubuntu 9.10 Started with HDTV or Monitor Turned Off

Lord knows this was painful to fix as I’m a relative Linux newbie.


My HTPC, when started up with my HDTV turned off does not detect the TV and results in a blank screen. I can VNC into the Ubuntu OS but the resolution is very low (800×600). I suspect this is due to the television as I’ve read in some forums that this is just ‘one of those things’ on certain models. The graphics card is an Nvidia MSI 8400GS, connected to a Toshiba 37AV505D HDTV via an HDMI cable with a DVI adapter into the card.

After some research it appears the graphics card is waiting for monitor information to come down the connected cable via EDID. As the monitor is off, the card defaults to ‘failsafe’ settings and switches output to the VGA port at 800×600.


Force the graphics to ignore missing EDID information, force output to DVI and also force the resolution.

Brief Solution Explanation:

Export EDID settings for connected and correctly configured flatscreen/HDTV. Point xorg.conf to use the exported settings and to ignore all else.

This is what I did to fix it:

Warning: This is, apparently, dangerous and can spanner your TV/monitor if done incorrectly. Proceed at your own risk etc etc

  1. Ensure ssh is installed
    This is so you can restore your xorg.conf file if everything goes tits up.
  2. Backup the xorg.conf file
    This file is, apparently, somewhat old and rarely used. When I totally spannered this setup (which I did a couple of times), I was be able to SSH back into the box and return the file to the original.
    First, open terminal and change permissions:
    cd /etc/X11
    sudo chmod 777 xorg.conf

    then make a new copy:
    sudo mv xorg.conf xorg.conf.original
  3. Make a new xorg.conf file
    At the moment no xorg.conf file exists. As I am using the Nvidia driver, I created a new xorg.conf file by starting the Nvidia settings in terminal:
    sudo nvidia-xconfig
  4. Start up the NVIDIA settings manager
    sudo nvidia-settings
    (You can also get to it by going to ‘System’ – ‘Preferences’ – ‘Display’. It should be present if your system is fully up-to-date) . Looks something like this:
  5. NVIDIA X Server Settings in Ubuntu 9.10Ensure the monitor/screen/LCD/HDTV or whatever is the ONLY monitor connected and save the settings
    Go to the ‘X Server Display Configuration’ option and ensure you select the correct resolution, frequency.
    Click on the ‘Advanced…’ button.
    Take a note of the ‘Model’ (in my case ‘TSB TOSHIBA (DFP-0 on GPU-0)’) and the ‘Mode Name’ (in my case ‘1920x1080_60i’).
    Click ‘Save to X Configuration File’ and save to ‘/etc/X11/xorg.conf’.
    If you have problems saving you will probably have to reset the permissions, as per step 2 (‘sudo chmod 777 xorg.conf’).

    Screenshot-NVIDIA X Server Settings

    Don't forget to save your settings

  6. Quit and restart Ubuntu.
  7. Export your EDID settings
    In terminal, start the Nvidia Settings GUI again with:
    sudo nvidia-settings
    Now go to the settings for your flat panel (in my case it was ‘DFP-0 – (TSB TOSHIBA-TV)’
    Click the ‘Acquire EDID…’ button and note where you saved it (in my case I chose ‘/home/mark/Desktop/edid.bin)
    Acquire EDID...
  8. Modify the xorg.conf file to use exported EDID file
    Open terminal and ensure you have write permissions for xorg.conf:
    cd /etc/X11
    sudo chmod 777 xorg.conf
    sudo gedit xorg.conf

    This should open your xorg.conf file.
    Under the ‘Section “Device”‘ I added:
    Option “CustomEDID” “DFP-0:/home/mark/Desktop/edid.bin”
    ‘DFP-0’ is ‘Digital Flat Panel – 0’, we noted this in step 5. Yours may well be different.
    The section ended up looking like this:
    Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce 8400 GS"
    Option         "CustomEDID" "DFP-0:/home/mark/Desktop/edid.bin"

    It’s probably worth restarting just to see that everything’s still ok. Still with the monitor on, it should boot up ‘normally’.
  9. Force the screen to use DVI and ignore other modes
    I added these two lines under the ‘Section “Screen”‘:
    Option         "ConnectedMonitor" "DFP-0"
    (This forces the graphics card to assume the above monitor is connected)
    Option         "ExactModeTimingsDVI" "TRUE"
    (This gets the graphics card to ignore any other possible modes available)
    I then removed all but the mode I wished to use and locked it to the monitor I wished to use:
    Option         "metamodes" "DFP-0: 1920x1080_60i +0+0"
    (This line had lots more modes specified, separated by commas and semicolons).
    The section ended up looking like this:
    Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "TwinView" "0"
    Option         "ConnectedMonitor" "DFP-0"
    Option         "ExactModeTimingsDVI" "TRUE"
    Option         "metamodes" "DFP-0: 1920x1080_60i +0+0"
    SubSection     "Display"
    Depth       24
  10. Reboot and check it boots up with monitor turned on
    The display should look totally normal.
  11. Reboot with monitor turned off to test
    Turn display on after it’s booted into the OS.

Problems? Troubleshooting? Try opening up ‘/var/log/xorg.0.log’ and looking through to see what’s not working.

If your display was hosed, you can see the log from the time BEFORE you just booted by checking out ‘/var/log/xorg.0.log.old’.

This post and this post really helped me out.

Installing OSX86 (Hackintosh) onto Gigabyte G41M-ES2H with iATKOS v7 (Mac OSX 10.5.7)

Please note: I’ve done another post detailing how to get OSX86 working (on iDeneb v1.5.1) with the same motherboard and an NVIDIA card, as the onboard Intel graphics don’t have full functionality. Click here to see the post.

Originally I bought this motherboard with the intention of running XBMC on top of OSX. It was a toss-up between Ubuntu 9.10 and an OSX86 Hackintosh flavour and in the end Ubuntu won, but only because it was marginally quicker to boot up and support for this setup on the XBMC forums seemed to be a little better.

Anyhow, I think that at least a few people should find this walk-through useful so I thought I’d write it up.

A word of warning before we begin – the highest resolution currently possible by the onboard Intel X4500 graphics card is 1280 x 1024px, nowhere near big enough to fill the 1920 x 1080 px resolution of the 37″ widescreen Toshiba TV I wanted to use it with. As it happens, support seems to be pretty dismal on Ubuntu as well, so after hours of research I found a graphics card that fit my requirements:

  • OSX86 compatibility, including QE/CI (a bit like DirectX for Windows this does not work with the onboard Intel GPU)
  • Ubuntu 9.10 compatibility
  • DVI output at 1920 x 1080 px
  • Low noise (eg, silent, fanless)
  • Under £40
  • NVIDIA chipset

Eventually I found the winner, an MSI N8400GS D512H graphics card which provided, as I discovered, near out-of-the-box functionality with OSX86 with only one box needing to be ticked in the setup – and that was good enough for me.

Setting up the BIOS

So, onwards and upwards. After installing all the components into the case (I used a SATA hard drive and port closest to the edge of the board) and having downloaded iATKOS V7 iso from one of the usual sources and burnt it to a DVD I had a quick wade through the BIOS to check the settings.

To start with I selected ‘Load Optimized Defaults’, save and exited in case the HDD needed to be redetected, then went back into the BIOS.

Here’s what I did on each page – I am only documenting settings I changed from the default:

Standard CMOS Features

On all IDE channels that weren’t in use I went into each and selected ‘NONE’. Although on the main page it already says ‘NONE’ I go into each and manually disable those not in use. In my experience it stops the motherboard detecting drives every time and can speed up the POST.
Drive A – ‘NONE
Halt on – ‘No Errors’Standard CMOS Features BIOS screen

Advanced BIOS Features

First Boot Device – ‘Hard Disk’
Second Boot Device – ‘Disabled’
Third Boot Device – ‘Disabled’

Advanced BIOS Features screen

Advanced Chipset Features

Don’t change any of these settings. I started messing around with the ‘PAVP Lite Mode’ and bumped up the memory allocation and had problems booting.

Advanced Chipset Features BIOS screen

Integrated Peripherals

Onboard Serial Port 1 – ‘Disabled’
Onboard Parallel Port – ‘Disabled’ – I don’t use any parallel or serial devices.
USB Keyboard Function – ‘Enabled’
USB Mouse Function – ‘Enabled’ – Otherwise your (USB) keyboard won’t work during setup.

Integrated Peripherals BIOS screen

Power Management Setup

I left all these settings as default.

Power Management Setup BIOS screen

PnP/PCI Configurations

I left these as default.

PnP/PCI Configurations BIOS screen

PC Health Status

I left these settings as default, and couldn’t be bothered to take a screenshot.

OSX86 Installation

Please note – it is best to do this part connected to a standard computer monitor/flatscreen. Otherwise you end up having to choose options and press buttons that aren’t visible on the screen, a bit like this:

iATKOS Welcome Screen on widescreen TV

If you use a widescreen TV, you may not be able to see or select buttons during installation

Now the BIOS is sorted, let’s get on with the actual installation. Pop the CD in the caddy, hit ‘F12’ as it runs through the POST to bring up the Boot Menu and select ‘CDROM’.

When it asks to ‘Boot from CD/DVD’ make sure you hit return. Another message with something like ”Press any key to start up from CD ROM…’ pops up a few seconds after, hit return again.

You should have the Apple logo up whilst the installer loads – after a few minutes the a dialogue box pops up asking to ‘Click the button to continue..’

First installation screen on iATKOS v7

The next thing to do is prepare your hard drive. When the ‘Welcome’ screen pops up you get the Apple menu along the top of the screen. Click ‘Utilities’ – ‘Disk Utility…’

The entire contents of this drive are about to be erased. Please ensure you have no important information on your drive because if you come whining to me I will honestly not give a fuck.

Select your drive in the left hand pane (in the screen below I already had a ‘Mac OSX’ partition created, ignore this), and click on the ‘Erase’ option to the right of ‘First Aid’. Choose ‘Mac OS Extended (Journaled)’ and name your new partition  (I used ‘Mac OSX’). Hit the ‘Erase…’ button. A warning dialogue box will pop up, just hit the ‘Erase’ button again.

Disk Utility in iATKOS v7

As soon as that’s finished, close Disk Utility and click ‘Continue’ on the welcome screen.

Agree to the ‘Terms and Conditions’ that pop up.

Next the ‘Select a Destination’ window will pop up. Select your drive and click ‘Continue’

Select a Destination for your OSX86 installation screen

This next part is important. On the ‘Install Summary’ screen, hit the ‘Customize’ button.

Under ‘Drivers’ – ‘VGA’ – ‘Intel’ select the ‘GMA X3100’ box. Apparently the X3100 chipset shares some of the same features as the onboard X4500. I have no idea whether the installer will work without this ticked, but this is how I did it.

Customize screen for iATKOS v7

After clicking ‘Done’, hit ‘Install’. I normally skip the DVD consistency test that next pops up. If it is the first time you are intalling you may want to let this run.

The installation time will depend on the speed of your DVD (hardware) and hard drive. My DVD is pretty old and slow, so it took about 15 minutes to install.

Your machine should reboot and you should see that hideous Chameleon graphic before it boots into OSX. Next you should be asked to identify your keyboard. Follow the instructions and choose the country you’re in and your keyboard layout.

When it asked me if I already owned a Mac, I chose ‘Do not transfer my information now’.

On the ‘Registration Information’ screen, I typed in my name and made up everything else in the compulsory fields.

When ‘Create Your Account’ popped up, I filled in all the fields and chose a password.

I selected ‘I don’t want to try MobileMe for free right now’.

When the ‘Thank You’ screen popps up, hit ‘Go’. Boom, all done.

OSX86 installation 'Thank You' screen

So you’ve got OSX installed. Now all you got to do is tackle the crappy resolution on your screen. Remember, without an NVIDIA GPU you’re pretty much stuck with it (don’t believe me? Check the thread on the insanelymac.com forum). But it is possible to up the resolution to 1280 x 1024. If you’re extremely stubborn and love banging your head against a brick wall I think I upped the resolution to 1280 x 1024 px by adding an entry to ‘/Library/Preferences/SystemConfiguration/com.apple.Boot.plist’. It is WAY easier to buy an NVIDIA card than fuck about with a legacy GPU that Apple have no interest in supporting. Trust me. Buy an NVIDIA card and be done with it.

GUI legibility (on a Hi Def Widescreen TV) for Firefox on Ubuntu 9.10

One problem I didn’t anticipate was the (il)legibility of the screen on my new HTPC when browsing the web. I have a 37″ Toshiba 37AV505D flatscreen with the HTPC hooked up via DVI cable. Running at 1920 x 1080px everything ends up looking, at best, fucking tiny.

At first I squinted, begrudgingly shuffled closer and made do with it all, but it was quickly doing my head in, and this is before I’d even let my technophobic short-sighted other half at it. I wasn’t going to spend all day on the Internet with it as it’s mainly for running XBMC which has nice, big fonts and is built with widescreen TVs in mind. However, as I’d gone to so much effort to make Firefox start from within XBMC I thought I may as well bite the bullet and figure out how to jig the zoom settings around in Ubuntu and Firefox to make the whole experience more comfortable.

In the screen below you can see what it looked like before I touched the browser settings (I’d already changed the OS settings). I can’t see shit.

1920x1080 Ubuntu 9.10 with Firefox at 100% Zoom

After some digging I found the NoSquint Add-on for Firefox and changed the global Zoom settings (click here to see what I set them as). Way better.

1920x1080 Ubuntu 9.10

I changed some settings in ‘Preferences’ – ‘Appearance’ – ‘Fonts’ in the Ubuntu GUI. Here’s what I changed them to:

Font Appearance Preferences in Ubuntu

I then hit ‘Details…’, and changing the Resolution (DPI) really made a difference to the legibility of the whole GUI. I whacked it up to around 150:

Font Rendering Details in Ubuntu

Ideally I wanted to make it easier to scroll up and down in Firefox by making the scrollbars wider. Apparently this is possible in earlier (than 3.0) versions of Firefox by modifying the ‘userChrome.css’ file in your user profile directory, but apparently this is no longer possible, which is a shame. If I ever find a solution to this (as well as making the ‘back’ and ‘forward’ buttons larger, I’ll be sure to post.

So there you go. A perfectly legible HTPC display with 10ft GUI.

Modifying the Aeon XBMC Skin to Launch Firefox from main menu in Ubuntu

If you followed the instructions in my previous post about starting Firefox from inside XBMC you’ll probably have realised by now that with Launcher you have to navigate through the ‘Programs’ main menu  etc etc to find the shortcut.

Ideally, I wanted it in my XBMC main menu – using the beautiful Aeon skin. I got it set up so it launched from the menu as per the picture below:

Firefox Browser Launcher for XBMC in Ubuntu

Background wallpaper pinched from Geekpedia (see footnote for link)

If you’d like to know how I did it just follow the steps below.

Please note that this is a ‘quick and dirty’ method, as you’re editing an existing menu item (in this case, ‘ASSISTANT’):

  1. To change the text on the main menu, open ‘~/.xbmc/skin/Aeon/language/English/strings.xml’.
    On a Mac this is in ‘/userfolder/library/Application Support/XBMC/skin/Aeon/language/English/strings.xml’)
  2. Find the ‘ASSISTANT’ entry which looks like
    <string id="31021">ASSISTANT</string>
    and change it to
    <string is="31021">INTERNET</string>
  3. Make a note of the string id (in this case ‘31021’)
  4. Open ‘~/.xbmc/userdata/favourites.xml’ and locate the Launcher shortcut you created for Firefox. It should look something like ‘plugin://programs/Launcher/?Firefox’
  5. Now we need to change what happens when you click the link in the menu to the shortcut to Firefox (above), and this is dictated by ‘~/.xbmc/skin/Aeon/720p/Includes_MainMenu.xml’
    Find the entry in the file that refers to the string id you modified in strings.xml file (in our case, ‘31021’). It should look something like this:
    <item id="21">
  6. You’ll need to change the ‘onclick’ entry to use the shortcut from your ‘favourites/xml’ file:
  7. Save the ‘Includes_MainMenu.xml’ file and your modified shortcut should fire up Firefox and return to XBMC when closed

Remember, if you want to change the backdrop for your new shortcut, change the ‘ASSISTANT’ entry as you modified the behaviour of that menu entry. These menu hacks are limited to entries you don’t use, but if I find a way of creating new menu items I’ll be sure to post here.

Footnote: I pinched the ‘Internet’ menu background image from Geekpedia. I found it by searching for ‘Firefox’ in Google images, set to ‘Large’

Starting a web browser in XBMC for Ubuntu 9.10

One essential thing I wanted to be able to do with my HTPC is surf the web. The front-end that I am running, XBMC, doesn’t have any kind of built-in browser as it was originally built on the meagre XBox hardware, so it’d be best to go back to the Ubuntu 9.10 OS to start Firefox. To do this I’d have to suffer the almighty indignity of closing the XBMC application and having to restart it after I’d finished browsing.

Obviously this wasn’t a particularly elegant solution.

So after a little digging around I found the ‘launcher‘ plugin via the XBMC forums. Follow the instructions below to launch Firefox from XBMC. When you close Firefox, XBMC returns to the main menu automatically:

  1. Install the Launcher plugin by copying the folder in the .zip file to the plugins folder of XBMC (in Ubuntu it’s located in ‘/home/username/.xbmc/programs/plugins’).
  2. Run this command in a terminal (I have absolutely no idea what it does but it’s in the installation instructions):
    sudo ln -sf /usr/lib/libcurl.so.4 /usr/lib/libcurl.so
  3. Then I had to create a symlink for Firefox to my home folder (as inexplicably Launcher couldn’t see higher than that level). I did this by typing:
    sudo ln -sf /usr/bin/firefox /home/mark/Documents/Firefox
    Note: There were actually two entries: ‘Firefox’ and ‘Firefox 3.5’. To find out which one is used by the OS, type ‘which Firefox‘ at the terminal and you can get the path to your application here.
  4. To run the launcher plugin you need to use a skin that has the ‘Programs’ menu option on the menu. I changed from Aeon, my normal skin, to Confluence to do this next bit.

  5. On your XBMC, go to ‘Programs’ – ‘Program Plugins’ – ‘Launcher’. I hit ‘c’ on my keyboard to get the context menu and went to ‘Add new launcher’ – ‘Standalone (normal PC executable)’.
    Here’s where Launcher presented me with only 2 options, ‘Home Folder’ or ‘Profile Folder’. As I’d already created a symlink to Firefox in my Documents folder I navigated to it and clicked ‘OK’.
    Before closing Launcher I right-clicked the ‘Firefox’ entry I just created, added it to my favourites and also downloaded a nice big icon for it (using ‘Get Thumb’), all through the context menu (you have to select ‘Get Thumb’ first otherwise your icon won’t show).
  6. Once this is done (and still using the Confluence skin), I went back to the main menu and chose the little icon in the bottom left-hand corner of the screen that looks like a list. Firefox popped up and sure enough it worked.

*note* if Firefox is starting ‘behind’ XBMC, ensure you haven’t already got an instance (of Firefox) running.

The next step was to make Firefox launch from the main menu, with the Aeon skin.

HTPC Part 3a – Installing Boxee on Ubuntu 9.10 and OSX86 10.5.8

Boxee LogoAt the moment with Boxee’s beta, there’s no option or download for the latest  version of Ubuntu (9.10). The below was pinched online somewhere, but I lost the link!.

You can still install it on your 9.10 Karmic using its Jaunty repository; deb http://apt.boxee.tv jaunty main – copy and paste in your /etc/apt/sources.list (System -> Administration -> Software Sources).

Grab and install these 3 dependencies

before installing with sudo apt-get install boxee – from the command-line. This is enough to get Boxee up and running roughly – whilst waiting for the official repository for Ubuntu Karmic.