Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to start stream: error code -1 #66

Closed
bam2000 opened this issue Oct 25, 2016 · 22 comments
Closed

Failed to start stream: error code -1 #66

bam2000 opened this issue Oct 25, 2016 · 22 comments

Comments

@bam2000
Copy link

bam2000 commented Oct 25, 2016

Please provide the following info.

NVidia Geforce Experience version: 2.2.3
Moonlight Embedded version: 0.1.0
Moonlight Embedded running on: Vita, iOS 10

Output of Moonlight Embedded:

What is the expected result?
Stream starting
What happens instead of that?
Failed to start stream: error code -1
failed stage: rtsp handshake
(Error code -1)

First of I have to use a old version of GeForce experience since my gt650m is not supported native.
So i use a modified version 2.2.3
With moonlight Alpha 6 while installing everything i got a connection with my vita and it worked.
Since 0.1.0 I get the error above, and when i downgrade to Alpha 6I also get the error message.
I have also installed moonlight on my iPad and it's connecting just fine no error. So I have to assume that's a problem with the vita version of moonlight.

I really hope someone can help me find the problem.

@d3m3vilurr
Copy link
Collaborator

d3m3vilurr commented Oct 25, 2016

please upload your log to pastebin

go settings->enable debug log->connect->if got error, close app and upload ux0:data/moonlight/moonlight.log

@bam2000
Copy link
Author

bam2000 commented Oct 25, 2016

Thanks,
i have the log, but i think i dont need pastebin not much information in it ⭕

connection_stage_starting - stage: 1
connection_stage_complate - stage: 1
connection_stage_starting - stage: 2
connection_stage_complate - stage: 2
connection_stage_starting - stage: 3
connection_stage_failed - stage: 3, -1
connection terminated

Its strange because its working on my iOS devices

P.S.
I have the wrong Nvidia Geforce Experiance given. I run on 2.5.14.5

Greetings and thanks for the help :)

@d3m3vilurr
Copy link
Collaborator

oops.. i forgot add to log...

@d3m3vilurr
Copy link
Collaborator

please check with this

@bam2000
Copy link
Author

bam2000 commented Oct 25, 2016

Initializing platform...connection_stage_starting - stage: 1
connection_stage_complate - stage: 1
done
Resolving host name...connection_stage_starting - stage: 2
connection_stage_complate - stage: 2
done
Starting RTSP handshake...connection_stage_starting - stage: 3
Failed to parse RTSP response
RTSP OPTIONS request failed: -1
failed: -1
connection_stage_failed - stage: 3, -1
Cleaning up platform...done
connection terminated

@d3m3vilurr
Copy link
Collaborator

please retest with this
it will store more detail rtsp log

please paste to http://pastebin.com/ :)

@d3m3vilurr
Copy link
Collaborator

and can you share info about modified GFE? that sound is interesting :)

@bam2000
Copy link
Author

bam2000 commented Oct 25, 2016

Thanks.
http://pastebin.com/6PQu2dwh

and the modification is from the good people of XDA :)
http://forum.xda-developers.com/showthread.php?t=2394478

@d3m3vilurr
Copy link
Collaborator

@bam2000 please retest with this
i'll review log next day :/ (my local time is am3)

@bam2000
Copy link
Author

bam2000 commented Oct 25, 2016

No Problem, have a good night :)
Now i got another Error Message -35

the Log:
http://pastebin.com/6Den03pv

@d3m3vilurr
Copy link
Collaborator

ok. i guess that's tcp socket problem of vita. i'll make more small test set for this. thanks :)

@bam2000
Copy link
Author

bam2000 commented Oct 29, 2016

Thanks for the help, i will not be available the next week, but i will check after i come back from vacation.

@d3m3vilurr
Copy link
Collaborator

@bam2000 please retest and upload log using this
this version only add date-time information...

@bam2000
Copy link
Author

bam2000 commented Nov 6, 2016

thanks, and here is the log :)
http://pastebin.com/dhF48Pcy

@cgutman
Copy link

cgutman commented Nov 6, 2016

@d3m3vilurr This definitely looks like a bug in the sockets implementation. Moonlight-common-c places TCP sockets in non-blocking mode using FIONBIO to allow the connect() operation to timeout out if necessary, however it sets the sockets back to blocking mode before returning from connectTcpSocket(). See the code here: https://github.com/moonlight-stream/moonlight-common-c/blob/master/src/PlatformSockets.c#L229

The socket appears to still be in non-blocking mode when recv() is called, which is certainly the cause of the failure.

@d3m3vilurr
Copy link
Collaborator

I made non-block socket
actually, i think normal case socket start non-block mode and added this code to enableNoDelay

val = 0;
setcokopt(s, SOL_SOCKET, SCE_NET_SO_NBIO, (char*)&val, sizeof(val));

anyway, current build config not set FIONBIO. so i ignored that section.

i'll try rechecking socket and socket options at tonight.

PS. it's little strange issue, other sockets are working.(eg. libcurl) :(

@cgutman
Copy link

cgutman commented Nov 7, 2016

@d3m3vilurr Do you have that socket code somewhere that I can look at? In a proper BSD/POSIX sockets implementation, sockets must start in blocking mode for correct application behavior. If they're starting in non-blocking mode, that's a serious bug that would break most applications running on that implementation.

If FIONBIO isn't defined, that's okay - it just won't enable the connection timeout.

Libcurl may work because it tries to enable non-blocking sockets itself, so it expects the EAGAIN return value and uses select() or poll() to wait for data.

@d3m3vilurr
Copy link
Collaborator

d3m3vilurr commented Nov 8, 2016

ok. i found problem. @cgutman you are right. vita-newlib's setsockopt is wrong.
current implement not allow timeval structure, so this socket closed immediately.
btw, in nonblock method, these socket use select & this function can use timeval.
so, enet not make problem, but only tcp socket got a problem.

i'll make patch newlib or moonlight-common-c. (but i guess it probably newlib's problem.)


@cgutman i was wrote wrong before. i expect socket open block mode, but actually don't know so repeat set after connect.
i don't have socket implement source code. but vita socket is probably bsd competable something, and we use newlib layer instead direct use this. https://github.com/vitasdk/newlib/tree/vita/newlib/libc/sys/vita

@d3m3vilurr
Copy link
Collaborator

@bam2000 please check this build. sorry i'm late :/

@bam2000
Copy link
Author

bam2000 commented Nov 11, 2016

Hey, no problem :)
Thanks for the help the Problem is gone and its working just fine with my Vita 👍

@d3m3vilurr
Copy link
Collaborator

i'll attach newer vpk to release page asap ;)

@d3m3vilurr d3m3vilurr mentioned this issue Nov 20, 2016
@calvin11119999
Copy link

Could you please give me the download address of GFE 2.2.3 ? My GPU is GT750M. And I am use the way like @bam2000 to open the gamestream. However, I could not find the Geforce Experience version2.2.3,
I had try to use the version2.1.5,but fail.And prompt Failed to start stream: error code -1
failed stage: rtsp handshake
(Error code -1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants