Browsed by
Category: Technical

Core Parking and You

Core Parking and You

So, Windows added a little feature a while back to help save power.  Unfortunately, it can have serious side effects for gaming and other high-performance computing.

Windows 7 / Server 2008  machines running on multi-core CPU’s have an obscure feature enabled by default called CPU core parking. While usually benign – some people have experienced serious issues that seem completely unrelated to this feature.  The symptoms are a decrease in performance with unstable and jittery in-game FPS, or noticeably laggy/jittery and unresponsive game play.  All this despite a high-end graphics card and CPU that should be more than capable of running the game. People have often seen this problem or described it as micro-stuttering – random fractional frame pauses that are hard to pin down precisely but are definitely noticeable and detrimental to game play.

Core parking comes in at this point.  Modern multi-threaded games often can leave a core idle for micro-portions of the frame after it has completed it’s processing and other cores are still finishing their work up.  Windows sees this idling, and decides to put the idle core in low-power mode.  Normally, threads go idle for long periods of time (often hundreds to thousands of milliseconds), so putting them to sleep is fine and can save power.  But in a game, the core goes idle only to be woken up only microseconds later for the next frame.  Unfortunately, parking and unparking has a time cost associated with the operation of a couple of micro/milliseconds – which when rendering 60+fps – actually creates noticeable tiny ‘hitches’.  It often appears randomly because it requires just the right set of conditions to cause the parking/wakeup to be visible.

So, what to do?  You can actually disable this ‘feature’ – which on a gaming rig – is probably the right action since it’s unlikely that power saving is your highest concern.  How do you do it?  Just like this:

  • Open Regedit
  • Find this key:  ” 0cc5b647-c1df-4637-891a-dec35c318583 “
  • Within this key, there is a value called:  ” ValueMax ” This value represents the % number of cores the system will park – the default is 64(hex) or 100%  ie:  all Cores are potentially park-able.
  • Change the value from 0x64 to 0 so the ” ValueMin ”  and  ” ValueMax ” are both zero
  • You will have to find the key a few times and repeat the process for each time it is found – the number of instances will depend on the number of power profiles in your system  [  for me, it was only found twice ]D
  • Do a full shutdown, power-off, and cold-re-start

Here’s a good description of the problem and how it manifests itself.

 

Adaptive Volumetric Shadow Maps

Adaptive Volumetric Shadow Maps

AVSM1

Many people ask me what sorts of things I work on.  Well, here’s one of them you can download and run on your own!  This is a graphics and code sample that co-developed to show off not only a novel new kind of volumetric effect, but also a new extension on some of Intel’s new CPU graphics hardware.

This technique is called adaptive volumetric shadow maps.  The base idea was developed by Marco Salvi who published a paper on it a little while back.  However, this version has been substantially improved by the use of a new feature of Intel processors called PixelSync which allows one to do the volumetric shadowing effect with a constant-sized buffer and no depth slicing.

The effect allows for self-shadowing on any kind of transmissive, volumetric media – such as smoke or hair simulations.

You can download the sample, run it your own, and read more about it here:
http://software.intel.com/en-us/blogs/2013/03/27/adaptive-volumetric-shadow-maps

Mr. Div and his amazing graphics

Mr. Div and his amazing graphics

As a 3D graphics software developer, what attracted me to the field was always the fact that you could create images and scenes of the mind.  There were no physical laws other than the ones you created when generating visuals.

Mr. Div is a designer that has captured much of what I have always hoped to do.  He communicates unique experiences and ‘feels’ via strange and unique graphics/animation.  I find myself drawn to the 70’s era style of his work that was present in the very first days of 3D graphics.  Even though it’s not the highest rez/most realistic graphics, and the tools he uses are simple off-the-shelf variety – it’s the output and imagination that’s amazing. It’s exactly this kind of stuff that makes me excited to be in this field.

http://mrdiv.tumblr.com/

 

 

Foscam

Foscam

So, I recently had a Home Depot gift card about to expire.  It was going to either be another flashlight (which are always handy)


or this deal was going on for a Foscam FI8910W Wireless IP camera.  I’ve heard of these things; but figured I’d give it a shot.  It has some great features:

  • Day and night (up to about 10-15 feet – not the 8 meters they assert)
  • Wireless N or wired connectivity
  • 300 degree pan, 120 degree tilt – remotely controllable from pcs or mobile devices like phones
  • 2-way audio (listen and speak!)
  • Auto-detection of motion and broadcast+email of images from the device

