netbrain / zwift

Easily zwift on linux
The Unlicense
265 stars 28 forks source link

Wayland and podman #19

Closed netbrain closed 1 year ago

netbrain commented 1 year ago

Seems the --userns keep-id flag is required for podman to work under wayland, atleast on my test setup.

The following command gave me a proper zwift window

podman run -d --rm --privileged -e "DISPLAY" -v /tmp/.X11-unix:/tmp/.X11-unix -v /run/user/1000/pulse:/run/user/1000/pulse -v /home/netbrain/.config/zwift/netbrain:/home/user/Zwift --gpus all --userns keep-id docker.io/netbrain/zwift:latest

Not sure why this is required tho.

Can anyone else confirm this aswell?

danquantum commented 1 year ago

In my attempt to install and run the container nothing shows up on the first run after install, then after adding the --userns keep-id option it displays an error stating that neither Documents or Desktop folders are accessible for writing, and after doing a chmod 777 on all files in ~/.config/zwift it again doesn't display anything. I tried it on a Fedora 37 and Wayland with proprietary nvidia driver installed (yes, I installed the nvidia-container-toolkit). I really hoped your solution would work as I also tried to manually install .Net 4.7.2 runtime, Edge, WebView2 and Zwift directly on the system using WineHQ with no success either (it does display a message box with "Error" and an ok button).

netbrain commented 1 year ago

What UID/GID does your running user have? what is the output of id -u; id -g ?

netbrain commented 1 year ago

I think #20 fixes this. Can you give it a spin @danquantum ?

danquantum commented 1 year ago

Gosh, you were too fast, thank you.

What UID/GID does your running user have? what is the output of id -u; id -g ?

the usual 1000:1000 as I am the only user on the system.

I think #20 fixes this. Can you give it a spin @danquantum ?

I did, it did not complain anymore so I think the access issue is fixed, but it still doesn't display anything on the screen on my system. It might have something to do with the graphics, I don't know, I kinda let Zwift go after trying the mobile app as well (using scrcpy by your suggestion) and seeing how poorly it connects to the sensors (which makes it pretty much unplayable).

Just to give some info on the behavior, the container simply stops after displaying "non-network local connections being added to access control list" and if I look in the zwift logs inside the shared volume I can't figure a good reason for it:

Launcher_log.txt: [20:39:21 2023-09-13] Launcher: This is an AutoStartup Launch. [20:39:21 2023-09-13] Launcher: Auto Startup is Enabled. [20:39:21 2023-09-13] Launcher: Launcher Version Number 1.1.10 [20:39:21 2023-09-13] Launcher: Initializing UI Components

Log.txt: ... [20:39:22] DEBUG LEVEL: Close file 0x41ba2630 [20:39:22] DEBUG LEVEL: Open assets/gearing/gearing.wad in file 0x41ba2630 [20:39:22] Unable to open WAD file "assets/gearing/gearing.wad". [20:39:22] ERROR: Could not load wad file: assets/gearing/gearing.wad (maybe it has something to do with this?) [20:39:22] DEBUG LEVEL: Open assets/haptic/fittech_haptic.wad in file 0x41ba2630 [20:39:22] Loading WAD file 'assets/haptic/fittech_haptic.wad' with file. [20:39:22] DEBUG LEVEL: Close file 0x41ba2630 [20:39:22] ERROR: Sky::Load(): Japan not found [20:39:22] ERROR: Sky::Load(): Japan not found [20:39:22] ERROR: Sky::Load(): France not found

netbrain commented 1 year ago

Hm. For funsies could you try an older version? Like 1.45.0?

VERSION=1.45.0 zwift

On Wed, Sep 13, 2023, 23:08 Dan-Alexandru Avasi @.***> wrote:

Gosh, you were too fast, thank you.

What UID/GID does your running user have? what is the output of id -u; id -g ? the usual 1000:1000 as I am the only user on the system.

