Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Resolved Webcam capatibility not work on publish setting

Discussion in 'Windows' started by ibompuis, Mar 30, 2020.

  1. ibompuis

    ibompuis

    Joined:
    Sep 13, 2012
    Posts:
    100
    Hello everyone,

    I use Unity 2019.3.7f1 with MRTK 2.3.0 to make video chat app.
    In publish setting I'v selected Webcam and Microphone capatibility and some other stuff. When I launch app in hololens2, I'v an error in dev console that said you need to select webcam capatibility etc.
    If I launch the capture video off device it's black screen, But I can see the video off my other mobile device on hololens2...

    How can correct this ?

    Thanks for help
     
  2. timke

    timke

    Joined:
    Nov 30, 2017
    Posts:
    400
    Did you make this change in the Editor before building your UWP Visual Studio project?

    If you already generated the VS project, this change won't take effect because Unity doesn't want to modify an existing project, i.e. we don't want to blow away any changes you might have made directly to the project. Instead, open the Package.manifest file in Visual Studio and add the Webcam and Microphone capabilities there.
     
    Ninjorico likes this.
  3. ibompuis

    ibompuis

    Joined:
    Sep 13, 2012
    Posts:
    100
    Thanks, works fine now with VS modification :) but now I'v second problem;

    Error: Operation has failed with error 0xc00d36e6: The requested attribute was not found. (C:/buildslave/unity/build/PlatformDependent/MetroPlayer/MetroWebCamTexture.cpp:WebCamTexture::Update at 613)

    Best,
     
  4. timke

    timke

    Joined:
    Nov 30, 2017
    Posts:
    400
    The error is coming from our IMFMediaSink implementation (MediaFoundation), and from reviewing the HoloLens specific section when processing IMFSamples, it appears the attempt to retrieve the MRC_SAMPLE_ATTR_CAM_TO_REFERENCE_FRAME_TRANSFORM and MRC_SAMPLE_ATTR_CAMERA_PROJECTION_MATRIX attributes is failing.

    My guess is you also need to set the "Gaze" Capability in order to get this data from the video frame. If that doesn't work, I'd recommend asking about this in HoloDevelopers Slack channel. https://holodevelopersslack.azurewebsites.net/

    Nevertheless, Unity shouldn't be bubbling this error up, which prevents video playback, since the data is optional. Could you please file a bug for this issue?
     
  5. ibompuis

    ibompuis

    Joined:
    Sep 13, 2012
    Posts:
    100
    Thanks timke,
    <DeviceCapability Name="gazeinput" /> already exist in manifest
    Bug already exist too: https://issuetracker.unity3d.com/issues/webcamtexture-doesnt-work-on-hololens-2
     
  6. timke

    timke

    Joined:
    Nov 30, 2017
    Posts:
    400
    Thanks for the link to the bug, I'll update it with the info from my investigation.
     
    ibompuis likes this.
  7. TheDimin

    TheDimin

    Joined:
    Oct 22, 2015
    Posts:
    1
    Are there any updates on this ? having this issue in 2019 4.9f1
     
  8. timke

    timke

    Joined:
    Nov 30, 2017
    Posts:
    400
    The fix for the error message:
    "Error: Operation has failed with error 0xc00d36e6"
    should be in the current 2019.4 release (will double-check that).

    Can you please clarify exactly what problem you're having?
     
  9. KevinReich

    KevinReich

    Joined:
    Jun 16, 2019
    Posts:
    4
    Hello! I get the same issue! Black quad with the message 0xc00d36e6: The requested attribute was not found.
    Unity v: 2019.4.9f1
    PlatformDependent\MetroPlayer\MetroWebCamTexture.cpp
    WebCamTexture::Update at 613 If that is any help!
    View attachment 702819
     
  10. timke

    timke

    Joined:
    Nov 30, 2017
    Posts:
    400
    Thanks for confirming the issue still repros; I've reactivated the bug.
     
  11. KevinReich

    KevinReich

    Joined:
    Jun 16, 2019
    Posts:
    4
    Hello!
    Any updates on this issue?
     
  12. timke

    timke

    Joined:
    Nov 30, 2017
    Posts:
    400
    Hey,

    Thanks for pinging this thread, I don't know why the public issuetracker link no longer works for this case. The bug number (for future reference) is 1230750.

    Anyway, the fix has been backported to 2019.4.13f1 release, which should be the next 2019 LTS update.
     
    KevinReich likes this.
  13. sptek_arvr_002

    sptek_arvr_002

    Joined:
    Mar 19, 2019
    Posts:
    1
    Today I check New update. And Test issue.
    But Same Error at PlatformDependent\MetroPlayer\MetroWebCamTexture.cpp
    WebCamTexture::Update at 613

    Anything I check another??
     
  14. timke

    timke

    Joined:
    Nov 30, 2017
    Posts:
    400
    According to the 2019.4.13f release notes this should have been fixed:
    Are you getting the exact same error message and code?
    Did you perform a "clean" UWP build from Unity, i.e. build form Unity to a new folder, to make sure you're not using any old code?

    I don't have a HoloLens2 and can't check myself, but I'll ping the XR team to let them know you're still having trouble.
     
  15. JasonCostanza

    JasonCostanza

    Unity Technologies

    Joined:
    May 23, 2017
    Posts:
    404
    Hello everyone,

    I heard you were still having issues with webcam texture so our engineer and myself started to review the code and our first code change we released in 2019.4.13f1 and we identified an error handler we totally missed. With that, we didn't actually fix the bug like we thought so we are cooking up a fix and should have it out in the next release. Sorry for the trouble and thank you for your patience.
     
  16. KevinReich

    KevinReich

    Joined:
    Jun 16, 2019
    Posts:
    4
    I appreciate the effort, but please keep in mind that your users might have deadlines too. Please let us know the exact date the fix is rolling out so we can take action accordingly.
    Many Thanks
     
  17. briotto13

    briotto13

    Joined:
    Jun 6, 2018
    Posts:
    2
    Is there any estimate on when that fix will be available? We are also having issues with this bug in Unity 2020.1.10
    Thanks!
     
  18. JasonCostanza

    JasonCostanza

    Unity Technologies

    Joined:
    May 23, 2017
    Posts:
    404
    Currently our 2019.4 fix has landed in 19.4.14f1 and our 2020 change will be different because it's a package change to the Windows MR XR SDK package as opposed to 2019.4 which is a change in the core editor code. That means that fix will be going through the system in the coming days, our engineer is working on that this week it sounds like but we will try to keep you updated on the progress of that fix.
     
  19. KevinReich

    KevinReich

    Joined:
    Jun 16, 2019
    Posts:
    4
    When is 19.4.14f1 going to be released? I still have not heard back from anyone yet.
     
  20. JasonCostanza

    JasonCostanza

    Unity Technologies

    Joined:
    May 23, 2017
    Posts:
    404
  21. RodLekey

    RodLekey

    Joined:
    Dec 10, 2019
    Posts:
    8
    After trying 19.4.14f1 I'm still having some issues. Any time I call WebCamTexture.Play() I get this in the build log.

    With a Black Magic Intesity 4k as a Webcam Device:
    Error: Operation has failed with error 0xc00d36b4: The data specified for the media type is invalid, inconsistent, or not supported by this object.
    (Filename: C:\buildslave\unity\build\PlatformDependent\MetroPlayer\HandleSystemError.cpp Line: 19)

    With a Logitech HD Pro Webcam C920
    Error: Operation has failed with error 0xc00d36b2: The request is invalid in the current state.
    (Filename: C:\buildslave\unity\build\PlatformDependent\MetroPlayer\HandleSystemError.cpp Line: 19)


    Any ideas on this? I'm running the build on a computer to be later streamed to a hololens, but it isn't working with a simple UWP app directed for desktop. Any way to get a WebCamTexture working in Metro consistently?
     
  22. RodLekey

    RodLekey

    Joined:
    Dec 10, 2019
    Posts:
    8
    It looks like the main issue I'm having is with WDM Devices in general. I've now gotten the Logitech webcam working, it's just the Black Magic card giving me issues.


    Any plans to support these in UWP builds?
     
    Last edited: Nov 11, 2020
  23. RodLekey

    RodLekey

    Joined:
    Dec 10, 2019
    Posts:
    8
    Submitted a bug report with the project and information if there's any chance of fix or assistance.

    1292288_lsglo25aoolc0qia

    Thanks!
     
  24. timke

    timke

    Joined:
    Nov 30, 2017
    Posts:
    400
    @RodLekey

    Sorry for asking, but did you ensure both the Webcam and Microphone Capabilities are enabled in the appxmanifest? It's such a common mistake (I do it too) that can result in strange errors like this.
     
  25. RodLekey

    RodLekey

    Joined:
    Dec 10, 2019
    Posts:
    8
    Yeah I did confirm they're set. Definitely have made that mistake before!
     
  26. timke

    timke

    Joined:
    Nov 30, 2017
    Posts:
    400
    Thanks for checking.

    I'm not too familiar with capture cards, but I did a little investigating and it seems they generally don't work as webcams unless you have additional software installed to "fake" it. Is that the case with your setup? Do other video/camera apps (Windows "Camera", Zoom/Skype, etc.) work with the capture card?

    For UWP, WebCamTexture is implemented using the Windows.Media.Capture.MediaCapture APIs with a custom IMFMediaSink, which copies the raw video sample into the Texture. The error typically means the "setting" or "property" we tried to set on the webcam doesn't exist or has been disabled. It can also mean the requested video settings don't exist for this device, but this shouldn't be the case because we enumerate all the webcam modes and choose the "best" one.

    Unfortunately, without the capture device we can't determine exactly what is failing and why (it's also might be a problem we cannot fix). However, if you're interested, you might be able to investigate it yourself with the help of Microsoft samples. That is, use these samples to build and run UWP video capture apps and see if you hit the same or similar issue as Unity.

    I recommend trying these samples:
    I hope this is somewhat helpful.
     
  27. RodLekey

    RodLekey

    Joined:
    Dec 10, 2019
    Posts:
    8
    Thanks! I'll check those out.
     
  28. RodLekey

    RodLekey

    Joined:
    Dec 10, 2019
    Posts:
    8
    It does in fact look like it's something to do with MediaCapture and the WDM Device the capture card is is sending. Got the same error. Going to open a ticket with Black Magic to see if they have an update to their drivers or if there's any ideas over there.

    Thanks for pointing me in a direction!
     
  29. RodLekey

    RodLekey

    Joined:
    Dec 10, 2019
    Posts:
    8
    For more information, it will not work in any Universal Windows Application, like Teams or Camera, but will work in Zoom and other regular windows apps.
     
  30. timke

    timke

    Joined:
    Nov 30, 2017
    Posts:
    400
    :( UWP can really suck...

    Thanks for the update, in case others stumble onto this thread.

    I guess you can also try and submit a bug to Microsoft via the Feedback Hub (for what it's worth). If you do that, please post the link to Feedback ticket, and I'll pass that on to our Microsoft contacts; it might help get some traction.
     
  31. briotto13

    briotto13

    Joined:
    Jun 6, 2018
    Posts:
    2
    Is there a version of the Windows MR XR SDK package that has the fix implemented? I don't see any versions that mention a fix and none are released later than October 6, 2020
     
  32. RodLekey

    RodLekey

    Joined:
    Dec 10, 2019
    Posts:
    8
    Some more info,

    After buying and playing around with a bunch of different capture solutions, ehhhhh nothing really worked lol.

    Elgato: Not supported, since it's using DirectShow
    OBS Virtual Cam: DirectShow again
    Logitech HD1080: Is supported in the Unity Build and the UWP Samples! YUV2
    Cheap Chinese usb camera HDMI capture: Is supported in UWP Samples, causes an access violation in Unity UWP build. NV12 frame format.

    So I'm basically at the point where I'm gonna have to keep a unity license on my production computers so they can run the HoloLens Remote Rendering as well as an External Camera/Capture feed. Excited to hear any other ideas here that I can revisit but gotta deliver by end of year. Hopefully I can sneak in a fix during maintenance.

    Thanks again for all your help!
     
  33. timke

    timke

    Joined:
    Nov 30, 2017
    Posts:
    400
    @RodLekey

    Thank you for your investigation with this, and I apologize that UWP webcam support is so poor.

    For what I understand, the UWP WebCamTexture implementation was originally written to only support Windows Phone and later HoloLens cameras, but wasn't written to support the full range of webcam devices on PC. I would really like to fix this.

    Will you please file a bug for the webcams that don't work, providing as much detail as possible. Although I can't promise anything, this will give us the info we need if/when we decide to improve this, e.g. adding support for NV12 frames.
     
  34. Ninjorico

    Ninjorico

    Joined:
    Sep 7, 2015
    Posts:
    1
    This worked for me while trying to deploy to a HoloLens 2, thank you!