pygame is sharing code with you

Bitbucket is a code hosting site. Unlimited public and private repositories. Free for small teams.

Don't show this again

pygame / pygame http://pygame.org/

Clone this repository (size: 15.4 MB): HTTPS / SSH
hg clone https://bitbucket.org/pygame/pygame
hg clone ssh://hg@bitbucket.org/pygame/pygame

Issues

#83 mixer.quit() very slow

Reported by weeble

Pygame takes over 2 seconds to quit for me, and pretty much all this time is taken in mixer.quit(). This is pretty frustrating when starting and stopping my game a lot for debugging.

>>> import pygame
>>> from time import time
>>> pygame.init()
(6, 0)
>>> t1=time();pygame.quit();print time()-t1
2.15260004997</code>
>>> pygame.init()
>>> t1=time();pygame.mixer.quit();print time()-t1
2.28296613693
>>> t1=time();pygame.quit();print time()-t1
0.00190806388855

I don't think I get this on Windows, only on Linux, although I only have a Linux machine to hand right now.

I'm running on Ubuntu 10.10. SDL version is 1.2.14. I built pygame from the hg repository today and still see this behaviour.

$ uname -a
Linux dischord 2.6.35-30-generic <<issue 59>>-Ubuntu SMP Tue Aug 30 19:00:03 UTC 2011 x86_64 GNU/Linux
Status: resolved Responsible: nobody Type: bug Priority: major
Milestone: none Component: mixer Version: Development

Attachments

No attachments added for this issue yet.

Comments and changes

  1. #1 illume

    written

    • Changed status from new to wontfix.

    Hi,

    this is an SDL issue. I can't find the sdl bug link, but I know it has been fixed by SDL.

    You should be able to try using a different audio driver to see if that helps?

    You can try putting one of these in your .bash_profile perhaps one of them will solve the problem for you.

    export SDL_AUDIODRIVER=alsa
    export SDL_AUDIODRIVER=dsp
    export SDL_AUDIODRIVER=null
    export SDL_AUDIODRIVER=pulseaudio
    

    cheers!

  2. #2 weeble

    written

    I hunted down that bug. It sounds like it's actually a PulseAudio issue. These links might be helpful for anyone else experiencing this and wanting more info:

    http://bugzilla.libsdl.org/show_bug.cgi?id=1013

    http://pulseaudio.org/ticket/866

  3. #3 Lenard Lindstrom

    written

    • Changed status from wontfix to resolved.

    Fix unit test execution for Python 3.2 ( closes #83 )

    The pygame.tests.testutils.async_sub module sets the stdout pipe to O_NONBLOCK. Yet for linux a pipe set as O_NONBLOCK returns immediately from a select call, even with nothing to read. This mucks up the Python 3.2 pipe read, which expects something, and fails (a bug) when there is nothing.

    Setting a socket to O_NONBLOCK is a good idea. A remote connection may have a transmission error, which may trigger the select statement to return, but subsequently invalidate the data so 0 bytes are returned on a read. But a pipe, in this case, is inter-task; there should be no transmission errors. Therefore the O_NONBLOCK should be unnecessary, and safely removed.

    b34a4220db7b

Add comment / attachment

Verification: Please write the text from the image in the box (letters only)

captcha

Is that you, Humanoid? Is this me?