[jitsi-users] Why are mixed channels offered as recvonly?


#1

Using the REST interface, I patch a conference with 2 channels (audio+video) for 2 endpoints (4 channels total), all set to sendrecv. While the response shows channels with "rtp-level-relay-type": "translator" correctly as sendrecv, "rtp-level-relay-type": "mixer" channels are shown recvonly.

Why is that? I understand from jitsi's perspective these channels are recvonly, but if I create an sdp using recvonly, how would the client receive the mixed channels then? From the client's perspective, a mixed channel is nothing different than a translated channel; it receives it on the same peer connection and doesn't care what jitsi did with it.

Shouldn't direction be set to sendrecv in the response?

And then, why do I receive the same source id for both endpoints for the translated channels, while I receive different source ids for mixed channels? I would have expected to see a single source for all mixed channels, as it is the same stream which is sent to all endpoints.

PATCH:


{

  "id": "1ea100bdbf24f40",

  "contents": [

    {

      "name": "audio",

      "channels": [

        {

          "expire": 200,

          "initiator": true,

          "endpoint": "A",

          "direction": "sendrecv",

          "channel-bundle-id": "A",

          "rtp-level-relay-type": "mixer"

        },

                {

          "expire": 200,

          "initiator": true,

          "endpoint": "B",

          "direction": "sendrecv",

          "channel-bundle-id": "B",

          "rtp-level-relay-type": "mixer"

        }

      ]

    },

    {

      "name": "video",

      "channels": [

        {

          "expire": 200,

          "initiator": true,

          "endpoint": "A",

          "direction": "sendrecv",

          "channel-bundle-id": "A",

          "last-n": 2

        },

                {

          "expire": 200,

          "initiator": true,

          "endpoint": "B",

          "direction": "sendrecv",

          "channel-bundle-id": "B",

          "last-n": 2

        }

      ]

    }

  ],

  "channel-bundles": [

    {

      "id": "A",

      "transport": {

        "rtcp-mux": true

      }

    },

        {

      "id": "B",

      "transport": {

        "rtcp-mux": true

      }

    }

  ]

}

RESPONSE:


{

  "channel-bundles": [

    {

      "id": "A",

      "transport": {

        "candidates": [

        ],

        "xmlns": "urn:xmpp:jingle:transports:ice-udp:1",

        "ufrag": "857no1anngn7ti",

        "rtcp-mux": true,

        "pwd": "6vh4q6mr08irgnipdcaq8ij9cp",

        "fingerprints": [

          {

            "fingerprint": "C8:56:46:2D:C7:93:50:69:AE:BD:74:93:BA:A6:B8:CE:0A:47:60:BF",

            "setup": "actpass",

            "hash": "sha-1"

          }

        ]

      }

    },

    {

      "id": "B",

      "transport": {

        "candidates": [

        ],

        "xmlns": "urn:xmpp:jingle:transports:ice-udp:1",

        "ufrag": "cbr041anngn7tr",

        "rtcp-mux": true,

        "pwd": "1d4poh3jsb6vpr3euk3m7mlenf",

        "fingerprints": [

          {

            "fingerprint": "C8:56:46:2D:C7:93:50:69:AE:BD:74:93:BA:A6:B8:CE:0A:47:60:BF",

            "setup": "actpass",

            "hash": "sha-1"

          }

        ]

      }

    }

  ],

  "contents": [

    {

      "channels": [

        {

          "endpoint": "A",

          "channel-bundle-id": "A",

          "sources": [

            368796450

          ],

          "rtp-level-relay-type": "mixer",

          "expire": 200,

          "initiator": true,

          "id": "21e709f563112a4a",

          "direction": "recvonly"

        },

        {

          "endpoint": "B",

          "channel-bundle-id": "B",

          "sources": [

            2013976405

          ],

          "rtp-level-relay-type": "mixer",

          "expire": 200,

          "initiator": true,

          "id": "cc4cfd4d3833efc2",

          "direction": "recvonly"

        }

      ],

      "name": "audio"

    },

    {

      "channels": [

        {

          "endpoint": "A",

          "channel-bundle-id": "A",

          "sources": [

            1726206550

          ],

          "rtp-level-relay-type": "translator",

          "expire": 200,

          "initiator": true,

          "id": "585c220ad48c23a9",

          "receive-simulcast-layer": null,

          "direction": "sendrecv",

          "last-n": 2

        },

        {

          "endpoint": "B",

          "channel-bundle-id": "B",

          "sources": [

            1726206550

          ],

          "rtp-level-relay-type": "translator",

          "expire": 200,

          "initiator": true,

          "id": "3d3414726921e869",

          "receive-simulcast-layer": null,

          "direction": "sendrecv",

          "last-n": 2

        }

      ],

      "name": "video"

    }

  ],

  "id": "1ea100bdbf24f40"

}


#2

Hi Oliver,

when mixer is used the direction of channels will change to sendrcv as soon as the bridge starts receiving media from the endpoints.

From the code:

case MIXER:
    MediaDevice device = getContent().getMixer();

    stream.setDevice(device);

    /*
     * It is necessary to start receiving media in order to
     * determine the MediaFormat in which the stream will send the
     * media it generates.
     */
    if (stream.getFormat() == null)
        stream.setDirection(MediaDirection.RECVONLY);
    break;

So the response to your patch is correct.

Cheers,

Matteo

···

________________________________
From: users <users-bounces@jitsi.org> on behalf of Oliver Hausler <oliver@closeup.cc>
Sent: Tuesday, July 19, 2016 2:40 AM
To: Jitsi Users Mailinglist (users@jitsi.org)
Subject: [jitsi-users] Why are mixed channels offered as recvonly?

Using the REST interface, I patch a conference with 2 channels (audio+video) for 2 endpoints (4 channels total), all set to sendrecv. While the response shows channels with "rtp-level-relay-type": "translator" correctly as sendrecv, "rtp-level-relay-type": "mixer" channels are shown recvonly.

Why is that? I understand from jitsi's perspective these channels are recvonly, but if I create an sdp using recvonly, how would the client receive the mixed channels then? From the client's perspective, a mixed channel is nothing different than a translated channel; it receives it on the same peer connection and doesn't care what jitsi did with it.

Shouldn't direction be set to sendrecv in the response?

And then, why do I receive the same source id for both endpoints for the translated channels, while I receive different source ids for mixed channels? I would have expected to see a single source for all mixed channels, as it is the same stream which is sent to all endpoints.

PATCH:


{

  "id": "1ea100bdbf24f40",

  "contents": [

    {

      "name": "audio",

      "channels": [

        {

          "expire": 200,

          "initiator": true,

          "endpoint": "A",

          "direction": "sendrecv",

          "channel-bundle-id": "A",

          "rtp-level-relay-type": "mixer"

        },

                {

          "expire": 200,

          "initiator": true,

          "endpoint": "B",

          "direction": "sendrecv",

          "channel-bundle-id": "B",

          "rtp-level-relay-type": "mixer"

        }

      ]

    },

    {

      "name": "video",

      "channels": [

        {

          "expire": 200,

          "initiator": true,

          "endpoint": "A",

          "direction": "sendrecv",

          "channel-bundle-id": "A",

          "last-n": 2

        },

                {

          "expire": 200,

          "initiator": true,

          "endpoint": "B",

          "direction": "sendrecv",

          "channel-bundle-id": "B",

          "last-n": 2

        }

      ]

    }

  ],

  "channel-bundles": [

    {

      "id": "A",

      "transport": {

        "rtcp-mux": true

      }

    },

        {

      "id": "B",

      "transport": {

        "rtcp-mux": true

      }

    }

  ]

}

RESPONSE:


{

  "channel-bundles": [

    {

      "id": "A",

      "transport": {

        "candidates": [

        ],

        "xmlns": "urn:xmpp:jingle:transports:ice-udp:1",

        "ufrag": "857no1anngn7ti",

        "rtcp-mux": true,

        "pwd": "6vh4q6mr08irgnipdcaq8ij9cp",

        "fingerprints": [

          {

            "fingerprint": "C8:56:46:2D:C7:93:50:69:AE:BD:74:93:BA:A6:B8:CE:0A:47:60:BF",

            "setup": "actpass",

            "hash": "sha-1"

          }

        ]

      }

    },

    {

      "id": "B",

      "transport": {

        "candidates": [

        ],

        "xmlns": "urn:xmpp:jingle:transports:ice-udp:1",

        "ufrag": "cbr041anngn7tr",

        "rtcp-mux": true,

        "pwd": "1d4poh3jsb6vpr3euk3m7mlenf",

        "fingerprints": [

          {

            "fingerprint": "C8:56:46:2D:C7:93:50:69:AE:BD:74:93:BA:A6:B8:CE:0A:47:60:BF",

            "setup": "actpass",

            "hash": "sha-1"

          }

        ]

      }

    }

  ],

  "contents": [

    {

      "channels": [

        {

          "endpoint": "A",

          "channel-bundle-id": "A",

          "sources": [

            368796450

          ],

          "rtp-level-relay-type": "mixer",

          "expire": 200,

          "initiator": true,

          "id": "21e709f563112a4a",

          "direction": "recvonly"

        },

        {

          "endpoint": "B",

          "channel-bundle-id": "B",

          "sources": [

            2013976405

          ],

          "rtp-level-relay-type": "mixer",

          "expire": 200,

          "initiator": true,

          "id": "cc4cfd4d3833efc2",

          "direction": "recvonly"

        }

      ],

      "name": "audio"

    },

    {

      "channels": [

        {

          "endpoint": "A",

          "channel-bundle-id": "A",

          "sources": [

            1726206550

          ],

          "rtp-level-relay-type": "translator",

          "expire": 200,

          "initiator": true,

          "id": "585c220ad48c23a9",

          "receive-simulcast-layer": null,

          "direction": "sendrecv",

          "last-n": 2

        },

        {

          "endpoint": "B",

          "channel-bundle-id": "B",

          "sources": [

            1726206550

          ],

          "rtp-level-relay-type": "translator",

          "expire": 200,

          "initiator": true,

          "id": "3d3414726921e869",

          "receive-simulcast-layer": null,

          "direction": "sendrecv",

          "last-n": 2

        }

      ],

      "name": "video"

    }

  ],

  "id": "1ea100bdbf24f40"

}


#3

Hey,

···

On 19/07/16 02:40, Oliver Hausler wrote:

Using the REST interface, I patch a conference with 2 channels
(audio+video) for 2 endpoints (4 channels total), all set to sendrecv.
While the response shows channels with "rtp-level-relay-type":
"translator" correctly as sendrecv, "rtp-level-relay-type": "mixer"
channels are shown recvonly.

Why is that? I understand from jitsi's perspective these channels are
recvonly, but if I create an sdp using recvonly, how would the client
receive the mixed channels then? From the client's perspective, a mixed
channel is nothing different than a translated channel; it receives it
on the same peer connection and doesn't care what jitsi did with it.

Shouldn't direction be set to sendrecv in the response?

And then, why do I receive the same source id for both endpoints for the
translated channels, while I receive different source ids for mixed
channels? I would have expected to see a single source for all mixed
channels, as it is the same stream which is sent to all endpoints.

It is not the same stream, as each receiver gets a mix which excludes his/her own audio.

Boris


#4

Thank you guys, excluding the own audio is smart :wink: Haven't even been thinking about this!
Oliver.