Old stack freezes -- something about "player"

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Timothy
Posts: 78
Joined: Tue Apr 11, 2006 7:38 pm

Old stack freezes -- something about "player"

Post by Timothy » Sun Jan 01, 2017 8:07 am

Hello,

I've come and gone on previous iterations of this forum since the early days of HyperCard. I don't do much "authoring" these days. (In the early days of hyperCard, I think it was called "authoring.") Nevertheless, I'm a self-taught dabbler and I'll be a newbie 'til I die. If you do the arithmetic on my age, you'll see that might not be long now!

I just fired up an old stack I haven't looked at in a couple of years, give or take. I can't remember what version of LC I was using when I built it. It's a rudimentary stack for ear-training, like in music. It launches okay. (I guess "launch" isn't the modern term any more, is it?) It looks like it freezes whenever the script encounters the word "Player"

I guess I should mention, I'm using Mac OS 10.12.2 and LC Community 8.1.2 unless I'm advised to try an earlier version.

This stack depends heavily on players. I have a vague notion that QuickTime has been deprecated or eliminated, and I guess players depend on QuickTime, or something like that. Or maybe I can still use the old players, but the syntax has changed? Here's the first line that causes a freeze:

Code: Select all

set the filename of player "player.1" to hinote
For now, I'm not asking for a lot of detailed hand-holding, just a few hints. Maybe I can take it from there on my own.

What's changed and what's an easy way to get this old stack up and running again?

Thanks in advance,

Tim
It's better to be happy and rich than poor and sad -- W. C. Fields

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Old stack freezes -- something about "player"

Post by Klaus » Sun Jan 01, 2017 1:21 pm

Hi Tim,

the syntax did not change at all, only the underlying technology!

Apple is currently deprecating QuickTime and on the Mac it uses
the AVFoundation Framework for multimedia playback.

So it will not be the syntax that causes your grieve but maybe
the format of the movies you are trying to play?

AVFoundation does not not support as many codecs as QuickTIme!
What format are your movies in?

However this should not crash LC in any case.


Best

Klaus

Timothy
Posts: 78
Joined: Tue Apr 11, 2006 7:38 pm

Re: Old stack freezes -- something about "player"

Post by Timothy » Sun Jan 01, 2017 7:02 pm

Hi Klaus,

Thanks for the help so far.
AVFoundation does not not support as many codecs as QuickTIme!
What format are your movies in?
I'm trying to play short audio clips in .wav format. Could .wav be the problem?

If not, has the player object changed? I.e, do I need to use a newer player object, instead of an older one?

Hugs and puppies,

Tim
It's better to be happy and rich than poor and sad -- W. C. Fields

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Old stack freezes -- something about "player"

Post by Klaus » Sun Jan 01, 2017 7:09 pm

Hi Tim,
Timothy wrote:I'm trying to play short audio clips in .wav format. Could .wav be the problem?
nope, should work as exspected.
Timothy wrote:If not, has the player object changed?
No, it hasn't.
Timothy wrote: I.e, do I need to use a newer player object, instead of an older one?
"Default" setting of players on the Mac is to use the new AVFoundation framework.
You can force the use of QuickTime only by setting a property for every player object:

Code: Select all

...
set the dontuseqt of player "xyz" to FALSE
...
You can send me a WAV file that does not work and I will take a look.
If you like: klaus AT major-k.de


Best

Klaus

Timothy
Posts: 78
Joined: Tue Apr 11, 2006 7:38 pm

Re: Old stack freezes -- something about "player"

Post by Timothy » Sun Jan 01, 2017 7:20 pm

Thanks, you've been very helpful. I now know what the problem isn't. Back to basic troubleshooting...

Tim
It's better to be happy and rich than poor and sad -- W. C. Fields

Timothy
Posts: 78
Joined: Tue Apr 11, 2006 7:38 pm

Re: Old stack freezes -- something about "player"

Post by Timothy » Sun Jan 01, 2017 9:00 pm

Any idea why this line would cause a freeze?

Code: Select all

 set the currentTime of player "player.1" to 1
I tried adding these lines before the problem line:

Code: Select all

