[Discord, WebRTC Application Bug] OBS causes Discord error 2011 after selecting an active OBS video source as Discord video input

bonbons

New Member
I don't expect that this behavior should be fixed, because I believe that OBS's current behavior is correct.

Reproduction Steps
  • Open OBS on macOS
    • Create a Scene with a capture card, webcam, or other UVC video input device.
  • Open Discord
    • Join a voice channel
    • Right click on the "Camera" icon in the bottom left ("Turn On Camera") to bring up the Video input context menu
      • Click on "Camera", and then select the same video input device.
  • After some time, Discord will show an error in the video preview window.
This also applies to Discord's "Share Your Screen > Devices" selector, commonly used for capture cards.

Workaround

Use OBS Virtual Camera.

Why is this happening?

OBS calls lockForConfiguration() and holds that lock. Certain Mac applications rely on being able to take this lock to configure the device. This definitely includes Discord.

The lockForConfiguration documentation states that applications should:
lockForConfiguration() - Apple Developer Documentation said:
Only hold the device lock if your app requires settable device properties to remain unchanged.

OBS should hold this lock. It'd be bad if opening Zoom or Teams or your choice of evil stream-ruining video conferencing application instantly ruined your stream by changing the video format from 3840x2160 @ 60fps NV12 to 640x480 @ 0.01fps. Discord's behavior isn't exactly wrong here, because erroring here prevents more inscrutable "other Discord components reject unsupported video format/configuration, causing grey loading screens of doom".

Since neither behavior is wrong, there's not a good fix. I'm writing this forum post instead.
 
Last edited:
Top