Subscribe via RSS
5Dec/141

Vaio Duo 11 – 1TB SDD Upgrade

So, the latest in my Sony collection is a Vaio Duo 11. This 'convertible' tablet is a charm... I really love the form factor, resolution and horsepower. I had bought it with the intent to upgrade the 256gb SSD to a 1TB Samsung EVO 840 for for AUD$500.

DSC04619 DSC04622 DSC04627

Step 1: Duplicate your current disk to the new disk

The goal from this entire upgrade is to have more space, not change the OS or existing data. The first step is therefore to clone the source drive (existing 256gb internal SSD) to the newly acquired Samsung 1TB SSD. To do this, you'll need to have them both plugged in at once. The Vaio Duo 11 only has one internal slot for the SSD, so an external enclosure was required.

DSC04629 DSC04630 DSC04632

Do be careful with the enclosure purchased. It turns out that there are warnings across the web indicating that SSD are liable to overheat inside these tiny airtight boxes. This is exacerbated when doing a full drive clone as you're trying to read/write as quickly as you can.

As for the cloning, there's quite a few methods available, all with their own quirks. My goal was to do an exact 1:1 copy to ensure that the recovery and boot partitions was all intact. The first thought was something like gparted. Instead I stumbled across Samsung's own 'Data Migration Tool' which promised to do exactly what I wanted. This was a 4-click process and the copying started. After it completed, I checked out the disk in drive management and all was not as it should have been. The partitions didn't look 1:1... but I still then tried a reboot with the USB as the boot disk. Windows still booted and so I went with this.

Step 2: Get the new disk into the new hardware

Sony are usually pretty tricky when it comes to internal product design. They're not as 'closed' as Apple when it comes to making products as un-openable as possible, but they're not far off. There was nothing short of 20 overly-difficult screws in the bottom of this unit to remove!

NOTE: The speaker grills need to be taken off. These consist of a mesh grill with a layer of sticky gunk that's also of grill-design. You cannot remove these without ruining them. Note that you also have to take off all of the rubber feet and the 'locking areas' for the extra battery. I'm still trying to find double-sided tape to put all these back in. I might just use glue.

DSC04635 DSC04636 DSC04637

In the second and last pics above you can see the slot where the SSD sits. I happened to take the photo of the unit after I'd spent about an hour trying to remove the SSD. All other sites say to remove the screws nearest the SSD and then simply pop it out. Turns out it's not this simple... that blue patch you see is a chunk of sticky spongy rubber that acts as a support for the SSD. The stickiness actually makes it VERY difficult to remove. As I'd had this unit for all of 1 day, I had no intention of breaking it and so was very gentle when tinkering with the internals. Either way, after a little more prying I realised that I had to lift the SSD off the support and then it came out. To anyone trying this at home: be careful, don't apply too much force and, if possible, find a thin utensil to slide under the SSD and release it from the gunk!

After this the new SSD slotted in very easily and all screws went back in place quite easily. As stated, I'll update again when I find a tidy solution for putting the feet and grills back.

Step 3: Booting up the copied disk...

Well, it booted straight into windows and looked good. I then went into the disk management studio and realised that I was in trouble. There were partitions directly after my main partition which meant that there was no clean way to expand it! I therefore considered and attempted to 'restore' windows. Doing this inside windows should have been easy until it told me that it couldn't find the recovery partition! I then rebooted with the assist key and it also said the recovery partition was missing! Thanks to the Samsung Data Migration Tool, all of my partitions were out of whack.

Step 4: The Samsung Data Migration Tool sucks...

I had no intention of removing the SSD again... so I decided to do this copy in reverse. The old disk was in the external enclosure and then new one internal. I downloaded clonezilla and attempted a copy but it failed miserably telling me that it couldn't determine the partition table type... meh... probably to do with UEFI?

So the next step was to go all low-level. 'dd' is the tool and it will byte-by-byte copying _everything_ from the given source to the given destination. I'd known my device names thanks to the menu options in the clonezilla attempt, so I entered the following command:

dd if=/dev/sdc of=/dev/sda

It started going... I went to make a coffee, got back and found it had prematurely stopped. I checked that the USB was still mounted, all good. Then I went to pick up the USB and nearly burnt a hole in my palm! The thing was red hot. It turns out that this Toshiba drive does not bode well in this external enclosure. It's all over the web... should've checked.

Anyway, I left it to cool for a few hours then came back with a plan.

DSC04641 DSC04644

My jug'o'water heatsink-cooler worked perfectly and the copy completed... I even had the running progress meter:

dd if=/dev/sdc bs=1024M | pv | dd of=/dev/sda bs=1024M

After a reboot, all partitions looked good and recovery started, but I didn't run through with it. I'd google'd a little in the meantime and realised that windows creates a recovery partition every bloody time you upgrade significantly. In this case it was from Windows 8.0 to 8.1. If I then removed a partition I'd kill my ability to recover.

Instead I just created a new partition in the space at the end of the drive and called it D:

Step 5: Actually getting that disk space back...

So, a little more googling indicated that there was indeed a way around the recovery partitions. The purchase of an 32gb (MUST BE THIS BIG) thumb drive allowed me to copy the recovery partition onto it and then remove them from the disk. I could then expand my main drive without too much screwing around.

10Aug/1420

r5u870 for v4l2 (Linux Kernel > 3.8?)

Update: 3pei has updated the driver to work on the latest linux releases. View his github repo here or download here.
Big thanks!

The Ricoh U5870 is a USB2.0-Video Interface Controller compliant with USB2.0 Video Class. The built-in series regulators allow power supply from 3.3V power to the R5U870 and the CMOS Sensor Module. In addition, coming in CSP package, the R5U870 is the best solution for a compact USB Camera Module.
The R5U870 comes with audio interface; MIC connection by using Audio Codec connections is possible.
This driver seems to have been left for dead... it's no longer needed as the r5u87x has replaced it for all UVM cameras. Unfortunately, the older WDM drivers still need this one and it hadn't been updated for the newest kernels or video-for-linux 2.

There have been many attempts to keep this driver alive here, here, here, here, here and here.

I have a Sony Vaio UX490N. It has a Ricoh Co., Ltd - Sony Visual Communication Camera VGP-VCC3 [R5U870] and it is WDM. It cannot use the r5u87x driver. The r5u870 exists around the web... but I couldn't find one that would work out-of-the-box on Linux Mint 17. PCNetSpec over at the peppermintos.com forums posted information and an updated driver. Unfortunately, this driver threw an error on initialisation:

[  440.587372] Linux video capture interface: v2.00
[  440.620480] usbcam: registering driver r5u870 0.11.3
[  440.620532] r5u870-0: Detected Sony VGP-VCC3
[  440.620920] ------------[ cut here ]------------
[  440.620939] WARNING: CPU: 0 PID: 2467 at /build/buildd/linux-3.13.0/drivers/media/v4l2-core/v4l2-dev.c:779 __video_register_device+0x4ff/0x540 [videodev]()
[  440.620943] Modules linked in: r5u870(OF+) usbcam(OF) videobuf_dma_sg videobuf_core videodev ctr ccm hid_generic snd_hda_codec_realtek snd_hda_intel snd_hda_codec snd_hwdep snd_pcm snd_page_alloc dm_multipath coretemp scsi_dh snd_seq_midi snd_seq_midi_event snd_rawmidi kvm joydev arc4 snd_seq pcmcia iwl3945 serio_raw iwlegacy snd_seq_device tifm_7xx1 mac80211 snd_timer usbhid yenta_socket tifm_core pcmcia_rsrc snd btusb hid lpc_ich cfg80211 pcmcia_core soundcore bnep rfcomm bluetooth sony_laptop binfmt_misc mac_hid parport_pc ppdev lp parport dm_mirror dm_region_hash dm_log i915 i2c_algo_bit drm_kms_helper firewire_ohci psmouse(OF) firewire_core crc_itu_t drm sky2 video [last unloaded: videobuf_core]
[  440.621020] CPU: 0 PID: 2467 Comm: modprobe Tainted: GF       W  O 3.13.0-24-generic #47-Ubuntu
[  440.621023] Hardware name: Sony Corporation VGN-UX490N/VAIO                            , BIOS R0112N2 12/05/2007
[  440.621027]  00000000 00000000 e9fe5be4 c164b8c3 00000000 e9fe5c14 c10567ee c1826ffc
[  440.621036]  00000000 000009a3 f8f5a598 0000030b f8f4b54f f8f4b54f f2a7a800 ffffffff
[  440.621044]  00000000 e9fe5c24 c10568b2 00000009 00000000 e9fe5c50 f8f4b54f 00000002
[  440.621052] Call Trace:
[  440.621063]  [c164b8c3] dump_stack+0x41/0x52
[  440.621072]  [c10567ee] warn_slowpath_common+0x7e/0xa0
[  440.621084]  [f8f4b54f] ? __video_register_device+0x4ff/0x540 [videodev]
[  440.621094]  [f8f4b54f] ? __video_register_device+0x4ff/0x540 [videodev]
[  440.621100]  [c10568b2] warn_slowpath_null+0x22/0x30
[  440.621111]  [f8f4b54f] __video_register_device+0x4ff/0x540 [videodev]
[  440.621120]  [f8abd7f4] usbcam_usb_probe+0x334/0x590 [usbcam]
[  440.621128]  [c14a98b3] usb_probe_interface+0x193/0x2b0
[  440.621136]  [c140730a] ? driver_sysfs_add+0x5a/0x80
[  440.621141]  [c1407975] driver_probe_device+0x105/0x380
[  440.621147]  [c14a9089] ? usb_match_id+0x49/0x60
[  440.621153]  [c14a9166] ? usb_device_match+0x46/0x80
[  440.621158]  [c1407ca1] __driver_attach+0x71/0x80
[  440.621164]  [c1407c30] ? __device_attach+0x40/0x40
[  440.621169]  [c1405dd7] bus_for_each_dev+0x47/0x80
[  440.621175]  [c14073de] driver_attach+0x1e/0x20
[  440.621180]  [c1407c30] ? __device_attach+0x40/0x40
[  440.621186]  [c1407037] bus_add_driver+0x157/0x230
[  440.621192]  [c1408269] driver_register+0x59/0xe0
[  440.621197]  [c14a8317] usb_register_driver+0x67/0x140
[  440.621205]  [f8abcc42] ? usbcam_register_mod+0x62/0x210 [usbcam]
[  440.621213]  [f8abcd92] usbcam_register_mod+0x1b2/0x210 [usbcam]
[  440.621221]  [f8421000] ? 0xf8420fff
[  440.621228]  [f842105a] usbcam_minidrv_init+0x5a/0x1000 [r5u870]
[  440.621235]  [c1002122] do_one_initcall+0xd2/0x190
[  440.621241]  [f8421000] ? 0xf8420fff
[  440.621248]  [c104c87f] ? set_memory_nx+0x5f/0x70
[  440.621256]  [c164769a] ? set_section_ro_nx+0x54/0x59
[  440.621263]  [c10c3e9a] load_module+0x111a/0x18e0
[  440.621274]  [c10c47c5] SyS_finit_module+0x75/0xc0
[  440.621281]  [c11396db] ? vm_mmap_pgoff+0x7b/0xa0
[  440.621294]  [c1659bcd] sysenter_do_call+0x12/0x28
[  440.621298] ---[ end trace bab7f9cdd3a1dbaa ]---
[  440.621301] r5u870-0: usbcam_usb_probe: video_register_device failed
[  440.621317] r5u870: probe of 1-6:1.0 failed with error -22
[  440.623343] usbcore: registered new interface driver r5u870

