Building the Yak-1 Wearable Translator

$Id: construction.html,v 1.2 2000/10/27 03:57:11 jani Exp $
$Revision: 1.2 $

Index

Hacking the hardware

Hardware used

Glasstron monocular conversion

Using a stock Glasstron PLM-A35, I followed Clifford Leong's excellent instructions and ripped out the right LCD display. In all the process was surprisingly painless, but do make sure you have quality equipment to work with: some screws are very small and if you break their threads you're, well, screwed. When rebuilding the device at the end, if you opt for removing the right side (like me and unlike Mr. Leong), you'll probably want to temporarily remove the circuit board's cable connector and place it back on last. Note that the display will not focus properly until you've got it positioned correctly, which means screwing the center and nose screws all the way down -- don't do this until you're sure you haven't made any major mistakes...

Glasstron audio hacking

For starters, the Glasstron's built-in audio amp is bad. Turn it down low and use the laptop's amp instead. The "AVLS" audio limiter seems to be useless, but leaving it turned on does no harm.

Next, you'll probably want to do something about the horrible included dinky little always-in-the-way earphone buttons. Take a look at the instructions for adding a stereo plug to the Glasstron (and ripping out a few useless pieces while you're at it).

Now that you have a plug, you can obviously use your own headphones. A more fun thing to do would be to attach a microphone, which can then be routed back into your computer's microphone jack! If you're willing to deal with mono, you could even use one channel for input and the other for output. Unfortunately, the built-in amp seems to do too good a job of nuking any signals going the wrong way around, bypassing it would be trivial if I only knew the pinout of the Glasstron cable... but I don't. <sigh>

Victor Handy Mouse

The Victor Handy Mouse is a USB mouse designed for, if not quite wearable, then at least portable use. About the size of a large marker pen, one tip has a miniature thumb-joystick, two buttons underneath it and a handy "lock" key that can be used for dragging (press lock, move pointer with joystick, press button to release). No special drivers required, so (assuming you have USB installed) it works well under X.

Unfortunately, it does not have a third button. It would be very intuitive to push down on the joystick but, while this produces a "click!" sound, it doesn't actually do anything. (And this would cause lots of unintentional clicks if carried in your pocket.) The workaround is to use Emulate3Buttons in your XF86Config so you can press both buttons simultaneously for a third-button click.

The Handy Mouse retails for about Y5000 in Japan. The Japan Victor Company is better known as "JVC" elsewhere...

CatEye FinRing

The FinRing, made by BossWave according to the website but LuckyTech according to the packaging, is an interesting attempt to develop a wireless mouse. The FinRing transmitter is worn on your index finger, press the three buttons (left, move, right) with your thumb and move your wrist for pointer motion. Like the Handy Mouse, the FinRing is a normal USB HID and works with a standard mouse driver.

At time of writing, the FinRing costs $79 straight from the manufacturer, express shipping from Taiwan to anywhere in the world included.

Standard USB mouse into wearable input device

My software needs a method of moving up and down in a menu and selecting items, for which the scrollwheel of a mouse is perfect. To optimize your mouse for wearable use, reroute the cable to go through the "wrong" end and rip off the mouse button covers and anything covering the switches: this will prevent accidental presses but still allow you to use the buttons if needed.

Configuring Windows 98

The laptop comes with Windows 98 installed, and getting the Glasstron to work under Win98 is such a piece of cake that sometimes I wonder whether the pain of installing Linux was worthwhile. Then again, I'm a relative Linux newbie, so a guru would probably have no problems at all...

Glasstron display

At any rate, plug the (included) VGA-TV converter into the laptop, put the video (yellow) cable of the Glasstron into the TV output and the audio (red/white) cables into the Vaio's headphone jack via the adaptor. Get some power into Glasstron (AC adaptor or battery) and turn it on, you'll see a cross, press the button and you'll get -- darkness. No problem, press Fn-F8 on the laptop, and you should get a display.

Note: Fn-F8 works only after Win98 has booted. Except when closing the screen, there appears to be no way to get the LCD screen turned off while leaving the TV output enabled!

After the initial excitement, you'll soon discover that the display is too small and distorted to be usable. Correct. Create a new account in Win98 for the Glasstron -- mine is called Yak -- and do Control Panel -> Display -> Design: set the background to white, fonts to bold, black and 17 pts or so, and display size to 640x480. (For a monocular Glasstron, you'll probably find the inverse white-on-black better.) Remove all extra icons from the desktop and rename the ones you actually need with short words that so that "Format disk" will not be abbreviated as "F...k".

Under Display -> Settings you'll find a driver configuration button, under which hides an extra tab for the NeoMagic chip's own configuration, which includes a handy point-and-click interface for changing the centering of the display. As far as I can see, most settings here are overridden by Windows and the BIOS (the Fn-X keys).

