{ "id": "77326", "key": "TIMOB-4544", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "2", "description": "The problem described is an issue which will never be fixed.", "name": "Won't Fix" }, "resolutiondate": "2014-04-21T21:25:22.000+0000", "created": "2011-07-03T12:00:07.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "aacp", "audioplayer" ], "versions": [ { "id": "11367", "description": "", "name": "Release 1.7.1", "archived": true, "released": true, "releaseDate": "2011-06-21" } ], "issuelinks": [], "assignee": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-22T17:56:48.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "As per [this Q&A question|http://developer.appcelerator.com/question/121172/aacp-shoutcast-radio-stream], AAC streams don't work on Android 2.1, and rarely work on 2.2, when using Titanium 1.7.X. See the notes next to the URLs in the following code for more info. Note that code allows each stream to be tested in sequence.\r\n\r\n{code:lang=javascript}\r\nvar url = [];\r\nurl.push(\"http://st2.webradioworld.net:8036\"); // direct stream - exception on 2.1, exception on 2.2\r\nurl.push(\"http://radio.musicvictim.com:8012\"); // direct stream - exception on 2.1, works on 2.2\r\n\r\n// Info page: http://www.radioparadise.com/content.php?name=Listen\r\nurl.push(\"http://www.radioparadise.com/musiclinks/rp_64aac.m3u\"); // exception on 2.1, exception on 2.2\r\nurl.push(\"http://173.244.214.174:8008\"); // direct stream - exception on 2.1, exception on 2.2\r\n\r\n// Info page: http://kzsulive.stanford.edu/\r\nurl.push(\"http://kzsulive.stanford.edu/audio/kzsu-1-48.pls\"); // exception on 2.1, exception on 2.2\r\nurl.push(\"http://171.66.118.51/kzsu-1-48.aac\"); // direct stream - exception on 2.1, does not work on 2.2 but no exception\r\n\r\n\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor : \"white\",\r\n layout:'vertical',\r\n exitOnClose:true\r\n});\r\n\r\nTi.Media.audioSessionMode = Ti.Media.AUDIO_SESSION_MODE_AMBIENT;\r\n\r\nvar urlIndex = 0;\r\nvar audio = Ti.Media.createAudioPlayer({\r\n url:url[urlIndex],\r\n preload:false,\r\n allowBackground:true\r\n});\r\n\r\naudio.format = Ti.Media.AUDIO_FORMAT_AAC;\r\naudio.audioSessionMode = Ti.Media.AUDIO_SESSION_MODE_PLAYBACK;\r\n\r\nvar buttonControl = Ti.UI.createButton({\r\n title: 'Play',\r\n isSound:false,\r\n top:50\r\n});\r\n\r\nwin.add(buttonControl);\r\nwin.open();\r\n\r\nvar nav_hidden = false;\r\n\r\nTi.API.info(\"Starting stream: \"+ url[urlIndex]);\r\nbuttonControl.addEventListener('click', function(){\r\n if(buttonControl.isSound){\r\n audio.stop();\r\n buttonControl.title = 'Play';\r\n buttonControl.isSound = !buttonControl.isSound;\r\n Ti.API.info(\"Stream stopped\");\r\n if(urlIndex === url.length-1){\r\n urlIndex = 0;\r\n } else {\r\n urlIndex++;\r\n }\r\n audio.url = url[urlIndex];\r\n } else {\r\n Ti.API.info(\"Starting stream: \"+ audio.url);\r\n audio.start();\r\n buttonControl.title = 'Stop';\r\n buttonControl.isSound = !buttonControl.isSound;\r\n Ti.API.info(\"Stream started\");\r\n }\r\n});\r\n\r\naudio.addEventListener('change', function(e){\r\n Ti.API.info(\"Current audio state: \" + e.state);\r\n});\r\n{code}\r\n\r\nThe following shows output generated using Android 2.2 when the first and second streams were played, the first caused an exception, the next played successfully.\r\n\r\n{code}\r\n 628 TiAPI I (kroll$1: app://app.js) [2568,5385] Starting stream: http://st2.webradioworld.net:8036\r\n 34 StagefrightPlayer I setDataSource('http://st2.webradioworld.net:8036')\r\n 118 dalvikvm D GC_EXPLICIT freed 144 objects / 7536 bytes in 132ms\r\n 628 MediaPlayer E error (1, -2147483648)\r\n 628 TiSound W (kroll$1: app://app.js) [1381,6766] Issue while initializing : \r\n 628 TiSound W java.io.IOException: Prepare failed.: status=0x1\r\n 628 TiSound W \tat android.media.MediaPlayer.prepare(Native Method)\r\n 628 TiSound W \tat ti.modules.titanium.media.TiSound.initialize(TiSound.java:118)\r\n 628 TiSound W \tat ti.modules.titanium.media.TiSound.play(TiSound.java:177)\r\n 628 TiSound W \tat ti.modules.titanium.media.AudioPlayerProxy.play(AudioPlayerProxy.java:111)\r\n 628 TiSound W \tat ti.modules.titanium.media.AudioPlayerProxy.start(AudioPlayerProxy.java:104)\r\n 628 TiSound W \tat ti.modules.titanium.media.AudioPlayerProxyBindingGen$9.invoke(AudioPlayerProxyBindingGen.java:355)\r\n 628 TiSound W \tat org.appcelerator.kroll.KrollMethod.call(KrollMethod.java:51)\r\n 628 TiSound W \tat org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1701)\r\n 628 TiSound W \tat org.mozilla.javascript.Interpreter.interpret(Interpreter.java:854)\r\n 628 TiSound W \tat org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)\r\n 628 TiSound W \tat org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:426)\r\n 628 TiSound W \tat org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3177)\r\n 628 TiSound W \tat org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:162)\r\n 628 TiSound W \tat org.appcelerator.titanium.kroll.KrollCallback.callSync(KrollCallback.java:139)\r\n 628 TiSound W \tat org.appcelerator.titanium.kroll.KrollCallback$1.run(KrollCallback.java:164)\r\n 628 TiSound W \tat android.os.Handler.handleCallback(Handler.java:587)\r\n 628 TiSound W \tat android.os.Handler.dispatchMessage(Handler.java:92)\r\n 628 TiSound W \tat android.os.Looper.loop(Looper.java:123)\r\n 628 TiSound W \tat org.appcelerator.titanium.kroll.KrollHandlerThread.run(KrollHandlerThread.java:86)\r\n 628 TiAPI I (kroll$1: app://app.js) [57,6823] Stream started\r\n 628 TiAPI I (kroll$1: app://app.js) [6,6829] Current audio state: 4\r\n 628 TiAPI I (kroll$1: app://app.js) [24,6853] Current audio state: 5\r\n 628 TiAPI I (kroll$1: app://app.js) [34684,41537] Stream stopped\r\n 161 EventLogService I Aggregate from 1309717206104 (log), 1309717206104 (data)\r\n 161 dalvikvm D GC_FOR_MALLOC freed 4070 objects / 443448 bytes in 94ms\r\n 628 TiAPI I (kroll$1: app://app.js) [4457,45994] Starting stream: http://radio.musicvictim.com:8012\r\n 34 StagefrightPlayer I setDataSource('http://radio.musicvictim.com:8012')\r\n 34 AwesomePlayer I calling prefetcher->prepare()\r\n 34 Prefetcher I [0x782b8] cache below low water mark, filling cache.\r\n 34 AwesomePlayer I prefetcher is done preparing\r\n 34 AudioSink D bufferCount (4) is too small and increased to 12\r\n 628 TiAPI I (kroll$1: app://app.js) [1950,47944] Stream started\r\n 628 TiAPI I (kroll$1: app://app.js) [2,47946] Current audio state: 4\r\n 628 TiAPI I (kroll$1: app://app.js) [28,47974] Current audio state: 1\r\n 628 TiAPI I (kroll$1: app://app.js) [29,48003] Current audio state: 3\r\n 628 TiAPI I (kroll$1: app://app.js) [16,48019] Current audio state: 3\r\n 34 AudioFlinger W write blocked for 74 msecs, 2573 delayed writes, thread 0xb3f0\r\n 34 AwesomePlayer E Not sending buffering status because duration is unknown.\r\n 34 AudioFlinger W write blocked for 73 msecs, 2600 delayed writes, thread 0xb3f0\r\n 34 AudioFlinger W write blocked for 72 msecs, 2629 delayed writes, thread 0xb3f0\r\n 34 AudioFlinger W write blocked for 72 msecs, 2654 delayed writes, thread 0xb3f0\r\n 34 AudioFlinger W write blocked for 75 msecs, 2678 delayed writes, thread 0xb3f0\r\n{code}", "attachment": [], "flagged": false, "summary": "Android: AudioPlayer AAC streams do not work for some streams", "creator": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "subtasks": [], "reporter": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "environment": "* Android APIs 2.1 and 2.2\r\n* Emulator with hw.audioOutput enabled\r\n* Titanium 1.7.1 (2011/06/17 00:13 293a6d...)\r\n", "comment": { "comments": [ { "id": "158467", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "Please note that the streams included in the usecase have yet to be checked against Android's official list of [supported codecs|http://developer.android.com/guide/appendix/media-formats.html] (sample rates, container formats, etc)", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2011-07-05T07:31:27.000+0000", "updated": "2011-07-05T07:31:27.000+0000" }, { "id": "220271", "author": { "name": "alexistkd", "key": "alexistkd", "displayName": "Alexis Gaitan", "active": true, "timeZone": "America/Chicago" }, "body": "any news on this :) im trying to reproduce aac stream too without luck", "updateAuthor": { "name": "alexistkd", "key": "alexistkd", "displayName": "Alexis Gaitan", "active": true, "timeZone": "America/Chicago" }, "created": "2012-09-22T14:46:29.000+0000", "updated": "2012-09-22T14:46:29.000+0000" }, { "id": "301956", "author": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Please reopen if you can reproduce this on newer devices.", "updateAuthor": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-04-21T21:25:12.000+0000", "updated": "2014-04-21T21:25:12.000+0000" }, { "id": "414826", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as the issue will not fix and with reference to the above comments. ", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-22T17:56:48.000+0000", "updated": "2017-03-22T17:56:48.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }