moonlight-stream / moonlight-embedded

Gamestream client for embedded systems
https://github.com/moonlight-stream/moonlight-embedded/wiki
GNU General Public License v3.0
1.5k stars 326 forks source link

Unable to pair moonlight 2.7.0 on a Sunshine v0.22.0 or higher #892

Closed luzfcb closed 3 months ago

luzfcb commented 4 months ago

Please provide the following info.

NVidia Geforce Experience version: Do not apply. Steam Running on Linux via https://github.com/Steam-Headless/docker-steam-headless and a Sunshine server v0.22.0 (also tested with 0.23.1 and the same problem happened) Moonlight Embedded version: 2.7.0 Moonlight Embedded source: https://github.com/knulli-cfw/distribution/tree/knulli-main/package/batocera/emulators/moonlight-embedded Moonlight Embedded running on: Anbernic RG35xx-h Moonlight Embedded running on distribution: Knulli Linux (it's a fork of Batocera Linux)

Verbose output -verbose of Moonlight Embedded:

[root@KNULLI /userdata/system]# moonlight -debug pair -keydir /userdata/system/configs/moonlight/keydir 192.168.3.150
Moonlight Embedded 2.7.0 (CEC;SDL;ALSA;PULSE)
Connecting to 192.168.3.150...
Request http://192.168.3.150:47989/serverinfo?uniqueid=0123456789ABCDEF&uuid=616652f7-9d38-4e4f-aaec-58b4bcc28edd
Response:
<?xml version="1.0" encoding="utf-8"?>
<root status_code="200"><hostname>SteamHeadless</hostname><appversion>7.1.431.-1</appversion><GfeVersion>3.23.0.74</GfeVersion><uniqueid>417067A6-059F-672A-6614-EB5FD05600E6</uniqueid><HttpsPort>47984</HttpsPort><ExternalPort>47989</ExternalPort><MaxLumaPixelsHEVC>1869449984</MaxLumaPixelsHEVC><mac>00:00:00:00:00:00</mac><LocalIP>192.168.3.150</LocalIP><ServerCodecModeSupport>257</ServerCodecModeSupport><SupportedDisplayMode/><PairStatus>0</PairStatus><currentgame>0</currentgame><state>SUNSHINE_SERVER_FREE</state></root>

Request https://192.168.3.150:47984/serverinfo?uniqueid=0123456789ABCDEF&uuid=a7672985-bd57-4235-9395-2c68cf2bb8b0
Request http://192.168.3.150:47989/serverinfo?uniqueid=0123456789ABCDEF&uuid=af512ba3-2591-46e5-ae84-b58741f27133
Response:
<?xml version="1.0" encoding="utf-8"?>
<root status_code="200"><hostname>SteamHeadless</hostname><appversion>7.1.431.-1</appversion><GfeVersion>3.23.0.74</GfeVersion><uniqueid>417067A6-059F-672A-6614-EB5FD05600E6</uniqueid><HttpsPort>47984</HttpsPort><ExternalPort>47989</ExternalPort><MaxLumaPixelsHEVC>1869449984</MaxLumaPixelsHEVC><mac>00:00:00:00:00:00</mac><LocalIP>192.168.3.150</LocalIP><ServerCodecModeSupport>257</ServerCodecModeSupport><SupportedDisplayMode/><PairStatus>0</PairStatus><currentgame>0</currentgame><state>SUNSHINE_SERVER_FREE</state></root>

