How to share computer desktop to HoloLens2? - unity3d

I need to share my desktop on Hololens2 in real time.
All the methods I have found deal with synchronizing the HoloLens2 screen to the PC side, instead of the PC side to HoloLens2. I want to try the Unity plug-in FMETP STREAM, but it doesn't seem to meet my requirements. What should I do to synchronize the PC screen to HoloLens2 in real time?
Please excuse my poor English. I would be grateful if you could answer my question.

FMETP STREAM should satisfy this use case, I find this post the developer replied, this package supports the case desktop Unity app stream the content to the VR headset. I believe it should also work for HoloLens.
Besides, the MixedReality-WebRTC release from Microsoft can help you enable real-time audio/video/data communication with a remote peer. It also meets your requirements. You can get it starts with this doc:Unity library overview

You can modify Hololens Remoting player. It streams desktop app to Hololens in real time.
https://learn.microsoft.com/en-us/windows/mixed-reality/develop/platform-capabilities-and-apis/holographic-remoting-player

Related

Unity Load Media Files From PC At Runtime

I'm developing an app for HoloLens 2 with Unity version 2020.3.3f1
This app should be able to load some medical data from a PC at runtime, thus I need to implement a connection with a PC when running the application on HoloLens, and to take some files from it.
I'm struggling a lot in finding some useful information to do this, thus I'd be really glad if someone can give me some suggestions on how to achieve this.
Thanks a lot.
The most direct way to do that, you can establish a TCP connection between HoloLens 2 and PC, then build a PC server app to respond to the file request from HoloLens Client App.
Another way, instead of coding your own server app, creating a file-sharing using the SMB protocol on your PC, and access this drive from HoloLens, for more detail please refer to this thread: Issue with using StorageFolder in a Unity UWP App deployed on a Hololens

Movesense with Unity BLE plugin

I am trying to get the Movesense to work with a Unity BLE asset as originally I thought MS would be simple enough. I have managed to connect to it and subscribed to the "61353090-" starting service and the "34802252-" starting charasteristic. I think I even got some notifications. Now the problem is, that I am not receiving or able to decode any data from there.
I also ended up reading the example codes and found out the complex system the Movesense uses and the "whiteboard", which I am unfamiliar with. I cannot find anything sensible by googling, as whiteboard is a whiteboard :)
Now my questions are:
What should I do to progress? Do I need to write something to the "17816557"?
What is the "whiteboard" actually?
Would it actually be smarter to just make a Unity plugin for the Movesense?
Thank you
Your are quite right that the answer is in the "Whiteboard" component. Whiteboard is the embedded REST framework (Note: it is not over HTTP!) that Movesense uses to implement REST services within as well as inter device (e.g. over UART or BLE). As you can imagine it is not a simple component, so decoding the traffic without Amersports'/Suunto's help is quite a big challenge. The actual BLE layer is simple: one characteristic to each direction (write & notify), the complexity lies in what goes inside that data pipe.
However, if you are trying to use Unity to make a mobile app the situation is not so bad. There has been a prototype of Movesense mobile library integration for Unity (Android) that uses the existing Movesense mobile library. If you ask Movesense team (info (at) movesense.com) they might be able to help you further. For Windows (Unity or plain) there is nothing done (at least not yet) mainly because until Windows 10 there was no official BLE API for Windows.
Full disclosure: I work for the Movesense team

Control Camera desktop application using Gyroscope of Android smartphone

