Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal error in audio_send_stream.cc #118

Open
Charles92011 opened this issue Mar 30, 2023 · 6 comments
Open

Fatal error in audio_send_stream.cc #118

Charles92011 opened this issue Mar 30, 2023 · 6 comments
Assignees

Comments

@Charles92011
Copy link

Describe the bug
I've had my experimental project working for a while now: https://github.com/Charles92011/webrtc-java-experimental-server
It was working great, but I put it away for a couple of months until we're ready to transition to it.
When I started it up today, it gets this error upon connecting two connections together:

#
# Fatal error in: ../../audio/audio_send_stream.cc, line 387
# last system error: 0
# Check failed: !race_checker.RaceDetected()
# 

I updated my pom file to get the latest version of the library and it still fails.
This error is untrappable, so I can't recover from it

To Reproduce
Steps to reproduce the behavior:

  1. clone https://github.com/Charles92011/webrtc-java-experimental-server
  2. run main.java
  3. browse to wsclient.html
  4. click start
  5. click mirror
  6. Server will crash

Expected behavior
You should get two videos working fine

Desktop (please complete the following information):
Windows 10

Additional context
This was working fine when I last used it a few months ago.

@Charles92011
Copy link
Author

This error only appears when transmitting an audio track.
Video tracks alone do not throw this error.

@naveenSaini1
Copy link

naveenSaini1 commented Apr 10, 2024

hey i am also getting this same error wheni am trying to add mediastreamtrack of another party

Map<String, RTCPeerConnection> savedMapOfConnection = list_of_connected_user
		                .get(roomUserResponse.getRoomId());
		        	savedMapOfConnection.forEach((key, connection) -> {
		        	final int receivers = connection.getReceivers().length;
		    		if (receivers == 0)
                                      {return;}
		    		try {
		    			for (int index = 0; index < receivers; index++) {
			    			
			    			final RTCRtpReceiver receiver = connection.getReceivers()[index];
			    			if (receiver != null) {
			    				
			    				final MediaStreamTrack track = receiver.getTrack();
			    				if (track != null) {
			    							    					
			    					List<String> streamIds = new ArrayList<String>();
			    					streamIds.add(receiver.getTrack().getId());
			    					
			    					@SuppressWarnings("unused")
			    					RTCRtpSender sender = connection.addTrack(track, streamIds);
			    				}
			    			}
			    		}
		    			
		    		}
		    		catch(Exception e) {
		    			System.out.println("someting went wrong "+e.getMessage());
		    			
		    		}
		    		
		            
		        });
		}

so help

@Charles92011
Copy link
Author

@naveenSaini1 I was never able to get past this error, and in a year there's been no update that mentions it.
I had to abandon it.

@naveenSaini1
Copy link

@Charles92011 hey i saw your project and that is really amazing most of the things i learn from there and about this error i need to resolve this because i am trying to make sfu server in webrtc and now i have been stuck at this point if you want we can figure out on this

@Charles92011
Copy link
Author

@naveenSaini1 I'm in the same situation. My goal was to build a server with this library, but I had to abandon it because of this error.

You could always download the library source, and see if you can trap the error.

From my research, the error is actually occurring in the WebRTC code itself, not the java RTC library. So you could try to modify JavaRTC to trap the exception or try to debug Google's WebRTC code to fix it. I don't have the resources available to do either one.

@naveenSaini1
Copy link

@Charles92011
hi i noticed something in this , like whenever we send the audioTrack like this

 AudioTrackSource audioSource = peerConnectionFactory.createAudioSource(new AudioOptions());
		AudioTrack audioTrack = peerConnectionFactory.createAudioTrack("audioTrack", audioSource);
			audioTrack.addSink(new AudioTrackSink() {
				@Override
				public void onData(byte[] data, int bitsPerSample, int sampleRate, int channels, int frames) {
					System.out.println(data);
				}
			});
			
			List<String> streamIds = new ArrayList<>();
			streamIds.add("stream-0");

			RTCRtpSender audioSender = peer_connection.addTrack(audioTrack, streamIds);

we will not get the error so i change this way to puting the track in diffrent way

AudioTrack audioTrack = (AudioTrack)allTheTracks.get("a");
   		audioTrack.addSink(new AudioTrackSink() {
   			@Override
   			public void onData(byte[] data, int bitsPerSample, int sampleRate, int channels, int frames) {
   				System.out.println(data);
   			}
   		});
   		
   		List<String> streamIds = new ArrayList<>();
   		streamIds.add(allTheTracks.get("a").getId());

   		RTCRtpSender audioSender = peer_connection.addTrack(audioTrack, streamIds);

but guess what same thing that same issue

 #
# Fatal error in: ../../audio/audio_send_stream.cc, line 387
# last system error: 11
# Check failed: !race_checker.RaceDetected()

@devopvoid can you please look into this , i really don't know like how to resolve this or can you gave little hint

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants