Android Media Player service freezes Samsung galaxy S

Go To StackoverFlow.com

1

I have a radio app for my website working in my EVO and other devices that works great, but a user tells me that in his Samsung Galaxy S it freezes the app (he send me a video in witch I can see that the media player service gets call and starts, but no sound comes out and the app freezes no crash screen to send a report or nothing it just freezes), I don't have a Galaxy to test on, so what can I do? have anyone else had a similar problem? I try pasting my code here but someone decided to close my question with out any suggestions. all my app does is from the main activity a button calls the media player adds the url of my mp3 stream and starts the payer.

Button canal1 = (Button) findViewById(R.id.bcanal1);
        canal1.setOnClickListener(new View.OnClickListener() {
        public void onClick(View view) {
               mUrl = "http://67.212.165.106:8161";
                   textRadioName.setText("you are listening to VARIADO!");
                       Intent i = new Intent (ChevereMovilActivity.this, PlayerService.class);
        startService(i);
        PlayerService.setSong(mUrl, "Temp Song", null); 
        start();
        }});

start method

@Override
public void start() {
    if (PlayerService.getInstance() != null) {
        PlayerService.getInstance().startMusic();
    }
}

in the manifest

<service android:name=".PlayerService" 
            android:label="@string/app_name"> 
            <intent-filter>
        </intent-filter>    
    </service>

like I said it works in my eve but not a Samsung Galaxy S I'm using Android 2.2

2012-04-05 20:22
by zvzej
I found this [link] (http://innovator.samsungmobile.com/cms/cnts/knowledge.detail.view.do?platformId=1&cntsId=9578&listReturnUrl=http%3A%2F%2Finnovator.samsungmobile.com%3A80%2Fplatform.main.do%3FplatformId%3D1%26cateId%3D1%26cntsId%3D%26imgType%3D%26searchText%3Dgalaxy%2Bs%2B%26sortType%3D0%26codeType%3DAll%26nacode%3D%26indexDirection%3D1%26indexType%3D1%26listLines%3D10%26tabNum%3D1&linkType=0&nacode=&codeType=All) where you could get the Samsung GALAXY S Skin for handset emulation, I follow the instructions int the site but can't build the AVD - zvzej 2012-04-06 23:20
it gives me the error [2012-04-06 16:07:51 - SDK Manager] Skin 'Galaxy_s' does not exist. [2012-04-06 16:07:51 - SDK Manager] Missing skinpath in the AVD folder. what am I doing wrong - zvzej 2012-04-06 23:21


0

The service is frozen because Samsung Galaxy S can't prepare the stream and you are probably using mediaPlayer.prepare() instead of mediaPlayer.prepareAsync().

I think it's an undocumented "quirk" in some Galaxy devices. The problem is the stream format. If you write in a console:

wget -S -O stream http://67.212.165.106:8161

and them:

head -n 12 stream

you can see something like:

ICY 200 OK
icy-notice1:<BR>This stream requires <a href="http://www.winamp.com/">Winamp</a><BR>
icy-notice2:SHOUTcast Distributed Network Audio Server/Linux v1.9.8<BR>
icy-name:My Station name
icy-genre:Various
icy-url:http://www.radiokolergan.com
content-type:audio/mpeg
icy-pub:1
icy-br:64

qOCéúÐX43‘¤]ÝáÅQ(;Œ6½v<‡ÿò„

I think the problem is this header. If you try with others urls (for example: http://195.55.74.213/rtve/radio4.mp3?GKID=804c9f24cb4811e1af4600163ea2c743) you doesn't obtain this header and it reproduce fine in Samsung Galaxy Tab and other devices.

2012-07-11 13:31
by Brais Gabin
I found out that actually those streams did work but only when I had the WiFi on, I think that the galaxy will stall if the stream is trying to play quality is to high - zvzej 2012-07-13 00:31
The stream http://67.212.165.106:8161 doesn't work for me when I have the WiFi on. I will continue researching the problem. If I find something new I will edit the answer - Brais Gabin 2012-07-13 09:13
I think that, that url is no longer working - zvzej 2012-07-13 15:01
I too am experiencing the same problem and it happens for both prepare() and prepareAsync(). Function calls do not return or never trigger any of the callbacks like onError, onPrepared, etc. Same code works fine for streams without the ICY header, but not for streams with the ICY header. Same code works on S4, S5, Galaxy Tab, etc but not S6. : - Ken 2015-10-21 01:45
Ads