Bad, bad behavior of Rev2.9/3.0 with Mplayer

Deploying to Linux? Get penguinated here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
astroboy
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 30
Joined: Wed Apr 09, 2008 8:05 pm

Bad, bad behavior of Rev2.9/3.0 with Mplayer

Post by astroboy » Sun Sep 07, 2008 2:15 am

A lot of times, when I switch to another stack (sort of "go to card x of anotherstack") the stack freezes, with no apparent reason.

After a while, I realized what's going on.

Let's say that you have two players in a card. They are started via buttons that contains "start player...". When leaving this card (going to another card in the same stack, or to a card in another stack) the players must be stopped, so I put on closeCard a list of players of the card that should be stopped:

stop player whatever
stop player uglyStuff

If only one player is playing, no problem. Revolution happily closes it. But the problem arises when 2 or more players are playing...

Going to another card while 2 or more players are working, causes that only one player is closed, the other(s) will remain open as processes, as reported typing 'ps -aux' in a terminal. Sometimes it's not needed to leave a card while 2 or more players are working, Rev only closes one and the others are left opened, even when they finished playing.

Going to other cards in the same stack and playing their own players causes no issues, the problem could go undetected. The problem arises when the app tries to go to a card located in another stack: the app hangs. If I kill the non-defunct mplayer process in a terminal, the app comes back to life!

Since this bug seems to be caused by bad management of Revolution of multiple players playing at one, I designed a script as a harsh fix to this behavior.

on closeCard, I request stopping all the players contained in a card, no matter if they are playing or not, and then invoke the procedure cleanMess:

...
stop player whatever
stop player badStuff
cleanMess
...

cleanMess in the stack script contains the following:

on cleanMess
if the platform is "Linux" then
get shell("ps -ef | grep mplayer | awk '{print $2}' | xargs kill")
end if
end cleanMess

This allowed me to get rid of the freezes in my app, and also avoid getting undesirable processes open.

This seems to be a Linux-only related problem, tested my app on Mac OSX and no problems there, and I guess that the Windows folks don't have these problems either.

Buggy, buggy, bad, bad... :cry:

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Sun Sep 07, 2008 8:43 am

Atroboy,

This is not the place to report bugs. Only bugs entered in http://quality.runrev.com/qacenter/ are noticed by RunRev Ltd.

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Bernard
Posts: 351
Joined: Sat Apr 08, 2006 10:14 pm
Location: London, England

Post by Bernard » Sun Sep 07, 2008 8:43 am

http://www.runrev.com/support/quality-control-center/

Please take the time to register this bug at the quality control center. Unless people keep raising bugs against the Linux version it will always lag behind and be more buggy.

Let's make Rev a better tool for Linux.

Bernard

astroboy
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 30
Joined: Wed Apr 09, 2008 8:05 pm

Post by astroboy » Sun Sep 07, 2008 9:46 am

Hi Mark and Bernard

Oh, I was already registered to Quality Control Center. Nevertheless, I comment about these issues before posting there just to be sure some other users can confirm this behavior, and to discard the possibility that this could be some hardware o distro related issue. Also, I posted here in order to share the workaround that worked for me, and to find if someone would have a better approach to it.

Best Regards,

Astroboy

astroboy
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 30
Joined: Wed Apr 09, 2008 8:05 pm

Post by astroboy » Sun Sep 07, 2008 3:13 pm

astroboy wrote: Also, I posted here in order to share the workaround that worked for me, and to find if someone would have a better approach to it.
And, that already happened! A user sent to my email a better solution.

Instead of using:
get shell("ps -ef | grep mplayer | awk '{print $2}' | xargs kill")

It is easier:
get shell("killall mplayer")

Post Reply

Return to “Linux”