What is master port and port zero ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Guys,
Please correct me here if I am wrong in any point. I have been studying 
PJSip for sometime now but I may have many incorrect assumptions when 
trying to connect the dots. :)

Hello Khoa,
In conferencing, the way it works port zero would either be Sound Device 
Port or Master Port. These are attached for a reason, both these ports 
have a unique property, they provide clock/timing to the media they 
connect to. Other media ports by design are passive, they would not push 
the conference to take their buffers and mix them for other parties to 
listen. Sound card interfaces require callbacks which either provide 
recorded voice in buffer or while playing a buffer when finished would 
ask for next buffer.

Sound card has callbacks and on similar pattern media port internally 
has an instance of Clock Generator, so for the conference mixing to 
happen you need to have one of these added to the conference.

If you have any further queries or if any of my points above are not 
clear, please do let me know.

Regards
Manmeet

On 01/28/2013 10:24 PM, Khoa Pham wrote:
> Hi Manmeet,
>
> I've read those 3 links. please explain to me what is the relation 
> among sound device port, master port, and port zero.
>
>
> On Mon, Jan 28, 2013 at 8:37 PM, Manmeet Singh 
> <manmeets at gc-solutions.net <mailto:manmeets at gc-solutions.net>> wrote:
>
>     Hello Khoa,
>
>     If following links don't clarify things then please do let me
>     know. Then I'll try and give you a snapshot of the complete
>     scenario of how the conference is designed in pjsip.
>
>     snd_port
>     http://www.pjsip.org/pjmedia/docs/html/group__PJMED__SND__PORT.htm
>     master_port
>     http://www.pjsip.org/pjmedia/docs/html/group__PJMEDIA__MASTER__PORT.htm
>     port
>     http://www.pjsip.org/docs/latest-2/pjmedia/docs/html/group__PJMEDIA__PORT.htm
>
>     The media clock/timing extends the media port concept that is
>     explained inMedia Ports Framework
>     <http://www.pjsip.org/docs/latest-2/pjmedia/docs/html/group__PJMEDIA__PORT.htm>.
>     When clock is present in the ports interconnection, media will
>     flow automatically (and with correct timing too!) from one media
>     port to another.
>
>     There are few objects in PJMEDIA that are able to provide
>     clock/timing to media ports interconnection:
>
>       * Sound Device Port
>         <http://www.pjsip.org/docs/latest-2/pjmedia/docs/html/group__PJMED__SND__PORT.htm>
>         The sound device makes a good candidate as the clock source,
>         and PJMEDIAPortable Sound Hardware Abstraction
>         <http://www.pjsip.org/docs/latest-2/pjmedia/docs/html/group__PJMED__SND.htm>is
>         designed so that it is able to invoke operations according to
>         timing driven by the sound hardware clock (this may sound
>         complicated, but actually it just means that the sound device
>         abstraction provides callbacks to be called when it has/wants
>         media frames).
>         SeeSound Device Port
>         <http://www.pjsip.org/docs/latest-2/pjmedia/docs/html/group__PJMED__SND__PORT.htm>for
>         more details.
>
>       * Master Port
>         <http://www.pjsip.org/docs/latest-2/pjmedia/docs/html/group__PJMEDIA__MASTER__PORT.htm>
>         The master port usesClock Generator
>         <http://www.pjsip.org/docs/latest-2/pjmedia/docs/html/group__PJMEDIA__CLOCK.htm>as
>         the clock source. By usingMaster Port
>         <http://www.pjsip.org/docs/latest-2/pjmedia/docs/html/group__PJMEDIA__MASTER__PORT.htm>,
>         it is possible to interconnect passive media ports and let the
>         frames flow automatically in timely manner.
>         Please seeMaster Port
>         <http://www.pjsip.org/docs/latest-2/pjmedia/docs/html/group__PJMEDIA__MASTER__PORT.htm>for
>         more details.
>
>
>     Regards
>     Manmeet
>
>
>     On 01/28/2013 06:53 PM, Khoa Pham wrote:
>>     Thanks Gaurav for the prompt reply, I've already read that link.
>>     "A master port has two media ports connected to it". What are
>>     those 2 media ports?
>>     In "pjmedia_conf" structure, there are "master_port", "snd_port"
>>     and "ports" list, how are they related ?
>>
>>
>>     On Mon, Jan 28, 2013 at 8:15 PM, Gaurav Srivastava
>>     <gaurav.srivastava2 at agnity.com
>>     <mailto:gaurav.srivastava2 at agnity.com>> wrote:
>>
>>                     Hi Khoa,
>>
>>                     Please go through the link
>>
>>         http://www.pjsip.org/pjmedia/docs/html/group__PJMEDIA__MASTER__PORT.htm
>>
>>                     In case not fruitful, please let me know.
>>
>>                     Thanks and Regards,
>>
>>                     Gaurav
>>
>>         -----Original Message-----
>>         *From:* pjsip [mailto:pjsip-bounces at lists.pjsip.org
>>         <mailto:pjsip-bounces at lists.pjsip.org>] *On Behalf Of *Khoa Pham
>>         *Sent:* Monday, January 28, 2013 6:33 PM
>>         *To:* pjsip list
>>         *Subject:* [pjsip] What is master port and port zero ?
>>
>>         When reading conference bridge on pjsip.org/pjmedia/docs
>>         <http://pjsip.org/pjmedia/docs>, I see these 2 port. What are
>>         they, are they the same ?
>>
>>         When running pjsua_app, I use "cl" command to list port in
>>         conference bridge, I see
>>
>>         pjsua_var.mconf->master_port->info->name = "Wave mapper"
>>
>>         pjsua_var.mconf->ports[0]->name = "Wave mapper"
>>
>>         pjsua_var.mconf->ports[1]->name = "ringback"
>>
>>         pjsua_var.mconf->ports[2]->name = "ring"
>>
>>         pjsua_var.mconf->ports[3]->name =
>>         "sip:voip1 at freesipserver.com
>>         <mailto:sip%3Avoip1 at freesipserver.com>"
>>
>>         And it says ports[0] is transmitting to port[3], and port[3]
>>         is transmitting to ports[0]
>>
>>         Any answer is highly appreciated, thanks in advance.
>>
>>         -- 
>>         Khoa Pham
>>         HCMC University of Science
>>         Faculty of Information Technology
>>
>>
>>         _______________________________________________
>>         Visit our blog: http://blog.pjsip.org
>>
>>         pjsip mailing list
>>         pjsip at lists.pjsip.org <mailto:pjsip at lists.pjsip.org>
>>         http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>>
>>
>>
>>
>>     -- 
>>     Khoa Pham
>>     HCMC University of Science
>>     Faculty of Information Technology
>>
>>
>>     _______________________________________________
>>     Visit our blog:http://blog.pjsip.org
>>
>>     pjsip mailing list
>>     pjsip at lists.pjsip.org  <mailto:pjsip at lists.pjsip.org>
>>     http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>
>
>
>
> -- 
> Khoa Pham
> HCMC University of Science
> Faculty of Information Technology

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20130129/7e136f1d/attachment-0001.html>


[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux