Unity-Technologies / Unity-Technologies/com.unity.webrtc

[BUG] OpenGL verification fails with DeviceSimulator package

Open
#511 2 comments 0 reactions 1 assignee View on GitHub

@karasusan is already working on this.

Since Aug 17, 2021.

bug issued
Dominant language
Assembly
Stars
852
Forks
238
PR merge metrics
No merged PRs in 30d

Description

Hey,

I've been using this package and the DeviceSimulator package in the same Unity project. I noticed that the OpenGL verification that is triggered during WebRTC.Initialize fails when both the DeviceSimulator and this WebRTC package are part of the same Unity project.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new Unity project
  2. Add this WebRTC package
  3. Add the DeviceSimulator package
  4. In the Game View open the dropdown and select Simulation
  5. In the Simulation View choose an Android device like the Google Pixel 2
  6. Switch to the Android platform (Build Settings > select Android > switch platform)
  7. Go to ProjectSettings > Player > Android tab > Graphics API > remove Vulkan (only OpenGLES3 should be left in the array of supported Graphics APIs)
  8. Import the WebRTC samples (Package Manager > WebRTC > import samples)
  9. Open the PeerConnection sample (any sample would do)
  10. Switch into PlayMode

Expected behavior
The sample runs as expected without error.

Current behaviour
The sample aborts with error:

Not Support OpenGL API on ...

Environment:

  • OS: OSX Editor
  • Unity Version 2020.3.13f1
  • Package version 2.4.0-exp.3

Additional context

What happens is that the DeviceSimulator simulates SystemInfo! Now when, e.g., the Google Pixel 2 is selected, SystemInfo.graphicsDeviceType (see WebRTC.Initialize) will return the simulated graphicsDeviceType of the selected simulated device instead of the graphicsDeviceType of, e.g. in my case, my MacBook.

Note that is the expected behaviour of the DeviceSimulator. It's just that the OpenGL verification fails to take into account the DeviceSimulator in the Editor.

As a band aid fix one can turn off the simulation of SystemInfo (ProjectSettings > DeviceSimulator > "Simulate SystemInfoClass"). For projects that actively use the DeviceSimulator this might break some stuff, if they rely on the simulation of SystemInfo in the Editor.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.