Category Archives: Linux Notes

Ubuntu on the Sony Vaio VPCYB2M1E/S

tl;dr: This post describes how well Ubuntu GNU/Linux works on the Sony Vaio VPCYB2M1E since there’s otherwise not much information on the web about the hardware support for this model on Linux.  In summary, so far it seems that this is a good choice for running Ubuntu on so long as you use the 32-bit version, but these are still early days.

At the moment, looking for a new computer in the netbook space which runs Linux well is a rather frustrating exercise.  This is chiefly because:

  • The market moves fast, and often there’s little information on the web about Linux support for the models that are actually available in the shops.
  • Frustratingly, it seems that some companies change the hardware in their machines without changing the model number.
  • What random people on Ubuntu forums consider to count as “working well” can include “won’t suspend to RAM” or “ethernet doesn’t work”.
  • Most reviews of netbooks by technology journalists are written with a totally unhelpful set of assumptions, such as the  following:
    • They assume that you wouldn’t use a netbook as your main machine.  This might be true if you use Windows, but I used Ubuntu on the Samsung NC-10 as my main development machine for a long time.  Sure, it’s not the same experience as working on a powerful desktop system with multiple monitors, but you can get Real Work done quite happily nonetheless.
    • You see netbooks which are around the £400 price point denounced as “not knowing what they’re trying to be”, as if there aren’t customers who want the portability and battery life of a £200 netbook, but would be happy to pay a bit more for improved performance and a slightly better screen.  Their frequent suggestion that you might as well buy some powerful but bulky laptop for this money is completely missing the point.

Anyway, if you’re looking for one of these slightly-better-than-a-netbook machines to run Ubuntu on, you might consider the VPCYB2M1E – the Sony Vaio Y series that is available in the UK at the moment (summer 2011).  We believe that the “/S” at the end of the model number just means that it’s the silver rather than pink version.  This is based around the AMD E-350, so we initially chose to use the 64-bit version of Natty – however, due to some freezes that don’t seem to occur with the 32-bit flavour, we reinstalled with the 32-bit version.  (See below for more details.)

The specifications of this laptop can be found on Sony’s website.  The weight (at 1.46kg) is slightly more than I’d like, but the 1366 x 768 screen is very nice.

First we checked by booting from a live USB stick that enough of the hardware seemed to work (wireless, sound, graphics) that we were willing to risk wiping all the existing partitions and claiming all the disk space for Ubuntu.  On the second laptop I installed Natty alongside Windows 7, which worked fine.  (I note that the installation of Natty is very slick now.)

At the end of this post, we’ve include the output of “cat /proc/cpuinfo” and “lspci -v”, for those who are interested in the details.  There’s a summary of what we’ve tested so far below.  However, first a description of the only big problem we’ve seen so far:

I/O Related Freezes

When using rsync to copy large files onto this system, we found that the interface would freeze to a greater or lesser extent.  This seemed to be reproducible with any command that wrote a lot of data to disk (e.g. even dd from /dev/zero) but was only present on 64-bit installations, not 32-bit.  This problem is described here:

https://answers.launchpad.net/ubuntu/+source/linux/+question/159329

… and linked to a bug that might be related.  However, since this didn’t seem to be a problem with the 32-bit installation, we didn’t pursue it further.  (However, it should be still reproducible with the 64-bit Live USB stick.)

Ethernet

Works fine out-of-the-box

Wireless

Works out-of-the-box

Power Management

Suspend-to-RAM

Works out-of-the-box.  (When suspended, the power light glows bright orange, though, which is somewhat annoying.)

Hibernate (Suspend-to-Disk)

Works out-of-the-box

Special Keys

Work out-of-the-box

Sound

Speakers

Work out-of-the-box – pretty loud.  I’ve found on one occasion that the sound stopped working after a while and I had to reboot, but I need to investigate that more.

Microphone

Works out-of-the-box, a bit noisy, but we haven’t tried to change any of the mixer settings yet.

Graphics

With the default driver, some of the desktop effects flickered a great deal, and the desktop background showed some flickering. Installing the closed source ATI drivers (via the “Additional Drivers” in the System Settings) seems to have fixed this.

External monitor

– Not tested yet.  In particular we need to check how large a resolution it can drive.

Card Readers

The SD card reader and the slot for Sony’s memory sticks both work fine.

HDMI output

– Not tested yet.  (No HDMI monitor available.)

Webcam

Works out-of-the-box

Touchpad

Works fine out-of-the-box.  Changing the scrolling behaviour (from dragging on the right hand side to two-fingered scrolling) can be easily done with the mouse properties.

