invisible-college / tawk.space

Social video chats
https://tawk.space
Apache License 2.0
14 stars 1 forks source link

Participants sometimes can't hear each other #1

Closed karth295 closed 8 years ago

karth295 commented 8 years ago

We don't know why, but sometimes some participants can hear one person, while others can't. That person's microphone does work, and tawk sets the person's volume to the correct number (20, 80, or 100%). Here are debugging tips:

  1. Everybody should check that their microphones are on and working: https://www.onlinemictest.com/. Obviously if some people can hear but not others this isn't the problem.
  2. When you hover over someone it shows you the percent volume that their audio is playing at. If that number if wrong, tawkspace has a bug. The group volume code is limited to the dom.GROUP and dom.PERSON functions if you want to look there, but the code looks right to me...
  3. Maybe there are weird semantics around people joining/leaving groups, or changing the volume on video streams. It would be helpful to figure when that happens.
  4. Very unlikely, but we could be finding browser bugs. I'm not sure how to debug that.

I'm inclined to think it's #3. If that's the case, we could leave everybody's volume at 100% (across all groups) and see if that fixes it.

karth295 commented 8 years ago

I think I figured out the issue. Changing the volume of video/audio tags using React doesn't work.

Code that should work, but doesn't:

<script type= 'statebus'> # -*- mode: coffee -*-
dom.BODY = ->
  DIV {},
    INPUT
      type: 'range'
      onChange: (e) ->
        volume = fetch('volume')
        volume.volume = e.target.value / 100.0
        save(volume)
    HOLA {}

dom.HOLA = ->
  volume = fetch('volume')
  AUDIO
    src: '/iron-man-01.mp3'
    autoPlay: true
    controls: true
    volume: volume.volume || 0.5
</script>

<script>
  statebus_server = window.location.protocol + '//' + window.location.hostname + ':3004'
  statebus_version = 3
</script>
<script src="https://stateb.us/client.js" ></script>

Code that does work:

<script type= 'statebus'> # -*- mode: coffee -*-
dom.BODY = ->
  DIV {},
    INPUT
      type: 'range'
      onChange: (e) ->
        volume = fetch('volume')
        volume.volume = e.target.value / 100.0
        save(volume)
    HOLA {}

dom.HOLA = ->
  volume = fetch('volume')
  AUDIO
    src: '/iron-man-01.mp3'
    autoPlay: true
    controls: true
    volume: volume.volume || 0.5

dom.HOLA.refresh = ->
  volume = fetch('volume')
  console.log('HOLA.refresh', volume)
  @getDOMNode().volume = volume.volume || 0.5
</script>

<script>
  statebus_server = window.location.protocol + '//' + window.location.hostname + ':3004'
  statebus_version = 3
</script>
<script src="https://stateb.us/client.js" ></script>
karth295 commented 8 years ago

If this theory is correct, the repro should be:

-Person A enters tawk.space and creates a group -Person B enters and creates a different group (meaning A/B can't hear each other) -Person B should join Person A's group. If they can't hear each other, we've reproduced the bug.

toomim commented 8 years ago

Cool man. I think this theory fits with the situation where I saw it occur. It would happen when the group changes somehow, often because of a dropped connection. I could imagine that the new group gets diffed with the old group, and ... somehow something might be initialized to null or something.