Category Archives: Ubuntu

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:

gconf-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.

Problem:

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.

Solution:

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"
    EndSection

    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
    EndSubSection
    EndSection
  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.

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.