Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-20234

Streaming Audio not working on Android Marshmallow with Alloy

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Release 5.4.0
    • Component/s: Android
    • Labels:
    • Story Points:
      3
    • Sprint:
      2016 Sprint 3 SDK, 2016 Sprint 5 SDK

      Description

      As mentioned in ticket: TIMOB-20140 reported by Patrick Mounteney

      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)
      Examples:
      Won't play: http://sc2.radiocaroline.net:10558
      Will play: http://sc2.radiocaroline.net:8000
      The error starts at: E/NuCachedSource2(16101): source returned error -1, 10 retries left
      In 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:
      AAS: Asking for stream handler for protocol: 'http'
      Audio 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!

      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.
      Test code built with Ti. SDK 6.0.0.v20160112093414 and targeting Android API 23

      var player = Titanium.Media.createAudioPlayer(
      { allowBackground: true, url: "http://sc2.radiocaroline.net:10558" }
      );
      function streamButtonClick()
      { Ti.API.info("Playing : "+ player.url); player.play(); }
      

      Test 1:
      Alloy build - run on Nexus 7 Tablet Android 6.0.1 - It doesn't play and throws error (1, -2147483648)
      Classic build - run on Nexus 7 Tablet Android 6.0.1 - streams plays
      Test 2:
      Alloy build - run on Lenovo Tablet Android 4.2.2 - streams plays
      Classic build - run on Lenovo Tablet Android 4.2.2 - streams plays
      Observations: When it works we see this printed in the Ti Console:
      [DEBUG] : AAS: Asking for stream handler for protocol: 'http'
      [DEBUG] : MediaPlayer: setSubtitleAnchor in MediaPlayer
      When it doesn't work we get:
      [ERROR] : MediaPlayer: error (1, -2147483648)
      And when it does work, in the Android log we see:
      01-12 07:48:55.722: D/audio_hw_primary(16101): enable_audio_route: apply and update mixer path: low-latency-playback
      01-12 07:48:55.988: E/NuCachedSource2(16101): source returned error -1, 10 retries left
      Conclusion: There is something in an Alloy build, when run under Android 6.0, that is causing NuCachedSource2 to error and the stream never plays.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                msamah Ashraf Abu (Inactive)
                Reporter:
                msamah Ashraf Abu (Inactive)
              • Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-20852
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Source Code