devopvoid / webrtc-java

WebRTC for desktop platforms running Java
Apache License 2.0
248 stars 60 forks source link

Disable Media Input Source of Peer. #119

Open Gamer08YT opened 1 year ago

Gamer08YT commented 1 year ago

Describe the bug As soon as a peer connection is created via the factory, the Lib uses the default audio inputs. I write a master->many server, with too many peers Windows terminates the task.

Is there a way to create a peer without input and output sources?

To Reproduce Steps to reproduce the behavior:

  1. Create some Peer Connections
  2. Sometimes Windows kills the Process with Error (EXCEPTION_ACCESS_VIOLATION (0xc0000005))

Expected behavior I think Windows is killing the process because too many processes/threads are trying to access the same device.

Screenshots image

Desktop (please complete the following information):

SFX123456 commented 1 month ago

Hello I have the same issue and i dont create a extra audiooutput just an input with AudioOptions audioOptions = new AudioOptions(); AudioTrackSource audioTrackSource = peerConnectionFactory.createAudioSource(audioOptions); AudioTrack audioTrack = peerConnectionFactory.createAudioTrack("audio",audioTrackSource); Error occurs after around 1 minute.

SFX123456 commented 1 month ago

Ok so i found a fix thats working at least for me @Gamer08YT . When i compile it to a jar using maven shade plugin and run it via powershell or cmd the error disappears for me. Currently i have 3 peers connected but just one is sending audio.