Problems with accessing parameters of MediaFrameSourceGroup on HoloLens 2 - c#

I am currently working with MediaFrameSourceGroup and I have noticed two things today where I do not know how to fix them. I hope someone can help me or at least explain them to me.
while I am searching with await MediaFrameSourceGroup.FindAllAsync() for all possible MediaFrameSourceGroups I wanted to get DisplayName and other parameters. This works for all parameters except the Id.
As soon as I try to access it, my debugger detaches itself with the code 'The program 'Unity' has exited with code 1 (0x1).'.
Although I have activated the research mode and was able to see both depth sensor with the SensorVisualization Sample, the depth sensor is not listed.
Now I have a more general question/problem, which I would like to mention here to not open a new question. I hope this is ok.
When I have loaded the app on the HoloLens 2 and connected the debugger, I get the following error
System.DllNotFoundException: Unable to load DLL 'advapi32.dll': The specified module could not be found. This is accessed in WindowsMixedRealityDeviceManager.cs
According to similar questions I found with Google, the problem should not occur in the Unity version (2018.4.22f1) I use. How can you fix such an error without ideally updating Unity. I must honestly admit that I'm afraid of updating Unity, because I think that after that the app won't work anymore or I'll get other errors on board.

while I am searching with await MediaFrameSourceGroup.FindAllAsync() for all possible MediaFrameSourceGroups I wanted to get DisplayName and other parameters. This works for all parameters except the Id. As soon as I try to access it, my debugger detaches itself with the code 'The program 'Unity' has exited with code 1 (0x1).'.
Where is the error message you got? In Unity Editor or Visual Studio? It seems like Unity crashed when you're debugging the app. Would you be able to copy a stack at the crash? Thanks.
Although I have activated the research mode and was able to see both depth sensor with the SensorVisualization Sample, the depth sensor is not listed.
Just as the link referred to in your comment says, currently, the research mode API only supported invoking directly from C++. However, it should be possible to use the API from C# as well, but you would have to rebuild the entire set of convenience functions / wrappers in the HoloLensForCV project yourself.
When I have loaded the app on the HoloLens 2 and connected the debugger, I get the following error System.DllNotFoundException: Unable to load DLL 'advapi32.dll': The specified module could not be found. This is accessed in WindowsMixedRealityDeviceManager.cs
It should be a Unity side issue, we recommend that you re-open the bug or submit a new feedback to the Unity product team. Besides, we always recommend the latest Unity LTS (Long Term Support) stream as the best version so that we can avoid some known issue, and the current recommendation is to use Unity 2019.4.11f1: https://unity3d.com/unity/qa/lts-releases

Related

Windows 10 push notifications in Unity

I have been looking all over and I cannot get notifications in Unity to work without the nasty PowerShell popup needed.
My investigations
Through my investigations, I've found many ways to achieve my goals but only 1 can unsatisfactorily solve my issues. Hopefully, the community here can provide some assistance.
The first option that I found was that you can create notifications with PowerShell commands. Unfortunately, this isn't ideal as when it is ran, the PowerShell will flash on the users screen and that can be very unsettling for users. It is also very hard to customize the code as there is inadequate documentation. If you know of a way to customize PowerShell notifications and run PowerShell commands in Unity without running PowerShell then that would solve my issue,
The second option that I ran across was the Microsoft documentation for creating a toast but no matter what I try, I cannot get it to work. The closest I got was by adding a plugin folder to my assets, and adding microsoft.toolkit.uwp.notifications.7.1.2.zip\lib\netstandard1.4\Microsoft.Toolkit.Uwp.Notifications.dll to the plugins folder but then I get the error .Show() is not a command. Which meant that I can create the toast object but not display it.
Another option is to create a python script but I assume I'd encounter similar issues.
The last option that I've seen was using some 3rd party API called burned toast but I can see that I would have the issues from attempts 1 and 2 going that route.
The last option that I've seen are $60+ assets on the Unity Asset store but there is no guarantee that those will work at all or on Windows. Not to mention, spending money on what should be free is unheard of.

HoloLens Networking Issues on Windows Holographic Version(21H1)?

Since a while I am working with HoloLens2. My last OS-Versions were 10.0.18362.1005 and 10.0.19041.1109. I am developing with Unity 2019.4.7. My whole code was and still is running great on those old OS-Versions. Now I updated to OS-Version 21H1 and I have huge problems with everything including networking.
For example, my Mixed-Reality-WebRTC Pluging (from Microsoft), which only supports ARM-Architecture, does not work anymore on my new Device. The app crashes after it was successfully starting.
Another thing is, that the DevicePortal does not transmit virtual inputs. Again, on my older HoloLens2´s Virtual Input works great.
Also, even if I disable WebRTC parts of my Project, I still get an Exceptions in my Networking-System which I can´t assign to any cause. In term it is useful for you, I work with windows.Networking Library and in special with DatagramSocket.
I would be really glad if anybody could help me with this. Is OS-Version 21H1 restricted to any specific Unity- or VisualStudio Version (here currently I use 16.4.5)? Or is it Restricted to specific Networking Libraries? Thanks in advance!
Now I was able to fix the Networking Exception. The reason for that is located within my UDP-Communicator which uses DatagramSocket. Since earlier .Net.Sockets was not available at HoloLens2, now it is and I coincidentally came across this information. So I switched my implementation to .Net.Sockets which already exists in my project for editor-usage and now basic networking works fine.
Also, I was able to make WebRTC work again. With one of my Provisioning-Packages I disabled the usage of microphone for mixedReality and it seems like access to those audio-informations is mandatory for MR-WebRTC.
Unfortunately, I still have the same issues with Device Portal.This really looks like a bug.

