Firefox 35 Custom High Contrast Fix

As I wrote in my last post, I’ve been compiling custom XUL.DLLs for a number of Firefox releases to get around the ridiculous restriction that if you are running Windows in High Contrast mode, then ALL WEB PAGES WILL BE DISPLAYED IN HIGH CONTRAST MODE,  making the “Allow pages to choose their own colors” check box broken and useless. Honestly who thought this was a good idea, clearly not a visually disabled person! What would have been wrong with detecting HC mode, asking and turning OFF the “allow pages to choose…” option, with a way to stop it asking? Or a least the current arrangement with a power user string to disable it.

After some futzing I found my custom compilation/fix only works if XUL.DLL and MOZJS.DLL from the custom build (of the Firefox 35 release source code) are copied, a little strange as I am using Visual Studio 2013 which is used for the Win32 releases now, but probably due to a different config.

In following up fixes to this issue, I found Firefox 37 has fixed it using a 3 way option picker. I would have stuck with the nightly release but the Custom Colors toolbar button that I use to toggle colors isn’t compatible with the new setup. That’ll need to be fixed by the time 37 is released.

Firefox 32 High Contrast Fix

Firefox updated itself to version 32 and my ability to turn the forced high contrast mode for pages when Windows 8.1 is running in HC mode disappeared, even within a sandbox as worked previously.

I compiled version 32 from source and applied the patch to use an extra configuration variable as detailed here. It worked but, as I found with previous compilations, it consistently refused to load Adobe Flash (the plugin crashes, leaving Firefox running). This would make it annoying to use as my mainstream browser.

I guess the crash is due to me using Visual Studio 2013 when the official compiler is documented as Visual Studio 2010. Or soemthing else. Its been that way since version 28 and persists with the latest nightlies and build environment.

It occured to me that the problem causing the Flash crash might be in a different DLL to the fix for the high contrast override, which compiles to XUL.DLL.

So I copied my compile of XUL.DLL to a stock release of version 32, and I now have both Flash and my colour override working.  Good times are back.

VMWare 10.0.1 Under Win8.1 Network Issues

A default VMWare 10.0.1 install under Windows 8.1 had some pretty serious issues by default.

Firstly I found network performance of new VMs was atrocious for VM to host shares in Bridged and Host Only mode. This turned out to be due to a new broken virtual ethernet device and the fix is to change “e1000e” to “e1000” in the virtual hardware line in the VMX file, ie: you want:

ethernet0.virtualDev = “e1000”

The other issue was that VMWare’s NAT and Host Only networks were detected as “public” and hence blocked by the host’s firewall. The fix involves deep registry hacking, as described here. Basically:

  1. Navigate to this key: HKLM\System\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}
  2. Navigate through the folders inside the previous key until you’ll find an entry called “VMNet“. (There will be one for each virtual NIC). You can also search for that entry using the find commands in the Edit menu.
  3. Add a new DWORD 32 bits value and name it *NdisDeviceType. Don’t forget the * as it is needed.
  4. Set its value to 1.
  5. Repeat steps 3 to 5 until both NICs are updated.
  6. Close regedit.
  7. Disable and reenable both NICs.

I love big nasty UUID’s, don’t you?

