Hello everyone.

The Mixed Reality Forums here are no longer being used or maintained.

There are a few other places we would like to direct you to for support, both from Microsoft and from the community.

The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.

For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.

If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.

And always feel free to hit us up on Twitter @MxdRealityDev.
Options

Issues with the QR code scanner from M Taulty on the RS4 Preview

I am trying to get this QR code scanner to work:
https://mtaulty.com/2016/12/28/windows-10-uwp-qr-code-scanning-with-zxing-and-hololens/

While it's not essential for my app, I would love to have it working, and some things that are essential for my app make it best for me to stick with the following configuration:

Unity 2018.1b
VS2017
RS4 Preview on HoloLens
SDK17125
MixedRealityToolkit

Here is an example of a program for this:
https://s3.amazonaws.com/sapph/ReadFile3.30.18.rar

When I try building this and running on the device, I get the behavior:
Click QR button
It asks me if it can access my camera, I say Ok
It says 'Running forever'
I look at a QR code that is on my computer and nothing happens

When I tried an app earlier that left the microphone in it (it's now swapped for a button), I had a similar issue. It would ask me if it could use the mic, I tell it ok, and then it just didn't respond to my voice at all after that. As a note, the permissions for using the mic and camera are checked in player settings.

It seems like for some reason apps that require permissions to access things like the camera or microphone just aren't working as expected with the RS4 Preview.

Answers

  • Options

    I tried to replicate what you're doing and so I installed Unity 2018.1.0b13 and I took the project as it was and I branched it to here;
    https://github.com/mtaulty/QrCodes/tree/ForumPost

    and I took most of the toolkit out because I didn't really need it in that project and I see a similar but perhaps not identical situation to you with the code that is now in the branch.

    What I see is that when I first run the code and it tries to use a KeywordRecognizer then the microphone permission dialog pops and I say "yes" but then I don't see speech recognition happening. It's perhaps also worth noting that the dialog says that I can audibly say "yes" but I find that I can't, I have to tap.

    If I then re-run the app (without reinstalling it which means that the microphone permission will stay) then speech recognition seems to work fine and I see the camera permission dialog pop and I say "yes" and then the app seems to scan and detect QR Codes ok.

    So, for me - I see an initial problem in that trying to use a KeywordRecognizer the first time around seems to fail after the permission dialog has been accepted.

    It sounds like that might be different to what you're seeing though? BTW - I find that using the debugger's "Uninstall/Reinstall my app each time I run" can be useful for diagnosing these things.

  • Options
    vivivivi
    edited April 2018

    I think you're having the same problem as I am. I was playing around with it more and it was working briefly a few days ago but now it's back to not working. :\

    I went to HoloLens settings -> Privacy -> Camera and make sure the app was selected as "On". I then rebooted my device, and double checked that was still selected. For some reason, it unchecks itself occasionally, so it may help to leave the settings open. I also deleted the ProjectSettings and Library folder to my app, reimported assets, reselected the permissions to access the camera and rebuilt the app. I'm not really sure why the permissions need to be checked on in the HoloLens settings if you click OK within the app, or why they uncheck themselves.

    Doing all that worked a few days ago, but now it doesn't work again, and I've tried repeating the steps but with no luck. I get a new issue now when I try re-importing the assets that the InputManager of MRTK stops working. x_x

  • Options

    @mtaulty

    I think it's related to this
    https://docs.microsoft.com/en-us/windows/mixed-reality/hololens-rs4-preview#update-3---build-171341000#wc

    "Permission requests to use sensitive resources (camera, microphone, etc.) - RS4 on HoloLens will enforce permission requests for apps intending to access sensitive resources, such as the camera or microphone. RS1 on HoloLens did not force these prompts, so, if your app assumes immediate access to these resources, it may crash in RS4 (even if the user grants permission to the requested resource). Please read the relevant UWP app capability declarations article for more information."

  • Options
    vivivivi
    edited April 2018

    Oh, I finally got it. I needed to enable all the things from here https://docs.microsoft.com/en-us/uwp/schemas/appxpackage/how-to-specify-device-capabilities-in-a-package-manifest

      <Capability Name="internetClient"/>
      <Capability Name="musicLibrary"/>
      <Capability Name="videosLibrary"/>
      <DeviceCapability Name="microphone"/>
      <DeviceCapability Name="webcam"/>
    

    Checking all five of those in Unity, I found using the QR code scanner asked for both Webcam and microphone permissions. So I think assuming I didn't need mic permissions since I replaced it with a button was the issue.

Sign In or Register to comment.