To get an idea of what api calls are happening around the freezing, you could try running your program under strace, or attach to it while it's running using `strace -p`. It may not help much, but it's easy to do and could provide insights for future improvement.
-Casey On Mon, Apr 25, 2011 at 9:41 PM, Dylan <[email protected]> wrote: > I strongly suspect at this point what is causing the freezing might be the > background music. I never had issues with crashing and freezing unexpectedly > with either library until I added background music in pyglet. I don't know > why pyglet would have issues with that, but I do have an idea why it could > with pygame and pyglet at the same time. I found that pygame's sound module > can be easily used in a simple program without a gui, and it doesn't seem to > affect the program much, but maybe by using the functions specifically for > music, which is streaming, it could lead to the deadlock which seems to be > what freezes my program. It would make sense since it's the most obvious > continuous thing I'm using outside of pyglet, and although it doesn't > directly use the pygame main loop, I would not be surprised if it used its > own thread or something. > > What I really want to know now is how to get joystick support and music from > pygame without these issues. Though I would still appreciate a second > opinion on what's causing the problem in the first place because this is > just all a guess. Even if I don't get either to work for this particular > game, I'd like to be able to get this combination to work for later programs > I work on. > > On Sat, Apr 23, 2011 at 2:07 PM, Dylan Reimer <[email protected]> wrote: >> >> On 04/23/2011 04:18 AM, Richard Jones wrote: >>> >>> On Sat, Apr 23, 2011 at 12:26 AM, ssnake<[email protected]> wrote: >>>> >>>> Hello, I've been using Pyglet lately to make a game, but I keep >>>> getting these freezes for no apparent reason if I leave it on for more >>>> than a few minutes it seems. I've eliminated everything I thought >>>> could be causing them but it has not stopped them. When it happens I >>>> can still move the window and I don't get an exception, but I hear no >>>> sound, nothing gets drawn in the window, and it does not react to >>>> input. I thought it could have been caused by using pygame's event >>>> loop along with pyglet's for the joystick support, or pygame at all, >>>> or running the game through Geany, but even with all disabled I still >>>> get the problem. I do still use pygame for sound however, and I almost >>>> always have Firefox on with Flash at the same time. I really would >>>> like to remove this bug before I have to present my game in less than >>>> a month. >>> >>> There's some information missing from your post :-) >>> >>> What version of pyglet? What version of Python? What operating system? >>> Are your video card drivers up to date? >>> >>> What does your application do? It seems to incorporate pygame as well >>> as pyglet. In what way exactly and how do you manage their separate >>> event loops? >>> >>> You mention futex_wait_queue_me in your followup message - Google >>> searching implies you're running on Ubuntu, and you seem to not be >>> alone: http://ubuntuforums.org/showthread.php?t=1517043 >>> >>> >>> Richard >>> >> Yeah I thought of including that only after I posted it. I'm on Linux Mint >> 10, using Python 2.6, Pyglet 1.1.4, and Pygame 1.9.1. So you were pretty >> much right that I was using Ubuntu. I last upgraded my video drivers like a >> couple weeks ago or so, because I was using the Gallium3d drivers for a >> while but it they gave me issues so I switched back to radeon. >> >> My application is a game that uses pyglet for graphics, keyboard input, >> the main event loop, and the resource module. I use pygame mostly for sound >> now, as well as code for joystick support, but I commented out all of it >> because I thought it was causing this problem. I only use pygame in two >> files so far, which I put links for below. >> >> The thread about futex_wait_queue_me seems to be saying it's about threads >> reaching a deadlock, which makes me think it might still be from pygame. I >> don't know much about threads, but I could imagine that pyglet on its own >> does this somehow too. I started using pygame for joystick suppport and >> audio because on #pygame they seemed to say that was a good idea, and I was >> having issues with pyglet audio where it would crash randomly when I loaded >> sounds. I also didn't like how all the drivers on Linux have major >> limitations with pyglet audio. >> >> Actually now that I think of it maybe what I should do is move where I put >> pygame.mixer.init() at the beginning of soundManager.py, but I'm not sure if >> that's really affecting anything, just a thought. >> >> main.pyw: http://pastebin.com/YFRN9ydK >> soundManager.py: http://pastebin.com/5SBspjY5 > > -- > You received this message because you are subscribed to the Google Groups > "pyglet-users" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/pyglet-users?hl=en. > -- You received this message because you are subscribed to the Google Groups "pyglet-users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/pyglet-users?hl=en.
