SPA3012 update

As a long overdue update to my last post here (a whole year ago), Linksys finally did release an update (spa3102_v5.2.13_FW) which I’ve been running since April 2012.

The ATA has been running flawlessly since then, with touchtone problems and dropped calls a thing of the past.

Linksys/Cisco SPA3102 broken promises

My Linksys VOIP ATA was acting up, refusing to call one of my SIP services even though it claimed it was registered. I was on firmware 5.1.10 which has been the latest for a few years. Searching the internets for news of any update, I stumbled on the unfortunate tales of promises unfulfilled, as expressed in these threads:
right through to

and then ending up here

Basically, I’m facing the same problem as many. The ATA works fine until you make a call through your PSTN connection. This switches the SIP codec to G711u and locks it there. If you have a SIP service that demands something different (G711a in my case), you’re out of luck and the only option is to reboot the ATA. Any options you set are disregarded after the PSTN call.

I learnt from the discussions linked above that for three years, a group of dedicated owners have been chasing Cisco for a firmware fix. Support promised that the fix was in testing for years, continually pushing forward the release deadline. The last promise was US Summer 2011, and thats long gone now.

As someone who has worked for the last 22 years on many projects (including commercial simulation, realtime systems and satellite modems) with a release cycle measured in days or weeks, all I can say is that it was good to be made aware of this sorry 3 year saga before I upgraded the ATA with something new.

For now I’ve downgraded it to an earlier firmware version (5.1.7) which doesn’t have the annoying and stupid bug.

Samsung Galaxy Note / AM Radio Hack

I’ve discovered a unique hack with my Samsung Galaxy Note phone.

It was playing an audio podcast and sitting next to an AM/FM clock radio (in AM mode). I tried tuning the radio around just to see what the phones digital interference sounded like.

To my amazement I found I could tune in the audio playing on the phone, very clearly, in multiple places on the dial. Testing with a radio with a digital tuner,  I found 855KHz was a good spot.

It works best if the audio level on the phone is quite low and the screen is off. The AM radio makes a nifty audio power amp. Its not perfect, if the charger is plugged in things get really noisy … and when the phone polls the GSM network it makes the radio buzz, as you’d expect if you’ve ever left a digital phone next to a radio.

I’m guessing the phone uses a switchmode audio power amp which happens to make an effective very short range transmitter.

Bridging an Ad Hoc Wireless Network

I wanted to wirelessly share a network my laptop was physically connected to, so I thought I’d give WinXP’s adapter bridging a try, bridging the wireless and wired network devices.

It seemed to work – I set my computer to create an adhoc network (enabling the option to always connect).  The other computer saw the adhoc network and got an address from DHCP supplied from the LAN I was connecting to… but it couldn’t access the network and was unpingable from my laptop.

Research revealed the problem is that my laptop’s WLAN driver (Intel) reports that it supports “promiscuous mode” when it doesn’t. This is resolveable by forcing Windows to use a workaround for when promiscuous mode isn’t available in an adapter. This is done as follows.

(in cmd)
netsh bridge show adapter

This should show the network devices in the bridge. Use the ID of the wireless device, mine was 1. Then issue:

netsh bridge set adapter 1 enable

With this, the other compouter was able to access the LAN via the bridged WLAN.

It should now work (dont think I had to reboot).

Don’t be disappointed to see “Not Connected” on the Wireless Networks list. The status doesn’t seem properly reported. Also its WEP only do keep your shares locked down.


Playing the arp

I thought it would be interesting to have a small linux VM running on the ION HTPC. Nothing heavy, just an SSH server. I installed VMWare player from my 7.1 VMWare Workstation install and copied across my linux VM.

It booted but there was a bizarre networking problem. I could ping from the guest (VM) to other machines on my network except its host, for which it would report destination unreachable. The host could ping it and I discovered that after the host pinged the guest, the guest could ping the host, for a while. Then it became “unreachable” again. It wasn’t a host firewall problem.

The same VM was fine on my main PC, both setups were using a bridged network. The only difference was that the ION is using a wireless network.

Some searching found this very useful thread:

It turns out that the guest is having problems finding routing information at the ethernet level. It does not know how to reach the host which is sharing the same network adapter. The guest sends out an arp request but the response it gets has the IP address of the host, probably related to them being bridged on the same device on a wireless network.

The solution is simple, in rc.local add an ‘arp’ command to create an association between the host’s IP address and its adapter MAC.

This worked for me:
arp -s yy:yy:yy:yy:yy:yy
where is the IP address of the host and yy:yy:yy:yy:yy:yy is the MAC address of the host.

Interestingly, if I used the MAC address of the guest, it also worked! Not surprising since host and guest are bridged. But pings were about 150us quicker if I used the host MAC address.

Speaking of speed, given the ION is no speed demon and has no hardware VM support, the VM is not exactly fast. It feels like the speed I used to get with VMs on a PIII; good enough for lightweight linux stuff and data rates < 2MB/second.

VMs and Old OSes

Here are a few things I’ve found running VMWare 6 to host my main work environment:

Win2K and large SATA drives

I initially started using Win2K as the host environment for the VM, given it is more lightweight than XP. I found that even Win2K SP4 didn’t see my entire 300GB drive, instead cutting it short at 139GB. This is both in the installer and the drive manager once installed.

Fortunately I had just started and didn’t have any partitions set up yet. Turns out that out-of-the-box Win2K does not see large partitions and it would have corrupted any large partitions had it mounted them. Its fixable by creating this registry key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\atapi\Parameters\EnableBigLba [DWORD] = 1

Guess not enough people have corrupted large drives under 2K for MS to make this a default in a hotfix. In any case I wouldn’t like to install Win2K cold on a large drive with existing partitions on it, by the time you get to hack the registry, the other partitions might be trashed.

Dropped network transfers

I persisted with Win2K and soon discovered the networking between the guest VM and the host (bridged mode) was really flaky; large file transfers would fail inexplicably with silly errors. It turns out that Win2K’s networking was freaking out because data was flowing between the VM and the host at speeds faster than the physical “real” interface (100mbit) could support. Win2K has some kind of “check” for this which fires even though the data isn’t actually going over the physical interface.

The fixes for this included hacking in a new virtual ethernet adapter for VMWare (which bridges at the MAC level) and using a separate “host only” adapter for the guest-to-host sharing. The second way worked fine but I decided to give up on 2K as a host and went back to XP as the host OS.

Big differences between Uniprocessor and Multiprocessor Win2K VM HALs.

My guest VM is Win2K and I initially installed it with one CPU enabled under VMWare, so it installed a Uniprocessor kernel/HAL. All worked great so I thought it might be good to try a dual CPU VM. Adding the CPU isn’t enough, you have to use Device Manager in the guest to change the computer from ACPI Uniprocessor to Multiprocessor (update the driver, manually select the alternate HAL). This enabled the VM to see multiple CPUs but I noticed something very nasty.

Running Winamp or ZoomPlayer now used 100% of both real cores. Changing the VM back to a single virtual CPU (still with a multiprocessor HAL) just meant I now had one real core maxxed out. After I switched the VM back to the ACPI Uniprocessor HAL (device manager again) it now uses a couple of percent for Winamp and about 15% for 640×480 video stretched to 1280×1024, like I’d originally observed. Not bad if you remember its a VM!

I guess the multiprocessor HAL needs more of VMWare’s attention to manage when doing I/O, even with a single virtual core.

No ActiveX, No Internet for you

A couple of weeks ago, when I arrived here in Seoul, we had a tech come out to connect broadband. The building is on fiber and the hardware side of the connection just involved patching the existing RJ45 wallplate to the building’s router rather than the phone line.

The software side was a bit of a shock to me; the tech installed 4 ActiveX controls as part of the connection process. After he left, I looked closer at what was going on.

