Sunday, July 26, 2009

Image to ZX Spec 1.0.5 Released

UPDATE: Version 1.2.1 supersedes this revision of Image to ZX Spec you can get this here



Image to ZX Spec 1.0.5 "Omega" is now available - try it online (requires Java 6, you will be shown a security prompt) or download it (more links bottom of this post beneath changes).

You can find out more about what Image to ZX Spec can do here and here


Bill and Ted agree being Omega dithered is most excellent (click image)


Changes
-------
Version 1.0.5
  • Added Bayer Ordered Dither (2x1)
  • Added Omega Ordered Dither (2x2)
  • Minor code changes including better error messages.
  • Remembering directory locations in the file dialogs
  • OpenGL hardware acceleration switch (disabled by default, source
    code only adjustment required to enable it due to instability and
    currently only rendering display improvements).
  • Small UI changes

Downloads:

YouTube video tutorial

Webstart Image to ZX Spec (i.e. "online" usage - requires Java 6)

Download Image to ZX Spec 1.0.5

Download the Image to ZX Spec 1.0.5 (GPL 2) source code

Saturday, July 18, 2009

Ubuntu: Mount a RAID array, show in Gnome Places as a single disk


DISCLAIMER: I accept no responsibility for any damage you may do by following the instructions below, do so at your own risk!! I advise you read all of the instructions before you start.


After the pathetic lack of responses on Linux forums for this question here and here I decided to spend a large amount of my time getting this to work so some of you don't have to. In all honestly I've not posted on these forums because I want the website traffic for my 2 days of sweat and blood trying to find a clean solution to clear deficiencies in the Gnome Window Manager.

Background for Ubuntu RAID (Important read! :) )

First of all, although you may have been sold your mainboard on the premise it has a hardware raid controller built in, many have in fact what is known as a soft RAID controller, basically a chip that can link two IDE (disk) channels together - the actual RAID work is done by the software in the OS, i.e. a driver in Windows.

This causes a problem in Ubuntu as without the software part it shows as two individual disks and if you mount any separately it will break your RAID setup, as one disk will be out of sync - so don't do it!

