{ "id": "154315", "key": "TIMOB-20234", "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": [ { "id": "17706", "name": "Release 5.4.0", "archived": false, "released": true, "releaseDate": "2016-08-11" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2016-03-02T07:08:54.000+0000", "created": "2016-01-14T02:23:04.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "qe-5.4.0" ], "versions": [], "issuelinks": [ { "id": "50552", "type": { "id": "10011", "name": "Includes", "inward": "is included by", "outward": "includes" }, "inwardIssue": { "id": "154419", "key": "TIMOB-20251", "fields": { "summary": "Android 6.0: java.io.FileNotFoundException: open failed: ENOENT (No such file or directory)", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "50294", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "152346", "key": "TIMOB-20140", "fields": { "summary": "Streaming Audio not working on Android Marshmallow", "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" } }, "priority": { "name": "Critical", "id": "1" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "updated": "2016-07-08T21:12: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 mentioned in ticket: TIMOB-20140 reported by [~patrickmounteney]\r\n\r\n{quote}I did try a nightly build about a week ago and again today and found that although some of my Shoutcast streams now played under Android 6.0 (on a Nexus 7), others did not and produced our old friend error (1, -2147483648)\r\nExamples:\r\nWon't play: http://sc2.radiocaroline.net:10558\r\nWill play: http://sc2.radiocaroline.net:8000\r\nThe error starts at: E/NuCachedSource2(16101): source returned error -1, 10 retries left\r\nIn a further test using 'Classic' Ti the stream that would not play in an Alloy build now plays and we see the following printed in the Console, which I have never seen in an Alloy implementation:\r\nAAS: Asking for stream handler for protocol: 'http'\r\nAudio in Android seems to be a bit of a lottery - if it works great. If it does't we're stuffed as nobody seems to be able to say what the cause is!{quote}\r\n\r\n{quote}As far as I can tell both of the above Shoutcast streams are the same protocol as they come from the same server (Shoutcast 1.9.8), be it different ports. But read on as I spent some time testing this yesterday and my conclusion is that there is some difference between the way the 'Classic Ti' implements AudioPlayer behind the scenes and the way Alloy does. I can run the same very simple test (below) and get two different results, depending on if it was built with Alloy or not and version of Android the test is run under.\r\nTest code built with Ti. SDK 6.0.0.v20160112093414 and targeting Android API 23\r\n{code}\r\nvar player = Titanium.Media.createAudioPlayer(\r\n{ allowBackground: true, url: \"http://sc2.radiocaroline.net:10558\" }\r\n);\r\nfunction streamButtonClick()\r\n{ Ti.API.info(\"Playing : \"+ player.url); player.play(); }\r\n{code}\r\nTest 1:\r\nAlloy build - run on Nexus 7 Tablet Android 6.0.1 - It doesn't play and throws error (1, -2147483648)\r\nClassic build - run on Nexus 7 Tablet Android 6.0.1 - streams plays\r\nTest 2:\r\nAlloy build - run on Lenovo Tablet Android 4.2.2 - streams plays\r\nClassic build - run on Lenovo Tablet Android 4.2.2 - streams plays\r\nObservations: When it works we see this printed in the Ti Console:\r\n[DEBUG] : AAS: Asking for stream handler for protocol: 'http'\r\n[DEBUG] : MediaPlayer: setSubtitleAnchor in MediaPlayer\r\nWhen it doesn't work we get:\r\n[ERROR] : MediaPlayer: error (1, -2147483648)\r\nAnd when it does work, in the Android log we see:\r\n01-12 07:48:55.722: D/audio_hw_primary(16101): enable_audio_route: apply and update mixer path: low-latency-playback\r\n01-12 07:48:55.988: E/NuCachedSource2(16101): source returned error -1, 10 retries left\r\nConclusion: There is something in an Alloy build, when run under Android 6.0, that is causing NuCachedSource2 to error and the stream never plays.{quote}", "attachment": [], "flagged": false, "summary": "Streaming Audio not working on Android Marshmallow with Alloy", "creator": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "subtasks": [], "reporter": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "environment": null, "closedSprints": [ { "id": 580, "state": "closed", "name": "2016 Sprint 3 SDK", "startDate": "2016-01-30T01:31:48.991Z", "endDate": "2016-02-13T01:31:00.000Z", "completeDate": "2016-02-15T05:32:40.725Z", "originBoardId": 114 }, { "id": 585, "state": "closed", "name": "2016 Sprint 5 SDK", "startDate": "2016-02-27T01:30:43.377Z", "endDate": "2016-03-12T01:30:00.000Z", "completeDate": "2016-03-14T11:50:17.995Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "376209", "author": { "name": "patrickmounteney", "key": "patrickmounteney", "displayName": "Patrick Mounteney", "active": true, "timeZone": "Europe/London" }, "body": "Further in this issue: It looks to be a case of needing permissions for WRITE_EXTERNAL_STORAGE for streaming to work when run under Android 6.0. - at least for an Alloy build. I did a number of tests, mainly with a Nexus 7 device, but it was not until trying a Genymotion emulated Galaxy 6 that its log gave more detail of the issue:\r\n\r\n02-06 15:58:11.667: E/FFmpegExtractor(480): android-source:0xf60d9cc0|file:http://sc2.radiocaroline.net:8000: avformat_open_input failed, err:Operation not permitted\r\n\r\nBut the clincher was that on deleting and reinstalling my app I noticed some images that need downloading and storing in the applicationDataDirectory were failing with a large number of errors to do with permissions. It was only after adding runtime permission for WRITE_EXTERNAL_STORAGE that the streams suddenly started working again. But this only seemed to affect apps built with Alloy - a 'Classic' built app did not need these permissions.\r\n\r\nBut if the failure to play audio streams is to do with permissions - what is being written to the applicationDataDirectory? Surely not the buffer? That would be to RAM memory would it not?\r\n", "updateAuthor": { "name": "patrickmounteney", "key": "patrickmounteney", "displayName": "Patrick Mounteney", "active": true, "timeZone": "Europe/London" }, "created": "2016-02-08T07:22:14.000+0000", "updated": "2016-02-08T07:22:14.000+0000" }, { "id": "376472", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "Tested this with the fix in TIMOB-20251. Issue is resolved.\r\n\r\nResolving ticket as fixed.", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-02-10T05:24:48.000+0000", "updated": "2016-02-10T05:24:48.000+0000" }, { "id": "376473", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "[~patrickmounteney] Thanks for the investigation.", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-02-10T05:27:06.000+0000", "updated": "2016-02-10T05:27:06.000+0000" }, { "id": "376983", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "[~msamah] if this is fixed with TIMOB-20251, which is in 5.2 then the fixVersion for this ticket should be 5.2 right?", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2016-02-16T15:34:15.000+0000", "updated": "2016-02-16T15:34:15.000+0000" }, { "id": "377055", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "[~fokkezb] You are right.", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-02-17T02:42:13.000+0000", "updated": "2016-02-17T02:42:13.000+0000" }, { "id": "377219", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "Reopening since a TiSlack user reported it's still not working with the RC. He'll leave a comment with his findings here.", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2016-02-18T11:27:57.000+0000", "updated": "2016-02-18T11:27:57.000+0000" }, { "id": "377220", "author": { "name": "macasfaj", "key": "macasfaj", "displayName": "Miguel Ángel Castaño", "active": true, "timeZone": "Europe/Berlin" }, "body": "Tested with SDK 5.2.0RC and the error is still there.\r\n\r\nGenimotion Nexus 5 - Android 6.0\r\nResult:\r\n[ERROR] : MediaPlayer: error (1, -2147483648)", "updateAuthor": { "name": "macasfaj", "key": "macasfaj", "displayName": "Miguel Ángel Castaño", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-02-18T11:30:56.000+0000", "updated": "2016-02-18T11:30:56.000+0000" }, { "id": "377243", "author": { "name": "patrickmounteney", "key": "patrickmounteney", "displayName": "Patrick Mounteney", "active": true, "timeZone": "Europe/London" }, "body": "As I understood it the fix was in SDK 6.0.0 (which is what I tested using a continuous build) - it certainly said the fix was in 6.00 at the top of one of the tickets relating to this, which I thought was TIMOB-20140, but I now see it's saying the fix is in Release 5.4.0!\r\n\r\nBut still nobody has been able to tell me and the others what this fix actually is (not the permissions one as that appears to be required on top of the '6.00' fix).", "updateAuthor": { "name": "patrickmounteney", "key": "patrickmounteney", "displayName": "Patrick Mounteney", "active": true, "timeZone": "Europe/London" }, "created": "2016-02-18T15:28:17.000+0000", "updated": "2016-02-18T15:28:17.000+0000" }, { "id": "377244", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "[~msamah] I guess [~patrickmounteney] is right and this is not included by TIMOB-20251 (5.2) but TIMOB-20140 (5.4) so this ticket should be re-linked and resolved as fixed in 5.4", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2016-02-18T15:33:27.000+0000", "updated": "2016-02-18T15:33:27.000+0000" }, { "id": "377313", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "[~macasfaj] Could you provide a sample code for me to test this out?\r\nThe link that would reproduce this error.", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-02-19T02:54:29.000+0000", "updated": "2016-02-19T02:54:29.000+0000" }, { "id": "377353", "author": { "name": "macasfaj", "key": "macasfaj", "displayName": "Miguel Ángel Castaño", "active": true, "timeZone": "Europe/Berlin" }, "body": "Sure!\r\n\r\nalloy.js\r\n\r\n{code}\r\nAlloy.Globals.AUDIOPLAYER = Ti.Media.createAudioPlayer({\r\n\turl : 'http://194.169.201.177:8085/stream/prisacom_Sevilla',\r\n\tallowBackground : true\r\n}); \r\n{code}\r\n\r\nindex.js:\r\n\r\n{code}\r\nAlloy.Globals.AUDIOPLAYER.addEventListener('change', function(e){\r\n\t\t\t\t\t\t\t\t\t\t\tTi.API.info(e.state);\r\n});\r\n\r\nAlloy.Globals.AUDIOPLAYER.start();\r\n{code}\r\n\r\nThe result is:\r\n\r\n{code}\r\n[ERROR] : MediaPlayer: error (-2147483648, 0)\r\n[ERROR] : MediaPlayer: start called in state 0\r\n[ERROR] : MediaPlayer: error (-38, 0)\r\n[ERROR] : MediaPlayer: Error (-2147483648,0)\r\n{code}", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2016-02-19T09:31:06.000+0000", "updated": "2016-02-19T09:58:33.000+0000" }, { "id": "377476", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "Thanks [~macasfaj] for the test case!", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-02-22T02:28:28.000+0000", "updated": "2016-02-22T02:28:28.000+0000" }, { "id": "378416", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "Tested that link with both Alloy and Classic with Android 6.0, same error occurs.\r\n{code}\r\n003-01 19:31:47.969 381 5751 D NuPlayerDriver: notifyListener_l(0xb332d120), (1, 0, 0)\r\n03-01 19:31:47.970 5511 5526 D MediaPlayer: setSubtitleAnchor in MediaPlayer\r\n03-01 19:31:47.982 381 1573 E MediaPlayerService: getDuration returned -2147483648\r\n03-01 19:31:47.982 5511 5526 W MediaPlayer: Attempt to seek to invalid position: -1\r\n03-01 19:31:47.982 381 1265 E MediaPlayerService: getDuration returned -2147483648\r\n03-01 19:31:47.983 5511 5526 W MediaPlayer: Stream has no duration and is therefore not seekable.\r\n03-01 19:31:47.983 5511 5526 E MediaPlayer: error (-2147483648, 0)\r\n03-01 19:31:47.985 5511 5526 E MediaPlayer: start called in state 0\r\n03-01 19:31:47.985 5511 5526 E MediaPlayer: error (-38, 0)\r\n03-01 19:31:47.986 5511 5526 I TiAPI : 1\r\n03-01 19:31:47.987 5511 5526 E MediaPlayer: Error (-2147483648,0)\r\n03-01 19:31:47.988 381 1573 D NuPlayerDriver: reset(0xb332d120)\r\n03-01 19:31:47.988 381 1573 D NuPlayerDriver: notifyListener_l(0xb332d120), (8, 0, 0)\r\n03-01 19:31:47.990 381 5766 I NuCachedSource2: caching reached eos.\r\n03-01 19:31:47.991 381 5751 D NuPlayerDriver: notifyResetComplete(0xb332d120)\r\n03-01 19:31:47.993 5511 5526 W MediaPlayer: mediaplayer went away with unhandled events\r\n03-01 19:31:47.994 5511 5526 I TiAPI : 3\r\n{code}", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-03-02T03:32:55.000+0000", "updated": "2016-03-02T03:47:31.000+0000" }, { "id": "378417", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "Don't think it's an Alloy issue. More of an Android 6.0 (Marshmallow issue)", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-03-02T03:47:58.000+0000", "updated": "2016-03-02T04:30:53.000+0000" }, { "id": "378440", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "5.2.0.GA seems to have this bug and it's not working.\r\n\r\nTried this with Master (5.4.0) and alloy and classic version both are able to work.", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-03-02T07:08:41.000+0000", "updated": "2016-03-02T07:08:41.000+0000" }, { "id": "378441", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "Resolving this as fixed in 5.4.0.", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-03-02T07:09:44.000+0000", "updated": "2016-03-02T07:09:44.000+0000" }, { "id": "390194", "author": { "name": "jlongton", "key": "jlongton", "displayName": "Josh Longton", "active": true, "timeZone": "Europe/London" }, "body": "Verified as fixed. \r\nTested on:
 \r\nNexus 5 (6.0.1)\r\nandroid emulator (6.0, 4.2.2) \r\n
Mac OSX El Capitan 10.11.5 \r\nStudio: 4.7.0.201607070843\r\n
Ti SDK: 5.4.0.v20160705213725 \r\n
Appc NPM: 4.2.8-1 \r\nAppc CLI: 5.4.0-29 \r\nNode v4.4.4 \r\n*
Closing Ticket*", "updateAuthor": { "name": "jlongton", "key": "jlongton", "displayName": "Josh Longton", "active": true, "timeZone": "Europe/London" }, "created": "2016-07-08T21:12:25.000+0000", "updated": "2016-07-08T21:12:25.000+0000" } ], "maxResults": 17, "total": 17, "startAt": 0 } } }