When the building router senses a new ethernet MAC address, it requires you to authenticate. Any URL you enter redirects to a login page. The kicker is that the login requires an ActiveX control to be installed, into which you enter your national ID card # and your phone number. (Not so much authentication as a reminder that everything you do is traceable to YOU).

Had I been running on a Mac or Linux without Windows, it would have been a show stopper. Those OSes simply dont matter here, its Windows or its nothing.

The other controls he installed included an “IP checker” and a speed tester.

I’ve since set up a new computer here and also bought a router. We had to reactivate the link again (for the router’s MAC address) but I made sure we did it in a VM this time so I could Snapshot whatever it installed away.

I notice that the IP address assigned to me hasn’t changed since I got here a few weeks back, even after disconnecting and reauthenticating. The net is working fine, I get 90mbits in and out to sites within Korea; the international link is nowhere near that capable. I usually achieve about 1MB/sec for Gutsy updates from a server in Japan. USsites are about 400KB/second. Australia is about 200KB/second on a good day.

It seems the reason ActiveX is so prevalent here is because the Korean government mandated it for e-commerce years back when trade restrictions prevented the export of strong crypto, so the Koreans developed all their own. Some banks install a half dozen ActiveX controls, sometimes ocnflicting with controls installed by other banks. One even installs its own firewall. Thanks.

We now use VMWare virtual machines to avoid clagging up the host system.

Apache’s transfer speeds

Being away from home, I’m downloading programmes recorded by the HTPC over the internet. I set up a batch file that uses WGET to retrieve the compressed WMVs that get created from recorded programmes. Its the same Apache server thats serving this blog.

Even though my uplink is 256kb (30KB), I’m very disappointed to only get about 12KB/s using wget. I’ve also tried direct downloads in Firefox, same thing.

If I use PHP File Manager instead though, I achieve 26KB per second. Unfortunately I cant automate this method easily.

So it seems Apache is being very conservative with its use of the link.

I thought it might have something to do with the long latency from Korea to Australia (nearly 400ms) so I tried increasing the receive window size, right up to 87600. This is supposed to reduce the frequency of ACKs and improve things over a high latency link. Didn’t help.

I’m guessing that Apache is doing some kind of connection load balancing which is annoying. Might be interacting with Windows XP’s QoS packet scheduler. Dont want to mess with that remotely at this stage; some connectivity is better than none… if I kill the network interface,

SIP phone fun

Wanted a local dial in number that would ring on my laptop. Went with Pennytel as their untimed international calls (8c) sounded good. Getting it to work ended up being much harder than it should have and took $20 of landline calls to my DID number.

The basic problem was that my outgoing audio was not heard by a caller to my DID number. It wasn’t a port problem nor an audio hardware problem; the voicemail system could hear me fine, (determined after a lot of wasted calls).

Their tech support guy was responsive and I went through the process of trying a number of SIP clients (he preferred X-Lite) on a couple of XP computers with different audio hardware.

A couple of colleagues had the same problem under XP but one got it working on a hardware SIP phone. I tried a complete WinXP reinstall. No dice, even with a totally fresh install.
Finally had a breakthrough when I discovered it worked fine on my Win2K computers. This eliminated a local network/router/ISP problem.
I used Ethereal to capture packets during a test call; data was flowing in both directions. Sent the data to Pennytel and their tech support (Antony) came back with the solution; try with just the G711 ALaw codec enabled. I tried this in Bria and it came good. Seems something in XP breaks that codec when using it with Pennytel!  You’d think they would have known about this.

EDIT April 2009: Nearly 2 years later and I’ve been using Pennytel using my SPA3102 ATA. Now I’m wanting to have Bria available on my laptop again. I installed version 2.5, the very latest and again had outgoing audio problems on incoming PT calls.

Using settings->Audio Codecs I just left G711-alaw in there but it didn’t help. Then I checked the “when negotiating audio codecs, accept the first codec offered”. Its all good now.