answer the duration of player "player.1"
answer the currentTime of player "player.1"
They work normally. Both values are zero

I'm wondering about the nature of the freeze. The debugger stops responding, the script won't scroll in its window. The stack window displays normally and I can drag it around the screen normally. Buttons and the LC menu items do not respond. Rolling the mouse over the red "close" dot in the upper left of the stack window does not cause the little black "X" to appear. Control-clicking on the LC icon in the dock produces the usual contextual menu, including "Quit." but the Quit command does not cause LC to quit. I have to use "Force Quit" in the apple menu. LC continues to use a tiny bit of CPU. There are no repeat loops or handlers other than "on mouseUp" in the script.

This abnormal LC condition, technically, is it called a freeze or a crash or what? Does the freeze behavior tell you anything about what is going wrong? There are no repeat loops or handlers other than "on mouseUp" in the script. The last time I used this stack, a couple of years ago, it was totally stable, worked fine. I don't think it started freezing, whatever, because I changed the script.

I'm assuming I have not found a bug...

Tim
It's better to be happy and rich than poor and sad -- W. C. Fields

Timothy
Posts: 78
Joined: Tue Apr 11, 2006 7:38 pm

Problem diagnosed and solved!

Post by Timothy » Sun Jan 01, 2017 9:46 pm

I'm the OP. Figured it out! Thanks to Klaus for trying to help.

The thing that has changed is that I have a new computer with a new username. Duh! Derrr! So the filename for the sound I want to play has changed. The script has been setting the filename of the players to an audio file in a non-existent folder.

Once the filename of the player is incorrect, if I try to set the currentTime of the player, or do various other things to the player, LC freezes.

The problem behavior is somewhat inconsistent or at least illogical. For example, neither "start player 1" nor clicking on the "play" button of the player causes a freeze, but setting the currentime or manually scrolling the scrollbar of the same player does cause a freeze.

In a perfect world, these commands would either be ignored or they would generate an error message. Agreed?

Well, it works now, and this world is not yet quite perfect.

Tim
It's better to be happy and rich than poor and sad -- W. C. Fields

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7389
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Old stack freezes -- something about "player"

Post by jacque » Mon Jan 02, 2017 10:54 pm

In a perfect world, these commands would either be ignored or they would generate an error message.
Any errors should be in "the result".
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Timothy
Posts: 78
Joined: Tue Apr 11, 2006 7:38 pm

Re: Old stack freezes -- something about "player"

Post by Timothy » Tue Jan 03, 2017 1:46 am

Hi Jacque,

Your name looks like a friendly face. :)

I did try to "answer the result" after the "start player" command. LC froze before "the result" was generated. Repeatedly.

I'm getting some funny and inconsistent behavior with invalid filenames in players, causing deadly freezes. I have to force-quit from the Apple menu. Possibly some kind of a complex and obscure bug, but it's not for me to say.

I just discovered the operator that tests the validity of a file path. Wow! My life just got SO much easier!

Hugs and puppies,

Tim
It's better to be happy and rich than poor and sad -- W. C. Fields

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7389
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Old stack freezes -- something about "player"

Post by jacque » Tue Jan 03, 2017 8:25 am

Since the engine should never freeze up that way, I'd say it's worth a report.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10080
Joined: Fri Feb 19, 2010 10:17 am

Re: Old stack freezes -- something about "player"

Post by richmond62 » Tue Jan 03, 2017 2:40 pm

I have fallen foul of file paths so many times that I have
been embedding media files in my LiveCode stacks since
I started fiddling around with Metacard 15 years ago.

This, while making files larger, does make portability
a hundred times simpler.

Timothy
Posts: 78
Joined: Tue Apr 11, 2006 7:38 pm

Re: Old stack freezes -- something about "player"

Post by Timothy » Tue Jan 03, 2017 10:50 pm

That's an excellent suggestion, Richmond62. I haven't scripted at all in a couple of years, so I kind of forgot that's a possibility. That's probably a change I will make in a future version.

Glad to know I'm not the only one who falls afoul of file paths.

Tim
It's better to be happy and rich than poor and sad -- W. C. Fields

Post Reply