The long and short is that it works great when set up; but the setup and software certainly can leave a lot to be desired.  At least the Foscam forums are easy to use and full of help.  You’ll be using them a lot.  While I was eventually able to solve my problems; I wasted a good 2 hours setting this thing up.  Unfortunately, the part that’s lacking is really the software stack.  It really does feel like a bunch of first-year computer programmers put this thing together.  They have a lot of features and they do seem to work, but they’re all very picky and error-prone.  You have to set up things jusssssst right. If you do accidentally make a mistake or set up a feature in conflict with another – it doesn’t report a problem, it just doesn’t work and doesn’t tell you why or even what is wrong.  Just 20 more minutes of coding for it to say ‘password wrong’ or ‘IP conflict’ or something like that would have solved 90% of these problems; but you won’t get that.  It’s the classic pain of trying to second-guess what the programmers were trying to do, what you know the stack needs to do, and using the woefully underpowered knobs to get it to do that. Problems that I encountered:

  1. Setting up the ability to watch the camera over the internet (not just locally)
    I credit the Foscam for the fact each camera actually gets its on unique hosting web address from Foscam.  That is slick.  However, getting it to work was a real pain.  Can’t remember all the details at this point, but check the forum for the common problems and solutions.  I remember I could easily control the camera locally on the network, but getting the camera to work through their web hosting was the pain.
  2. Setting up the auto-email on motion detection
    This was just a painful experience in bad software/firmware design.  Once you have #1 set up, it should be trivial to have the camera email you the pictures when it senses motion/audio.  The setup screen is fairly straightforward.  Type in the email address(es) you want the camera to mail pictures to; set the parameters for alerts (motion/audio events) and hit ok.  Well, I got these horrible problems where the camera would not save the settings.  I’d enter the data, enter the admin password to change the settings, then look at the info panel again and see the old settings.  Infuriating!  It turns out, the Foscam admin password CANNOT ACCEPT SPECIAL CHARACTERS.  If  you have any special characters in your admin password ($%#^!&*, etc) – then you basically just locked yourself out of changes.  I had to hit the hardware reset, pick a generic password, and only then did my changes stick.  Worse was that it didn’t tell you this anywhere or warn you when you were picking the admin password.  It would just act like it saved the settings, but not and merrily go on its way.
  3. Motion detection with still images is pretty much broken/useless
    When you use the email stills when motion happens feature, 1 out of 2 times the person is long gone by the time the shot fires.  I tested it a couple times, and you need a full 2 seconds of the person moving in the field of view before the shot is taken.  If someone just walks across the path of view, most of the time you get an email of an empty room.  I believe the recording of video option is better, but you better make the field of view big or place the camera such that it will have a full 2 seconds of the person moving in the target area before the shot fires.
  4. Auto-panning
    The camera had a nasty habit of going into auto-scanning paning/tiling mode when it got confused.  So you’d see/hear the little camera looking all over the place every now and again if you logged in or it reset itself.  I disabled the feature in software and it stopped.

Supposedly these are some of the better cameras out there.  But if that’s the case – then I’m disappointed.  It was worth it since it was nearly free to me; but if I’d paid the list price on this thing – I’d have been pretty upset and took it back.  It works great now; but the setup was painful and it’s poor auto-notification of motion detection give it two solid strikes.

 

 

XAMPP v3 and VMWare 8

XAMPP v3 and VMWare 8

Let’s say you want to install the latest XAMPP software so you can do some local wordpress/html work. But after installing XAMPP, you get this message when trying to start the Apache server:


4:33:47 PM [Apache] Problem detected!
4:33:47 PM [Apache] Port 443 in use by "vmware-hostd.exe"!
4:33:47 PM [Apache] Apache WILL NOT start without the configured ports free!
4:33:47 PM [Apache] You need to uninstall/disable/reconfigure the blocking application
4:33:47 PM [Apache] or reconfigure Apache to listen on a different port

In order to get over this, you must change the SSL port number that XAMPP Apache listens to (or change VMWare).  I found changing XAMPP was easier.

Here’s the steps:

  1. Close the XAMPP control panel
  2. Open http-ssl.conf using notepad in the ...\xampp\apache\conf\ directory
  3. Look for the line that has:
    Listen 443
  4. Change that port number to anything you want (i.e. 4430 worked for me)
  5. Search the rest of the document – replacing 443 with 4430 (or your port)
  6. Save the file
  7. Restart XAMPP and Apache should start up properly this time.
Battlefield 3/Origin client tray icon disappears

Battlefield 3/Origin client tray icon disappears

Sigh.  Had ANOTHER problem with Battlefield 3 recently.  More annoyance than problem, but the icon in the tray for the Origin client was showing up as a busted link:

The Origin program worked fine, but it was annoying because sometimes I forgot I’d opened it and having the ‘broken icon’ button on your toolbar isn’t exactly helpful for finding it.  I tried right-click setting properties.  Changing the icon to a different icon then back.  Removing the program and re-pinning it.  Nothing worked.

