Monday, 30 December 2013

Ubuntu resolution problem

(or never overlook the obvious)

The problem

Over the years I have mainly used Windows based PCs but have also dabbled with Linux based systems.  I have tried a few different Linux distributions but have settled on Ubuntu as my distribution of choice. 

There was one problem that I was never able to resolve, that was really bugging me. When I connected my Linux box to a monitor via the VGA connector I could never set a usable resolution. My pair of Dell 22" run at a native 1920 x 1080 but I was lucky if I could get it working at 1024 x 768 which is also a 4:3 aspect ratio rather than the native resolutions 16:9 making squares look like rectangles and circles look squashed.

If I connected the PC via a digital connection such as a DVI or HDMI cable the resolution was always correctly selected. The left hand green monitor is connected with a DVI cable and the right hand yellow monitor is connected by a VGA cable. This was going to be a problem as I was planning on setting up a Linux Ubuntu PC as a replacement for an ageing Windows XP PC for a friend that is the wrong side of 70, who only had a VGA monitor.

The non solution

The graphics card in the PC that I had Ubuntu loaded on to it had Nvidia chipset loaded on to it. Researching the problem on the internet it seemed that the Nvidia drivers could be an issue, so I tried many different variations of driver from the Nvidia stable as well as the Ubuntu Nouveau drivers. There were also articles stating that you could insert custom resolutions into an xorg file. On several occasions I broke my Linux installation to such an extent I had to reinstall it. 

Now I am not too bad when it comes to PC use (usually Windows), but the problem I have found with Linux in general, is that if you want to do anything more than basic things you need to have a reasonable knowledge of the Linux operating system, but you can't get that reasonable knowledge because you can't do anything but the basics. A bit of a Catch 22 situation. So playing around with xorg and drivers can seem a bit daunting and very frustrating.

In Windows you have the option of choosing the resolution and refresh rate that you want to run the monitor at. It is up to you to apply the correct settings. With Ubuntu, and probably other Linux distributions, the operating system tries to determine the correct resolution so as not to apply a resolution that could potentially damage the monitor.

After many attempts at getting a usable resolution on VGA I was frustrated and resigned my self to just being able to connect via DVI.

The real solution

My pivotal moment was when I realised that my Sons dual monitor Ubuntu setup was using DVI and VGA connections just like mine, but he was using the correct resolutions on both monitors. In my defence he is away at university most of the year and I thought both monitors were connected via DVI.

With this small piece of information I started investigating my resolution problem with renewed vigour knowing that it was possible to run a VGA monitor in Ubuntu at the correct resolution.

So where does the problem lie? Well what you have to understand first is my PC setup. I don't just have an Ubuntu PC, I have two PCs at my desk. My main PC (at the moment) is a Windows 8 machine that sits in the cupboard to my left, and an Ubuntu box at my feet. I have twin 22" Dell monitors that each have a DVI and VGA input. The Windows box runs on a single graphics card that has a a VGA and DVI output. Therefore one monitor is connected to the Windows box via VGA and the other via DVI. This means that there is a spare input into each monitor, these are therefore available for the Ubuntu box at my feet. When I want to use the Ubuntu box I just switch the input on the monitor. Before fixing the problem I connected the Ubuntu box to a monitor using just the DVI cable and therefore using just one monitor rather than the twin monitor set-up that the Windows PC has.

The monitor on the right is the one that is connected to the Ubuntu box via VGA and was the one that I could never set to the correct resolution. To try and keep the cables relatively tidy they are cable tied and routed in a way that means that I don't catch them with my feet. This meant that the VGA cable that was supplied with the monitor would not reach the Ubuntu box at my feet.

A cable that is not long enough is not a problem as there are many solutions, I could have bought a longer cable or I could use an extension cable. Well I had a good quality VGA extension cable made by Belkin which is what I had used for quite a while and had served me well when I was working on Windows PCs.

It had a nice thick cable, was a reasonable length, it even had gold plated connectors what more could I want?

Well it seems that I need just a little bit more. A good resource on VGA pin outs is the Wikipedia VGA page  It would seem that my high quality Belkin VGA extension cable does not have all of the pins connected. Pin 9 is missing completely from one end but this seems to be a +5v power feed and does not have any affect in my set up. More importantly pins 12 and 15 are not connected through. Pins 12 and 15 appear to be involved with an I2C bus between the monitor and graphics card that is used to identify the monitor to the graphics card so that the monitor know what the monitors supported resolutions are. Eureka! 

To prove the theory I plugged the monitor VGA port directly in to the graphics card without the extension lead. Success I could now choose the correct resolution for the monitor

So now I had to locate a VGA extension cable that had all of the pins connected. This was not as difficult as I thought it would be, however you have to be careful, you can't go by price, brand, size of cable or whether any part of it is made of gold. It needs to explicitly state that all pins are connected in the description. In the end I opted for a very expensive (not) lead from an Amazon seller for about £3.

The cable is thinner than the Belkin, shorter than the Belkin, has less gold than the Belkin but it enables me to run my VGA monitor at its correct resolution. Result!

So the lesson learnt here is to never overlook the obvious. This cable worked perfectly under Windows where I was able to select the correct resolution, but not under Ubuntu which was trying to query the monitor over the non-existent I2C bus. 

So I have a twin monitor Ubuntu set-up but more importantly my 70+ year old family friend now has a fresh PC running Ubuntu, instead of her old XP set-up.

Sunday, 4 August 2013

Help! I've got a hard drive.

