Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-2148] IOS: sound_record.js from KS crashes when inoked in another app

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-04-17T01:58:14.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.5.0
ComponentsiOS
Labelscrash, ios, record, regression, rplist, sound
ReporterRalf Pfeiffer
AssigneeBlain Hamon
Created2011-04-15T03:11:53.000+0000
Updated2011-04-17T01:58:14.000+0000

Description

I am using the exact sound_record.js file from KS in another app.

The repro steps are:

hit the start recording button
"say something" hit the stop recording button

Note: It will not flip the button label back to [start recording], as it does in KS
(maybe it is stil recording?)

When you leave the window, the app crashes (log attached)

Attachments

FileDateSize
flashcard_recording_crash.rtf2011-04-15T03:11:54.000+000023878

Comments

  1. Ralf Pfeiffer 2011-04-15

    Note that this is using XCode with IOS 4.0

    Also there is code that is NOT at all in our API that needs some clarification:

    IN the following listener:

    there is a line like:
    file = recording.stop(); // our API doc says this returns a void!

    IN another listener there is:
    sound = Titanium.Media.createSound({sound:file}); // our API does not list the sound property!

  2. Ralf Pfeiffer 2011-04-15

    ok, earler I was using SDK 4.0, and 1.4.x

    Now I have upgraded to Xcode/SDK4.1 and latest Ti 1.5.

    I have the same problem, AND I can replicate in Simulator! The Simluator should notice that no Audio exists as per the code but it does not.

    From running in Simulator with FlashCard:
    [INFO] tab Phone prevTab = Controls [ERROR] Improper audio session mode for recording. 1835361385 in -TiMediaAudioRecorderProxy start: [ERROR] The application has crashed with an unhandled exception. Stack trace: 0 CoreFoundation 0x0382cb7c exceptionPreprocess + 156
    1 libobjc.A.dylib 0x0397c40e objc_exception_throw + 47
    2 KitchenSink 0x000aa3ee -[TiProxy throwException:subreason:location:] + 478
    3 KitchenSink 0x0011b671 -[TiMediaAudioRecorderProxy start:] + 1253
    4 CoreFoundation 0x0379d5cd
    invoking + 29
    5 CoreFoundation 0x0379d4a1 -[NSInvocation invoke] + 145
    6 KitchenSink 0x00048fc5 -[KrollMethod call:] + 2092
    7 KitchenSink 0x00048377 KrollCallAsFunction + 327
    8 KitchenSink 0x0026c736
    ZN2TI16TiCallbackObjectINS_8TiObjectEE4callEPNS_10TiExcStateEPS1_NS_7TiValueERKNS_7ArgListE + 550
    9 KitchenSink 0x0023759d cti_op_call_NotTiFunction + 637
    10 ??? 0x10915590 0x0 + 277960080
    11 KitchenSink 0x001e4f9f ZN2TI11Interpreter7executeEPNS_18FunctionExecutableEPNS_10TiExcStateEPNS_10TiFunctionEPNS_8TiObjectERKNS_7ArgListEPNS_14ScopeChainNodeEPNS_7TiValueE + 783
    12 KitchenSink 0x002508ef
    ZN2TI10TiFunction4callEPNS_10TiExcStateENS_7TiValueERKNS_7ArgListE + 127
    13 KitchenSink 0x00199479 _ZN2TI4callEPNS_10TiExcStateENS_7TiValueENS_8CallTypeERKNS_8CallDataES2_RKNS_7ArgListE + 57
    14 KitchenSink 0x0026a2b3 TiObjectCallAsFunction + 611
    15 KitchenSink 0x000431e9 -[KrollCallback call:thisObject:] + 726
    16 KitchenSink 0x00044355 -[KrollEvent invoke:] + 92
    17 KitchenSink 0x000439e6 -[KrollContext invoke:] + 43
    18 KitchenSink 0x00045187 -[KrollContext main] + 3092
    19 Foundation 0x005bf76c -[NSThread main] + 81
    20 Foundation 0x005bf6f8
    NSThreadmain + 1387
    21 libSystem.B.dylib 0x97cb481d pthread_start + 345
    22 libSystem.B.dylib 0x97cb46a2 thread_start + 34
    2010-10-21 17:36:26.868 KitchenSink[29232:8113] Terminating app due to uncaught exception 'org.kitchensink.TiMediaAudioRecorderProxy', reason: 'Improper audio session mode for recording. 1835361385 in -TiMediaAudioRecorderProxy start:'
    Call stack at first throw: ( 0 CoreFoundation 0x0382cb99 exceptionPreprocess + 185
    1 libobjc.A.dylib 0x0397c40e objc_exception_throw + 47
    2 KitchenSink 0x000aa3ee -[TiProxy throwException:subreason:location:] + 478
    3 KitchenSink 0x0011b671 -[TiMediaAudioRecorderProxy start:] + 1253
    4 CoreFoundation 0x0379d5cd
    invoking
    + 29
    5 CoreFoundation 0x0379d4a1 -[NSInvocation invoke] + 145
    6 KitchenSink 0x00048fc5 -[KrollMethod call:] + 2092
    7 KitchenSink 0x00048377 KrollCallAsFunction + 327
    8 KitchenSink 0x0026c736 ZN2TI16TiCallbackObjectINS_8TiObjectEE4callEPNS_10TiExcStateEPS1_NS_7TiValueERKNS_7ArgListE + 550
    9 KitchenSink 0x0023759d cti_op_call_NotTiFunction + 637
    10 ??? 0x10915590 0x0 + 277960080
    11 KitchenSink 0x001e4f9f
    ZN2TI11Interpreter7executeEPNS_18FunctionExecutableEPNS_10TiExcStateEPNS_10TiFunctionEPNS_8TiObjectERKNS_7ArgListEPNS_14ScopeChainNodeEPNS_7TiValueE + 783
    12 KitchenSink 0x002508ef ZN2TI10TiFunction4callEPNS_10TiExcStateENS_7TiValueERKNS_7ArgListE + 127
    13 KitchenSink 0x00199479
    ZN2TI4callEPNS_10TiExcStateENS_7TiValueENS_8CallTypeERKNS_8CallDataES2_RKNS_7ArgListE + 57
    14 KitchenSink 0x0026a2b3 TiObjectCallAsFunction + 611
    15 KitchenSink 0x000431e9 -[KrollCallback call:thisObject:] + 726
    16 KitchenSink 0x00044355 -[KrollEvent invoke:] + 92
    17 KitchenSink 0x000439e6 -[KrollContext invoke:] + 43
    18 KitchenSink 0x00045187 -[KrollContext main] + 3092
    19 Foundation 0x005bf76c -[NSThread main] + 81
    20 Foundation 0x005bf6f8
    NSThreadmain + 1387
    21 libSystem.B.dylib 0x97cb481d _pthread_start + 345
    22 libSystem.B.dylib 0x97cb46a2 thread_start + 34
    ) terminate called after throwing an instance of 'NSException'
    [INFO] Application has exited from Simulator

  3. Ralf Pfeiffer 2011-04-15

    steps to repro in KS are simple now:

    Simulator:

    Launch KS
    [Phone] Tab [Sound] row [Record] (already you see the Playback Recording button which is and error) click [Start Recording]

    Crash!

  4. Ralf Pfeiffer 2011-04-15

    steps to repro on device with KS:

    Launch KS
    Phone
    Sound
    Record
    Start Playing
    go back to Sound from Record screen

    Crash!

  5. Stephen Tramer 2011-04-15

    Claiming this, could be related to module fixes.

  6. Jeff Haynie 2011-04-15

    (from [76706c39f5d8184166081b74c0163ca1d5bf5472]) [#2148] Fixes to getting audio session properties. http://github.com/appcelerator/titanium_mobile/commit/76706c39f5d8184166081b74c0163ca1d5bf5472"> http://github.com/appcelerator/titanium_mobile/commit/76706c39f5d81...

  7. Stephen Tramer 2011-04-15

    I would need much more information about whatever "other app" this was being used in to determine if audio recording really has a bug or not. Mixing audio playback and recording in iOS is very delicate, especially in Titanium, where the user has no direct control over audio sessions.

    I am not able to repo this in KS after the previous commit. Going to mark fixed-in-qa.

  8. Thomas Huelbert 2011-04-15

    4th gen ipod running 4.1, 3g iphone 3.1.2 .5.0.77ad8ac crash not repro

JSON Source