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

Sunday, November 23, 2008

iTunes Music Stuttering Issue

Very recently I encountered this problem with iTunes. I was running iTunes v 7.6.0.29. I was syncing my iPod classic 80 Gig fine for almost 6 months, after which I connected my new iPod Shuffle – that is when I noticed the problem. All the songs in my iPod shuffle played like a bad CD with garbled noises and kept skipping all the songs after trying to play it for a couple of seconds.

I then realized that even while playing the songs right from iTunes had the same problem. ALL my songs, which were earlier working fine, now did not, EXCEPT one particular album, which I had ripped myself from the audio CD.

I tried to remember what could have possibly caused this to happen. Maybe it was connecting another iPod device? Maybe not, I have seen people do that before without a problem.

I then remembered that I had installed Winamp just a couple of days before, after which I opened iTunes only to connect my shuffle. Maybe that installation messed up things?

I was unsure. So here are the steps I took.

  1. Tried uninstalling Winamp, did not help.
  2. Pounded the internet for fixes, looked almost everywhere and every post spoke about changing the Quick Time Player properties – tried that but nothing worked. I desperately tried setting different combinations of output rate, sample rate etc. but nothing worked.
  3. People had suggested it could be because of insufficient RAM, since iTunes has a reputation for hogging CPU for its “CoverFlow” view – but that was impossible, Mine had 3 gigs of RAM, besides, the CPU usage when running iTunes was, on an average, only about 3-4%.
  4. I then resorted to System Restore as it was driving me crazy. I tried restoring my system to as early as 3 months back – still NO DIFFERENCE!
  5. Luckily it was a Friday and I had the weekend and I decided to devote as much time to it as it takes. I backed up my songs and fully formatted my disks and got my OS reinstalled.
  6. I then installed all my onboard device drivers and then iTunes and tried playing the songs – STILL DID NOT WORK. I was totally stumped!
  7. With absolutely no other ideas in hand, I aimlessly surfed the net for some clue and stumbled upon one link where the user mentioned that sound card drivers could be a possible issue.
  8. I then searched if any sound card upgrades were available for my Intel motherboard – there was one and I downloaded and upgraded to it.
  9. This time when I tested, I loaded music from a different collection as I childishly felt that the other songs were probably jinxed. But to my surprise it WORKED! All newly added songs played smooth! And when I tried to play the old files, they stuttered. So they were jinxed in some form indeed!
My conclusion was this – the music files that initially played bad in iTunes – is damaged forever. So if you are testing any of the fixes, remember to use new music files each time.

Also I noticed yet another thing – When I tried to play music in the default windows Media Player on my newly installed Windows XP system – almost all of them caused Media Player to raise this warning – The file you are attempting to play has an extension (.MP3) that does not match the file format. That explained a few things. Plenty of my files were badly encoded mp3 files, which regular players like Winamp plays without even a warning.

Some files played fine when I clicked Yes, but some played bad even in WMP! I then took aside the files that played fine in WMP and renamed the extension to .wma and tried playing it in WMP and this time the warning went off and it played fine. So a bunch of files I had were actually .wma files with just their extensions changed to .mp3. No wonder iTunes struggled.

I am glad it works for me now, but I am still inconclusive on what exactly could have caused this problem in the first place. Anyways, I am just posting this for people who might want some ideas to try out. Trust me, I know how frustrating the problem is!

Saturday, November 22, 2008

ASP.Net Impersonation Issue

A month ago a colleague came with a strange problem. They had deployed their website into production environment and was using a newly created user account for impersonation. The problem was the site would not authenticate the user and impersonation fails. However, if the user is made as an administrator, it works fine.

Apparently, the company policy does not permit such user accounts to be given admin rights.

No one from the dev team has access to the production environment and the deployment is done by onsite support guys. That is how things work here. The support people report issues and we give them different solutions to try out until the issue is fixed.

So when it came to me I did exactly the following:
I created myself a sample page to host on my local IIS
Created a test user account to play with
Pound the MSDN for some clue

I started by revoking all rights and permissions from the user account and went up stone by stone. Incidentally I stumbled upon this link: 
http://msdn.microsoft.com/en-us/library/ms998351.aspx which saved my day.

You need not make the user an Administrator, but just need to enable the “Log on locally” right.After enabling the Logon Locally right to the user, the impersonation worked like a charm.


Quoted from the link:

"You can impersonate with the returned token and check which Windows groups the user is a member of. Whether you can access local resources or network resources depends on the logon session type that you request (you specify the logon session type in the third argument of LogonUser). The most commonly used logon session types when calling this API are the following:

Interactive logon: If you need to access remote resources, request an interactive logon session. This results in a logon session that has network credentials. The user account passed to logon user must be granted the Log on locally user right.
Network logon: This establishes a logon session with no network credentials. This means you can impersonate the token and access local resources only. The user account passed to logon user must be granted the Access this computer from the network user right. By default, all accounts have this right because it is granted to the Everyone group."