So you have an old hard drive. There are several reasons why you may have a old hard drive

  • You may have bought a new PC and you are wondering how to safely dispose of the old PC
  • Your old hard drive may be faulty and you have changed it for a new one
  • You may have upgraded the old hard drive for a newer bigger one
What ever the reason what you don't want to do is to just throw out your old hard drive with all your precious data on it.

If you have bought a new PC then you may want to either use the old PC as a secondary PC at home, maybe one for the kids or donate it to a charity for reuse or donate it to a relative. Information on either securely wiping the drive or just wiping your data can be found HERE,  Re using the old equipment as much as you can is the best thing to do, it can save precious resources and stop waste going to landfill or being exported to third world countries.

However sometimes the best thing to do is to get rid of the old equipment, it's either faulty or so old that it is no use to anybody.

I have had people ask my what to do with their old PC tower before taking it to the recycling point. They think that if they smash it with a hammer they will render it useless. They might but they could also leave the hard drive untouched meaning that the data could potentially be recovered from the hard drive easily.

My preferred method is to take the hard drive to pieces. Hard drives contain items that can be useful for the tinkerer. The hard drive disk itself make excellent mirrors that are virtually unbreakable, ideal when working on cars etc. There are a pair of super strong magnets in the hard drive that can be used for magnetic type things, watch out though they can pinch! If you are feeling really geeky you can take out the platter drive motor and have a play with it Like this.

The tools that you will need to take your hard drive apart are few, screwdrivers, Torq drivers and a pair of pliers or cutters to persuade some of the Torq screws that can be a little tight.

The parts from the stripped down hard drive that you don't think will be useful can be recycled. The main body is usually aluminium and the top is steel, you can use the magnet to test. My local recycling center has separate bins for steel, aluminium and electronics so I feel I am doing my bit to help the recycling effort.

You also get a better insight into how your hard drive worked, I can pretty much guarantee that it won't work again after this and that sort of makes your data pretty much irretrievable. If you are still worried you can wipe the drive before taking it to bits.

The time lapse video below shows me taking apart an 80GB 3.5" IDE Seagate drive. 3.5" drives have the biggest magnets. Most 3.5" drive are similar in there construction so come apart in a similar way.

Monday, 11 March 2013

HP 2600n Colour Laser Printer

Magenta fade and poor printing

I have a HP 2600n colour laser printer, which I have had for around 5 years and it has proven to be a very reliable printer. However recently we noticed that the colour printing quality was not as good as it used to be. To start investigating I printed a demo page (press left and right arrow together).

The demo page showed that there were slight problems with the alignment of the four different coloured toners. It also shows, but is not as easy to spot, a problem with the magenta toner. You think that the magenta is OK as the soldier’s tunic is red so you assume that the magenta is working fine.

To further prove that there was a problem I went to this page from Refresh Cartridges  and printed out the test page for colour laser printers. What that showed was that the magenta was fading on the left of the page.

Doing a quick search I found that this is a very common fault with this printer and the other printers that are based on the same workings such as the HP 2605 and HP 1600 and the Canon LBP5000. The problem is due to dust on one of the mirrors that the laser beam is reflected off on its way to the toner cartridge.

The optical box that contains the lasers, lenses and mirrors is not sealed against ingress of dust, and as the printer has fans to cool the internal workings of the printer, the result is that the fans suck dust in from outside the printer and deposit it inside the printer. If I was a cynical person I might think that the printer was specifically designed that way to try and get people to buy a new printer, after buying a new magenta cartridge that didn't fix the fading problem!

The optical box looks complicated, and it is, but it’s not as complicated as it seems on first glance. There is basically one set of mirrors and lenses that have been copied another three times to give a set of lasers, lenses and mirrors for each of the four different colours.

Each one of the four different coloured sections is made up of the following basic components:
  1. Laser – covered by shutter in picture
  2. Lens
  3. Rotating mirror – only one per pair of colours
  4. Lens
  5. Mirror – this is where most of the dust will be
  6. Compensating lens
  7. Calibration detector – only one per pair of detectors

The laser beam is emitted from the laser through the lens which focuses the beam on to the rotating mirror which then reflects the beam through the next lens and onto the mirror. The beam is the reflected through the compensating lens and onward to the toner cartridge. If you look carefully at the lens before the rotating mirror, you will see that there are actually three lenses moulded in to the plastic. Two of them are the lens that the two laser beams pass through before hitting the rotating mirror. The third one focuses the beam on to the calibration detector which is located back on the pcb.
All the lenses are made of plastic and care must be taken in cleaning them as they are easily scratched. The mirrors are also delicate as the reflective surface is on top of the glass and not behind the glass in a normal mirror. The magenta and yellow mirrors are particularly susceptible because the face upwards and any dust floating down will settle on them.

I came across an excellent site that takes you through the fix step by step. I am not going to repeat the steps but just going to point you towards the excellent site.

I recommend that you follow the instructions on the above site and then read the extra problems that I overcame.

After carefully cleaning the optic box and making sure that the box was sitting correctly inside the printer, I printed out the Self-Test / Configuration page from the printer. 

The good news was the magenta was OK all across the page; the bad news was the four colours were completely out of alignment.

I tried calibrating the printer, and although that changed the alignment of the colours it still was not correct. After more searching on line I tried a “Super NVRAM reset” by holding both arrow keys down whilst turning on the printer. According to all the warnings I found on line this reset clears all the non-volatile memory in the printer which could also wipe the record of the number of pages that have been printed. In my case the page count was not reset.

After doing the NVram reset the alignment was back as it should be hooray!

The print demo page also looks a lot better, there are reds all across the picture, the colours are aligned and you can even read the name on the side of the train!