I have installed RetroPie in my B+, but when I play a game, the sound cracks. I have connect my speakers using 3,5 mm jack.
There are three solutions for this:
Make sure your Pi is getting enough power. This is the most common problem with Raspberry Pi's, because they don't come with a standardized power supply. Just make sure you are using a thick and short cord, and not a thin and long one like phone charging cords.
Pulseaudio. Pulseaudio is a package for the RPi that significantly increases the quality of the audio. Follow this tutorial.
Buy an external USB sound card. This is what I do, just because I needed to record things and the RPi's audio jack is not capable of input. I use this card, it is very cheap at $3 and the quality exactly the same as the audio port on my Macbook.
If others are having this problem on a Raspberry Pi 1: Upgrade your firmware with
rpi-update - see https://github.com/raspberrypi/linux/issues/128
That reduces the number of cracks to 1, on the first use.