Not sure where to lay blame for the static/popping I'm getting so figured I'd post and see if anyone may have an idea...

Recently, I decided to upgrade a few movies in my media server to something with better quality, but being limited on space I've been using VidCoder to shrink stuff down in size to something that has good quality and a decent size.

I'll take a 16GB (more or less) 1080p movie (mkv/mp4) and usually it has DTS. I don't have surround sound, and DTS is a big chunk of space, so when I use VidCoder to convert down to about 4GB (3000-4000kbps) I take that 5.1DTS track, and I make 2 audio tracks with it.
1) AAC - Stereo 2.0 - 320kbps - Sample rate same as source
2) AC3 - 5.1 - 640kbps - Sample rate same as source
I'm very happy with the end results, audio and video seems fine, and although no surround sound I wanted to keep the 5.1 for a day when I do have it. I run the movies through my PC to my Sony Bravia 40" TV, using XBMC media centre.

Thing is, I'm not 100% certain if it only happens on these files, I think I've heard it happen on others as well. Reason I bring all this up is, when I play the movie and it hits a loud spot I'm getting popping/crackling in the audio. I look, see it's set to 5.1 so switch to 2.0 and not a single problem. Same audio source when converted, same file, same part of the movie, switching to stereo fixes the issue.

So, trying to figure out... is it the TV? XBMC? or should I use different settings for the 5.1 when converting?

It's not often it happens, and only at peak points in loud spots so, hard to just toss a movie in and know if will/won't do it. But, off-chance someone may know what causes such a thing I figured I'd ask.