Then I found this link.  Basically, you need to destroy and then rebuild/repair your icon cache.  You do this via:

  1. kill explorer.exe
    taskkill /IM explorer.exe /F
  2. Deleting your icon cache files:
    del %userpofile%\AppData\Local\IconCache.db /a
  3. Reboot
    shutdown /R /f /t 00

Upon restart, your entire icon cache will get rebuilt (which could take awhile).  Mine took about 2-3 minutes during which the machine was almost unresponsive.  After that the icons re-appeared and all was well.

Link to script that does all this for you and further information.

Asus P8Z77-V PRO keyboard and mouse inoperative at POST – won’t let you into BIOS/RAID setup

Asus P8Z77-V PRO keyboard and mouse inoperative at POST – won’t let you into BIOS/RAID setup

I wasted WAY to much time on this absolutely poor product validation problem.

I have an old Asus P8P67 motherboard that I suspected had a bug with it’s RAID controller hardware/firmware.  I would nightly put the machine into sleep mode, but when I’d wake the machine from sleep the next day the hard drives would start reset clicking and timing out madly.  It was so bad, you’d get 2-5 second delays just trying to access a file.  But if you rebooted, even a warm reboot, the drive would stop its schizophrenic timing out and run smoothly.  Further, it was always the third drive in the raid, even though I’d hot swapped the drive several times and the drives would be flawless when not in the RAID set.

Fortuitously, Fry’s had a sale on the new P8Z77-V Pro motherboards.  However, when I installed the motherboard, I had a different problem.  The machine started up first try without a problem, and I set the SATA mode to RAID so I would get the ‘Press <CTRL-I>to enter configuration utility…’ BIOS message and set up the hardware RAID.  The funny thing was, the message would pop up and I’d frantically press CTRL-I, but to no avail.  It was like it was ignoring me.  I tried turning on USB legacy mode and other USB settings and noticed strange things with the keyboard lights not always coming on/etc.

So, what do I do?  In searching forums, I found that other people were having even worse problems.  Some couldn’t even enter the UEFI BIOS setup at all. When I got my machine to boot into windows, they keyboards didn’t work at all.  I try plugging in another USB keyboard. I have a Logitech G15 and a no-name generic one. Initially, no luck, but I do notice the behavior of the keyboard change. I would toggling the scroll/caps/num locks during BIOS setup and sometimes the I can see both keyboards toggle the light correctly, and other times do not.

I try all the different USB ports. The rear, onboard ones fared the worst. They never worked for the RAID BIOS. Even in windows, the keyboard and mouse would sometimes not work at all depending on which port I had them plugged into. The ones on back that seemed to work best? The top usb port above the green outlined USB flashback port. Still, I cannot enter RAID setup, but windows sees my USB device correctly at startup.

Now, I leave one keyboard plugged into that top port, and then start playing with the headers on the motherboard. I take the USB backplane extender and start plugging it into the headers on the board. You know what? Each one acts differently! However, when I have it plugged into the front-most plug, the one closest the reset/power switches – THEN IT WORKS! You can then press CTRL-I and it registers.

Strangely enough, once you get the machine booted, then all the USB ports work perfectly.  But not while you’re in POST.

All I have to say is HFS – this is BUSTED ASUS. I’ll be sending in a trouble ticket this afternoon. Please let me know if this works for you.

Punkbuster kicking you off in BF3/Battlefield 3?

Punkbuster kicking you off in BF3/Battlefield 3?

UGH.  I went through tons of this headaches back on Battlefield 2 with Punkbuster, and now it appears to have come up again on BF3.  I had been playing along for months without a single issue, but then re-installed recently when I reconfigured my machine. Then I started getting this dreaded message:

Game disconnected: you were kicked by PunkBuster. Stated reason: PunkBuster kicked player  (for 0 minutes) … RESTRICTION: Service Communication Failure: PnkBstrA.exe

The forums are full of people with this same issue.  Here are some solutions that pertained to my particular problem:

  1. Punkbuster didn’t even get installed.  You need to go to Punkbuster’s website, download the installer, and install it yourself.  Go here and follow the directions:
    http://www.evenbalance.com/index.php?page=dl-bf3.php
  2. Punkbuster isn’t getting updated automatically.  There are HTML ‘key’ files that need to be installed and updated regularly.   You need to select 7 different links and save them in the correct folders.
    1. The first is: pbsec.htm, it goes in C:\Program Files (x86)\Origin Games\Battlefield 3\.  Be careful!  When I first saved it from the link, it saved it as pbsec-1.html – that doesn’t work.
    2. Update the remaining 6 htm files like ‘PB Client v2.317 for Win32’ et al. go into C:\Program Files (x86)\Origin Games\Battlefield 3\pb\htm
  3. pbsvc.exe is missing(!).  One post mentioned that you could manually run C:\Program Files (x86)\Origin Games\Battlefield 3\pbsvc.exe and it would test everything for you.  I actually found this file was missing.  However, a copy of it was there in C:\Program Files (x86)\Origin Games\Battlefield 3\__Installer\punkbuster\redist\pbsvc.exe.  I copied it to the root BF3 directory and then everything worked.