Trouble with initial distribution of C# .NET application

I've written an application in C# .NET with the WinForms UI toolkit. I'm attempting to provide Windows executables, but so far they simply don't work for anyone but me.
I'm creating the release packages by building the EXE and DLLs in Visual Studio 2017, copying them into one place, and putting that into a .zip archive. I'm not doing the fancy one-click publishing stuff.
The project is available on github (https://github.com/fadden/6502bench). The first person to try it got "<program> has stopped working" on Win7 (see issue). The second person was using Win10 Pro, and extracted some details from the event log that show it crashing in a system DLL (see issue). Both of them have the latest .NET framework installed.
I haven't worked with C# .NET outside Unity, so I'm a bit out of my depth. It's entirely possible I've skipped an "obvious" step, or am doing things wrong.
Update: answering some of the comments:
it's pure C#, no native or unsafe code
both people reporting problems confirmed that that latest .NET framework is installed (4.7.2)
the program doesn't seem to be starting at all, so I'm not sure what the app could be doing wrong as far as local paths go
the specific errors, including screen shots and log messages, are included in the issues linked above
the full source code, with the VS solution and projects, is up on github
The sense I'm getting from the comments is that what I'm doing isn't fundamentally wrong, so there's some devil in the details.
I downloaded the source, and debugged.
I received a StackOverFlowException on the following 2 lines of code.
ProjectView.cs
line 3545 : symbolListView.Columns[2].Width = lastWidth;
line 3719 : referencesListView.Columns[2].Width = lastWidth;
What is going on is you are handling the ColumnWidthChanged event on ListView components, and modifying the column width. This modification fires the event again, which is causing an infinite loop, and a subsequent StackOverflowException.
But why? I'll take a swing at an answer. You may have hard coded some values that line up with the DPI and resolution of your monitor. When the ListView instantiates on your machine, it doesn't have to 'redraw' the column with and does not fire the event, but for anyone else that doesn't have the same resolution and DPI, the event fires and causes the loop. I could be wrong, but sounds plausible to me.

Xamarin.Android Deployment Error using Android Virtual Device

I am trying to setup a development environment in Visual Studio Community for development with Xamarin.Forms. In order to make sure the Android Emulator was working, I followed the QuickStart Xamarin.Android tutorial found here.
When I Start Debugging with any number of Virtual Devices the output is always the same; the application does not show up, but the AVD successfully starts up and I can also successfully interact with OS; when trying the close the AVD (with the x icon on the top right) a pop-up dialog appears saying "There were Deployment Errors. Do you wish to continue? Yes\No". The frustrating part is that no matter my response there is absolutely no useful error informations, or warnings or messages for that matter. You may think this is a duplicate question but it is not. I have had problems with a similar problem in which the fix was to downgrade my Android SDK BuildTools to a version lower than 24.0. The was to circumvent an upstream bug that provided the error message: java.lang.UnsupportedClassVersionError blah blah blah. The problem here is I get NO error and my highest version Build Tools are version 23.0.3 which should be fine. Here is a pic on start-up:
AVD
Unfortunately as I am only a begginer user I am not permitted to post more links and images. Apologies for the images as links I am still only permitted to post images in this way.
Thank you for taking the time to help me out.
Hi anyone with a similar problem, this is what worked for me in this particular case. I started the AVD before starting Debugging, the application then showed up in the emulators device menu and everthing is working. I have been stuck with this problem for Five whole day trying dozens of things. Pheeeeuuuuuuw!

videoinput with C#

I have a video capture (usb-webcam) application that currently uses very old VFW with p-Invoke hookup to C#. I'm trying to replace it and I stumbled on the VideoInput library, and later found VideoInputSharp. I managed to get VideoInputSharp into my application and it gives me the frame rate and camera control I need. The problem is that on some PCs the call to VideoInput.IsFrameNew() never returns true even though the device is set up (VideoInput.IsDeviceSetup() does return true).
I've successfully run this on a W7x64 system and a XPx32 system, but does not work on W7x32. Any thoughts on why this is happening?
UPDATE1:
Since originally posting this question, I've found that on the systems that don't work, I am still able to call VI.ShowSettingsWindow() to generate a dialog box; however, it is a different dialog box than I see on the systems that work (even though it is the same camera/driver). Is this a clue? Also note that I'm running the same version of DirectX on the machine it works with and the machine it doesn't work with.
UPDATE2:
The systems that this is failing on are W7x32 and W7x64 both using a Microsoft LifeCam. I found yesterday that if I remove the Microsoft LifeCam software from the machine it then works! I sure could use an explanation for that.

Categories

Resources