Hype Hype - 5 months ago 102
Android Question

AudioFlinger server died. Play RTSP stream won't start on Lollipop device only.

I'm testing libstreaming library. My app description: One device stream video from camera to another device via RTSP. All working perfectly on KitKat devices but my Huawei p8 lite (Lollipop) can't run stream beacause:


W/AudioSystem: AudioFlinger server died!

W/IMediaDeathNotifier: media server died

E/MediaPlayer: error (100, 0)

E/MediaPlayer: Error (100,0)


My stream server side:

// Configures the SessionBuilder
SessionBuilder.getInstance()
.setSurfaceView(surfaceView)
.setPreviewOrientation(90)
.setContext(getApplicationContext())
.setAudioEncoder(SessionBuilder.AUDIO_NONE)
.setAudioQuality(new AudioQuality(16000, 32000))
.setVideoEncoder(SessionBuilder.VIDEO_H264)
.setVideoQuality(new VideoQuality(320,240,20,500000));

// Starts the RTSP server
this.startService(new Intent(this,RtspServer.class));


Play stream side:

private void play() {
if(mediaPlayer == null) {
mediaPlayer = new MediaPlayer();
}
setErrorListener();
mediaPlayer.setDisplay(surfaceHolder);
mediaPlayer.setOnPreparedListener(this);

try {
//RTSP SERVER URI
String videoUri = "rtsp://192.168.1.1:8086?/";

mediaPlayer.setDataSource(this, Uri.parse(videoUri));
mediaPlayer.prepareAsync();
} catch (IOException e) {
e.printStackTrace();
}
}


When lollipop device is streaming then kitkat device dont have any isuess to play stream. Why play stream not working on this particular device?

Answer

It's solved.

For some reason url created with ( "?/" ) doesn't work on Lollipop:

String videoUri = "rtsp://192.168.1.1:8086?/";

Then I edit method Parse(); in libstreaming. I removed the whole part about parameterization session using url.

And I changed videoUri to without (?):

String videoUri ="rtsp://192.168.1.1:8086/";