Skip to content
This repository has been archived by the owner on Nov 8, 2021. It is now read-only.

Any possibility of a Linux server? #279

Closed
parkerlreed opened this issue Mar 30, 2019 · 8 comments
Closed

Any possibility of a Linux server? #279

parkerlreed opened this issue Mar 30, 2019 · 8 comments

Comments

@parkerlreed
Copy link

Linux currently has zero solutions to stream a VR game to a standalone headset with tracking/the whole nine yards. ALVR seems like the best hope. I notice a few ifdefs and such mentioning Linux.

Is support planned at all?

@T-bond
Copy link

T-bond commented Jun 13, 2019

I would also like to play on Linux, as I doesn't have, and I won't have a Windows machine. If needed, I can create a GUI/Launcher in Qt for it (also it can then be used on Windows too)

@polygraphene
Copy link
Owner

I have no plan.

Possible tasks for porting:

  1. Convert DirectX calls into Vulkan or OpenGL (relatively large task)
  2. Convert WASAPI into pulseaudio or alsa
  3. Convert WinAPI calls into Linux syscall (not a large task, I guess)
  4. Port GUI written in C#/WinForms

I can give some advice if someone want to port.

@T-bond GUI code is very dirty, so if you have any question, feel free to ask.

@parkerlreed
Copy link
Author

  1. Maybe incorporate DXVK (If DirectX 11)

Sadly I have no experience in any of this. Would be happy to help test but that's about the limit of what I can offer.

@Nibodhika
Copy link

I have been taking a look at this for the past days, and I fear this is more complex than what I had initially anticipated. The code relies heavily on Windows API for basically everything, I tried using winelib which allowed me to compile some of the code (including d3drender.cpp) but created a bunch of other issues (a lot of them related to the use of wstring and differences between Linux and wine's wchar.h). So for my experience on the past days here are my thoughts on the 4 points of porting that were needed:

  1. I don't know if it will work, but winelib and DXVK seemed to have been able to compile part of the DX code at least, so it might be a good start.
  2. I didn't even came close to this, I feel that this can safely be left for last, as having video without audio should be possible
  3. This is the actual Bogeyman, basically everything relies on windows calls and windows way of working, i.e. using wstring and Microsoft::WRL::ComPtr, all of this provably deriving from the use of DX since it specifically requires those types.
  4. Again I didn't even came close to this, just looking at alvr_server for the past days.

I feel the correct way to approach this is from a Windows machine since it requires a major overhaul of the entire code and it can break stuff in the meantime. Unfortunately at the time I don't have windows on my system, nor do I think the code will work as is on my intel video card, but I'll try to reinstall the OEM windows that came with this laptop to give it a try. In the meantime if anyone more qualified wants to take the task be my guest, quick heads up if anyone wants to try this:

  1. winelib actually declares _WIN32, so I needed to add a definition in the CMakeLists to distinguish windows from wine code, e.g. wine does not provide VersionHelpers for obvious reasons
  2. Sometimes you'll get an error about passing 3 parameters to min similar to this GCC 6 error: macro "min" passed 3 arguments, but takes just 2 kartverket/fyba#21 and just like there the solution is to change the order of the includes
  3. since both windows.h and winsock2.h are being imported you need to add the WIN32_LEAN_AND_MEAN definition, or make sure windows.h always gets imported last from what I read online.
  4. Some files include share.h which is defined in msvcrt in wine, I don't know if the correct approach is to include everything on wine/msvcrt but doing that causes a lot of headache due to using wchar from wine but cwchar from gcc since wine does not have a cwchar implementation apparently, I changed the include to msvcrt/share.h and that seems to be working.

@Nibodhika
Copy link

Just an update here, I installed windows to try this, but unfortunately as expected neither the intel nor the radeon card on my laptop seem to be able to use the encoding required, so I would need to start to read a lot about how these codecs are being implemented and how to replace the nvidia sdk with intel/amd, etc, etc, etc, and again doing it all blind because I don't have an nvidia to see if I broke something. And all that just to make it work on windows so that I can then start to work on making the code platform agnostic and adding the GL backend and/or the dxvk libs for DX compiling on Linux.

In other words it's not realistic for me to do this in the near future, if the code for intel/radeon gets added and I can get it to work I might take another look at it, but as it stands it's just too much work blind on a codebase I don't know.

@kblood
Copy link

kblood commented Aug 16, 2019

I have no plan.

Possible tasks for porting:

  1. Convert DirectX calls into Vulkan or OpenGL (relatively large task)
  2. Convert WASAPI into pulseaudio or alsa
  3. Convert WinAPI calls into Linux syscall (not a large task, I guess)
  4. Port GUI written in C#/WinForms

I can give some advice if someone want to port.

@T-bond GUI code is very dirty, so if you have any question, feel free to ask.

Steam is already converting DirectX calls to Vulkan, so maybe that wont be that big a task? Depending on if its open source I guess.

I have begun considering Linux more and more the last few days and maybe just have Windows as a virtual machine. I am getting a new computer and could be nice o try that out. But want to try a test setup on my current computer first to see what is possible and not. Which made me think of how I stream SteamVR to my Quest using Virtual Desktop, which uses ALVR. So now I am here.

I am a developer and might give it a go at some point. Could be interesting to do... I have coded stuff in .NetCore before, but not sure how big an issue it might be to port this to .NetCore... I have not tried making something that has a Linux frontend of any kind. But... that would probably be educational for me to get into.

Hmmm... I guess since Wine is already doing it (transaling DX11 and 12 to Vulkan), maybe its just possible to also run ALVR server with Wine? Well, first off I might as well install Ubuntu and such and see what can be done

@parkerlreed
Copy link
Author

Yeah the problem with Wine is anything using .NET is a big tossup on whether it works or not. Wine support for .NET 4.x (from Microsoft) is still spotty at best. Then there's Mono support in Wine which is great, but things have to be made with Mono in mind for them to work.

@Patola
Copy link

Patola commented Nov 1, 2020

What if you start a kickstarter/indiegogo campaign for that support? I would happily contribute.

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

No branches or pull requests

6 participants