Hardware Details

$ lspci -v
00:00.0 Host bridge: Advanced Micro Devices [AMD] Pavilion DM1Z-3000 Host bridge
    Subsystem: Sony Corporation Device 9082
    Flags: bus master, 66MHz, medium devsel, latency 0

00:01.0 VGA compatible controller: ATI Technologies Inc Device 9802 (prog-if 00 [VGA controller])
    Subsystem: Sony Corporation Device 9082
    Flags: bus master, fast devsel, latency 0, IRQ 44
    Memory at e0000000 (32-bit, prefetchable) [size=256M]
    I/O ports at 3000 [size=256]
    Memory at f0200000 (32-bit, non-prefetchable) [size=256K]
    Expansion ROM at <unassigned> [disabled]
    Capabilities: <access denied>
    Kernel driver in use: fglrx_pci
    Kernel modules: fglrx, radeon

00:01.1 Audio device: ATI Technologies Inc Device 1314
    Subsystem: Sony Corporation Device 9082
    Flags: bus master, fast devsel, latency 0, IRQ 42
    Memory at f0244000 (32-bit, non-prefetchable) [size=16K]
    Capabilities: <access denied>
    Kernel driver in use: HDA Intel
    Kernel modules: snd-hda-intel

00:04.0 PCI bridge: Advanced Micro Devices [AMD] Device 1512 (prog-if 00 [Normal decode])
    Flags: bus master, fast devsel, latency 0
    Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
    I/O behind bridge: 00002000-00002fff
    Memory behind bridge: f0100000-f01fffff
    Capabilities: <access denied>
    Kernel driver in use: pcieport
    Kernel modules: shpchp

00:06.0 PCI bridge: Advanced Micro Devices [AMD] Device 1514 (prog-if 00 [Normal decode])
    Flags: bus master, fast devsel, latency 0
    Bus: primary=00, secondary=02, subordinate=02, sec-latency=0
    Memory behind bridge: f0000000-f00fffff
    Capabilities: <access denied>
    Kernel driver in use: pcieport
    Kernel modules: shpchp

00:11.0 SATA controller: ATI Technologies Inc SB7x0/SB8x0/SB9x0 SATA Controller [AHCI mode] (rev 40) (prog-if 01 [AHCI 1.0])
    Subsystem: Sony Corporation Device 9082
    Flags: bus master, 66MHz, medium devsel, latency 64, IRQ 19
    I/O ports at 3118 [size=8]
    I/O ports at 3124 [size=4]
    I/O ports at 3110 [size=8]
    I/O ports at 3120 [size=4]
    I/O ports at 3100 [size=16]
    Memory at f024c000 (32-bit, non-prefetchable) [size=1K]
    Capabilities: <access denied>
    Kernel driver in use: ahci
    Kernel modules: ahci

00:12.0 USB Controller: ATI Technologies Inc SB7x0/SB8x0/SB9x0 USB OHCI0 Controller (prog-if 10 [OHCI])
    Subsystem: Sony Corporation Device 9082
    Flags: bus master, 66MHz, medium devsel, latency 64, IRQ 18
    Memory at f024b000 (32-bit, non-prefetchable) [size=4K]
    Kernel driver in use: ohci_hcd

00:12.2 USB Controller: ATI Technologies Inc SB7x0/SB8x0/SB9x0 USB EHCI Controller (prog-if 20 [EHCI])
    Subsystem: Sony Corporation Device 9082
    Flags: bus master, 66MHz, medium devsel, latency 64, IRQ 17
    Memory at f024a000 (32-bit, non-prefetchable) [size=256]
    Capabilities: <access denied>
    Kernel driver in use: ehci_hcd

00:13.0 USB Controller: ATI Technologies Inc SB7x0/SB8x0/SB9x0 USB OHCI0 Controller (prog-if 10 [OHCI])
    Subsystem: Sony Corporation Device 9082
    Flags: bus master, 66MHz, medium devsel, latency 64, IRQ 18
    Memory at f0249000 (32-bit, non-prefetchable) [size=4K]
    Kernel driver in use: ohci_hcd

00:13.2 USB Controller: ATI Technologies Inc SB7x0/SB8x0/SB9x0 USB EHCI Controller (prog-if 20 [EHCI])
    Subsystem: Sony Corporation Device 9082
    Flags: bus master, 66MHz, medium devsel, latency 64, IRQ 17
    Memory at f0248000 (32-bit, non-prefetchable) [size=256]
    Capabilities: <access denied>
    Kernel driver in use: ehci_hcd

