Packet size, again...

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

 



Matti Zemack wrote:
> Hi all,
> 
> Quite recently I asked a question regarding packet sizes. And got a 
> really good answer from Benny quick as a lightning.
> I haven't had time to really dig into the code, and so the problem got 
> back at me today. Or so I am guessing?
> 
> I've seen packet size be well defined for G711 and G722 in the RFC's, 
> but what about other codecs?

I think you meant frame size rather than packet size, as one (RTP) 
packet may contain more than one frames. If you do mean packet, then 
actually packet size is not well defined. But frame size is indeed 
well defined.


> Trying to set up two PJSIP machines running PJSUA using PCM, 48kHz, 16 
> bit, mono works just fine.
> Doing the same in stereo is a no go. I'm guessing this might have to do 
> with packet size vs. MTU.

This could be a bug in pjmedia. With 48khz 16bit stereo and with 10 
msec ptime (ptime==frame duration), we'll get this frame size:

   48000 x 2 (bytes) x 2 (channels) x 0.010 (sec) = 1920 bytes

I suspect there could be few places in pjmedia where it assumes that 
packet size won't be greater than 1500 bytes. First is 
PJMEDIA_MAX_MTU config, which default value is 1500. You'd need to 
increase this (sorry I missed this last time; I thought we're only 
talking about SIP).

Second is the maximum packet size in transport_udp.c, which is hard 
coded to 1500 (the RTP_LEN macro). This needed to be changed to 
PJMEDIA_MAX_MTU, and it's just been fixed in r1630.

I think these should hopefully fix it.


> Would it be hard making a runtime command for setting the packet size? I 
> know I can set it at compilation time. But it would be far more useful 
> at runtime. Do you believe this will need too much programming effort?

I think that's not necessary. The actual packet size is always 
calculated on run-time based on the codec. The compile time settings 
only specifies the *maximum* value to be supported.

cheers,
  -benny


> Just want to know how deep this is, if I myself start trying to add it 
> to PJSUA
> 
> (I've so far tried to stay out of the PJSUA code, for future robustness. 
> I've constructed a simple GUI which actually sends command lines to 
> PJSUA and reads back the answers interpreting them into flashing graphics.)
> 
> Best regards,
> Matti Zemack, BBC, Kingswood, UK
> 
> 
> 
> http://www.bbc.co.uk
> This e-mail (and any attachments) is confidential and may contain 
> personal views which are not the views of the BBC unless specifically 
> stated.
> If you have received it in error, please delete it from your system.
> Do not use, copy or disclose the information in any way nor act in 
> reliance on it and notify the sender immediately.
> Please note that the BBC monitors e-mails sent or received.
> Further communication will signify your consent to this.
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Visit our blog: http://blog.pjsip.org
> 
> pjsip mailing list
> pjsip at lists.pjsip.org
> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org


-- 
Benny Prijono
http://www.pjsip.org




[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