Tuesday, January 19, 2010

Windows 7: Media Player 12 audio lag / lip sync problems

Windows Media Player12 (WMP12) now includes it's own codecs for handling many media formats e.g. H264 (high def) and Xvid/DivX through the new Media Foundation Framework.  This means WMP will use its own codecs in place of any 3rd party ones you had up and running happily under Vista, such as ffdshow Tryouts the excellent 'one stop shop' solutions for a/v decoding http://ffdshow-tryout.sourceforge.net/.  Changing codec merit etc is fruitless.

I experienced lip sync / audio lag issues when playing AVI containers with MP3 encoded audio.  In order to resolve this issue I wanted to use the trusted ffdshow Direct Show filter to decode the MP3.  Using the 'Preferred Filter Tweaker', the various decoders can be set to either 'Microsoft' or your filter of choice.  The most important step for me is disabling Media Foundation for the desired file extension (.avi) to instruct WMP to use (ffdshow) Direct Show Filters instead.  Without this step, changing the decoder made no difference to playback.

http://www.codecguide.com/windows7_preferred_filter_tweaker.htm

Another  vital step is to edit the options under ffdshow audio, in the 'output' section select 'Connect to' -> 'Direct Show' and unselect SPDIF, otherwise the audio will be an inaudible screech. There is a notice to this effect when selecting ffdshow as the default encoder for MP3.

Using an alternative decoder fixed the audio sync problems.  To give the WMP12 built-in decoders a chance I uninstalled ffdshow completely leaving all the Microsoft filters selected as default, but disabled Media Foundation in Preferred Filter Tweaker, and this alone also fixed the audio sync problems with MP3 audio in AVIs.  To be sure, I re-enabled Media Foundation and sure enough the audio sync problems returned.  With it off the audio is sync'd nicely and all my media formats are playing well in WMP12.  I just can't give a satisfactory answer as to why simply disabling MF resolves the sync issue when I presume the same filters are still being used.

Windows 7: How to emulate Vista style sidebar for gadgets

To emulate a Vista style sidebar allowing windows to be maximised and leave the gadgets (widegets) on the screen (not to be confused with 'always on top'), a 3rd party gadget can be installed to mimic the desired behaviour: http://nes.bplaced.net/sidebar7.html

This means a portion of your desktop 'real estate' is dedicated to your gadgets, which for me, is the whole point of them and with wide screen monitors being so common on laptops most people are more than willing to give up a slice of their desktop for them.

Other solutions involve replacing the win7 sidebar.exe file with that from Vista but that approach may unintentionally create problems further down the line and is a rather nasty hack.

Friday, January 15, 2010

Windows 7: Scaling gadgets when changing DPI

I have a 16 inch laptop screen running at 1920 by 1080 pixels, and despite having very good eyesight I find in uncomfortable to use my screen for prolonged periods at its native resolution. Hence I make the text larger by changing the DPI setting for my display under Control Panel in Windows 7. There is an option titled 'Make it easier to read what's on your screen'. This works better than ever in Windows 7.

However, in running in any mode over 100% (I use 125%) Windows automatically scales up its own gadgets accordingly, something which didn't happen under Vista. In order to retain the aesthetic integrity of the widget the whole thing is 'zoomed' or magnified to the new size resulting in a slightly soft or fuzzy widget. However, many of the 3rd party widgets don't scale automatically in the same way, so if you like to line up your gadgets down one side of your screen sidebar style, then they look terrible as they're different sizes. Not to mention the soft effect caused by the scaling. My personal preference is that the Windows gadgets are not scaled automatically and instead are shown at their original size for the native resolution. That way all the gadgets will match in size as well.

In order to disable the automatic scaling of the Windows 7 gadgets when you modify your display DPI you will need to create your own very slightly modified copy of the gadget. Here's how.

1) Take a copy of the gadget folder found here C:\Program Files\Windows Sidebar\Gadgets and paste it into a folder in Documents
2) Within the gadget folder structure you will find a file named gadget.xml which you need to edit in notepad. Taking the Calendar gadget as an example, you will need to modify Documents\Calendar.Gadget\en-US\gadget.xml
3) At the top of the file change the name of the widget e.g.

<name>Calendar</name>

to

<name>Calendar No Scale</name>


4) Next find a line referring to the auto-scaling, and change 'true' to 'false'

<autoscaleDPI><!--_locComment_text="{Locked}"-->true</autoscaleDPI>

to

<autoscaleDPI><!--_locComment_text="{Locked}"-->false</autoscaleDPI>

5) Save the file and close it.
6) Modify your folder options in Explorer under Organize and untick 'Hide extensions for known file types'
7) Create a New Compressed (zipped) folder in your Documents outside of the gadget folder structure. Copy and paste all of the files and folders from INSIDE your gadget folder into this new zip file.
8) Rename the zip file to anything you like but most importantly remove the .zip extension and replace it with .Gadget
9) The icon representing the file and 'file type' should change to show 'Windows Gadget'
10) You can now double click this file, select 'Install' and the gadget should appear at its original size without any scaling.
11) You can uninstall this gadget just like any of the others, and you are not modifying the original gadget, instead creating a new copy so no harm can be done to your original system files.

First Post at Already Solved

The idea behind this blog is simple. To document solutions for some of those more frustrating or unusual tech related problems/issues I come across in my daily life as an IT professional - and there seem to be many!