00:14.0 SMBus: ATI Technologies Inc SBx00 SMBus Controller (rev 42)
    Subsystem: Sony Corporation Device 9082
    Flags: 66MHz, medium devsel
    Kernel driver in use: piix4_smbus
    Kernel modules: sp5100_tco, i2c-piix4

00:14.2 Audio device: ATI Technologies Inc SBx00 Azalia (Intel HDA) (rev 40)
    Subsystem: Sony Corporation Device 9082
    Flags: bus master, slow devsel, latency 64, IRQ 16
    Memory at f0240000 (64-bit, non-prefetchable) [size=16K]
    Capabilities: <access denied>
    Kernel driver in use: HDA Intel
    Kernel modules: snd-hda-intel

00:14.3 ISA bridge: ATI Technologies Inc SB7x0/SB8x0/SB9x0 LPC host controller (rev 40)
    Subsystem: Sony Corporation Device 9082
    Flags: bus master, 66MHz, medium devsel, latency 0

00:14.4 PCI bridge: ATI Technologies Inc SBx00 PCI to PCI Bridge (rev 40) (prog-if 01 [Subtractive decode])
    Flags: bus master, 66MHz, medium devsel, latency 64
    Bus: primary=00, secondary=03, subordinate=03, sec-latency=64

00:18.0 Host bridge: Advanced Micro Devices [AMD] Family 12h/14h Processor Function 0 (rev 43)
    Flags: fast devsel

00:18.1 Host bridge: Advanced Micro Devices [AMD] Family 12h/14h Processor Function 1
    Flags: fast devsel

00:18.2 Host bridge: Advanced Micro Devices [AMD] Family 12h/14h Processor Function 2
    Flags: fast devsel

00:18.3 Host bridge: Advanced Micro Devices [AMD] Family 12h/14h Processor Function 3
    Flags: fast devsel
    Capabilities: <access denied>
    Kernel driver in use: k10temp
    Kernel modules: k10temp

00:18.4 Host bridge: Advanced Micro Devices [AMD] Family 12h/14h Processor Function 4
    Flags: fast devsel

00:18.5 Host bridge: Advanced Micro Devices [AMD] Family 12h/14h Processor Function 6
    Flags: fast devsel

00:18.6 Host bridge: Advanced Micro Devices [AMD] Family 12h/14h Processor Function 5
    Flags: fast devsel

00:18.7 Host bridge: Advanced Micro Devices [AMD] Family 12h/14h Processor Function 7
    Flags: fast devsel

01:00.0 Ethernet controller: Atheros Communications AR8131 Gigabit Ethernet (rev c0)
    Subsystem: Sony Corporation Device 9082
    Flags: bus master, fast devsel, latency 0, IRQ 43
    Memory at f0100000 (64-bit, non-prefetchable) [size=256K]
    I/O ports at 2000 [size=128]
    Capabilities: <access denied>
    Kernel driver in use: atl1c
    Kernel modules: atl1c

02:00.0 Network controller: Atheros Communications Inc. AR9285 Wireless Network Adapter (PCI-Express) (rev 01)
    Subsystem: Foxconn International, Inc. Device e017
    Flags: bus master, fast devsel, latency 0, IRQ 18
    Memory at f0000000 (64-bit, non-prefetchable) [size=64K]
    Capabilities: <access denied>
    Kernel driver in use: ath9k
    Kernel modules: ath9k

$ cat /proc/cpuinfo
processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 20
model           : 1
model name      : AMD E-350 Processor
stepping        : 0
cpu MHz         : 800.000
cache size      : 512 KB
physical id     : 0
siblings        : 2
core id         : 0
cpu cores       : 2
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 6
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc extd_apicid aperfmperf pni monitor ssse3 cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch ibs skinit wdt arat npt lbrv svm_lock nrip_save pausefilter
bogomips        : 3192.53
TLB size        : 1024 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management: ts ttp tm stc 100mhzsteps hwpstate

processor       : 1
vendor_id       : AuthenticAMD
cpu family      : 20
model           : 1
model name      : AMD E-350 Processor
stepping        : 0
cpu MHz         : 800.000
cache size      : 512 KB
physical id     : 0
siblings        : 2
core id         : 1
cpu cores       : 2
apicid          : 1
initial apicid  : 1
fpu             : yes
fpu_exception   : yes
cpuid level     : 6
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc extd_apicid aperfmperf pni monitor ssse3 cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch ibs skinit wdt arat npt lbrv svm_lock nrip_save pausefilter
bogomips        : 3192.05
TLB size        : 1024 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management: ts ttp tm stc 100mhzsteps hwpstate