When word processing, etc, I find about 14-16 points to be tolerably comfortable -- you will find that the display becomes sharper if you move it farther away from your eyes. The standard MS-DOS prompt is fixed to thin white-on-black, which remains unreadable even at the largest font setting -- you may wish to install another shell if you'll be needing this.

Power management

The most infuriating thing about using Windows 98 with a Glasstron is the plethora of really annoying power management features, most of which have to manually set over and over again.

Under Control Panel, you will find a Power Management icon. Select this, create a new profile (any attempts to change existing ones will be erased as soon as the machine reboots!) and, for starters, instruct the machine to never turn off no matter what. This takes cares of Win98.

And then there's the BIOS. Right-click the battery management icon in the System Tray and select the option "Power Management Off". If you're not running on AC power, the screen will get brighter, and -- more importantly -- closing the display will no longer cause the machine to instantly shut down! The internal display will still switch off when the cover is closed, so no worries.

Installing Linux

Getting everything you need working under Linux requires a lot of work and more than a little familiarity with Linux. On the bright side, at least you'll learn a lot while doing it...

An excellent starting point for installing Linux on the Vaio PCG-C1XG/BP is Lee Wen Tiong's little guide. He used Vine Linux 2.0, but the process was very similar for the Red Hat 6.2J that I opted for (with hardware this bizarre, the least you can do is choose a well-supported distro!).

You can follow his instructions dutifully all the way up to X configuration, after which the real fun starts. So do all this but no more:

There's also an excellent document on installing Debian on a Vaio C1 here (Japanese only/日本語で!). However, his installation seemed even more complex than this...

Enabling TV out

The most difficult part to get working under Linux turned out to be something as innocuous, or should I say downright stupid, as the TV output. In the Vaio C1 both TV and VGA output are located in a separate dongle and, for reasons known only to the Sony engineers who designed the thing, VGA output is trivially activated with either Fn-F7 or option extern_disp in XF86Config, but TV output cannot be activated at all. Period. Fn-F8 does not work, there is no support for TV output in the XFree86 NeoMagic driver, and Sony's tech support helpfully informed me that I need to run HKserv.exe to get the other function keys enabled. (Hint: it's a Windows program.)

So I opted for an equally stupid low-tech solution and bolted on a third-party scan converter to do the VGA-TV conversion. There was a "Poindeo TV" converter lying on the shelves of the lab so I snarfed up that and tracked down a male-to-male 15-pin adaptor so I could attach it to the dongle. One more box to break and it also needs a 9V battery or DC input to power it, but at least it works...

According to some unspecified laws of logic, the external VGA output gives out different signals, some of which will result in gargage. Press Fn-F7 to cycle through them until you get a decent display. One odd quirk: 1024x480 can be used with the Poindeo, it just squishes the aspect down from 2,13:1 to 1,33:1! For some applications this is in fact useful, since by using a 20-point Courier font, I can now get a tolerably legible 80x18 xterm with the Glasstron. (Under 640x480, you're limited to 50x18 or so, 50x27 if you're willing to use a 8x8 font.) Unfortunately the lower 20 pixels or so of the screen are cut off.

Installing USB

Before proceeding, turn off PnP in the BIOS, which you can access by pressing F2 and then ESC during the VAIO boot-up sequence.

By the time you read this, USB support may have made it into the stable kernels and your life will be easy. Mine wasn't.

Red Hat comes with kernel 2.2.14-5.0, the easiest (ha!) way to install USB is to update to 2.2.16 and install the 2.2 USB backport on top. Follow the instructions. While in make menuconfig, you will want to ensure that everything you need is enabled: USB (UHCI-type chipset), APM and modularized sound support, incl. OSS, would be a good start.

DO NOT reboot yet!

First of all, note that your new kernel has appeared in /vmlinuz, whereas Red Hat by default boots off /boot/vmlinuz. So:

cp /vmlinuz /boot/vmlinuz-2.2.16-usb
cd /boot
rm vmlinuz
ln -s vmlinuz vmlinuz 2.2.16-usb
Adjust /etc/lilo.conf accordingly and be sure to add an entry called linux-rescue pointing to the old 2.2.14 kernel, if (when) you screw up this will get you out of many a pickle. Even more importantly, run lilo to get the system to recognize the changes to the kernel and allow it to boot properly. Do this every time you change the kernel, otherwise your system will not boot.

If a new kernel won't boot, you can now boot the old, functional linux kernel by telling lilo to start linux-rescue. If not even that helps, boot off the Red Hat 6.2J disk and execute the incantation linux rescue ide2=0x180,0x386 to get you to a root prompt. Mount your root partition (presumably /dev/hda5 if you followed my advice) and run lilo and/or edit /etc/lilo.conf to get things working again.
No, you still can't reboot. Get the latest PCMCIA package from the Linux PCMCIA Information Page. Install PCMCIA now according to the included instructions, no special trickery needed during the compilation phase at least for my cards (Ethernet adapter and SmartMedia reader). However, reinstalling will break Red Hat's network configuration system, you will need to edit /etc/pcmcia/network.opts according to these instructions.

