Android audio stream does not work

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Android audio stream does not work

1,110 Views
gregorykim
Contributor I

Hi, I want to audio stream in iMX6 board using Android(JB) MediaPlayer (Example :http://80.237.156.44/iloveradio1.mp3).
But it does not work.
Could you help me with this?


[Tested version]

IMX6_R13.41_ANDROID_DEMO_IMAGE

 

[Error Description]

Android MediaPlayer can not play network audio stream. Other Android devices work well.

I tested using simple application.

===============================================================

public class MainActivity extends Activity {
    MediaPlayer mp;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        if (mp == null)
            mp = new MediaPlayer();
      try {
          mp.setDataSource("http://80.237.156.44/iloveradio1.mp3");
      } catch (IllegalArgumentException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      } catch (SecurityException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      } catch (IllegalStateException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      } catch (IOException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      }
      try {
          mp.prepareAsync();
      } catch (IllegalStateException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      }
      OnPreparedListener listener = new OnPreparedListener(){
          @Override
          public void onPrepared(MediaPlayer arg0) {
              Toast.makeText(getBaseContext(), "start", Toast.LENGTH_SHORT).show();
              arg0.start();
          }

      };
      mp.setOnPreparedListener(listener);
    }
}

[Reproducing Steps]

  1. Turn on device.
  2. Connect to network.
  3. Execute sample application.
Labels (2)
0 Kudos
2 Replies

543 Views
gregorykim
Contributor I

I tested it using IMX6_JB43_100_ANDROID_DEMO_BSP. But audio stream did not work.

The android log is like this.

11-27 06:51:45.896: I/OMXPlayer(5831): LEVEL: 1 FUNCTION: prepare LINE: 445

11-27 06:51:45.896: I/OMXPlayer(5831): failed to open file: /data/system/audio_pass_through_pref.

11-27 06:51:45.896: I/OMXPlayer(5831): Loading content: http://80.237.156.44/iloveradio1.mp3

11-27 06:51:45.916: I/OMXPlayer(5831): allocate priv_data

11-27 06:51:47.716: I/OMXPlayer(5831): ResetCache!!!

11-27 06:51:50.266: I/OMXPlayer(5831): ResetCache!!!

11-27 06:51:51.666: I/OMXPlayer(5831): [HttpsProtocol] seek() not correct, request: 2147467263, return: 0

0 Kudos

543 Views
gregorykim
Contributor I

I applied the "CT44139182-Internet-radio-playback-failure.patch" to build the android source files.

But audio did not work, too.

I confirmed the patch codes was applied to the source files.

The log is like this.

01-24 01:06:53.629:I/OMXPlayer(2356): ResetCache!!!
01-24 01:06:55.049: W/audio_hw_primary(2356): do_out_standby... 1085145616
01-24 01:06:55.309: I/OMXPlayer(2356): ResetCache!!!
01-24 01:06:56.009: I/OMXPlayer(2356): [HttpsProtocol] seek() not correct, request: 2147467263, return: 0

0 Kudos