Gnome "Places" on the menu adds these drives, unmounted, to the "Places" menu on the "taskbar" (the top panel) with no way of altering them in the UI (sure you can change bookmarks, but drives don't show as bookmarks).

The solution is simple, but I've documented in depth here for those unfamiliar with the command line (xterm). Sadly you need to use an xterm to set the drives up initially, but don't worry, you don't need to touch it again after that.

The Solution (The RAID half)

First of all you need to determine the soft RAID controller you have - use the dmraid tool for this. If Ubuntu doesn't have it already on the command line (an xterm) type:

sudo apt-get install dmraid

Now you need to run it and find your array (not add it):

sudo dmraid -r

You will be shown output like the following:

ERROR: sil: only 3/4 metadata areas found on /dev/sdb, electing...
/dev/sdb: "via" and "sil" formats discovered (using sil)!
ERROR: sil: only 3/4 metadata areas found on /dev/sda, electing...
/dev/sda: "via" and "sil" formats discovered (using sil)!
/dev/sdb: sil, "sil_afajdgcdejbj", mirror, ok, 234439600 sectors, data@ 0
/dev/sda: sil, "sil_afajdgcdejbj", mirror, ok, 234439600 sectors, data@ 0

In my case the device was incorrectly recognised as a "sil" (Silicon Image) RAID device, but I was told it guessed the device make of "sil" instead of "via" (which it is), so I need to type the following to add and recognise it correctly:

sudo dmraid -ay -fvia

which tells it to recognise the RAID device as a "via" AND adds it as a new device.

You may just need to do (no need to specify the format):

sudo dmraid -ay

You will be shown output like the above, make note of the weird multi character name...

Now to make it available to the system (dmraid has just added the RAID array as new device, but it's not ready -mounted- yet) type:

sudo mkdir /media/raid_disk
sudo mount /dev/mapper/via_yournamehere /media/raid_disk/

where via_yournamehere is the name of the sil, via or other RAID device - the weird name I said to make note of. You can change the name "raid_disk" to whatever you want, e.g. "WindowsXP" or "Data" or whatever you want to call the RAID array (this does not change any RAID data or names, just how you use it in Ubuntu).

Your RAID drive is now viewable in Gnome by browsing to /media/raid_disk - but you'll need to make this permanent to start with the machine.

Type:

sudo gedit /etc/rc.local &

This opens a text editor - the file may be empty, but if it isn't add at the bottom the two lines we've just tested so it looks like the following (example is from my own rc.local - remember I needed the "-fvia bit" you may not). Note you don't need the sudo command anymore:

/sbin/dmraid -ay -fvia
mount /dev/mapper/via_dgcgebhjdg1 /media/WindowsXP/


Now your RAID device will be loaded and mounted whenever you boot Ubuntu. Sadly it will now show up as three drives in Gnome "Places", if you've chosen to give the raid array the same name as the individual disks the only one mounted will be the RAID device, so if click in "Places" and you are prompted with a security warning to mount a disk DON'T DO IT - CLICK CANCEL! The one that opens a new file explorer window without any mounting prompt will be the RAID array.

We can see how to fix "Places" with the next part of the solution....

The Solution (The Gnome Places half)

Down to a stupid deficiency in Gnome you can't easily edit the drives in the "Places" on the menu bar panel. Since to find and add the drives Gnome is tied to the part of the Linux system that looks after devices (gvfs and udev if I remember), you need to tell Gnome to ignore the extra disks (i.e. the RAID array's individual disks found on startup).

Type the following:

sudo mkdir /usr/share/hal/fdi/preprobe/95userpolicy

This creates a folder for a new device probe policy, basically a rule set about using certain devices.
Now create a new rule set in this folder to ignore some disks:

sudo gedit /usr/share/hal/fdi/preprobe/95userpolicy/10ignore-disks.fdi &

If you know the device names of the drives you want to remove from "Places" you can skip this next step - type on the command line/xterm (not in the editor!):

sudo fdisk -l

to list the drives on your system, you should be able to identify the name from the size information, you need the full drive-partition name, not the drive, i.e. /dev/sda1 NOT /dev/sda.

Then add this information in the text editor for each drive you don't want to show in "Places" (where "/dev/sda1" is the device name of the drive that it is showing in Places - in my case I needed to remove the two RAID disks that were identified individually - /dev/sda1 and /dev/sdb1, this will not stop them being used as a RAID array by dmraid). For example from my 10ignore-disks.fdi file I have two:

<?xml version="1.0" encoding="UTF-8"?>
<deviceinfo version="0.2">
  <device>
   <match key="block.device" string="/dev/sda1">
    <merge key="info.ignore" type="bool">true</merge>
   </match>
  </device>
  <device>
    <match key="block.device" string="/dev/sdb1">
    <merge key="info.ignore" type="bool">true</merge>
   </match>
  </device>
</deviceinfo>

For every extra disk you want to hide, just add a new tag inside the tags, changing the bit that says string="/dev.....", or obviously if you are reading this and just want to know how to hide a device you only need the one element above, not two.

Once you save this file and reboot, Places will no longer show these drives, if you get it wrong (and hide the wrong disks) just redo this last step.

Drop me a post if you find this useful :)

Monday, July 13, 2009

Image to ZX Spec 1.0.4 Released

Hot on the heels of the 1.0.3 release I burnt out to finish 1.0.4 with a number of new ordered dithering options, performance tweaks and other nice things - try it online (requires Java 6, you will be shown a security prompt) or download it (more links bottom of this post beneath changes).

You can find out more about what Image to ZX Spec can do here

Here's a sample of the new ordered dither modes, note that although the Spectrum only has 7 effective colours (excluding half bright) the dithering achieves the appearance of many more...





Changes
-------
Version 1.0.4
- Added Ordered Dithering and a substantial number of new modes
- Added options control for ordered dither intensity
- Refactored some old code giving a small performance increase
for screen export and error diffusion dithering
- Replaced input folder option with file selector so individual
files can be processed instead

Downloads:

Webstart Image to ZX Spec (i.e. "online" usage - requires Java 6)

Download Image to ZX Spec 1.0.4

Download the Image to ZX Spec 1.0.4 (GPL 2) source code

Friday, July 03, 2009

Image to ZX Spec 1.0.3 Released

Lots of improvements in this release - as you can see! For a change list see below, for more info and screenshots see the original post.

If you don't fancy the download you can also now try Image to ZX Spec online (requires Java 6). You will be prompted about its digital signature being unverified - you will need to click the "Run" option or it won't start). You don't have to tick the "Always trust..." option.



Changes
-------
Version 1.0.3
- New options dialog (options can also be changed mid conversion!)
- New dithering options (including Low Error Atkinson)
- New jpeg image export option
- New pre-processing options such as brightness, contrast etc.
- New image scaling options (proportional scaling)
- Monochrome image mode with colour selection
- Small code refactor, improvements in speed on some operations
(speed is not a priority at the moment).

Version 1.0.2 (Internal build only)
- Numerous new dithering algorithms added
- Small bug fixes

Downloads:

Webstart Image to ZX Spec (i.e. "online" usage - requires Java 6)

Download Image to ZX Spec 1.0.3

Download the Image to ZX Spec 1.0.3 (GPL 2) source code