Showing posts with label windows media player. Show all posts
Showing posts with label windows media player. Show all posts

Tuesday, August 19, 2008

Workaround: Windows Media Player sound cuts out when Cisco VPN client v4.x is active

I had the opportunity to work from home today.  It was nice to change up my routine and get a good bit of mostly-uninterrupted work done.  The best part was probably getting to spend a full hour at lunchtime having lunch with my wife Melissa and my kids!

I did run into two issues during the course of day, though.  One was that the Charter cable modem service decided to go out for an hour or so in the afternoon (and the VOIP phone service along with it); there wasn't much I could do about that aside from work offline and wait it out.

The other issue was a strange one; while listening to mp3s on my local C: drive in Windows Media Player 11 (WMP), the playback would work fine for a minute or two, but then the sound would cut out.  The song would still apparently be playing (as evidenced by the track position slider continuing to advance), but I'd get only silence from my speakers or earphones.  Sounds from other Windows apps would still play as normal.  If I clicked Stop and then Play in WMP, or Previous Track / Next Track, the sound would come back for another minute or two, and then cut out again.  This behavior happened regardless of whether WMP was minimized or not, or whether it was in full mode or skin mode. 

I also noticed that when the sound playback cut out, the wmplayer.exe process (the Windows Media Player process) would peg the CPU it was running on; I could see in Task Manager that one of the two CPUs (on my dual-core machine) would go to 100% utilization, with wmplayer.exe accounting for 50% of my overall CPU usage (100% of 1 of the 2 CPUs).  If I stopped the playback or brought the sound back by clicking Previous Track / Next Track, the CPU utilization would go back to normal (less than 5%).  I tried pointing SysInternals' Process Monitor at wmplayer.exe while WMP was in the "pegged" state, but it didn't turn up any errors or any behavior that I could readily identify as unusual.

Since I use Windows Media Player on my laptop docked at my desk at work every day, I figured that the problem was probably related either to working with the laptop undocked, or else had something to do with my VPN connection to my office's intranet.  I ended up just getting out my iPod and listening to my music on that instead as a workaround.

At the end of the day, though, I came back and investigated the issue.  (It just bugs me when something on my machine isn't working the way it should be!)  Various Google web searches for combinations of terms including "windows media player", "100% cpu", "sound cuts out", and "vpn" didn't turn up anything useful, but when I searched for "vpn" on the microsoft.public.windowsmedia.player newsgroup, I came across what turned out for me to be the key to the solution: a 2005 post by "bsmaloney" describing nearly-identical behavior to what I was seeing.  bsmaloney didn't post a solution, but he mentioned that he was using a version 4.x Cisco VPN client.  This is what I was using as well!  It hadn't occurred to me up to that point that the problem might be attributable to a specific vendor's VPN implementation, rather than the fact that I was connected via a VPN in general.

I went back to Google and searched on "windows media player" vpn cisco, and sure enough, the #1 result was a Cisco VPN client release notes page listing that an issue related to Windows Media Player playback had been fixed in version 5.0.00.0340 of the Cisco client.  The release notes also mentioned that the problem would occur when either the SRS WOW or Graphic Equalizer were enabled.

It wasn't an option for me to upgrade to version 5 of the Cisco VPN client, since the standard at my office is still the 4.x version.  However, I checked in WMP, and I did in fact have the Graphic Equalizer enabled.  I turned that off (View menu | Enhancements | Graphic Equalizer), and playback has been working fine since then!

As a side note, the Cisco release notes page refers to the bugs it describes as "caveats."  I thought that was kind of cute.  "Defects" and "issues" I've heard of before, but the using term "caveats" to describe software bugs was a new one on me!

Friday, May 30, 2008

Control Windows Media Player with the ThinkPad Play/Pause Keys

Quick tip for ThinkPad owners: the media control keyboard keys located on the arrow keys at the bottom-right corner of the keyboard can be used to control music or other media playing in Windows Media Player (WMP) even when WMP isn't the foreground application! 

ThinkpadMediaKeys

To use these keys, hold down the blue "Fn" key at the bottom-left corner of the keyboard, and press the appropriate arrow key.

With these keys, I can have music playing in Windows Media Player in the background (or in a minimized window), and be working in other applications in the foreground.  Then, when I get interrupted and want to pause my music (when the phone rings, or when a visitor arrives at my desk), instead of having to open the WMP window and click on the Pause button, I can just quickly push Fn + Play/Pause (the down arrow key), and my music is paused.  Another press of Fn + Play/Pause, and my music starts playing again.  Quite handy!

Monday, December 03, 2007

Finding album art quickly

Here's a quick series of steps that can be taken to find album art for an album (music CD) to paste into Windows Media Player or iTunes:
  • Open up Google Image Search. (Follow that link, or go to the Google.com main homepage and click the "Images" link there.)
  • From Google Image Search, search on the album name. (If the album name is something generic, try entering both the album and artist name in the search field.)
  • Click on one of the image results where the image size is a square and isn't tiny (e.g. 200x200).
  • If the image isn't immediately visible on the page that comes up (or even before the page finishes loading, if you don't want to wait), click the "See full-size image" link that Google puts at the top of the page.
  • Right-click the image and select the Copy option from the context menu that appears to put the image on your clipboard.
