You Are Here:

Community: Developer Discussion Boards

#1 Old Occasional crash of the phone when using python script - 2008-08-14, 17:23

Join Date: Jul 2008
Posts: 9
bornet
Offline
Registered User
Hello all,

for our internal needs, we have developped a video recording application running on some N93i. This is done in Python, thanks to Python for S60 platform.

Due to some restrictions, we have modified the Python for S60 source code to be able to:
  • select the wanted resolution, frame rate and bitrate,
  • mirror the image before displaying it.

(see my previous posts on the subject).

Both functions seems to be working as expected, even if the mirror hack is a quick and dirty hack which I think will work only on our specific configuration.

I will post the changes we have done for changing the resolution, frame rate and bitrate as soon as everything will be working correctly.

All seems to be working correctly. But some time, we have a "big" freeze. The phone is no more responding, and we need to reboot it. As far as I have see, it's occuring at the end of our recording, where I do mainly:

Code:
    camera.stop_record ()
    e32.file_copy (internal_file, external_file)
    os.unlink (internal_file)
where internal_file is the file recorded, in c:/videos, and external_file is a file on the external flash, in e:/videos. (recording directly on the external flash give us some freezes in the recording).

As I'm writing this email, I'm thinking it's maybe the os.unlink() which is make too fast, before the stop_record() is really finished. Could this be the possible phone freeze reason ?

As other users some stability problems with the Python for S60 ?

Thanks in advance for any help on this point.

Have a nice day.
Reply With Quote

#2 Old Smile Re: Occasional crash of the phone when using python script - 2008-08-14, 17:54

Join Date: May 2007
Posts: 2,739
Location: 21.46 N 72.11 E
croozeus's Avatar
croozeus
Offline
Forum Nokia Champion
Hi bornet,

Quote:
Originally Posted by bornet View Post

As I'm writing this email, I'm thinking it's maybe the os.unlink() which is make too fast, before the stop_record() is really finished. Could this be the possible phone freeze reason ?
If you feel the stop_record() is really not finished before you call the unlink function try having a delay of a second or two before the os.unlink(internal_file) function.

Btw, does this freezing happen every time ?

Does it happen with short recordings too ?

If the recording is too big, then generally it would take time for the file to be copied.

Just try the following code: having delay between the statements,

Obviously, you can remove the unnecessary delay with trial and error methods.

Code:
    camera.stop_record ()
    e32.ao_sleep(1)
    e32.file_copy (internal_file, external_file)
    e32.ao_sleep(1)
    os.unlink (internal_file)
Hope that helps,

Best Regards,
Croozeus
Reply With Quote

#3 Old Re: Occasional crash of the phone when using python script - 2008-08-15, 01:55

Join Date: Aug 2008
Posts: 7
Location: México
arturotena
Offline
Registered User
Quote:
Originally Posted by croozeus View Post
If you feel the stop_record() is really not finished before you call the unlink function...
How could be possible that could stop_record() could not finish before returning?

I ask because I have a problem with another module, and I suspect some timing problems.

Arturo Tena
pys60 brother
Reply With Quote

#4 Old Re: Occasional crash of the phone when using python script - 2008-08-15, 08:36

Join Date: May 2007
Posts: 2,739
Location: 21.46 N 72.11 E
croozeus's Avatar
croozeus
Offline
Forum Nokia Champion
Quote:
Originally Posted by arturotena View Post
How could be possible that could stop_record() could not finish before returning?
Honestly speaking, I do not believe that there is a problem with the stop or the unlink statement. I just believe that your recording becomes to large to be copied instantly and thus your phone freezes.

Best Regards,
Croozeus
Reply With Quote

#5 Old Re: Occasional crash of the phone when using python script - 2008-08-18, 11:51

Join Date: Jul 2008
Posts: 9
bornet
Offline
Registered User
hello,

Quote:
Originally Posted by croozeus View Post
Honestly speaking, I do not believe that there is a problem with the stop or the unlink statement. I just believe that your recording becomes to large to be copied instantly and thus your phone freezes.
It also freeze with small files. And files are in general below 30 seconds. And when the phone freeze, I can wait forever, it doesn't come back to work. I can even not switch to another program.

I will try with the sleep to see if it's helping.

Thanks all for your answers.
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
New to Python for S60 (PyS60)? Read this first! croozeus Python 2 2008-10-17 20:23
python script on startup abimatrix Python 10 2008-07-24 08:32
How to run my python script? Gowtham_India Python 2 2007-06-25 11:15
controlling softkeys from python script dayashankar Python 5 2006-12-04 18:53
Phone Crash with Nokia Games Loongs PC Suite API and PC Connectivity SDK 1 2003-05-30 14:26

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia