You Are Here:

Community: Developer Discussion Boards

#1 Old N80: MIDlet crashes after recording short audio segments for 7-20 minutes - 2008-03-23, 13:31

Join Date: Mar 2008
Posts: 1
sivan.toledo@gmail.com
Offline
Registered User
Hi,

I have a MIDlet that records short audio segments using RecordControl. Each segment is 1-8 seconds. It works fine for between 7 and 20 minutes, but then crashes.

Usually it crashes with no exception (even though I tried to catch all exceptions and errors), sometimes RecordControl.commit() fails with an IOException that reports "commit failed: -4". But it never can record for more than about 20 minutes.

I tried this with both a player and RecordControl that exist all the time but are started and stopped, and with new instances of Player and RecordControl for each recording. The MIDlet does not run out of memory; I call gc() after every recording and show free memory on the screen, and it is not going down.

The recording is into a ByteArrayOutputStream. To test this failure, I removed all uses of the actual audio, but it still crashes.

I do not get these crashes if I record for a few seconds, then let the MIDlet run forever in a loop.

The recocrding is into 8000 samples/s PCM, 1 channel. I do get usable WAV files as long as the MIDlet is running.

Thanks, Sivan
Reply With Quote

#2 Old Re: N80: MIDlet crashes after recording short audio segments for 7-20 minutes - 2008-09-09, 12:23

Join Date: Aug 2008
Posts: 4
lud3e
Offline
Registered User
Well, I just wanted to say I have the same problem:)

Ive also tried catching the IOException and then creating a new Player and RecordController, but I still get the same error.
Even in a new Thread.

Have you found a solution, Id be glad to hear it.

By the way my phone is a Nokia 6220.

Cheers
Reply With Quote

#3 Old Re: N80: MIDlet crashes after recording short audio segments for 7-20 minutes - 2008-09-09, 12:59

Join Date: Oct 2007
Posts: 19
bharatpatel85
Offline
Registered User
Hi Sivan,

Each Player has upper limit for recording at once(in your case 20 min). Recording is not only thing going on behind the scene. In fact, 20 mins of recording is a huge amount of data. Though you have called gc(), it will not execute Garbage collector immediately. Ideally, GC is called whenever the processor is free. OutOfMemorryError seems to be the only culprit for the app crash.

You should use multiple players for larger recording. You will observe minor glitches during player switching, but it will definitely solve the crash.

Regards,
Bharat.
Reply With Quote

#4 Old Re: N80: MIDlet crashes after recording short audio segments for 7-20 minutes - 2008-09-09, 13:26

Join Date: Aug 2008
Posts: 4
lud3e
Offline
Registered User
Thank you for your answer Bahrat (even if it wasnt directly to me)

I do use multiple players and still get the same error with ALOT of free memory
600k of 800k total.

Ive tried with gc() and Thread.yield() but it still produces the same error.

The below loop works for some 20 minutes and then fails throwing
java.io.IOException: failed -4

After this, no recording can be made (Without commit giving the exception) until Midlet is restarted.
/**
* To allow for a certain amount of exceptions when recording.
* So that this thread doesnt die to easily
*/
int occurredNrExceptions = 0;

try {

while (true) {

ByteArrayOutputStream baos;

// Lets allow for n-time IOExceptions
try {
baos = new ByteArrayOutputStream();
p = Manager.createPlayer("capture://audio);
p.realize();
p.prefetch();

// Get the RecordControl, set the record stream,
rc = (RecordControl) p.getControl("RecordControl");

rc.setRecordStream(baos);
rc.startRecord();
p.start();
Thread.sleep(3000);

rc.stopRecord();
rc.commit();
p.stop();
p.close();


} catch (IOException ex) {
if (occurredNrExceptions++ < allowedNrException) {
try{
p.deallocate();
p.close();
}catch(IllegalStateException ise){
// player was allready closed, DO NOTHING
}
continue;
} else
throw ex;
occurredNrExceptions = 0;

// Use data in baos ...
}

Please help if you know this!

Could this be devicespecefic bugs?
Last edited by lud3e : 2008-09-09 at 15:10.
Reply With Quote

#5 Old Re: N80: MIDlet crashes after recording short audio segments for 7-20 minutes - 2008-11-17, 16:01

Join Date: Aug 2008
Posts: 4
lud3e
Offline
Registered User
Dear Nokia.

This issue has not been resolved and its also noted as "Audio capture crashes 6600" http://discussion.forum.nokia.com/fo...ad.php?t=51875 which means at least 3 phones, my "6220 Classic", N80 and 6600 are affected.

Please if someone who works with Nokias java implementation could address this issue. (Or other who knows the answer)

Is this a Nokia cross-model bug or is there a way of resetting Manager when this happens.

Kind Regards
Ludvig Derning
Reply With Quote

#6 Old Re: N80: MIDlet crashes after recording short audio segments for 7-20 minutes - 2009-02-26, 19:05

Join Date: Feb 2009
Posts: 2
n.maisonneuve
Offline
Registered User
+1
I have the same issue after several minutes while I record 1 second in a loop on a N95 8 Go.
Help is clearly needed
if someone has succeeded to fix that, I will be happy.
Reply With Quote

#7 Old Re: N80: MIDlet crashes after recording short audio segments for 7-20 minutes - 2009-02-26, 20:15

Join Date: Feb 2009
Posts: 2
n.maisonneuve
Offline
Registered User
Quote:
Originally Posted by sivan.toledo@gmail.com View Post
Hi,

I have a MIDlet that records short audio segments using RecordControl. Each segment is 1-8 seconds. It works fine for between 7 and 20 minutes, but then crashes.

Usually it crashes with no exception (even though I tried to catch all exceptions and errors), sometimes RecordControl.commit() fails with an IOException that reports "commit failed: -4". But it never can record for more than about 20 minutes.

I tried this with both a player and RecordControl that exist all the time but are started and stopped, and with new instances of Player and RecordControl for each recording. The MIDlet does not run out of memory; I call gc() after every recording and show free memory on the screen, and it is not going down.

The recording is into a ByteArrayOutputStream. To test this failure, I removed all uses of the actual audio, but it still crashes.

I do not get these crashes if I record for a few seconds, then let the MIDlet run forever in a loop.

The recocrding is into 8000 samples/s PCM, 1 channel. I do get usable WAV files as long as the MIDlet is running.

Thanks, Sivan
same problem

Does someone find a solution to this pb?
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
N80 midlet icon problem revisited... questions kounapuu Mobile Java General 1 2006-10-07 21:15
N80 MIDlet installation problem klapio General Discussion 3 2006-08-29 15:53
Audio capture crashes 6600 cforstner Mobile Java Media (Graphics & Sounds) 1 2005-09-22 18:28
REcording Audio with 3650 derdasser Mobile Java Media (Graphics & Sounds) 0 2005-02-23 21:01
Audio in VIDEO PLAYING in midlet rossottom Mobile Java Media (Graphics & Sounds) 0 2003-05-13 18:08

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 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomE2fforumE2fshowthreadE2ephpE3ftE3d18645X qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE44iscussionQ qdcZtypeQUqfntypeZE44iscussionContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZentertainmentQ qfnZtopicQUqfnTopicZj2meQ qfnZtopicQUqfnTopicZjavaQ qfnZtopicQUqfnTopicZmediaQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE44iscussionQ qfnZtypeQUqfntypeZE44iscussionContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE44iscussionQ qrdfZtypeQUqfntypeZE44iscussionContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