Thanks again Origin for really making PC gaming a viable environment and reminding me why consoles have eaten half your gaming lunch.

 

 

WordPress adventures

WordPress adventures

So, in case you didn’t notice, I updated my website’s look and feel.  While I was at it, I upgraded to the latest version of WordPress (v3.4.1) from my pretty ancient version 2.? version I installed years ago.  My, how things have improved.  It all went pretty smoothly, but there were some good ‘gotchas’ that I wanted to make note of.

Tips:

  1. Start from a template – The best way would simply to take one of the supplied ones and start modifying – as they are considered the canonical reference designs.  I started from one from a great web design guy who has won numerous awards.  He provides his ‘blank’ theme as a zip, along with his handy and time-saving tips to get the job done faster.
  2. Don’t touch the php files until you’re at finishing touches!  Everything you probably do should be in the style.css file – Your temptation again and again will be to modify the HTML code in the header.php/footer.php/index.php/etc files.  DON’T do it.  Use the style.css code to do what you need.  Most of the templates have everything you need in them already – you just need to modify their appearance via their style.css information.  Reasons?  Most of the code in the canonical templates has been tested extensively on many different browsers and have stood the test of many trials.  Yours has not.  Anything in those files is forever static – no matter how your page is used.  Single.php is used in several places – and in different formats.  Futzing with anything other than the styles will likely break things.
  3. Do all your development locallySet up a local XAMPP server and develop your theme locally.  Get everything working right – then publish.  Saves you TONS of time and gives you experience installing wordpress.

Special notes:

  1. Syntax error, unexpected T_VARIABLEon 1and1 hosting– When I installed my new, pristine version of WordPress on my 1and1 hosting, I got this error.  I had done this before without issue, but then I found this forum discussion on the topic.  Turns out 1and1 hosting hadn’t updated their PHP version.  Add a .htaccess file to your root directory with only this inside :
    SetEnv PHP_VER 5
  2. This does not appear to be a WXR file, missing/invalid WXR version number when exporting/importing from old WordPress version.  I upgraded from an old 2.x version of wordpress to 3.4.1.  I exported just find and got a nice, big .XML file with all my posts in it.  When I went to import it though, I got that error.  Turns out the old versions didn’t put the version number in the file when exporting it.  I simply opened up the .XML file, and added the following line near the top.
    <wp:wxr_version>1.1</wp:wxr_version>
    Everything imported like a champ.

There were lots more notes, but I’ll save those for another time, as these were the big ones that took some digging around.

Can’t rip in Windows Media Player

Can’t rip in Windows Media Player

Oh – yet another way in which Microsoft has made my, and others’, lives much more easy.

Problem:
You open Windows Media Player, and try to rip a CD, but it won’t rip despite the fact you’ve done this dozens of times before.  You get the message ‘Windows Media Player cannot rip one or more tracks from this CD’.

You open Tools->Options->Rip Music.  You see that the ‘Rip music to this location’ is blank – so you click ‘Change’ to set it.  But nothing happens.  Click, click, click.  No dialog opens to allow you  to set the output directory.  Any time you try to rip the CD, you get the same error saying it can’t rip.  You try running the Troubleshooting app and reset all the user settings to default.  Still no luck.


Solution:

The problem is caused because the drive and/or directory media player had been pointing to no longer exists, and the change directory button doesn’t work IF THE ORIGINAL DIRECTORY OR DRIVE IS GONE.  Too bad you can’t change where it is pointing at.  Too bad you also can’t even see what it THINKS it should be pointing at to recreate it.  Guess you’ll just have to remember the path from memory.  Shucks – that’s great design.

You either have to re-create that directory (from memory) – or do THIS highly intuitive operation to fix it:

1. Start menu -> right click ‘Music’ and get the properties.

2. Either: see what directory has a checkmark by it and re-create that directory/re-attach the drive, or add/pick a listed directory that DOES exist – (i.e c:users”your user”)

3. Right click on a directory that does exist, and select  ‘Set as default save location’

Close and reopen media player.  This will solve the problem.  The fact that clicking on the ‘Change’ button doesn’t work is just fundamentally broke.  That needs fixing.  Also, fix the automated troubleshooter to actually reset the default location back to something sane too. The troubleshooter is broken as well.

Sigh.