VMWare 10.0.1 has been out for months yet we have to resort to this kind of garbage. And Microsoft, if you cannot 100% determine that a network is “public” (particularly one which has “No Internet connectivity” like the VMWare host-only network, why not at least provide an advanced option somewhere for a user to set the network type instead of forcing us to have to dig into the guts of the system?

Still can’t get away from the twaking CONFIG.SYS mentality?




Thinking Out Of The Sandboxie

I need to work on computers with a light text / dark background colour theme, and for the last couple of decades I’ve been able to get Windows and most applications I use to follow suit.

Windows Vista introduced a new theme system which took away the control over UI element colours unless you used the High Contrast theme, very harsh and ugly compared to what I’d configured and used since Win 3.1 to XP. With support for XP ending, the time had come to upgrade.

I had high hopes for Windows 8.1. The High Contrast theme lets you configure UI element colours (menus, text, backgrounds) but for some nonsensical reason, window borders always follow the colour of the window title (even though there is a field for window border in the theme file). Nonetheless I came up with an acceptable theme to work with.

Things came unstuck when I installed Mozilla’s Thunderbird and Firefox. When these detect a system High Contrast (HC) theme, they switch to a hard coded and broken theme (since September 2013) which includes white on white text and menu bars that get garbled as you drag over them. Its horrendous yet after months and plenty of bug reports, its unresolved.

Worst though is that when running on a HC Win8.1 system, Firefox shows all sites using an internal theme which wrecks the CSS for many sites, making them unusable. The setting of the “Allow pages to choose their own colours” option is totally ignored. System HC? Then your pages are always HC in FF, not acceptable to me.

Experimenting with .THEME files I found I could create a theme file with the high contrast flag off but still using the AeroLite rendering framework. Whilst this made FF and TB look OK, the windows Control Panel and other system windows now had huge sploges of white on them, as Microsoft uses the HC flag to control whether UI colours are respected. Running this way would also be unacceptable.

I found I could make TB and FF run without the theming if I ran them in Windows XP Compatibility Mode. I could have lived with this if it wasn’t for the fact that they also insisted in running as Administrator when in compability mode, not what you want for a web browser.

I was pretty cornered and starting to consider compiling from source or hooking the calls to the check for HC mode, Win32 function SystemParametersInfo(). Then I remembered an application called Sandboxie.

Sandboxie allows you to run windows applications in such a way that any modifications they make to files or the registry are captured and retained in a separate “sandbox” folder, meaning the real files are not modified, but from the point of view of applications running through Sandboxie, the changes have been made and persist. Its great for web browsers to help contain exploits from messing up your real system. But could it help me with theme problems?

It took a minute to install and it created a shortcut I could use to run Firefox as sandboxed. From within Sandboxie I then launched Windows Control Panel and went to Personalisation and chose my modified dark theme which had the “high contrast” flag off – the theme I mentioned earlier that messes up the system Control Panel but fixes Firefox and Thunderbird.

Interesting. The selection was made but the system’s theme did not change to reflect the selection. Control panel still looked good. The system still saw HC mode as on.

Then I opened Firefox through Sandboxie. It saw the HC mode as off and had reasonable UI colours.

After ensuring email and web history folders were not included in the sandbox, I now have a very workable solution to Mozilla’s High Contrast theme problems, and with the sandboxing feature, additional security as well.

I like that you can browse the sandbox folder. You see all the folder structure and registry hives that have been modified from within the sandbox. With my data files not sandboxed, there is very little there except a few hundred K of registry data which stores the alternate non HC theme that exists only within the sandbox.

Using it is trivial. I’ve made another shortcut for Thunderbird which launches it through the sandbox and Sandboxie has lots of options to get it out of the way once you’ve set things up.

The only downside I can think of is that I’ll have to take care when Firefox and Thunderbird update. The changed program files will be sandboxed but I guess I’ll occasionally run them outside sandboxie when I want to bring the “real” installs up to date.

New HTPC – Shuttle XS35GSV3

The ASRock ION 330 HTPC had been a faultless performer for nearly three years but in late December, the combination of a hot summer, a warm amplifier underneath it and a flaky case fan caused it to cook itself, leading to it becoming prone to lock up for periods of time. I changed the hard drive, reseated cables and replaced the fan. None of this helped (EDIT: Both 320GB WD drives were faulty), It seemed to have lost the ability to control the case fan properly unless I kept it on maximum fan speed, making it intolerably noisy.

After a few attempts at fixing it I decided to replace it and was pointed to the Shuttle series of totally silent fanless PCs by work colleagues. I bought the Shuttle XS35GS V3  which promised a totally silent home theatre PC experience.

I’ve not been disappointed.

I thought I’d be adventurous and gave OpenElec a try,. This is a very optimised XBMC Linux distribution. I found I had to use a more “generic” build as there wasn’t a build for the V3 hardware. After struggling with networking and messed up graphics for a day, I decided to go back to the flexibility of the software set I’d used previously, that being: TV Scheduler Pro for TV recording, Zoom Player for playback and EventGhost for IR remote control.

I started with XP and it was “ok”, but  Zoom Player (now at version 8.5 vs. version 6 on the ION) had moved on to using the excellent LAV Video Decoders that offered GPU accellerated playback of hi-def content, something I’d achieved using MPC Video Decoder.

I really liked the quality of the LAV Decoder (DScaler is now obsolete for me) but I couldn’t get it to work with acceleration. I discovered it needed the use of the EVR Video Renderer under Windows 7, at least.

I decided to skip Windows 7 and bought an upgrade to Windows 8. Installing it went pretty smoothly, I had to “forcibly” install the drivers for the KWorld Dual DTV USB Tuner and the LinkSys Dual Band USB WiFi (the onboard WiFi of the XS35GS is 2.4G only).

Application wise, everything ran well and the much maligned start screen was a non-issue, I’ve set up buttons on my harmony remote to take me straight to Zoom Player’s navigator for either TV Recordings or my media  library. Most importantly though, GPU accelerated playback using the LAV Video Decoders and DXVA2 seemed to work.

It wasn’t until more critical viewing that we realised that *every* video played had a tear in the centre when there was horizontal motion. It was as if it was switching frames at precisely the wrong time. This started a big investigation for the cause.

The problem occured when using the EVR Renderer with either LAV Video Decoder (DXVA2 or software decoder) or the FFDShow. decoder. With the Shuttle using a Radeon 7410M, there wasn’t much choice in drivers to try as its a custom mobile chipset. The video driver did not have the usual option for VSync and I tried both RGB and YCbCr pixel formats, and setting the display framerate to match the video (something which fixes typical tearing).

I tried what drivers I could get to load on it and was at my wits end as everything else was great including smooth low CPU DXVA2 playback of 50FPS 1080P.

Then I tried a slightly older Zoom Player EXE (8.50 instead of 8.51) and the problem went away! Yet when I renamed the older EXE to the regular ‘zplayer.exe’ name, the problem came back. What the…

Looking at the Explorer options on the EXE, the cause soon became clear.

Zoom Player had been installed with the Explorer compatibility option “Disable display scaling on high DPI settings” enabled. This option helps older apps run on the new very high resolution displays.

I’m not sure why, but switching this option off caused the tearing to completely disappear. Playback is now smooth and after some colour calibration, I am very satisifed with the results.

Here is the newly installed Shuttle sitting next to my amplifier.


Asus P5Q-E BIOS Lockout

Its the time of year I do maintenance and this includes backing up the operating system partition of my 4 year old quadcare VMWare host machine, with the idea of upgrading to VMWare 9. I do this by booting to a USB key full of utilities including Acronis TrueImage 2010 (the last version I bought and use now they added “activation” to it).

I was quite annoyed to discover that no matter what I typed, I could not access the usual boot device menu, not even get into the BIOS pressing the DEL key worked. This was alarming, what if I needed to enter the BIOS to fix something!

This started a process of testing various keyboards in the different USB ports as well as an old PS/2 keyboard – even that wasn’t recognised during boot. The USB keyboards worked OK in Windows but the PS/2 one didn’t, so it wasn’t clear if the port was functional.

I then noticed that pressing Caps Lock (a way for testing if keyboard interrupts are working) did toggle the Caps Lock LED, just upon power on but not once the BIOS logo screen came up. So I now knew both PS/2 and USB ports were working during the initial parts of P.O.S.T.

At this point, you probably would clear the CMOS RAM, but what if the firmware itself was corrupted? Then if the system didn’t let me reconfigure it, it would be toast.

I remembered I had the Windows based AsusUpdate. I installed it, re-flashed the same version of the firmware (P5Q-E-ASUS-1406) and got it to clear the CMOS RAM as well. That restored access to the BIOS.

So I am not exactly sure what had gone wrong. On the same day (December 24th 2012) I’d found my NAS’s BIOS forgot which drive to boot from, and my normally reliable security DVR spontaneously rebooted.

Gamma ray burst anyone 🙂






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.

Stuttering Audio Fix for Asus EEE 1000HE

The not so new EEE PC was experiencing intermittently stuttery audio when playing a Flash based radio stream. This was strange as it coped fine with MP3 and WMV streams, even with video. It wasn’t a buffering issue. The audio had very short glitches – the kind of thing that happens when a device driver locks the bus too long (he says, having worked on a Linux audio driver a few years back).

The wireless drivers were up to date and the wireless hardware configured to use CAM mode (a problem that plagued the ION HTPC when I first installed XP on it). Power management settings were set for high performance.

I also determined it was no where near running out of CPU, sitting at only 10% when playing the stream. After updating drivers, firmware and minimising the configuration as much as I could, I started thinking it might be network related.

I set up a regular ping of length 8192 bytes from my workstation to the EEE so I could see what network performance was like. I was only half surprised to find that ping times were all over the place, with some peaks in the 100s of ms. With the audio streaming, the high peaks corresponded with glitches in the audio.

With it happening even when close to the WNDR3700 wireless AP, it wasn’t a signal level problem. It was connecting at 130mbit (N speed) on the 2.4GHz band.

I switched the router to limit 2.4GHz to 54mbit and the audio problem went away. Ping times to the EEE became a solid 4ms.

Looks like its a combination of crappy behaviour for the EEE’s wireless driver in “N” mode and the Flash Player using a very short audio buffer, making it easy to underrun audio playback. Fortunately I can handle the slower 2.4GHz network since I run a separate 5GHz network for the HTPC.

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.