Re: [PhoneGap] Media stopRecord "crashes" in 2.2.0 on IOS

45 views
Skip to first unread message

john hight

unread,
Nov 13, 2012, 9:50:02 PM11/13/12
to phon...@googlegroups.com
I thought I'd add some more context that I've discovered this problem.

Looks like some sort of race condition to me:

   // Re-using the XHR improves exec() performance by about 10%.
   // It is possible for a native stringByEvaluatingJavascriptFromString call
   // to cause us to reach this point when a request is already in progress,
   // so we check the readyState to guard agains re-using an inprogress XHR.
   // Refer to CB-1404.
   if (execXhr && execXhr.readyState != 4) {
       execXhr = null;
   }
   execXhr = execXhr || new XMLHttpRequest();
  • Stepping into the stopRecord call with the Safari debugger, the "if expression" at line 1017 evaluates to False, and subsequently, we reuse the execXhr (we don't make a new one), the constructor is not called, and stopRecord returns as it should.
  • without the debugger, just the simulator, the "if expression" evaluates True, execXhr is set null, and we next attempt to create a new execXhr, and the code silently fails within the call to the constructor. 
Perhaps there is still some issue with regard to CB-1404?

John


On Sat, Nov 10, 2012 at 12:19 PM, johnh <john...@gmail.com> wrote:
With 2.2.0, and when recording two simultaneous audio files, stopRecord just "crashes" with no apparent error indication.  The stream does indeed stop, as I do get the usual log messages, but the callback code I'm running does not return from the call to stopRecord.

2012-11-10 12:02:27.262 Test[15518:c07] Stopped recording audio sample '/Users/john/Library/Application Support/iPhone Simulator/6.0/Applications/6F937803-2C02-4FBC-8773-D9FD4BCB9568/tmp/audio0.wav'

2012-11-10 12:02:27.264 Test[15518:c07] Finished recording audio sample '/Users/john/Library/Application Support/iPhone Simulator/6.0/Applications/6F937803-2C02-4FBC-8773-D9FD4BCB9568/tmp/audio0.wav'

Stepping into stopRecord with the Safari debugger doesn't exactly yield to me any clues, and putting try/catch block around the call doesn't yield any exceptions. Recording two buffers simultaneously worked fine with 2.0 and 2.1.  I plan to work at reverting back to 2.1.0 to verify my results ... 

But while I'm working on that ... any thoughts on what the problem might be? 

John

--
-- You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to
phonegap+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com
 
To compile in the cloud, check out build.phonegap.com
 
 

Shazron

unread,
Nov 14, 2012, 1:19:41 PM11/14/12
to phonegap
It's best to comment on that issue so the dev can be notified. http://issues.cordova.io/1404

john hight

unread,
Nov 14, 2012, 2:01:12 PM11/14/12
to phon...@googlegroups.com
Done, thanks
Reply all
Reply to author
Forward
0 new messages