No Remote Audio on WebRTC Demo

181 views
Skip to first unread message

Jo Yum

unread,
May 30, 2015, 5:20:15 AM5/30/15
to discuss...@googlegroups.com
Hello,
I'm running a slightly modified version of the https://bitbucket.org/webrtc/codelab Step-6 code, which uses node.js, socket.io, node-static for the signaling channel.
I installed the signaling code (node.js, socket.io, node-static) on a public server, so I can test the Step-6 code over the Internet.

My slight changes customize the room name for any two peers that request connection. I added custom signaling to negotiate the room name. That's the "p2p server relay" signal you'll see in the log below.
Video streaming works fine, but audio streaming doesn't work at all. And there aren't any error messages in the Chrome consoles of the two peers.

The Step-6 constraints for getUserMedia() did not include audio, as you can see here:
var constraints = {video: true};
getUserMedia(constraints, handleUserMedia, handleUserMediaError);

So I added the audio constraint, like this:
var constraints = {audio: true, video: true};
getUserMedia(constraints, handleUserMedia, handleUserMediaError);

I tried removing preferOpus() from the client JS with same result (video yes, audio no.)
The same happens with two Firefox clients, or two Opera clients (video yes, audio no.)

My software versions are:
stun.l.google.com:19302


The STUN server is the one given in the Step-6 code, like this:
stun.l.google.com:19302

I used the same two clients (Windows 7 and OSX 10.6.8) to run https://www.apprtc.net (the WebRTC demo that uses Google App Engine for signaling). 
Both audio and video work perfectly on that WebRTC demo.
However, I noticed a lot more signaling traffic on https://www.apprtc.net compared to my Step-6 code's sparse signaling traffic.
Below is the signaling traffic of my Step-6 code on a Chrome client (Windows 7). 
This signaling allowed perfect video streaming, but no remote audio is heard on either client.

At your request, I can provide screen shots of any Objects in the signaling traffic below, to help resolve this issue:
This appears to be Chrome

Getting user media with constraints Object {audio: true, video: true}

Socket connected

Adding local stream.

Client sending message:  got user media

maybeStart() isStarted=false / typeofLocalStream=defined / isChannelReady=true

Created RTCPeerConnnection

>>> Message from server:  Got message:  got user media

Client received message: got user media

mkCall() sending "avid call offer" from/to  test004/test002

>>> Message from server:  socket.on("p2p server relay") relaying msg-type "avid call offer" from/to  test004/test002

socket.on("p2p server relay") received msg-type "avid call accepted" from/to  test002/test004

socket.on("p2p server relay") on "avid call accepted" joining room  test004-test002

Create or join room test004-test002

socket.on("p2p server relay") sending message "send me webrtc offer"

>>> Message from server:  Room test004-test002 has 1 client(s)

>>> Message from server:  Request to create or join room  test004-test002

This peer has joined room test004-test002

>>> Message from server:  Joined room  test004-test002

>>> Message from server:  Room test004-test002 has 2 client(s)

>>> Message from server:  Request to create or join room  test004-test002

>>> Message from server:  socket.on("p2p server relay") relaying msg-type "send me webrtc offer" from/to  test004/test002