For a project at my university I need to create a Unity3D application on my laptop, in which the camera is stationairy and can be controlled to rotate in any direction using the gyroscope of my Android smartphone (Nexus 5), wirelessly or through usbcable.
I've looked at the possibility of OSC or the Unity Remote 5 App, but up till now haven't found a way that works in order to obtain this result.
Any help or advice would be hugely appreciated - I don't have much experience yet with all this.
Thanks!
If i was going to do this then I would use UNET (Unitys built in multiplayer networking API) and have the rotation sync over LAN.
On the camera I would have a Network Transform and a script to control its rotation based on accelerometer input.
The version on the phone would be the authority and sync it's rotation over the network to the client on the laptop.
Pros: Wireless, fast (over wifi), very little code required to make it work, lots of documentation available online.
Cons: Relies totally on your network situation, you will have to do a lot of trial and error to get a smooth experience (not jerky) i think.
As for getting the tilt input on the device, Unity have a great tutorial here: https://unity3d.com/learn/tutorials/topics/mobile-touch/accelerometer-input
It's pretty straight forward.
Sound like a fun project, good luck!
It's possible to do this via cable, WiFi, Bluetooth 2.0 or Bluetooth 4.0 (BLE). I have implemented what you need in WiFi and Bluetooth 2.0 for my current work.
It's pretty easy to get rotation values and stream them from Android but I don't think you will need to do anything because you can just use this!
https://play.google.com/store/apps/details?id=de.lorenz_fenster.sensorstreamgps&hl=en
So the question is how do you receive the data this is sending on Unity's side. The answer is the UdpClient class.
If you need more reliability because every second student in your uni library is torrenting Mr. Robot and your getting huge lag then I can tell you how to implement the same thing in Bluetooth, which is not super trivial as .NET 2.0 (which unity uses) doesn't support bluetooth libraries, but there are solutions...

Google Cardboard controlling PC

When I saw the Google Cardboard for Unity, I assumed this meant that you would be able to make a Unity PC game and use your phone as a screen/controller. All I can see is it wanting me to make an android app which is all well and good, but it doesn't allow for input from the keyboard.
Is there a way to stream the Unity PC project to the device and retrieve input (i.e. Headtracking, NFC magnet)?
The problem with such a solution is latency. In VR latency is a big deal. The overall latency from input to photons reaching your eyes should be 20ms or lower. Regular games have 30-60 ms latency by themselves. Add to that the gyro latency, the phone display latency... If you want to add another 25ms or more ping to your VR experience, that's gonna be painful and may even make you sick. If you want to read more on why latency is such a big deal in VR, Michael Abrash wrote an excellend blogpost about it: post on latency
If you want to necessairly use a keyboard for navigation, consider using a bluetooth keyboard that can be used with android devices. Also keep in mind that with the current technology, especially without a dedicated headset, really dynamic vr experiences probably won't work very well and can make some people uncomfortable or sick. For a good read on designign virtual reality experiences, please refer to this guide from the Oculus Rift: http://static.oculus.com/sdk-downloads/documents/Oculus_Best_Practices_Guide.pdf
There's nothing in the Cardboard SDK for talking with a PC-hosted Unity game. You could adapt the code from the Unity Remote 4 project:
https://www.assetstore.unity3d.com/en/#!/content/18106
We are developing the app what you want except it uses GearVR instead of Cardboard. Please check the link below.
http://challengepost.com/software/airvr
Streaming from your PC to your phone's Cardboard is possible using third-party apps, such as Trinus VR (the client app on your phone) and Vireio (the streaming app on your computer). The two apps will then communicate via your home network (Wi-Fi or other) to stream the images.

WIA can not find my internal camera in windows 7

I am currently working on a project where I need to access a build in camera (software will run on a tablet), stream what the camera is showing, and allow the user to take a picture from the stream. I have a version of what I am trying to accomplish on my laptop with its built in camera working. The major difference is the Laptop is using windows XP the tablet is using windows 7.
Running the software on the tablet I get an exception (with some research it appears that exception is cause by no WIA device found). Is it possible that the built in Camera is not WIA compatible? The device does show in the Device Manager as an USB Camera Device, but unlike the camera on my laptop I can't access it directly. I have to use 3rd party software put in by the tablet maker to get the camera to work.
Has anyone experience similar problems? I have to believe if the tablet maker can do what I need I should be able to do something similar.
There also is the Windows Portable Device API that can access cameras, but that appears to be written in c++, without a .NET wrapper. Does anyone know of a simple tutorial of how I could get .NET to place nice with it? EDIT: Just tried WPD didn't list any devices either. I am beginning to thing this camera doesn't exist.
Any knowledge/ pointers to resources would be appreciated. (So far google has turned up the same few articles, no matter which way I approach the problem)
Turns out my Camera was not WIA compatible. I was able to get the tablet to do what I needed it to do using directshow (actually directshow.net)
Good links if others are trying to do something similar and having similar problems
http://msdn.microsoft.com/en-us/library/dd375454%28VS.85%29.aspx
http://directshownet.sourceforge.net/faq.html