KyroFrCode / moonlight-chrome-tizen

GameStream client for Tizen OS (Samsung Smart TV's)
GNU General Public License v3.0
90 stars 18 forks source link

Issues with Tizen Platform 3.0 #8

Open naget09 opened 1 year ago

naget09 commented 1 year ago

I have a Samung TV UN55mu6500 from 2017 with Tizen 3.0. Given how the config.xml file requires version 5.5, I change it to 3.0 for installation. Installation was succesful but I cant press options nor any buttons with my usb keyboard, mouse or the remote. I can move the mouse and I see the buttons respond when the mouse is on top, Yet it doesnt work. Could it be an incompatibilty with my tv? its my tv too old? I find it weird given that steamlink works fine on my tv. Hopefully theres a solution.

OneLiberty commented 1 year ago

Could you share a screenshot of what you can interact with ? So far regarding what you're saying, it seems that it does not load the moonlight plugin, which could very well be an incompatibility issue with Tizen 3.0

daaash commented 1 year ago

@naget09 @OneLiberty Where do i find the "config.xml"-File to change the value? My TV is on Tizen-Version 5.0 and i cant install the app.

I got this message:

app_id[MoonLightS.MoonlightWasm] install failed[118, -19], reason: Parsing error :

TV: GQ55Q70RGTXZG Year: 2019

OneLiberty commented 1 year ago

@daaash in the res folder edit the config.xml change this required_version="5.5" to this required_version="5.0" and it should do the trick. Then build the app like normal. Keep us informed, it might help other people

daaash commented 1 year ago

@OneLiberty I tried to install the app via the Docker file from here.

I edited the config.xml file directly in the Docker-Container. Unfortunately, this did not work for me, but the problem is currently being discussed in the Docker repository aswell moonlight-chrome-tizen-docker.

If you have any other tips or solutions, please let us know!

OneLiberty commented 1 year ago

@daaash Maybe docker is still pulling from the repo and not from the cached file.

I've modified the file and made a dockerfile to try this. here it is

I've uploaded the modified code to transfer.sh, and the dockerfile is pulling from it. I've changed from 5.5 to 3.0, but again even if the install succeed , the app might not work.

PS : install the app with tizen install -n Moonlight.wgt -t <device_id> (and not tizen install -n MoonlightWasm.wgt -t <device_id>).

daaash commented 1 year ago

@OneLiberty Thank you for your work, man! Apparently he realy tries to transfer old cached files, because with your Dockerfile Moonlight could now transfered to the TV.

However, the app gets stuck in the loading screen (screenshot). The app does not completly freeze, cause the loading bar keeps loading. Unfortunately nothing happens even after 10 minutes.

My TV has Tizen 5.0, and you specified 3.0 as the required version. That can not really be the problem, right? The Paramater is only for the installation?

Too bad, I thought you had solved the problem with this.

OneLiberty commented 1 year ago

@daaash No problem, always a pleasure to help

I don't think setting the required to 3.0 is the issue, it is more likely that 5.0 tizen tv or lower are incompatible, might be solvable by updating the code, but without knowing what broke, it will be hard to do.

Also, it seems that most [118, -19] errors are related to the required tizen version.

I didn't test the specific build i've sent you, it's pulled from this repo, you might want to test building (and modifying required version) from KyroFrCode repo just in case.

Edit : we might find informations on why it isn't working looking at the changes between 5.0 and 5.5 (like here or here)

MrPhaze62 commented 1 year ago

I too have that issue of the infinite 'loading moonlight plugin' as shown on that screenshot earlier but i'm on Tizen 4.0 with a TV from 2018, which i manually lowered the minium requirement as well, thought i'd point that out knowing im not alone with that issue.

evelynisthebest commented 1 year ago

we might find informations on why it isn't working looking at the changes between 5.0 and 5.5 (like here or here)

I am trying to get a working install on a 2019 Samsung TV with Tizen 5.0 using the docker instructions after modifying the config.xm for version 5.0 l I'm stuck on the "loading Moonlight plugin..." screen.

Does anyone have a current link to the ndriqimlahu repo mentioned above? It and the transfer.sh Dockerfile are both dead links for me.

I've been reviewing the 5.0 / 5.5 version differences that OneLiberty helpfully linked above and I've summarized some of them below. I've started looking at the web engine specifications but it's a much longer document.

GENERAL SPECIFICATIONS::

Tizen 5.0 uses the 5.5.0 C# Api version while Tizen 5.5 uses 6.6.0.

Tizen 5.0 does not support the @start or @initialization @t/@d/@r MPEG-DASH Attributes

I'm going to start looking into it to see if it's an issue with the C# API version - wouldn't know where to start with the MPEG-DASH attributes.

EDIT: The above general specification differences didn't lead anywhere. Between Tizen 5.0 and 5.5 the installed chromium version was updated from M63 to M69 I'm thinking there's something in that version change though nothing stuck out to me while looking into it.

I found an old issue from the moonlight chrome os project which also left you stuck on the same loading screen I tried modifying the manifest.json as described and rebuilding with no luck. The other suggestion was NaCl related so I guess that's what I'll be looking into next.

OneLiberty commented 1 year ago

I've just managed to install a tizen 5.0 emulator, but i'm struggling to build the app using tizen studio, did anyone managed to use tizen studio to build the app ? If so, could you describe some steps ?

This would help finding the problem with tizen 5.0 (and probably lower) as we could easily debug the app.

Also @evelynisthebest i think the repo that you talk about has been deleted or something. I might have a copy somewhere, but not one with the latest modifications. If you want I can re-upload the dockerfile (i might want to use github time) but the only changes i've made was the required tizen version (from 5.5 to 3.0).

schneimo commented 1 year ago

I found an old issue from the moonlight chrome os project which also left you stuck on the same loading screen I tried modifying the manifest.json as described and rebuilding with no luck. The other suggestion was NaCl related so I guess that's what I'll be looking into next.

I am not an expert Tizen nor web applications in general. Furthermore, I did not found information about changes in WASM and NACL in the links given by @OneLiberty. But could it be that older TizenOS versions (<5.5) do not support WASM (Web Assembly)?

You can find information about the deprecation of NaCL on Samsungs websites:

Due to NaCl deprecation by the Chromium project, Tizen TV will continue its support for NaCl only until 2021-year products. Meanwhile, Tizen TV will start focusing on high-performance, cross-browser WebAssembly from 2020-year products.

Tizen 5.5 was also published 2020. The same year Samsung started to support WASM in Tizen. The newest Gamestream implementation of Samsung requires WASM but there are commits in Samsungs history which changed the codebase to WASM (before it was NaCL I think): https://github.com/SamsungDForum/moonlight-chrome/commit/86881f531f521a3057b97b39294e67f3fab9b394

It could be worth it to build upon this older commit to integrate NaCL again. But I am not sure if it is easier to integrate the NaCL code into this repository here or to integrate KyroFrCode's changes into the Samsungs version before commit https://github.com/SamsungDForum/moonlight-chrome/commit/86881f531f521a3057b97b39294e67f3fab9b394.

I will start and try to do this sometime in the future but anyone feel free to do this of course.

leaskovski commented 1 year ago

So im interested to see what happens with this, though my samsung TV is a ku6400, so from 2016 by all accounts, which looks like it is a Tizen 2.4 (https://developer.samsung.com/smarttv/develop/specifications/tv-model-groups.html). I will try the config hack to see if that sucessfully pushes the app to the TV, but I fully expect the same plugin loading issue on the TV.

Watching with interest.

(Was running SteamLink fine, so looking for a replacement)

evelynisthebest commented 12 months ago

But could it be that older TizenOS versions (<5.5) do not support WASM (Web Assembly)?

Confirming from Samsung documentation that WebAssembly is only supported on 5.5 and above. The exact quote is "Samsung smart devices support WebAssembly from Tizen 5.5 (2020 models) onwards."

guba91 commented 12 months ago

any way to install on Tizen 5.0? :(

MrPhaze62 commented 12 months ago

any way to install on Tizen 5.0? :(

not at the moment, there are instances where you can lower the requirement to allow it to install on older tizen but as we've seen, it has issues.

But could it be that older TizenOS versions (<5.5) do not support WASM (Web Assembly)?

Confirming from Samsung documentation that WebAssembly is only supported on 5.5 and above. The exact quote is "Samsung smart devices support WebAssembly from Tizen 5.5 (2020 models) onwards."

Does this means they'd have to rebuild moonlight without WebAssembly support for older tizen versions from scratch?

evelynisthebest commented 12 months ago

Does this means they'd have to rebuild moonlight without WebAssembly support for older tizen versions from scratch?

That's the idea right now as mentioned above this tizen moonlight repo here is branched from moonlight chrome os repo. @schneimo found the commit when the chrome repo migrated from NaCl to WebAssembly

The newest Gamestream implementation of Samsung requires WASM but there are commits in Samsungs history which changed the codebase to WASM (before it was NaCL I think): https://github.com/SamsungDForum/moonlight-chrome/commit/86881f531f521a3057b97b39294e67f3fab9b394

I'm not sure if anyone has looked in detail yet if it would be easier to redo the tizen conversion to the old branch before the linked commit or rewrite the tizen branch as is back to NaCL. Holiday week for me right now 🦃 so I won't have a chance to take a look for another week or so.

MrPhaze62 commented 11 months ago

i uh tried somethin but am dum. ¯_(ツ)_/¯

tried to like, match/copy n paste it to the orignal linked here onto my forked repo that i've made, but i've yet to kinda try it out rn but am too lazy and i just know it isn't gonna work lol.

oh well, hopefully somebody smarter than me can actually do it.

OneLiberty commented 11 months ago

@MrPhaze62 You'll be better off porting the actual moonlight-chrome rather than RE into this version (I think). The problem here is that this version is using WebAssembly, TV's under 5.5 doesn't support Webassembly, while NaCl (which is used for the original moonlight-chrome) is supported up to 6.0 I believe.

I'm slowly looking into this (I managed to get to the loading spinner on emulator, but I don't think it means much). Unfortunately tizen studio doesn't package NaCl extensions anymore, if you want to try you can install the TV extensions 6.0.

NegatioN commented 11 months ago

I might be introducing noise here, but there seems to be a developer guide for the reverse process of what we want (moving from NaCl to WebAssembly) to make Moonlight work on the "new" Tizen versions. With a relevant fork of moonlight-common-c to follow.

Maybe that might be of use for someone looking into this.

OneLiberty commented 11 months ago

@NegatioN Well this is useful if we need to adapt things from NaCl to WebAssembly. The current Moonlight-chrome should work without much effort on old tizen Tvs as it's already running NaCl

Dean-Axe-Flip commented 11 months ago

Still learning about all this. The following might be useless and is per my inquiry to Bing Chat. The developer.chrome webpage is dead though if you try to access it. I can only view archived versions of that page via wayback.

To convert a WebAssembly (WASM) file into Native Client (NaCl), you can use Emscripten¹. Emscripten is a toolchain that can compile C and C++ code to WebAssembly, asm.js, and NaCl. Here are the steps to convert a WASM file to NaCl:

1. Install Emscripten on your system.

  1. Compile your C or C++ code to WebAssembly using Emscripten.
  2. Use the emcc command to generate a NaCl executable from the WebAssembly file.

Here's an example command to convert a WASM file to NaCl:

emcc -s WASM=1 -s SIDE_MODULE=1 -o my_module.wasm my_module.c

This command compiles the my_module.c file to WebAssembly and generates a my_module.wasm file. The -s WASM=1 flag tells Emscripten to generate a WebAssembly file, and the -s SIDE_MODULE=1 flag tells Emscripten to generate a WebAssembly module that can be loaded into NaCl. Finally, the -o flag specifies the output file name.

Once you have the my_module.wasm file, you can use the nacl-clang command to generate a NaCl executable:

nacl-clang -o my_module.nexe my_module.wasm

This command generates a my_module.nexe file, which is a Native Client executable that can be run in a NaCl environment.

Source: Conversation with Bing, 12/7/2023 (1) WebAssembly Migration Guide - Chrome for Developers. https://developer.chrome.com/docs/native-client/migration/. (2) NaCl to WebAssembly Primer - Excellarate - Encora. https://www.encora.com/insights/nacl-to-webassembly-primer. (3) How do I compile a C++ file to WebAssembly? - Stack Overflow. https://stackoverflow.com/questions/45146099/how-do-i-compile-a-c-file-to-webassembly. (4) c++ - How to compile WebAssembly into regular assembly / native code .... https://stackoverflow.com/questions/56403837/how-to-compile-webassembly-into-regular-assembly-native-code-or-cpp-etc. (5) undefined. https://github.com/fastly/lucet. (6) undefined. https://github.com/WebAssembly/wabt/tree/master/wasm2c.

Dean-Axe-Flip commented 11 months ago

One more post for today. I wonder if anyone from the thread posted below could be pinged for an assist? njibhu or jorys-paulin if they are still around in the githubs looks like they have some experience with related matters (not of Tizen, although of Moonlight NaCl and WASM). Others in the thread look like they have some NaCl / WASM experience as well.

https://github.com/moonlight-stream/moonlight-chrome/issues/446

ETA: I also found these additional resources:

https://developer.samsung.com/smarttv/develop/extension-libraries/webassembly/game-streaming-with-wasm.html

and

"Moonlight for ChromeOS is a legacy client that depends on the deprecated NaCl runtime. It is receiving only basic bugfixes and little/no feature work." https://github.com/moonlight-stream/moonlight-chrome

augustresende commented 11 months ago

My Tizen is 5.0 too :/

Fummowo commented 10 months ago

Moonlight on Tizen 3.0 would be amazing! I can provide any help needed for testing since i'm having the same issue on my tv

Dean-Axe-Flip commented 10 months ago

I might be introducing noise here, but there seems to be a developer guide for the reverse process of what we want (moving from NaCl to WebAssembly) to make Moonlight work on the "new" Tizen versions. With a relevant fork of moonlight-common-c to follow.

Maybe that might be of use for someone looking into this.

About https://github.com/SamsungDForum/moonlight-chrome/commit/86881f531f521a3057b97b39294e67f3fab9b394

@NegatioN

I think that's helpful but would be careful about calling it a reverse. I took a read through the code just to understand what was going on a bit. I'm a newb at this. The code is nice because it shows 4 files with Red section call outs for lines what were deleted and Green for sections that were added (often or always following a red section). I don't know if just undoing those things would make it work (or maybe would basically put the person back at the version that was originally used to create those 4 files). From a few weeks ago I remember reading something about Samsung like plugins that were used to make steam link work or something like that, so I don't know if similar would be needed for moonlight.

luc4sv commented 4 months ago

@daaash in the res folder edit the config.xml change this required_version="5.5" to this required_version="5.0" and it should do the trick. Then build the app like normal. Keep us informed, it might help other people

In my res folder has nothing, what I have to do to show the config.xml file? I'm trying to work on a 5.0 tizen TV and the way that I found is editing the xml but I cant find

MrPhaze62 commented 4 months ago

Hello all, There is a version of moonlight port by @OneLiberty that works on tizen 3.0 and upward to 6.0 alongside the current WASM port.

This is not perfect by any means and does have issues which i have posted an issue there.

https://github.com/OneLiberty/moonlight-tizen-nacl

This is a start and a proof of concept that it works for older tizen versions. Enjoy.

I do hope someone else does fix all the issues there.