Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Good sending rate for UDP for VoIP purposes?

Status
Not open for further replies.

MrNobody

New Member
Hi..
I am doing a VoIP like device using PIC18F4620 and ENC28J60 with a sample frequency of 8kHz..
The device is to send sampled voice data to a computer in a LAN environment so assuming that the network traffic is low and the latency is also low..

I need input on effective ways i can send the sampled data.
Should I send it as soon as I sampled the voice ie, as soon as i sampled a byte, i send it straight a way or should I send it in a chunk..?
I am assuming that eventhough i send a chunk of data, i still need to send it byte by byte right..? I don't know much about ethernet communication so i need some guidance on that..

Thanks..
 
Consider your network overhead. Although your data is a "byte", you would have to wrap it up in some type of header (every UDP packet still has a source and destination address etc etc). So does it make sense to have say.. 12 bytes of header (guesstimate), with a single byte payload?

Probably not.. so you will want to batch these up. How many? That is completely up to you. Of course if you want to adhere to some known standards (See RTP over UDP), you would be looking at sample sizes in increments of 10ms (80 bytes). A 30ms packet is quite a common occurence.

Do some more googling and reading..

Other keywords to search on: voip + latency + jitter, and/or jitter buffers
RTP g.711

It's doable... but non-trivial.
 
Ouch.. i am so lost about g.711 that i don't know how to start.
I have done a search in google and i know abit about it from wikipedia etc.. but how do i actually implement it in PIC18F4620..? I found that there are libraries for PIC24 and dspic.. but how to do it on PIC18F4620..?

Another thing is lets say i send the data every 10ms, so i have 80bytes of sampled data and few bytes of header data, when I send it using UDP, do i still send it bye by byte..? How is the concept of sending a packet of data like..?

Actually, I still don't know much about hoiw to implement UDP with PIC18F4620 and ENC28J60 and am still reading about it.. Oh, btw, if i am not mistaken, ENC28J60 does not support RTP right..? I may be mistaken..
 
A. G.711 is the encoding of the data. It is the simplest one out there and free source code is available.
B. RTP - is a protocol that runs over UDP and adds.. (as I recall) a 12 byte header to your packet. If you can do UDP.. you can do RTP. This protocol helps by adding sequence numbers and timestamps to the packet, so that the far end can detect a dropped packet, or data arriving early/late.
C. All theory.. I've never used the PIC's to do this (or the ENCxxx device)
D. Jitter = dealing with packets that arrive faster than expected (almost never) or slower than expected (more likely). On the receiving side you will want to buffer the data so that if you have a period waiting for a "late" packet, you can play some buffered data. Otherwise you get a noticable "blip" in the audio path.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top