Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3662420
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T01:24:53+00:00 2026-05-19T01:24:53+00:00

SDK level 8 (Froyo) has introduced the native capability for the MediaPlayer to connect

  • 0

SDK level 8 (Froyo) has introduced the native capability for the MediaPlayer to connect to a streaming source, like Shoutcast. Previous SDK versions were able to do workarounds, such as run a local proxy on the device (see NPR).

I took the same approach as NPR and am using a StreamProxy. However, NPR first checks if the currently running SDK is less than 8. If so, it uses the proxy. Otherwise, it connects directly.

My StreamProxy requests metadata from the Shoutcast server, so it does not simply route the data from Shoutcast to my client. Instead, it parses out metadata and uses it accordingly, and only routes the music data.

When trying to use the StreamProxy at SDK level 8 or above, the MediaPlayer fails to prepare. My StreamProxy receives the connection and accepts it, but after successfully writing out the status line and headers to the client, the next write produces java.net.SocketException: Connection reset by peer. This results in the client’s mediaplayer throwing an Error(1,-1007).

I am trying to figure out why the MediaPlayer is unable to connect to my local proxy. It should be the same as connecting to the original source without the metadata, which does work. I am forwarding on all headers from the external source, through my proxy, which includes content-type.

I will continue looking into it, but I feel like I’m at a dead-end. Let me know if more details are needed.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T01:24:53+00:00Added an answer on May 19, 2026 at 1:24 am

    EDIT: Ok I now believe I have the answer!

    Stagefright is strict when it comes to line-endings in the HTTP-header; They have to be CR,LF and not just LF which has worked earlier.

    So if you build your own headers, replace any “\n” with “\r\n” and you should be fine.

    (If you want to check this for yourself, look at receive_line() in media/libstagefright/HTTPStream.cpp)

    I can now stream shoutcast with Metadata on 2.2/Stagefright phones…

    …

    I have been running into the same problem;

    First I tried writing the streamed data to a fixed length file and wrapping – and playing it with setLooping(true). This causes glitches when the MP3 loops, even though I extract whole MP3 frames and tried to pad the uneven bytes at the end with both 0xff and 0x00. This might still be an acceptable solution if you have a big enough file.

    Then I did the proxy thing which works on my Samsung Galaxy S (v2.2) but not in the emulator and apparently not on the Desire (Not working = Error -1007 as mentioned above).
    One hint may be that the Galaxy S Mediaplayer asks for HTTP1.0, while it is 1.1 in the emulator.

    The brute-force method would be to open 2 streams in parallel, reading meta-data from one and streaming from the other 😉

    Anyway, I also want to hear if anyone else has had more luck…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I quote from the SDK docs: Beginning with Android 3.0 (API level 11), Android-powered
The Android SDK has an API that lets you access Google Voice Search directly
I currently have an app on the market that supports Android 1.5 (SDK level
Is there a way to adjust intensity/level of vibration in iPhone using iPhone SDK?
I'm building an Android Application (minimum SDK Level 10, Gingerbread 2.3.3) with some Fragments
I wrote an application using the Android 2.2 SDK (API level 8). It is
Android google maps sdk approximate zoom level to discrete values. I mean that i
When installing Google APIs for level 7 in Eclipse with the SDK Manager, I
I have a 3rd party SDK that handles an audio recording. It has a
Does anyone know of a high-level SDK for interacting with AWS? The SDK provided

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.