Note: Red Hat 6.2J's default PCMCIA installation has a few odd quirks on the Vaio, inserting or removing cards while in Linux would cause an immediate system crash. After updating the problems went away...

Still there? You may now reboot the machine. If everything works, good for you -- go get a coffee and prepare yourself mentally for soundcard installation. If not, get a coffee anyway and debug, debug, debug.

USB configuration

By now you should have network access and USB co-existing happily, but you still need to get X to recognize USB input devices. The USB Guide does a decent job of explaining how. For starters, you will probably at least want to be able to use a decent USB mouse instead of fondling that nipple all day, by default RH 6.2J comes with XFree86 3.3.6 so you'll need to add this incantation to your /etc/X11/XF86Config:
Section "Xinput"
   SubSection "Mouse"
        DeviceName   "USB Mice"
        Protocol     "IMPS/2"
        Port         "/dev/input/mice"
        AlwaysCore
# next two lines for scroll wheel mice only --jpatokal
        Buttons	     5
	ZAxisConfig  4 5
   EndSubSection
EndSection
(assuming you've configured your mouse as /dev/input/mice, that is...) You should now be able to move and click both with the built-in Vaio nipple and your USB mouse. Hooray!

If you want to use a scroll wheel mouse, you'll need to hack your ~/.Xdefaults a bit more to get support in more programs (like xterm and Netscape). See the mouse wheel scroll page for documentation, or just copy my .Xdefaults file. Note that Netscape scrolling is a little flaky at times, the screen does not always redraw properly.

That was too easy, time for more pain.

Soundcard installation

(many thanks to Lee Wen Tiong for much of this)

The Vaio comes with a rather bizarre Yamaha sound chip not supported by OSS, so the only way to get it to work is to install ALSA with OSS emulation. As of this writing ALSA is still in serious beta, but despite the scary zero versions 0.5.9b/c have worked for me -- once I got them installed right.

Fetch copies of the latest ALSA package (driver, lib, utils, the works) from the ALSA project and bookmark their extensive but chaotically disorganized documentation (odds are you'll need both the ALSA HOWTO/FAQ and the entirely separate ALSA-sound-mini-HOWTO).

Do a ./configure ; make ; make install for all three packages. Note that if you did not compile your kernel with ISA PnP support, you will get errors unless you use the --with-isapnp=no switch for ./configure. (And you did remember to turn off PnP in the BIOS, right?)

Run the included ./snddevices script to create all necessary devices. Add these lines to your /etc/conf.modules (or modules.conf). Modprobe everything in there as instructed in the installation guide, then run alsamixer to unmute all channels and push them up to 80% or so. Now try it! And remember to activate Input Gain, Capture and ADC Record if you want to use a microphone, alsamixer doesn't have these but the command-line amixer does. amixer set "Input Gain" 100%, etc...

Got it working? Dance a little jig of joy and save your configuration with alsactl store, then proceed to scratch your head over why Red Hat's default startup script worked fine with the 2.2.14 kernel but not 2.2.16, hack it by hand to either invoke /etc/rc.d/init.d/alsasound start or just simply modprobe what you need. (Feel free to nuke the lines calling aumix and replace them with a call to alsactl restore.)

CD-ROM configuration

With my setup the CD-ROM drive and its PCMCIA adapter are automatically correctly recognized and set up as /dev/hdc, and it can be manually mounted with mount -t iso9660 /dev/hdc /mnt/cdrom. However, since the default CD-ROM location is /dev/hde, you'll need to edit /etc/fstab and the link /dev/cdrom to point to hde instead of hdc.

One bizarre quirk: I haven't managed to get CD audio out through the VAIO's own speakers or the headphone jack, I have no idea why. CD player controls (including volume) work fine and I can listen through the CD player's own jack...

Advanced Power Management configuration

Much to my astonished APM worked right off the bat, although the VAIO's battery has a disturbing tendency to crash from 20% to 0% in two seconds flat at times. If you spend most of your time in GNOME, you'll want to install the APM monitor applet that will keep you informed and prevent most nasty surprises.

Hibernation (Fn-F12) works quite well under Linux, everything is done in hardware so no system configuration whatsoever is needed. When coming out of hibernation, the mouse pointer will initially be corrupted, but it will correct itself as soon as it hits something that causes an update (window edge, button, etc). One thing to watch out for, however, is inserting or removing PCMCIA cards while in hibernation, sometimes this works but sometimes it doesn't. Remember to umount the CD-ROM drive before removing the card, or Linux will get confused...

Unfortunately, ALSA is not APM aware, so by default sound will not work after exiting hibernation. A manual /etc/rc.d/init.d/alsasound restart ; modprobe snd-pcm-oss will fix this, or you can hack the apmd scripts in /etc/sysconfig/apmd to do this automatically.

On the To Do list...


Back to the Yak-1 home page