Share via

HoloLens 2 (Unity + OpenXR + MRTK3): PV camera photo/frame capture returns “Access denied” / no frames — correct capabilities + permission + API path?

Mustafa 20 Reputation points
2025-12-15T19:40:48.9566667+00:00

Hi, I’m developing a HoloLens 2 app in Unity using OpenXR and MRTK3 (UWP build). I need access to the PV camera to capture a photo (or frames) for simple computer-vision tasks (e.g., QR/marker detection).

What I did

  • Unity UWP capabilities enabled:
    • WebCam = ON
    • Microphone = OFF (not needed)
    • InternetClient = ON (for API calls, optional)
    Built and deployed to HoloLens 2 (ARM64) via Visual Studio.

Problem

At runtime, camera init/capture fails:

Sometimes I get “Access denied”

Sometimes camera starts but I receive no frames / null texture

Sometimes I get “device not found” or a generic capture failure

Questions

For Unity + OpenXR on HoloLens 2, what is the recommended way to access the PV camera today?

Use Windows.Media.Capture (MediaCapture) through a UWP plugin?

  Use Unity-only APIs?

  
     Use a specific OpenXR/MRTK3-supported camera path?

     
     Is enabling **WebCam** capability enough, or do I also need a **runtime permission prompt** or a specific call to trigger user consent on HoloLens 2?

     
     Are there official Microsoft samples that demonstrate a working PV camera capture pipeline for **HoloLens 2 + Unity + OpenXR** (preferably with MRTK3)?
```### Environment

Device: HoloLens 2

HoloLens OS: 20348.2000 (example)

Unity: 2022.3.20f1 (LTS)

OpenXR Plugin: 1.10.0

MRTK: MRTK3 3.0.0

Build target: UWP, ARM64

Visual Studio: 2022 (17.x), Windows 11

If needed, I can share the exact error logs from **Device Portal** / Visual Studio output.Hi, I’m developing a **HoloLens 2** app in **Unity** using **OpenXR** and **MRTK3** (UWP build). I need access to the **PV camera** to capture a photo (or frames) for simple computer-vision tasks (e.g., QR/marker detection).

### What I did

Unity UWP capabilities enabled:

   WebCam = ON
   
```sql
  Microphone = OFF (not needed)

  
     InternetClient = ON (for API calls, optional)

     
     Built and deployed to HoloLens 2 (ARM64) via Visual Studio.
```### Problem

At runtime, camera init/capture fails:

Sometimes I get **“Access denied”**

Sometimes camera starts but I receive **no frames / null texture**

Sometimes I get **“device not found”** or a generic capture failure

### Questions

For **Unity + OpenXR** on HoloLens 2, what is the recommended way to access the **PV camera** today?

   Use **Windows.Media.Capture (MediaCapture)** through a UWP plugin?
   
```yaml
  Use Unity-only APIs?

  
     Use a specific OpenXR/MRTK3-supported camera path?

     
     Is enabling **WebCam** capability enough, or do I also need a **runtime permission prompt** or a specific call to trigger user consent on HoloLens 2?

     
     Are there official Microsoft samples that demonstrate a working PV camera capture pipeline for **HoloLens 2 + Unity + OpenXR** (preferably with MRTK3)?
```### Environment

Device: HoloLens 2

HoloLens OS: 20348.2000 (example)

Unity: 2022.3.20f1 (LTS)

OpenXR Plugin: 1.10.0

MRTK: MRTK3 3.0.0

Build target: UWP, ARM64

Visual Studio: 2022 (17.x), Windows 11

If needed, I can share the exact error logs from **Device Portal** / Visual Studio output.

H. John | Builder @ Hadsiz(.)com (community forum) — interested in searchable knowledge bases
HoloLens | Other
HoloLens | Other

A family of Microsoft self-contained, holographic devices that enable engagement with digital content and interaction with holograms in the surrounding environment.Miscellaneous topics that do not fit into specific categories.

0 comments No comments

Answer accepted by question author
  1. Q&A Assist
    2025-12-15T19:41:01.3166667+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    To access the PV camera on HoloLens 2 using Unity, OpenXR, and MRTK3, follow these recommendations:

    1. Capabilities: Ensure that you have enabled the WebCam capability in your Unity UWP project settings. This is essential for accessing the camera.
    2. Runtime Permissions: In addition to enabling the WebCam capability, you may need to handle runtime permissions. On HoloLens 2, the user may be prompted to grant webcam permissions. This typically occurs the first time the app requests access. If the permission dialog does not appear, you may need to explicitly request access using the appropriate API calls.
    3. Using MediaCapture: It is recommended to use Windows.Media.Capture (MediaCapture) for accessing the PV camera. This approach provides more control and is compatible with UWP applications. You can initialize MediaCapture with the SharedMode property if you do not need exclusive control over the camera.
    4. Error Handling: If you encounter "Access denied" or "device not found" errors, verify that your app has the necessary permissions and that no other application is using the camera. Also, ensure that your app is running in a context where it can access the camera.
    5. Official Samples: Look for official Microsoft samples that demonstrate a working PV camera capture pipeline for HoloLens 2 with Unity and OpenXR. These samples can provide valuable insights and help you troubleshoot your implementation.
    6. Debugging: Utilize the Device Portal and Visual Studio output logs to gather more information about the errors you are encountering. This can help identify specific issues with your implementation.

    By following these guidelines, you should be able to successfully access the PV camera for your computer-vision tasks on HoloLens 2.


    References:

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.