GPU: , GFE: 3.23.0.74 (, 7.1.431.-1)
Server codec flags: 0x101
Please enter the following PIN on the target PC: 4349
Request http://192.168.3.150:47989/pair?uniqueid=0123456789ABCDEF&uuid=68eca8a7-7ca4-4c3c-86d4-67bae2435e49&devicename=roth&updateState=1&phrase=getservercert&salt=538b6a6a6c3574c1631cfa88a0c68081&clientcert=2d2d2d2d2d424547494e2043455254494649434154452d2d2d2d2d0a4d494943767a43434161656741774942416749424144414e42676b71686b694739773042415173464144416a4d53457748775944565151444442684f566b6c450a53554567523246745a564e30636d56686253424462476c6c626e51774868634e4d6a51774e6a417a4d5463784e44417a5768634e4d7a51774e6a41784d5463780a4e44417a576a416a4d53457748775944565151444442684f566b6c4553554567523246745a564e30636d56686253424462476c6c626e5177676745694d4130470a4353714753496233445145424151554141344942447741776767454b416f494241514353526b664a4e59724241334a7137485a5945665976502f3351797a51330a7564375a37304165595475674c756f46354f692b393152674c384175583035634e43384a6b7842376d4342776734334e686a4e713032646963763659763150520a4c785964736b4258612f4b654c536835506e7a66474e4271795a434970784450714f754f6c733644745133774f542b352f5977327876447875314777592f712f0a4e2f644f59736362445173457a534d4d6b38555a7036724b7571704a6a61454f49726857454530515777644a4b596169532f346430762f65414474534e61306a0a4a444536766a38547a5436694b5466564337705042565662414847494f622f4b6a737352465a65695632312f78314539484f3365574f7052617634764850694d0a654b674f4867614f4c6d634f33757352704564344864583059506772632b6d7a6d597736446e564937375a637673563442776a546c33556c41674d42414145770a4451594a4b6f5a496876634e4151454c42514144676745424144655a495073334e6c4270723376736955394773396d5a32325a756534432b6c57322b614a41450a655a6b4b4471786f2f4242544b552f5346334d78794148616c67594c436758546e2b59385673754f31494f494b514232636755466763314d2f632b6f567a58520a7142784a5379345668663841357070596f3454683947536479657538373069686647622b4270562f6f35746735482b3230716a6176486869566b65416e784f500a766a4b436d56364c71506431464b3177383652397246522b7054546171466142637455624a546f4e7974726263307048345a587841305a704e6870594d4658610a4646574c582b732f6b7a5a75333037474d4e36522b4e7630784c76502b585571697370684d384c4d76704246436c7a396c6163337556512f4e2f673762667a4b0a444a556a344e67514c794571636853685a61767644703931564b636230452b4a4e4c77444e634b32636772492f4e4d3d0a2d2d2d2d2d454e442043455254494649434154452d2d2d2d2d0a
Response:
<?xml version="1.0" encoding="utf-8"?>
<root status_code="200"><paired>1</paired><plaincert>2D2D2D2D2D424547494E2043455254494649434154452D2D2D2D2D0A4D494943306A434341627167417749424167495546516C6D7A38577A33466A56323430354B456647334E52724C3141774451594A4B6F5A496876634E4151454C0A42514177497A45684D42384741315545417777595533567563326870626D5567523246745A584E30636D56686253424962334E304D423458445449304D4455790A4D54457A4D5467314E6C6F58445451304D4455784E6A457A4D5467314E6C6F77497A45684D42384741315545417777595533567563326870626D5567523246740A5A584E30636D56686253424962334E304D494942496A414E42676B71686B6947397730424151454641414F43415138414D49494243674B43415145416E61446D0A354C4C564C38787348726C6D4C52485174673469336C4E64552F7539317A574E755A41503351523062667236723636564343376E5242555651562B66625332640A376E433944746D566F53692F67484D564E7755596C6B4B79366773452F635635554A4C7A2F674536466E4B6B6F547855683851666F435638766C56612B4D51500A6E6770304F536949786A64785533784A444C54784E4149585641544673665270397332385976517872625A656A6966645045416138706A3864615673496D7A370A57714D2F72756D575730664235675379517633714347553150396454417851357947644244514B72594D5256722B6F75566875666D343167327A2B49304361330A7A78714745526D396D5A6C3043766C2F45716E546B6C4E6843684C74745A323930356B4F6E31754E5551397671546A654C2B715278414F76313442585044784F0A614E476877345868423136356D4B5A5958514944415141424D41304743537147534962334451454243775541413449424151414768484A6C5A592F4F597337510A446745654B784D385357576655755331326C31597A712F4A306F6863445A2F327059525574584834757A4545323144694A65596A4B642B6B2B706776397733480A31354554762F57705249565455563471584C51343677614E794735697972424C4246444F34783663483962464F4C30763777304E4751343254613447347963770A7465676E48767065574D6C64324542756B33584D6E31577A356E6B4C772F6C716151784D6C5A792F46592B706C645831647750363639374564414656753031470A4C4C5555516B4C462B5938384F70422B44424D316E467A545A7964623633392F61532F694651784D4F624943722F427A544346686C595850366C4B4A6254676F0A5175706934566A2B47544B3271376A4A6D3536436B4A62744F71546D6B365976684E5A584432386D673455612B4D4E43397070713534484339564231716130500A73446C377833676E0A2D2D2D2D2D454E442043455254494649434154452D2D2D2D2D0A0A</plaincert></root>

Request http://192.168.3.150:47989/pair?uniqueid=0123456789ABCDEF&uuid=cbc8d8f3-19dc-48fc-b306-8400d9130e85&devicename=roth&updateState=1&clientchallenge=6ae69f693674d6660adfa61a1a0c6374
Response:
<?xml version="1.0" encoding="utf-8"?>
<root status_code="200"><paired>1</paired><challengeresponse>C467E426290DF83904A7F48049BDE940F2081A6BD47ECBDA9F5224EC1BE2C8B5FA088106AD173B5853A7EDFCF75CB84B</challengeresponse></root>

