Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-2938] Android: 2.3 only; Remote URL Sound fails to play with "java.io.IOException: Prepare failed" error

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionHold
Resolution Date2011-04-15T03:33:22.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
Labels2.3, android, remoteurl, reported-1.6.0, sound
ReporterThomas Huelbert
AssigneeDon Thorp
Created2011-04-15T03:33:21.000+0000
Updated2017-03-21T21:13:53.000+0000

Description

[INFO] Titanium SDK version: 1.6.0 (01/24/11 08:14 e1cb22a) Nexus S (2.3.1) specific

1.Phone > Sound > Remote URL or remote streaming
2.check logcat when sound fails to play

W/TiSound ( 615): (kroll$194) [164,11390895] Issue while initializing :
W/TiSound ( 615): java.io.IOException: Prepare failed.: status=0x1
W/TiSound ( 615): at android.media.MediaPlayer.prepare(Native Method)
W/TiSound ( 615): at ti.modules.titanium.media.TiSound.initialize(TiSound.java:119)
W/TiSound ( 615): at ti.modules.titanium.media.TiSound.play(TiSound.java:173)
W/TiSound ( 615): at ti.modules.titanium.media.SoundProxy.play(SoundProxy.java:116)
W/TiSound ( 615): at ti.modules.titanium.media.SoundProxyBindingGen$10.invoke(SoundProxyBindingGen.java:407)
W/TiSound ( 615): at org.appcelerator.kroll.KrollMethod.call(KrollMethod.java:48)
W/TiSound ( 615): at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1711)
W/TiSound ( 615): at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:854)
W/TiSound ( 615): at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
W/TiSound ( 615): at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:426)
W/TiSound ( 615): at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3161)
W/TiSound ( 615): at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:162)
W/TiSound ( 615): at org.appcelerator.titanium.kroll.KrollCallback.callSync(KrollCallback.java:139)
W/TiSound ( 615): at org.appcelerator.titanium.kroll.KrollCallback$1.run(KrollCallback.java:163)
W/TiSound ( 615): at android.os.Handler.handleCallback(Handler.java:587)
W/TiSound ( 615): at android.os.Handler.dispatchMessage(Handler.java:92)
W/TiSound ( 615): at android.os.Looper.loop(Looper.java:123)
W/TiSound ( 615): at org.appcelerator.titanium.kroll.KrollHandlerThread.run(KrollHandlerThread.java:73)

Comments

  1. Marshall Culpepper 2011-04-15

    Confirmed. This seems to be a bug in any Android device that uses the Stagefright media player implementation (which is the new player for 2.3, but some 2.2 devices from HTC are also shipping with it).

    An initial glance at the Stagefright C++ code, and it looks like their custom HTTP client is returning an EOF for the stream for some unknown reason.

    More trace info from my Nexus S:

       02-15 11:22:50.596: INFO/StagefrightPlayer(75): setDataSource('http://www.nch.com.au/acm/8kmp38.wav')
       02-15 11:22:50.615: INFO/NuHTTPDataSource(75): connect to www.nch.com.au:80/acm/8kmp38.wav @0
       02-15 11:22:50.959: ERROR/MediaPlayer(23243): error (1, -2147483648)
       02-15 11:22:50.971: INFO/NuCachedSource2(75): ERROR_END_OF_STREAM
       02-15 11:22:50.990: WARN/TiSound(23243): (kroll$10: app://examples/sound_remote_url.js) [399,1210563] Issue while initializing : 
       02-15 11:22:50.990: WARN/TiSound(23243): java.io.IOException: Prepare failed.: status=0x1
       02-15 11:22:50.990: WARN/TiSound(23243):     at android.media.MediaPlayer.prepare(Native Method)
       02-15 11:22:50.990: WARN/TiSound(23243):     at ti.modules.titanium.media.TiSound.initialize(TiSound.java:120)
       02-15 11:22:50.990: WARN/TiSound(23243):     at ti.modules.titanium.media.TiSound.play(TiSound.java:179)
       02-15 11:22:50.990: WARN/TiSound(23243):     at ti.modules.titanium.media.SoundProxy.play(SoundProxy.java:116)
       02-15 11:22:50.990: WARN/TiSound(23243):     at ti.modules.titanium.media.SoundProxyBindingGen$10.invoke(SoundProxyBindingGen.java:407)
       02-15 11:22:50.990: WARN/TiSound(23243):     at org.appcelerator.kroll.KrollMethod.call(KrollMethod.java:51)
       02-15 11:22:50.990: WARN/TiSound(23243):     at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1711)
       02-15 11:22:50.990: WARN/TiSound(23243):     at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:854)
       02-15 11:22:50.990: WARN/TiSound(23243):     at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
       02-15 11:22:50.990: WARN/TiSound(23243):     at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:426)
       02-15 11:22:50.990: WARN/TiSound(23243):     at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3161)
       02-15 11:22:50.990: WARN/TiSound(23243):     at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:162)
       02-15 11:22:50.990: WARN/TiSound(23243):     at org.appcelerator.titanium.kroll.KrollCallback.callSync(KrollCallback.java:139)
       02-15 11:22:50.990: WARN/TiSound(23243):     at org.appcelerator.titanium.kroll.KrollCallback$1.run(KrollCallback.java:164)
       02-15 11:22:50.990: WARN/TiSound(23243):     at android.os.Handler.handleCallback(Handler.java:587)
       02-15 11:22:50.990: WARN/TiSound(23243):     at android.os.Handler.dispatchMessage(Handler.java:92)
       02-15 11:22:50.990: WARN/TiSound(23243):     at android.os.Looper.loop(Looper.java:123)
       02-15 11:22:50.990: WARN/TiSound(23243):     at org.appcelerator.titanium.kroll.KrollHandlerThread.run(KrollHandlerThread.java:89)
       
  2. Marshall Culpepper 2011-04-15

    I've filed an Android bug here:

    http://code.google.com/p/android/issues/detail?id=14756">http://code.google.com/p/android/issues/detail?id=14756

  3. Marshall Culpepper 2011-04-15

    Marking back as hold until we get more feedback from our Android bug

  4. Gerry Cardinal III 2011-04-15

    There may be multiple issues here. It sounds like your Android bug is with wav files.

    However, we are seeing the same exception when streaming an mp3 on the 2.2 emulator, but that same mp3 streams fine on a G2 with 2.2.

  5. Dustin Hyde 2011-12-07

    Bug also found in NookColor: SDK: 1.8.0.1.v20111207091653 Runtimes: Android V8/Rhino Studio: 1.0.7.201112061404 OS: OS X Lion Devices Tested: NookColor, NookColor Emulator 2.2 (Rhino)
  6. Joe Falcone 2013-04-12

  7. Lee Morris 2017-03-21

    Closing ticket due to the time that has passed since it was filed.

JSON Source