The WARN indicates that there were assertions on entering the function. Inspecting the function shows that there are two WARNs to check for valid input data:

795         /* the release callback MUST be present */
796         if (WARN_ON(!vdev->release))
797                 return -EINVAL;
798         /* the v4l2_dev pointer MUST be present */
799         if (WARN_ON(!vdev->v4l2_dev))
800                 return -EINVAL;

So... guesswork.. which of these is null? Am guessing it's the v4l2_dev. We've done nothing to initialise it. Further investigation of other, more updated drivers showed that we had to call v4l2_device_register prior to video_register_device.

        #include <media/v4l2-device.h>
        ...
        struct v4l2_device v4l2_dev_tmp;
        ...
        res = v4l2_device_register(&intf->dev, &v4l2_dev_tmp);
        if (res < 0) {
                usbcam_err(udp, "Could not register v4l2 device\n");
                goto out;
        }
        udp->ud_vdev.v4l2_dev = &v4l2_dev_tmp;

The results were quite startling at 0100 hours.

camera

Download the driver here: R5U870 0.11.7.
To install all the required libraries to build: apt-get install build-essential linux-headers-`uname -r`.

Check that hideous screenshot... the best part? That number on the Cheese window was a count-down timer... I pressed the 'Capture' hardware button and Cheese responded by starting a 3-second count-down timer, resulting in taking a photo.

9Aug/142

Linux Mint 17 on the Sony Vaio UX490N UMPC

Right, this thing is powerful... Windows Vista came installed as default and there was no other choice than to replace with a Linux Distro. I scoured Distrowatch for a valid distribution, but had already had Linux Mint in mind.

Linux Mint

Linux Mint is fork of Ubuntu which is a distribution based on Debian.

Installation

Due to the age of the hardware, 32-bit was chosen and the ISO was downloaded. I then acquired a tool named Rufus which allows you to easily smush an ISO onto a USB stick. This stick is then bootable and we can install our distro.

The actual installation of Mint is painless... of course, you need to know how to partition and or WIPE all of your data, but that's something that I already expect you to know. One nice point is that if you choose "side-by-side" then the installer will resize your primary partition. I should check that the base Vista installation still works!

