Tuesday, August 30, 2011

Counter Strike Source crashes on launch after Migrating from Vista to 7

problem: After migrating from Vista to 7, CS:S no longer launches

You have Migrated from Vista to 7. I personally chose to clean install 7, as my games and other personal files are located on different hard drives.

When your system is ready for gaming, you load Steam, and when you try to launch CS:S, you see that hl2.exe launches but quickly dies. The game does not actually load 3D mode, so its not a crash to desktop, it just bails out on launching the hl2.exe while still on the desktop.

solution: force resolution and DirectX level

In the Counter Strike Source game properties, from the Steam games list, set the launch options as follows:
-dxlevel 90 -w 1024 -h 768
This should force CS:S to sort things out, with whatever is causing it to crash on launch. You can set your preferred settings in-game, quit the game, remove the launch options and then test to ensure everything is back to normal.

It is possible that my issue was specifically with CS:S remembering the wrong display adapter reference, perhaps it was not finding the reference to the previously known adaptor and getting its pants in a twist?

Its worth noting that the issue was CS:S specific in my case. Other hl2.exe based games work working fine.

Prior to trying this solution, I tried a bunch of other generic troubleshooting steps, including trying the -32bit launch option (given that I'm running x64 Windows 7). I also tried moving my existing cstrike cfg, to see if defaults would help. None of my attempts worked.

What MIGHT of worked, which I only learned about post finding the solution, was the -autoconfig launch option.

Feel free to read more about -dxlevel and -w -h launch options at the Valve developer community.
For specific info on dxlevel (mat_dxlevel) check out the Value developer community page for that cvar.

Successfully driving 3 DVI displays from a AMD/ATI 6970 GPU (Eyefinity)

problem: You cannot get 3 displays working on your 6970

  • You have three displays with DVI inputs.
  • You have a 6970 GPU.
  • Your running windows 7 (may apply to Vista and others).
  • You cannot get all three displays operational at the same time.
In my particular case, I was using the following hardware:
  1. Dell 3007WFP-HC (LG.Philips S-IPS).
  2. Dell 2407WFP (Samsung).
  3. LG L1980Q.
  4. GigaByte GV-R697OC2-2GD (ATI 6970 GPU).
Note, the Dell 30" requires Dual-Link bandwidth to display its native 2560x1600.
Note, the Dell 24" and LG 19" only require Single-Link bandwidth.

For reference, here is a diagram of my 6970 backplate connectors. Please note, the layout and types of outputs are manufacturer dependant. So one cannot say, this will be the configuration for all 6970 cards.

With my previous card, a Gigabyte ATI 5970, which has two DVI-I Dual-Link and a mini display port outputs.
I was using the two DVI outputs for the Dell's and an Apple mini Display Port to Analogue adaptor for the LG. This was the most cost effective set up that would drive all three panels at the same time. This worked well for me, because the LG 19" has analogue D-SUB and DVI inputs.
After a decent life, one of my 5970 DVI ports burnt out and left me no choice but to RMA the card. Gigabyte were absolutly amazing in handling my case and went beyond the call of duty to satisfy my requirements and concerns with the replacement card, the GV-R697OC2-2GD.

The new card came with two adaptors, a DVI to Analogue and a DVI to HDMI and a HDMI cable. There was no Display Port adaptor.

When setting up the new card and trying to get all my displays working, the first problem I came across was a limitation with the HDMI output and adaptor. As mentioned, all my monitors have DVI inputs, I have no native HDMI or display port inputs. So this meant using adapters to get things working... or at least that is what I thought.

ATTEMPT ONE, the Dell 30" would only display it's native 2560x1600 from the DVI-I output. I then had the Dell 24" on the DVI-D output these two together were fine. I then added the LG 19" output from the HDMI with the provided HDMI cable and used the DVI to HDMI adaptor connected to the LG.

PROBLEM ONE, with this set up, the CCC said I had to disable one of the monitors to get the HDMI output to display. Jokes. I guess this is a hardware restriction of some kind.
After a Google, I established that to drive 3 panels simultaneously, I needed to output using 2x DVI and 1x Display Port. OK. So another adaptor required.

Another Google led me to the most cost effective solution, a Display Port to Single-Link DVI adaptor. Note that the Dual-Link adaptors are _VERY_ pricey! I ordered a HIS Single-Link adaptor for ~20 EUR. Here is the HIS product page.

Note that Display Port does have the bandwidth for the native 2560x1600 of my Dell 30", however the adaptor was only Single-Link. So, the Dell 30" still had to be driven from the DVI-I output.

ATTEMPT TWO, Dell 30" driven from the DVI-I output, Dell 24" driven from the HDMI to DVI and the LG 19" driven from the Display-Port to DVI. NO DICE.
PROBLEM TWO, At this stage, I wonder if I'm hitting software issues with the ATI drivers. The Dell's would work fine and the LG would get a signal but would display a blank black screen.

ATTEMPT THREE, Dell 30" driven from the DVI-I output, Dell 24" driven from the Display Port to DVI and the LG 19" driven from the HDMI. SUCCESS. After some fiddling with the software settings, I stopped using the CCC and reverted to Windows 7 native display control panel, I got all three panels working simultaneously. Thank F.

Not satisfied that I'd exhausted all connection possibilities, I tried one more.

ATTEMPT FOUR, Dell 30" driven from the DVI-I output, Dell 24" driven from the Display Port to DVI and the LG 19" driven from the DVI-D. SUCCESS. Again, it seemed like using the native windows display control panel was more reliable than the ATI CCC.


I will be totally honest and say that I have NO IDEA why my ATTEMPT TWO did not work. In theory it should. Perhaps this is a software issue.

Good news, I do have two successful connection solutions. See attempts three and four above.
I hope the details shared here help someone with their own troubleshooting.

Sunday, August 28, 2011

My experience migrating GFWM (GFWL) from Vista to 7

First a bit of background, I had the horrible task of migrating from Windows Vista to 7 on my personal PC. I say horrible, because Microsoft don't seem to of thought things through for people with hardware and drive configurations outside the norm. I wasted a number of hours recovering my old Vista install and re-building the boot cfg to get everything working, however I will leave the details for another post.

So I had a few games under Games For Windows Marketplace, formally Games For Windows Live. I was wondering how I could avoid re-downloading the games/DLC again on my windows 7 clean install.

After a little trial and error I got things working and saved a bunch of time/bandwidth. I will focus on GTA4, which I purchased via Steam and subsequently purchased the DLC via GFWM.

This process could easily be streamlined, but I wanted to include everything. Please feel free to take your own approach to speed things up.

Note, Microsoft have updated the Games for windows client, so its now called Games For Windows Marketplace (GFWM). In GTA4, the GFW system is still called Games for Windows Live (GFWL).

UPDATE 2012-MARCH-10: I did a registry backup, then used the Games For Windows Marketplace to install one of the GTA4 DLC's. Then did a registry diff using Beyond Compare. Studying the diff revealed no specific changes related the DLC downloaded from the GFWM. So I'm very confident that all of the magic that makes the GTA4 DLC work via GFWM/GFWL, is located in the file/folder structure located at:
VERY IMPORTANT: If you change the location of your installed games, or DLC via the Games for windows Marketplace UI, it COULD delete any game content in the original location and perhaps even the new location. Make sure you have a backup of your content that is NOT located in your old or new content folders.
  1. Ensured I had a tested backup of my games and DLC.
  2. Ensured I had a tested backup of the following folders from my Vista install
  3. Sorted out my Windows 7 clean install, drivers, cfg etc.
  4. Launched steam, this is on a dedicated games drive.
  5. Launched GTA4, this did some "first run" steps.
    This included installing GFWL, though a very old copy.
  6. GTA4 launched, Social Club sign in etc.
  7. Signed in via GFWL, allowed the GFWL update to download.
  8. Exited the game, GFWL update ran.
  9. Loaded GTA4 again, issues with activation, GFWL crashing.
  10. Did a windows update on GFWL and it upgraded to GFWM.
  11. Launched GTA4 again, GFWL sign in worked.
  12. Launched GTA4 TBOGT DLC but save games were missing.
  13. Placed my backed up save games in:
    \Users\$youruser\AppData\Local\Rockstar Games\GTA IV\savegames\user_{some number}\
    Check that {some number} is the most recent folder created.
  14. Loaded GFWM (direct from Start Menu) and checked my Game/DLC status, it was not correct.
  15. I updated my GFWM settings with the ones from my screenshot from Vista.
  16. Exited GFWM.
  17. Deleted and Replaced the following folders on my Windows 7 install with ones from my Vista install.
  18. Loaded GFWM (direct from Start Menu) and checked my Game/DLC status, it was correct, settings were also still correct.
  19. Exited GFWM and launched GTA4.
  20. Signed in to GFWL.
  21. Entered my GTA4 key (available via Steam game properties).
  22. Everything works, save games were also as desired.
Props to:
Rjck @ Seven Forums.com for his post on save games

Thursday, August 11, 2011

Linux HOWTO: mount a UDF iso

problem: you want to mount a UDF iso

solution: mount -t auto

It is nice and simple's, after a Google, I found grando's blog post which explained a more permenant solution to said issue. Here is how I used his tip:
mount -t auto -o loop /path/to/my/iso.iso /mnt/myiso


Props to: amazingrando @ The Penguin Trail

Sunday, August 7, 2011

Automating addition of users to a DBM DB for HTTP auth

problem: the passwords you're generating don't work

  1. You're using one or more DBM DB's for storing HTTP authentication (authn_dbm_module).
  2. You want to automate adding users to a DBM DB.
  3. You want to use SHA1 passwords.
You're at a loss, as how to generate passwords that will work with automation.

impact: manual job to add users :(

Against the pragmatic principle of "Don't Repeat Yourself! (DRY).

solution: understand sha1 encryption for DBM and authn_dbm_module

One key bit of info buried in man htpasswd is the fact SHA1 passwords for DBM and authn_dbm_module are not salted. This does make life a little easier. However I missed this when looking for solutions and before looking at the source code of dbmmanage.

With something like the following in your script, you can automate adding users to a DBM DB:
dbmmanage -s $db add $user $password $groups
However, simply supplying a SHA1 password does not work. This is because DBM stores it SHA1 passwords as a base64 binary digest. More info about this over at CPAN.

So, in PHP for example, you could do something like the following to generate a valid password for your automation:
$enc_pass = base64_encode(pack("H*", sha1($password)));
Then you would use the $enc_pass for your automation :)

Further reading