Client received message: Object {type: "offer", sdp: "v=0
↵o=- 465806041336689787 2 IN IP4 127.0.0.1
↵s=…8838 label:725e4a8a-9d13-424a-9cd1-d8c6711e355c
↵"}

Sending answer to peer.

setLocalAndSendMessage sending message RTCSessionDescription {}

Client sending message:  RTCSessionDescription {}

Client received message: Object {type: "candidate", label: 0, id: "audio", candidate: "candidate:2795255774 1 udp 2122260223 192.168.1.7 54186 typ host generation 0"}

Client received message: Object {type: "candidate", label: 0, id: "audio", candidate: "candidate:2795255774 2 udp 2122260222 192.168.1.7 51236 typ host generation 0"}

Client received message: Object {type: "candidate", label: 1, id: "video", candidate: "candidate:2795255774 1 udp 2122260223 192.168.1.7 53982 typ host generation 0"}

Client received message: Object {type: "candidate", label: 1, id: "video", candidate: "candidate:2795255774 2 udp 2122260222 192.168.1.7 55195 typ host generation 0"}

Client received message: Object {type: "candidate", label: 0, id: "audio", candidate: "candidate:3894397742 1 tcp 1518280447 192.168.1.7 0 typ host tcptype active generation 0"}

Client received message: Object {type: "candidate", label: 0, id: "audio", candidate: "candidate:3894397742 2 tcp 1518280446 192.168.1.7 0 typ host tcptype active generation 0"}

Client received message: Object {type: "candidate", label: 1, id: "video", candidate: "candidate:3894397742 1 tcp 1518280447 192.168.1.7 0 typ host tcptype active generation 0"}

Client received message: Object {type: "candidate", label: 1, id: "video", candidate: "candidate:3894397742 2 tcp 1518280446 192.168.1.7 0 typ host tcptype active generation 0"}

Remote stream added.

handleIceCandidate event:  RTCIceCandidateEvent {}

Client sending message:  Object {type: "candidate", label: 0, id: "audio", candidate: "candidate:2437072876 1 udp 2122260223 192.168.1.2 57210 typ host generation 0"}

handleIceCandidate event:  RTCIceCandidateEvent {}

Client sending message:  Object {type: "candidate", label: 1, id: "video", candidate: "candidate:2437072876 1 udp 2122260223 192.168.1.2 57210 typ host generation 0"}

>>> Message from server:  Got message:  Object {type: "answer", sdp: "v=0
↵o=- 5000668392638045311 2 IN IP4 127.0.0.1
↵s…3093 label:a2237698-392a-4a14-8382-63e92f163ee5
↵"}

>>> Message from server:  Got message:  Object {type: "candidate", label: 0, id: "audio", candidate: "candidate:2437072876 1 udp 2122260223 192.168.1.2 57210 typ host generation 0"}

>>> Message from server:  Got message:  Object {type: "candidate", label: 1, id: "video", candidate: "candidate:2437072876 1 udp 2122260223 192.168.1.2 57210 typ host generation 0"}

handleIceCandidate event:  RTCIceCandidateEvent {}

Client sending message:  Object {type: "candidate", label: 0, id: "audio", candidate: "candidate:3753982748 1 tcp 1518280447 192.168.1.2 0 typ host tcptype active generation 0"}

handleIceCandidate event:  RTCIceCandidateEvent {}

Client sending message:  Object {type: "candidate", label: 1, id: "video", candidate: "candidate:3753982748 1 tcp 1518280447 192.168.1.2 0 typ host tcptype active generation 0"}
handleIceCandidate event:  RTCIceCandidateEvent {}

End of candidates.

>>> Message from server:  Got message:  Object {type: "candidate", label: 0, id: "audio", candidate: "candidate:3753982748 1 tcp 1518280447 192.168.1.2 0 typ host tcptype active generation 0"}

>>> Message from server:  Got message:  Object {type: "candidate", label: 1, id: "video", candidate: "candidate:3753982748 1 tcp 1518280447 192.168.1.2 0 typ host tcptype active generation 0"}

The chrome://webrtc-internals on both clients show that the audio streams are being sent and received, but remote audio isn't heard on either client.
Also, with the Step-6 code, there's a lot of audio feedback of each client's local audio stream. 
That much audio feedback doesn't happen on the https://www.apprtc.net demo. On that demo, at normal volume, local audio and remote audio are heard without distortion on both clients.
Below is a screenshot of the audio sections of chrome://webrtc-internals on a Window-7 Chrome client, running the Step-6 code.

Thank you.


Silvia Pfeiffer

unread,
May 30, 2015, 6:22:52 AM5/30/15
to discuss...@googlegroups.com
Sorry if this sounds obvious, but first things first: is your video
element muted?

Silvia.
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "discuss-webrtc" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to discuss-webrt...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/discuss-webrtc/1da89620-5263-4da9-90e1-e5eb1bf55c65%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Jo Yum

unread,
Jun 3, 2015, 8:51:45 PM6/3/15
to discuss...@googlegroups.com
@Silvia,

Thank you for pointing this out. You were correct, the remote video element was muted in the original https://bitbucket.org/webrtc/codelab Step-6 code. I just didn't see it.

But now that remote audio is working, there's so much feedback that the audio is almost unusable.

However, the https://www.apprtc.net demo doesn't have such severe audio feedback, so audio feedback is apparently not an inherent problem of WebRTC.

Do you have any suggestions for improving the audio feedback problem with the https://bitbucket.org/webrtc/codelab Step-6 code?

Thank you

Jo Yum

unread,
Jun 3, 2015, 8:59:37 PM6/3/15
to discuss...@googlegroups.com
 
My software versions are:
node.js: 0.10.38
node-static: 0.7.6
socket.io: 1.3.5

Silvia Pfeiffer

unread,
Jun 4, 2015, 5:40:49 AM6/4/15
to discuss...@googlegroups.com

You do have to mute the local video element though.

Best Regards,
Silvia.

--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.

Jo Yum

unread,
Jun 4, 2015, 9:08:23 AM6/4/15
to discuss...@googlegroups.com
@Silvia,

That fixed the audio feedback. The person who wrote the Step-6 code must have meant to mute local audio, but instead muted remote audio. Thanks again !!!

Silvia Pfeiffer

unread,
Jun 4, 2015, 12:50:57 PM6/4/15
to discuss...@googlegroups.com

Make a pull request! :-)

Best Regards,
Silvia.

--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.

Sam Dutton

unread,
Jun 5, 2015, 3:13:57 AM6/5/15
to discuss...@googlegroups.com
Make a pull request! :-)

Yes please :^).

I've neglected bitbucket.org/web/codelab recently, but we are planning to update the codelab and properly maintain it. Contributions and suggestions welcome.

Sam 
Reply all
Reply to author
Forward
0 new messages