Question

I want to implement full duplex communication using alsa. I first wrote capture and playback programs and i am transferring data from captured process to playback process using UDP communication. It is working fine when i was running two processes where one is capturing and another is playing(consider this as half duplex from A to B) , the problem comes when i was trying to implement another half duplex(Half duplex from B to A) then I am getting Broken Pipe error while reading the data from Mic. How to resolve this?. Any help, thanks in advance.

Note: I am running two processes on different systems

Was it helpful?

Solution

When the application has to wait for a PCM device, it goes to sleep and gets woken up at the next period boundary. Therefore, the optimal size to read/write is one period (or a multiple of that).

You should read/write sample data as soon as some frames are available.

To reduce the chances of an over/underrun, increase the buffer size. (On capture devices, increasing the buffer size does not increase latency.)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top