--- Dirk Meyer <[EMAIL PROTECTED]> escreveu: > Gustavo Sverzut Barbieri wrote: > > --- Dirk Meyer <[EMAIL PROTECTED]> escreveu: > >> Gustavo Sverzut Barbieri wrote: > >> > Hello guys, > >> > > >> > I'm implementing MPAV (MPlayer Audio Visualization, > >> > http://gsbarbieri.sytes.net/mpav/) but I found some issues: > >> > > >> > - childapp.py: Sometimes poll() is called before the child > >> __init__() > >> > is finished, so many times it breaks because there's no t1 or t2 > >> > attributes (isAlive()). > >> > I solved this declaring "ready=False" as class attribute and > >> setting it > >> > to True at the end of __init__(). Then isAlive() must check if > it's > >> > ready. It's the right solution? > >> > >> No, I guess we should better find out why this happens. Do you use > >> ChildApp or ChildApp2? For ChildApp2 this shouldn't happen because > >> there is not thread to be a problem at this point. > > > > I'm using ChildApp2. I don't know its internals, just based my > usage on > > video/plugins/mplayer.py > > The problem is that sometimes it breaks in isAlive(), which > looks > > for .t1, which is not available. Browsing the code I see it's only > > created in ChildApp, which is inherited by ChildApp2 so the problem > > could just be there... To figure it out I put prints in the begin > and > > end of the constructor and one in isAlive, together with a > > traceback.print_stack(). Then I see "Constructor started. isAlive() > > called from poll(). Constructor ended" > > Do you start ChildApp2 from a thread? If so, do not do it, it doesn't > work. If not, I can't see the bug. The main threads starts Childapp2, > this one starts ChildApp, this creates the threads. Since poll() > should only be called from the main thread, the main thread can't do > it until the constructor is done and t1 and t2 are there.
I cloned video/plugins/mplayer plugin (video_mplayer) to audio/plugins/mplayer (now audio_mplayer) and took bmovl as mpav base. I don't start a thread myself, maybe the plugin system does? See the attached files. > >> > - The second issue is with stop_osd. I need to stop the osd, > since > >> my > >> > app uses SDL and can display in framebuffer and dxr3. I'm using > >> > ChildApp2 and leave stop_osd=2, so it must stop the osd when > >> > OSD_STOP_WHEN_PLAYING=1 but instead of just stop the osd, it > exits > >> and > >> > leaves mplayer playing! > >> > >> add some 'print' debug to see why. What do you mean with 'just > >> exits'? > >> Freevo stops? > > > > Yes, freevo stops. Quit. The only 'python' thread left is the one > that > > called mplayer. > > Strange, maybe it tries to restart the osd and crashes? In > childapp.ChildApp2, add some print statement at the stop and restart > osd functions to see if they are called correct. I already did, they're called, but then it exit. It doesn't crash, no error reported. Give me some explanation on how it works, then I could try to figure it out. What threads it stop, what else keeps running, ... > > > NOTE: I don't have LIRC, just the keyboard. Maybe it relies on > LIRC > > thread or something? > > No :/ Gustavo ______________________________________________________________________ Yahoo! Mail - O melhor e-mail do Brasil! Abra sua conta agora: http://br.yahoo.com/info/mail.html
mplayer.py
Description: mplayer.py
mpav.py
Description: mpav.py