Request http://192.168.3.150:47989/pair?uniqueid=0123456789ABCDEF&uuid=78e26019-fd6f-4772-b26d-35580a2f605d&devicename=roth&updateState=1&serverchallengeresp=095c25f5594c94f69c94fccd762f5ba3fdce1de1bac682209b3884c4f77e9adf
Response:
<?xml version="1.0" encoding="utf-8"?>
<root status_code="200"><pairingsecret>54FAF44737E9675C3A4C4BFD3ADFB1FF41D947EF10096821B4E7C89807D686099B4D719A5413CF16916876B4A34A687AFA51A24036E195114CFD8DAFC87C4FA61B62B75E807AA2C4B21C8D9E4BA5C03577836785D1CC9E6E9FD89DFB796F8D083B59F3B6268F5D6040AE5230C537CB091DF8ADED80AD2F37C3F6556BAE09AB8EEB438806085905949D312075B6BD5ED83143FFA70A20756BBFFF86B495B349D81F98876A755ADDD40028E1B82B483AC4BE5ABE7688E2B72436E218ED29417A34EF7A168EF3623E0E1007F4F28108242BF8000B37CF989F5DD9B6DF0FD8530AE1CE1BBAAC94FB8914AFFB97B5F4730AD4DEE593D1892960C6174E30293C9BB92E559CC587DCB0AEAA8ED2AD6213B3AE33</pairingsecret><paired>1</paired></root>

Request http://192.168.3.150:47989/pair?uniqueid=0123456789ABCDEF&uuid=e8ee396c-33e3-4f59-a278-3e8617b7c058&devicename=roth&updateState=1&clientpairingsecret=7e27bad5d4e9cb31dd96fcafd5ab7a296e319478b9f0d43e3e4140f1a4933ef44344e4c3b762d0502942c44368c0a33b3dd8c6aef19fbea931ec6f334038281795ea6b847e30df5d5d9dcd76095fe501b35e98312d996770e22ce72a1f547af887ce8cae9e54a4b92502b3c122f09885a5d17ddfdfa2d638a6fdb4d69a13dc501508b7bb2c8c13fce8a4f0e701b3e536d5e55f0d3ea4a3e5877b462cef8f2bfe157389b0bc56b685cdd111dadc974982f9e529e9b1c73f3fa62d27c118403a214f720bd1eb7845cf6150e30367d1bed08fe037b614ae011ca67ef1c8023e9375d80b79acfe747b2d83b291a3f8ceb0257ff66061d34faafd5e60aefa1868d3932efd93db620d05992466d297628798b6
Response:
<?xml version="1.0" encoding="utf-8"?>
<root status_code="200"><paired>1</paired></root>

Request https://192.168.3.150:47984/pair?uniqueid=0123456789ABCDEF&uuid=efff07f8-9011-4dfd-8149-4c582c431e18&devicename=roth&updateState=1&phrase=pairchallenge
Request http://192.168.3.150:47989/unpair?uniqueid=0123456789ABCDEF&uuid=160028f3-f396-4b7c-b7d2-fb83ccd14ad5
Response:
<?xml version="1.0" encoding="utf-8"?>
<root status_code="404"/>

Failed to pair to server: Error

What is the expected result?

Successfully execute the pairing process

What happens instead of that?

I noticed that, for some reason, moonlight 2.7.0 is sending a request to unpair right after it manages to pair. I'm not sure if this is the expected behavior.

Just restating, I'm trying to connect to a Sunshine server v0.22.0 (also tested with 0.23.1 and the same problem happened)

Is there any reason why uniqueid is always 0123456789ABCDEF?

Related issue: https://github.com/batocera-linux/batocera.linux/issues/11684

luzfcb commented 4 months ago

I tested pairing Moonlight 2.7.0 with all Sunshine server versions from 19.4 up to v2024.601.193044, but could not pair with any of them.

I wanted to try downgrade Moonlight to 2.6.x to test it, but I don't know how to find a binary compatible with Batocera/Knulli and my Anbernic RG35xx-h.

I'm using The Knulli linux (a batocera fork) https://github.com/knulli-cfw/distribution because it is compatible with the Ambernic RG35xx-h (that uses the Allwinner H700 processor)

luzfcb commented 4 months ago

I decided to compile Moonlight 2.6. from source using the batocera configuration (https://github.com/knulli-cfw/distribution/tree/knulli-main/package/batocera/emulators/moonlight-embedded) , and I still get the same error with any version of Sunshine. weird error.

luzfcb commented 3 months ago

Interesting fact: moonlight-embedded 2.6.0 from the original RG35xx-h ROM works as expected, while the batocera/knulli version does not.

The only difference between the two that I could see is that moonlight-embedded 2.6.0 of the original RG35xx-h ROM uses very old versions of OpenSSL (1.x) and libcurl.

I have no idea if this is the cause (incompatibility with some change in OpenSSL or libcurl)

luzfcb commented 3 months ago

This bug is related to the OpenSSL and libcurl versions, and it has already been fixed on Batocera.linux master branch

Related pull-requests:

https://github.com/batocera-linux/buildroot/pull/819 https://github.com/batocera-linux/batocera.linux/pull/11962