1

First, sorry for my grammar, I'm not native!!!

I'm try to develop Miracast application on Sink device. It's done with some Android phones (LG G, Asus...) which not base on stagefright like Nexus 10 (also Nexus 4, HTC One...).

When I trying establish WFD session, the Nexus 10 says: "RTSP/1.0 505 RTSP Version not supported" after I reponse message M3. I googled and know the problem may be source device can't find "RTSP/1.0" in the message reponse. I defined RTSP_VERSION and use it to all of message (include M1 and M2 and still OK).

#define RTSP_VERSION "RTSP/1.0"

And the question is: Why the phone reply me like that (error 505)? Any suggestions for me to fix the problem?

the RTSP message log look like:

 !!!
OPTIONS * RTSP/1.0
Date: Wed, 02 Jul 2014 08:21:50 +0000
Server: stagefright/1.2 (Linux;Android 4.4.4)
CSeq: 1
Require: org.wfa.wfd1.0

!!!
***
RTSP/1.0 200 OK
CSeq: 1
Public: org.wfa.wfd1.0, GET_PARAMETER, SET_PARAMETER

***
***
OPTIONS * RTSP/1.0
CSeq: 0
Require: org.wfa.wfd1.0

***
!!!
RTSP/1.0 200 OK
Date: Wed, 02 Jul 2014 08:21:50 +0000
Server: stagefright/1.2 (Linux;Android 4.4.4)
CSeq: 0
Public: org.wfa.wfd1.0, SETUP, TEARDOWN, PLAY, PAUSE, GET_PARAMETER, SET_PARAMETER

!!!
!!!
GET_PARAMETER rtsp://localhost/wfd1.0 RTSP/1.0
Date: Wed, 02 Jul 2014 08:21:50 +0000
Server: stagefright/1.2 (Linux;Android 4.4.4)
CSeq: 2
Content-Type: text/parameters
Content-Length: 83

wfd_audio_codecs:
wfd_video_formats:
wfd_content_protection:
wfd_client_rtp_ports
***
RTSP/1.0 200 OK
CSeq: 2
Content-Type: text/parameters
Content-Length: 210

wfd_audio_codecs: AAC 00000001 00
wfd_video_formats: 28 00 02 02 00000020 00000000 00000000 00 0000 0000 00 none none
wfd_content_protection: none
wfd_client_rtp_ports: RTP/AVP/UDP;unicast 6500 0 mode=play
!!!
SET_PARAMETER rtsp://localhost/wfd1.0 RTSP/1.0
Date: Wed, 02 Jul 2014 08:21:50 +0000
Server: stagefright/1.2 (Linux;Android 4.4.4)
CSeq: 3
Content-Type: text/parameters
Content-Length: 246

wfd_video_formats: 00 00 02 02 00000020 00000000 0000
<missing log but don't care about that, it's fine>
***
RTSP/1.0 200 OK
CSeq: 3

***
!!!
RTSP/1.0 505 RTSP Version not supported
Date: Wed, 02 Jul 2014 08:21:50 +0000
Server: stagefright/1.2 (Linux;Android 4.4.4)
CSeq: 3

!!!

##MIRA Break!!!!

##MIRA EndClient!!!
heinekenB
  • 21
  • 3

2 Answers2

0

The error which you have reported is coming from onReceiveClientData as here. Since the control is coming here, it is apparent the response is not starting with RTSP. Please check if there are any typos or spaces in the response string.

Ganesh
  • 5,880
  • 2
  • 36
  • 54
  • Thank you, I understand your answer but the error occur at M4 (CSeq: 3), my response string is: **snprintf(res, MESSAGE_BUFF_LEN, "%s 200 OK\r\nCSeq: %d\r\n\r\n", RTSP_VERSION, CSeq_Source);** And my code worked with some phones as LG G, Zenfone, Sony Z.. without any error. – heinekenB Jul 23 '14 at 02:14
  • @heinekenB.. as an experiment can you please hardcode the `RTSP/1.0` string into your `snprintf` statement instead of employing `RTSP_VERSION`. Does that help? – Ganesh Jul 23 '14 at 03:45
  • Thank Ganesh, hardcode is the first of many ways I tried before but nothing different. For new information, I work with Nexus 4 (4.3), it says __RTSP/1.0 400 Bad Request__ at M4 but continue send M5 to me. However, it asks to trigger TEARDOWN after PLAY command??? – heinekenB Jul 24 '14 at 02:15
  • @heinekenB.. Now I have one doubt on your sink implementation. Do you support `HDCP` or not? It may be possible that if your sink is __not__ supporting `HDCP` the source may be terminating the connection as it may not want to support streaming to your sink. – Ganesh Jul 24 '14 at 03:42
  • I also think about HDCP but my sink talks to Galaxy S4 (which need HDCP and I said "none") successful, RTSP session has been established. However, the screen show **HDCP not supported by connected device**. So, I think the root cause of my error is not about HDCP. – heinekenB Jul 24 '14 at 04:10
  • @heinekenB..For `HDCP`, there is no `SET` parameter in `M4`. Hence, the source has it's own discretion to continue with connection or not. So the way Galaxy S4 is responding will be different from the way Nexus would do. I will try to check if I can get access to Nexus tree, but from all our discussions, I feel that the connection termination is mainly coming from `wfd-content-protection` set to `none`. – Ganesh Jul 24 '14 at 04:19
  • ummm.. If it like what you said, poor me.. But why is the nexus says: __505 RTSP Version not supported__ ? And why at M4 not M3 when the sink said **wfd-content-protection: none**? May be I'll find a smart TV without HDCP and check again with nexus 10. Thank you Ganesh xD – heinekenB Jul 24 '14 at 04:33
0

Even I was facing same issue. It's because of wrong content-length value. Try with 211 instead of 210 while replying to GET_PARAMETER request

ASB
  • 324
  • 1
  • 2
  • 7