I found these steps useful when setting up my small music library in iTunes for the first time recently, having purchased my first iPod. These steps worked for even some of the non-mainstream CDs in my collection, such as Michigan Marching Band CDs and Black Mages CDs.

Sunday, September 09, 2007

Schneider's Eleven - New skin for Windows Media Player

Over the past week, I've created a new skin (theme) for Windows Media Player. I call it "Schneider's Eleven" -- more on that below.

For a while now, I've wanted a skin for Windows Media Player that meets the following two criteria:

  1. Unobtrusive. I wanted something that I could leave visible in a corner of the screen all the time which wouldn't draw my eye with scrolling text or other graphical animations while I'm concentrating on other tasks.
  2. Informative. Many "minimal" skins do not display the album, artist, and track name of the currently playing track, or alternate between displaying those values; I wanted a skin where all of those values would be visible at a glance.

None of the default skins included with Windows Media Player meet these criteria, nor does the main Windows Media Player 11 interface in its "compact mode". I'd poked around on several occasions for such a skin, but I couldn't find one on Microsoft's official skins site or elsewhere.

I did a little reading about Windows Media Player skins, and found that WMP skin files -- files with a .wmz extension located in the Program Files\Windows Media Player\Skins folder -- are actually just renamed .zip files. This means that it is possible to inspect the implementation of any existing skin by uncompressing and looking at the files in the skin's archive.

I had previously assumed that skin files were created using some difficult-to-learn proprietary language, but as I found by looking at existing skins on my system, I found that the layout and behavior of WMP skins are defined in standard XML and Javascript code. Once I discovered that, I set out to create my own skin that would have the design and behavior that I wanted.

I was able to implement the new skin by learning by example from the skins already on my system. Between inspection of the source code of the Microsoft skin "9SeriesDefault" (internally named "Corona") and a skin I had previously downloaded in my earlier search for a suitable skin named Basic6, I was able to write 95% of the implementation for my new skin; the remainder I was able to get from Microsoft's skinning reference at MSDN.

The UI layout of the new skin was inspired by the TrackInfo pane of the Basic 6 skin, written by Richard Kohut, which featured display of all of the information I wanted (album, artist, track name), plus display of the album art for the album, a cool touch. For the play controls of the UI, I created a reduced-size version of the standard Windows Media Player 11 interface -- thus the name for the new skin, "Schneider's Eleven".

Schneider's Eleven UI

To my surprise, the technique for displaying the album art in the skin doesn't appear to be documented anywhere in the MSDN online documentation -- or anywhere else on the WWW that I could find! The key is setting the background image property of a subview element in the skin to the constant string value "WMPImage_AlbumArtSmall". At the time of this writing there is only a single result returned in a Google search for WMPImage_AlbumArtSmall (and that result is a long discussion thread in Japanese which I can't read)! As I mentioned, I find this really surprising -- is there another way to put album art into a skin; or else maybe the technique for putting album art in a WMP skin is still little-known, or maybe there just isn't a lot of discussion of WMP skinning out there? I'm not sure at this point. In any event, if you are a skinner looking to put album art into your skin, by all means download a copy of Schneider's Eleven and take a look at the source to see how I did it.

Doing the same search in Google News currently returns 4 results, one of which is a post to microsoft.public.windowsmedia.player.skins by "Stevie BM" describing a technique to work around an issue with album art not being sized properly when displayed in a skin, which I took advantage of in my skin. Thanks Stevie! It's always very cool when someone, having found a solution to a tricky problem, takes the time to follow up and let the community know about the solution, rather than just silently implementing the solution without letting anyone else know about it.

If you'd like to download a copy of the Schneider's Eleven skin, follow that link to my web site for the download link. Feedback on the skin would be welcome!