I think it's an issue with the playback engine. I have an LE40B655 that tend to show similar audio gasps. It's not the AVI files. I've actually ripped a couple of DVD's myself. Latest stable LAME for VBR MP3 audio, latest stable Xvid MPEG-4 ASP for video, and final mux made with latest VDubMod, which is also more or less de facto standard.
On computer these files play fine, but when played over USB stick / external HDD through the television, it's another story. Most of the times, they play fine, but still, issues may occur.
I'm pretty convinced that it has something to do with the "interleaving" that AVI files audio/video tracks are based on. Somehow one or more interleave phases are lost in translation, or something like that. I've actually managed to "reattach" the sync by fast forward/rewind-ing just a little bit.
I also have a cheap(!) stand-alone player which handles AVI (only). After pressing play on a 700MB AVI file it will start some sort of pre-load, with a hourglass symbol showing for a couple of minutes, before the playback starts.
I guess/assume(!) that this machine is pre-rendering slash indexing the entire file before playback starts, hence the delay. However, I've never(!) experienced audio sync issues on AVI files with this garbage(!) stand-alone. On my Samsung television set, there is hardly any delay for playback to start, a second or so, tops. Supposedly, Samsung tv sets do interleaving / indexing like more of a "on the fly" event, hence the possibility for errors.
Guess we'll have to suffice for better or worse, or perhaps hope for someone from the Samsung tech group to stumble through this thread, realize facts, and throw us a decent f/w upgrade.