DefaultDesktop

SSH

Sure, the UX is damn handy... but the thumb-typing can be really tiresome... even if our new shells have auto-complete. Due to this, you may want to remote in from your desktop via SSH. By default, SSH isn't installed. Run the following to install it. Yes, note that we install 'ssh'... I initially expected to install sshd, but the ssh package includes this.

sudo apt-get install ssh

Press 'yes' when prompted to download the additional packages. apt-get just warns you if there are dependencies over the single package you asked for.
You can now log in to your machine on port 22. Use the account you created when you installed Mint.

ssh

Ethernet?

dmesg gets spammed with eth0 link-up, link-down messages. I imagine the device is in the unit and the dock provides the physical port?
Either way, disable it permanently:

sudo nano /etc/rc.local

Add the following line:

sudo ifconfig eth0 down

Just before 'exit 0'. File should then look like:

#!/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.

sudo ifconfig eth0 down

exit 0

Touchscreen

The Vaio UX comes with a Gunze touchscreen. This works out of the box, but isn't correct calibrated by default. Once you have Mint installed, run the following in a shell:

sudo apt-get install xinput-calibrator

Once this is installed, we can now run it to get our touchscreen aligned.
Note the underscore in the executable, whereas the package had a hyphen!

xinput_calibrator

Follow the on-screen prompts. Touch the points with the stylus when asked.
You'll then be provided a configuration to store against X11:

Section "InputClass"
        Identifier      "calibration"
        MatchProduct    "GUNZE USB Touch Panel"
        Option  "Calibration"   "34 992 34 970"
        Option  "SwapAxes"      "0"
EndSection

There'll be a whole lot of output... it'll even tell you where to store the configuration. Unfortunately the location they specify is incorrect. Mint wants the file in a different area. Copy the section that matches the chunk above (chances are it's exactly the same) into the clipboard and then run the following:

sudo nano /usr/share/X11/xorg.conf.d/99-calibration.conf

Paste the configuration you copied and save your file.
Reboot your device just for fun... your touchscreen should now behave as expected when you touch the furthest corners!

ALPS Trackpoint

This wasn't fun... Under windows, you can disable the 'tapping'. This, just like a touchpad (of which the trackpoint is not) is the action of hitting the device with a single, focused prod. The expectation is then a 'left mouse button' click. As stated, you can easily disable this in windows, but you don't get that option out of the box on Mint.

I started hacking apart the xf86-input-evdev, but realised that disabling mouse buttons on the trackpoint meant the left-hand physical buttons were also switched off.

Fortunately, our friend Lawrence Wu on github has hacked the psmouse kernel driver for us. He's lowered the sensitivity so that our taps need to be serious in order to be registered.

The driver is managed by dkms which allows a substitute driver to be loaded in replacement of the built-in kernel driver. Below are the instructions for doing so. (Note that these have been copied and annotated from Lawrence's page. All credit to him! We thank you a lot!)

cd /usr/src/
sudo wget https://github.com/antonizoon/psmouse-ux/archive/master.zip
sudo unzip master.zip
sudo rm master.zip
sudo mv psmouse-ux-master psmouse-ux
sudo dkms add -m psmouse -v ux
sudo dkms build -m psmouse -v ux
sudo dkms install -m psmouse -v ux

At this point, as long as there have been no errors, DKMS will have hold of a tasty new psmouse driver for your trackpoint. To use this new driver, we need to unload the current psmouse driver:

sudo modprobe -r psmouse

You'll note from here that your mouse doesn't work... we've removed the link from the hardware to the windowing system. Mouse events are no longer making it through the pipes. Let's now reload what seems to be the same driver.

sudo modprobe psmouse

No output... no messages... just a mouse cursor! Try your hardest to make that little rodent 'tap'!...

Camera

There hasn't been an up-to-date driver for this camera for a long time. Due to this, I modified the driver from PCNetSpec's post to work with the UX. See more information on how this happened here. To install my driver, the instructions are as follows:

(Please disregard the warnings... I'll fix these at a later date.)

wget http://www.otenko.com/ux/r5u870-0.11.7.zip
unzip r5u870
cd r5u870/
sudo make install
sudo modprobe r5u870

Note: This is still a work in progress... Once it's working here, I'll post the final instructions.

4Aug/140

Introducing my new Sony Vaio UX490N

Have wanted one of these things for ages... finally bought one on eBay.
There used to be tons of them in Sofmap in Denden Town, Osaka.... but they were too dear for what was offered.

DSC04022

DSC04012 DSC04013 DSC04024

See my other posts under the 'Vaio UX' Category for instructions, hints, etc...