Sound lag in pygame on Ubuntu - a solution

I had a problem with lag in sound effects from pygame (on ubuntu).

The solution is:
 apt-get remove pulseaudio
 apt-get install esound


(log in to comment)

Comments

Cool, I'll have to try it out. The solution I used was:

    pygame.mixer.pre_init(11025, -16, 2, 256)

I seem to remember this had some issue, but I can't remember what.
Anytime you mess with the mixer it isn't always cross-compatible with other computers - I believe one setting works on windows while another for Linux :S
But then again, it has been years since I messed with it, so...
Ah, I found the old thread:
http://www.pyweek.org/d/2702/

Apparently if you set the sample rate too high and the buffer too low, the sound quality gets scratchy. 11025 and 256 works pretty well for me, and nobody gave me any feedback that it was bad. But who knows.