Making an encrypted partition on a USB drive

On Ubuntu or Debian, it’s really simple to create an encrypted partition on a newly-purchased USB mass storage device.  In my case, I had bought a 1TB hard drive which had very mixed reviews, some people saying their drives had failed very early.  I wanted to be able to return the drive under warranty if it broke without worrying about personal data.

It turns out that if you want to reformat a partition on an external USB drive so that it’s encrypted, this is just a matter of doing the following:

sudo luksformat -t ext4 /dev/partitiondevice

…. where /dev/partitiondevice is the device for the drive partition you want to overwrite.  Obviously, this will destroy everything that was previously on that partition.

I like to use a proper filesystem for USB mass storage devices, but if you leave out the -t ext4 then the default is to use VFAT.

When you next plug in that drive, you’ll be prompted to enter the password that you picked when creating the partition – if you type that correctly, the drive will be mounted and usable.  (If you mistype it, you’re not given another chance to enter the password, so you’ll need to go to the command line and do: gvfs-mount -d /dev/partitiondevice to try again.)

One small thing is that the mount point in /media will be based on a UUID by default, but if you set the ext4 partition label, it’ll be mounted under that name in /media/ instead.  To do this, starting from when your disk is mounted, you can run mount without parameters to find the unencrypted device name and then unmount it and change the label:

$ umount /dev/mapper/udisks-luks-uuid-b7bbb2c8-etc
$ e2label /dev/mapper/udisks-luks-uuid-b7bbb2c8-etc topsekrit

If you unplug and plug in the disk again, it should be mounted on /media/topsekrit

The Canon PIXMA MP560 on Ubuntu

I’ve resisted getting an all-in-one printer / scanner / copier device in the past, largely due to worrying about the driver situation on Linux, but when I found out that my scanner hadn’t survived the trip to Zürich and we were also without a printer, we risked it and bought a Canon PIXMA MP560.

I say “risked”, because the noise levels in the search results when trying to find out whether this printer would actually work were very high.  In the hope that it will be of use to anyone similarly searching in the future, I thought it might be useful to add the following notes about things that definitely work for us.  (There are lots of things that we haven’t simply tried yet, e.g. printing via USB or scanning via USB, so I can’t comment on what’s involved in getting those to work.)

Update: with these drivers the printer does seem to have trouble printing more complex pages – it’ll only print out the top eighth of the page and then give up.  e.g. as an example, try printing out the English rules for Tobago (PDF linked from that page).  Rather annoying, and I haven’t had time to report it to Canon yet.

Obviously I can’t provide support if you’re having problems with this printer, so this is just to describe what worked for us on Ubuntu 9.04 (Jaunty Jackalope), 10.04 (Lucid Lynx) and 11.04 (Natty Narwhal).  I’m pretty happy with this printer, and it’s great to see that Canon are supporting Linux users by providing drivers.

Printing over Wireless

The instructions supplied with the printer explain how to get it to connect to your wireless network, which worked fine with WPA2 (AES).

Then you need to go to the drivers page for the PIXMA MP560 on Canon’s website, select “Linux” and “English”, and download “Debian Linux Print Drivers (3.2)”.  That’ll give you a tar file, which you should unpack in a new directory.  This in turn contains a tar.gz archive called cnijfilter-mp560series-3.20-1-i386-deb.tar.gz.  Unpack that and you’ll get the following:

cnijfilter-mp560series-3.20-1-i386-deb/
cnijfilter-mp560series-3.20-1-i386-deb/packages/
cnijfilter-mp560series-3.20-1-i386-deb/packages/cnijfilter-common_3.20-1_i386.deb
cnijfilter-mp560series-3.20-1-i386-deb/packages/cnijfilter-mp560series_3.20-1_i386.deb
cnijfilter-mp560series-3.20-1-i386-deb/install.sh

The “install.sh” script will fail if your setup is like either of ours, with the error message:

==================================================
Canon Inkjet Printer Driver Ver.3.20-1 for Linux
Copyright CANON INC. 2001-2009
All Rights Reserved.
==================================================
Error! Cannot specify package management system.

This error arises when both “dpkg” and “rpm” exist in your path, so you need to edit install.sh to cause the test for “rpm” to fail – find these lines:

## Judge is the distribution supporting rpm? ##                                                                                                                
 rpm --version 1> /dev/null 2>&1                                                                                                                                
 c_system_rpm=$?

