4 ms·
Forward error correction implies extra latency, so of course it has to make up for enough packet loss to provide a net reduction in latency to be useful. Is th
by nitrogen 11y ago
Forward error correction implies extra latency, so of course it has to make up for enough packet loss to provide a net reduction in latency to be useful.
Is there a generic UDP-based FEC transport library that one could use to wrap a simple Opus or FLAC stream and test this out? Edit: I found http://openfec.org/ http://openfec.org/ but it seems to implement something other than packet loss recovery
- mikeash 11y agoYep. Fortunately audio is relatively low-bandwidth compared to a typical LAN so you can pile on a lot of redundancy. If you want to go crazy you could transmit everything twice from the start. AirTunes uses 352-frame packets. At 44100Hz, that's about 8ms per packet. So you definitely do not want to do FEC over more than a fairly small number of packets, or else you'll hit audible latency. (In my testing, if two sets of speakers are playing identical audio but with different delays, latency differences can be heard down to about 10ms with the right audio. Under 50ms is usually OK.) Of course, if you're doing your own protocol you could use whatever size you want for the packets, keeping in mind that overhead will start to dominate if you make them really tiny. Another problematic question is, what causes the packet loss? If it's just random, that's one thing, but what if it's outside interference? If some outside transmitter blasts your network for, say, 200ms and causes all data to be lost in that time, then a 2s buffer can recover, but a low-latency scheme is screwed no matter what. I don't know what the answer is here.
- charleslmunger 11y agoWireless networks usually exhibit bursty packet loss on top of a base packet loss rate, which poses challenges for streaming (and everything else). QUIC uses forward error correction in some cases to mitigate this: https://www.chromium.org/quic https://www.chromium.org/quic One model widely used for simulating packet loss on wireless networks is the Gilbert-Elliot model, http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.90.1411&rep=rep1&type=pdf http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.90.... which is supported by http://info.iet.unipi.it/~luigi/dummynet/ http://info.iet.unipi.it/~luigi/dummynet/ if you want to play with this yourself.