I think #20 https://github.com/netbrain/zwift/pull/20 fixes this. Can you give it a spin @danquantum https://github.com/danquantum ? I did, it did not complain anymore so I think the access issue is fixed, but it still doesn't display anything on the screen on my system. It might have something to do with the graphics, I don't know, I kinda let Zwift go after trying the mobile app as well (using scrcpy by your suggestion) and seeing how poorly it connects to the sensors (which makes it pretty much unplayable).

Just to give some info on the behavior, the container simply stops after displaying "non-network local connections being added to access control list" and if I look in the zwift logs inside the shared volume I can't figure a good reason for it:

Launcher_log.txt: [20:39:21 2023-09-13] Launcher: This is an AutoStartup Launch. [20:39:21 2023-09-13] Launcher: Auto Startup is Enabled. [20:39:21 2023-09-13] Launcher: Launcher Version Number 1.1.10 [20:39:21 2023-09-13] Launcher: Initializing UI Components

Log.txt: ... [20:39:22] DEBUG LEVEL: Close file 0x41ba2630 [20:39:22] DEBUG LEVEL: Open assets/gearing/gearing.wad in file 0x41ba2630 [20:39:22] Unable to open WAD file "assets/gearing/gearing.wad". [20:39:22] ERROR: Could not load wad file: assets/gearing/gearing.wad (maybe it has something to do with this?) [20:39:22] DEBUG LEVEL: Open assets/haptic/fittech_haptic.wad in file 0x41ba2630 [20:39:22] Loading WAD file 'assets/haptic/fittech_haptic.wad' with file. [20:39:22] DEBUG LEVEL: Close file 0x41ba2630 [20:39:22] ERROR: Sky::Load(): Japan not found [20:39:22] ERROR: Sky::Load(): Japan not found [20:39:22] ERROR: Sky::Load(): France not found

— Reply to this email directly, view it on GitHub https://github.com/netbrain/zwift/issues/19#issuecomment-1718320006, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACTNC6LLYFEYDNJ7VSBBVDX2IOFZANCNFSM6AAAAAA4Q5Q4B4 . You are receiving this because you modified the open/close state.Message ID: @.***>

netbrain commented 1 year ago

It might also be a race condition within the entry point script. The last instructions is for it to kill a few unnecessary processes. But maybe this happens too soon.

You could try to launch the container manually and change the entry point to bash, --entrypoint=bash.

Then run the container interactively (-it)

And the script that launches Zwift is simply called entrypoint. Try launching it manually from within the container. And maybe modify it to your needs (try removing the pkill statements)

On Thu, Sep 14, 2023, 07:17 Kim Eik @.***> wrote:

Hm. For funsies could you try an older version? Like 1.45.0?

VERSION=1.45.0 zwift

On Wed, Sep 13, 2023, 23:08 Dan-Alexandru Avasi @.***> wrote:

Gosh, you were too fast, thank you.

What UID/GID does your running user have? what is the output of id -u; id -g ? the usual 1000:1000 as I am the only user on the system.

I think #20 https://github.com/netbrain/zwift/pull/20 fixes this. Can you give it a spin @danquantum https://github.com/danquantum ? I did, it did not complain anymore so I think the access issue is fixed, but it still doesn't display anything on the screen on my system. It might have something to do with the graphics, I don't know, I kinda let Zwift go after trying the mobile app as well (using scrcpy by your suggestion) and seeing how poorly it connects to the sensors (which makes it pretty much unplayable).

Just to give some info on the behavior, the container simply stops after displaying "non-network local connections being added to access control list" and if I look in the zwift logs inside the shared volume I can't figure a good reason for it:

Launcher_log.txt: [20:39:21 2023-09-13] Launcher: This is an AutoStartup Launch. [20:39:21 2023-09-13] Launcher: Auto Startup is Enabled. [20:39:21 2023-09-13] Launcher: Launcher Version Number 1.1.10 [20:39:21 2023-09-13] Launcher: Initializing UI Components

Log.txt: ... [20:39:22] DEBUG LEVEL: Close file 0x41ba2630 [20:39:22] DEBUG LEVEL: Open assets/gearing/gearing.wad in file 0x41ba2630 [20:39:22] Unable to open WAD file "assets/gearing/gearing.wad". [20:39:22] ERROR: Could not load wad file: assets/gearing/gearing.wad (maybe it has something to do with this?) [20:39:22] DEBUG LEVEL: Open assets/haptic/fittech_haptic.wad in file 0x41ba2630 [20:39:22] Loading WAD file 'assets/haptic/fittech_haptic.wad' with file. [20:39:22] DEBUG LEVEL: Close file 0x41ba2630 [20:39:22] ERROR: Sky::Load(): Japan not found [20:39:22] ERROR: Sky::Load(): Japan not found [20:39:22] ERROR: Sky::Load(): France not found

— Reply to this email directly, view it on GitHub https://github.com/netbrain/zwift/issues/19#issuecomment-1718320006, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACTNC6LLYFEYDNJ7VSBBVDX2IOFZANCNFSM6AAAAAA4Q5Q4B4 . You are receiving this because you modified the open/close state.Message ID: @.***>

netbrain commented 1 year ago

Docker seems to fair better than podman. Maybe you could try docker instead as well?

Regarding connectivety issues with treadmill and roller, this app can't help you with that. In both scenarios, scrcpy and wine instance you will still have to rely on your handheld for the Bluetooth part.

Another option for you if this isn't good enough. You could try running a full fledged subdued machine (kvm) with GPU passthru or vgpu (Nvidia) and combining this with lookinglass is actually a pretty good setup. In addition you probably want to passthrough a bluetooth controller. Been experimenting myself a bit with libvirt and win11 with vgpu passthrough and can run Zwift pretty comfortable within the virtual machine. Performance is however better still with wine, but for connectivety you might get a better experience with going down this route. No guarantees tho since I haven't tried that part of it.

danquantum commented 1 year ago

Maybe I'll try some of your hints on the side, I also have a Win10 on kvm but didn't play too much with the GPU passthrough in the past. Thank you for your efforts in the attempt to make this work seamlessly for Linux users as well, I think Zwift should also step up their game a little and not just rely on web content rendered in WebView for UX, maybe even make it compatible with Steam.

Momentarily I can train using mywhoosh on the phone and scrcpy for screen and sound casting to my laptop (thanks again for this suggestion). It's not great but it works, as I said I had terrible connection issues with the sensors using the same setup and Zwift.

quietvoid commented 1 year ago

@danquantum You shouldn't need WebView2 if you start the launcher in silent mode:

wine64 start ZwiftLauncher.exe SilentLaunch

The current docker image was updated to always do that, but it should work in regular Linux environment too.

It does sound like most podman issues are filesystem permissions related.

danquantum commented 1 year ago

Thanks @quietvoid, I tried starting in silent mode using wine outside container and the result is the same as I got previously, a small popup appears saying "Zwift Error" and nothing else. It's probably related to my system specs and setup but let's not reopen the thread. You and @netbrain were both wonderful and sorry for not investigating more but I gave up on Zwift at the moment, in the end what I care about is doing workouts during the cold season and not about Zwift in particular.

netbrain commented 1 year ago

No worries, thanks for the update!

On Mon, Sep 18, 2023, 18:14 Dan-Alexandru Avasi @.***> wrote:

Thanks @quietvoid https://github.com/quietvoid, I tried starting in silent mode using wine outside container and the result is the same as I got previously, a small popup appears saying "Zwift Error" and nothing else. It's probably related to my system specs and setup but let's not reopen the thread. You and @netbrain https://github.com/netbrain were both wonderful and sorry for not investigating more but I gave up on Zwift at the moment, in the end what I care about is doing workouts during the cold season and not about Zwift in particular.

— Reply to this email directly, view it on GitHub https://github.com/netbrain/zwift/issues/19#issuecomment-1723828195, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACTNC43XF7TKBMCCKZGH5TX3BXNJANCNFSM6AAAAAA4Q5Q4B4 . You are receiving this because you were mentioned.Message ID: @.***>