… and change “rpm –version” to “rpm-no-thanks –version”, or something.  If you re-run ./install.sh then it should all work OK.  (I’ve put in bold the bits where you need user interaction.

 : mark@cava:~/Desktop/canon-drivers/cnijfilter-mp560series-3.20-1-i386-deb (master)
 ./install.sh
==================================================
Canon Inkjet Printer Driver Ver.3.20-1 for Linux
Copyright CANON INC. 2001-2009
All Rights Reserved.
==================================================
Execution command = sudo dpkg -iG ./packages/cnijfilter-common_3.20-1_i386.deb
[sudo] password for mark: 
(Reading database ... 490522 files and directories currently installed.)
Preparing to replace cnijfilter-common 3.20-1 (using .../cnijfilter-common_3.20-1_i386.deb) ...
Unpacking replacement cnijfilter-common ...
Setting up cnijfilter-common (3.20-1) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place/sbin/ldconfig.real: /usr/local/lib/ is not a symbolic link
Execution command = sudo dpkg -iG ./packages/cnijfilter-mp560series_3.20-1_i386.deb
(Reading database ... 490522 files and directories currently installed.)
Preparing to replace cnijfilter-mp560series 3.20-1 (using .../cnijfilter-mp560series_3.20-1_i386.deb) ...
Unpacking replacement cnijfilter-mp560series ...
Setting up cnijfilter-mp560series (3.20-1) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
/sbin/ldconfig.real: /usr/local/lib/ is not a symbolic link

## Driver packages installed. ##
#=========================================================#
#  Register Printer
#=========================================================#
Next, register the printer to the computer.
Connect the printer, and then turn on the power.
To use the printer on the network, connect the printer to the network.
When the printer is ready, press the Enter key.
> #=========================================================#
#  Connection Method
#=========================================================#
 1) USB
 2) Network
Select the connection method.[1]2
Searching for printers...

#=========================================================#
#  Select Printer
#=========================================================#
Select the printer.
If the printer you want to use is not listed, select Update [0] to search again.
To cancel the process, enter [Q].
-----------------------------------------------------------
 0) Update
-----------------------------------------------------------
Could not detect the target printer.
-----------------------------------------------------------
(Currently selected:[0](Update) )
[At this point I remembered to turn on the printer...]
Enter the value. [0]0
Connect the printer, and then turn on the power.
To use the printer on the network, connect the printer to the network.
When the printer is ready, press the Enter key. > Searching for printers..

#=========================================================#
#  Select Printer
#=========================================================#
Select the printer.
If the printer you want to use is not listed, select Update [0] to search again.
To cancel the process, enter [Q].
-----------------------------------------------------------
 0) Update
-----------------------------------------------------------
Target printers detected (MAC address  IP address)
1) Canon MP560 series (00-1E-8F-64-60-96 192.168.1.5)
-----------------------------------------------------------
(Currently selected:[1]Canon MP560 series (00-1E-8F-64-60-96 192.168.1.5)) 
Enter the value. [1]
#=========================================================#
#  Printer Name
#=========================================================# 
Enter the printer name.[MP560LAN]mp560-again
Execution command = sudo /usr/sbin/lpadmin -p mp560-again -m canonmp560.ppd -v cnijnet:/00-1E-8F-64-60-96 -E
#=========================================================#
#  Set as Default Printer
#=========================================================# 
Do you want to set this printer as the default printer? (yes/no) [yes]no
#=========================================================#
Installation has been completed.
Printer Name : mp560-again
Select this printer name for printing.
#=========================================================#

Then the printer should be set up correctly, and you can test it by going to System -> Administration -> Printing, right clicking on the new printer, selecting “Properties” and clicking on “Print Test Page”.

Scanning over Wireless

Thanks to Fergus in the comments below for pointing out that this is easy to get working.  First, make sure that you have the package libgimp2.0 installed with:

sudo apt-get install libgimp2.0

Now, from the Canon MP560 drivers page, download “ScanGear for Linux (1.4)”, which gives you a file called MP560_Linux_Scangear.tar.  Unpack that tar file, and you’ll find within it another archive called scangearmp-mp560series-1.40-1-i386-deb.tar.gz.  Unpack that, and change into the newly created scangearmp-mp560series-1.40-1-i386-deb directory.  Then run ./install.sh – the installation should work fine.

Then you can scan with Simple Scan.

Scanning to a USB stick

As an alternative to scanning over wireless, you can plug a USB stick into the printer and scan directly to that – just follow the prompts on the display.  It only offers scanning to PDF or JPEG, unfortunately – it would be nice if PNG was another option available when scanning to a USB mass storage device.