savonet / liquidsoap

Liquidsoap is a statically typed scripting general-purpose language with dedicated operators and backend for all thing media, streaming, file generation, automation, HTTP backend and more.
http://liquidsoap.info
GNU General Public License v2.0
1.45k stars 131 forks source link

UDP: Feeding stopped #1494

Open Moaneschien opened 3 years ago

Moaneschien commented 3 years ago

While looking in to ways to send audio from a MCU(ESP8266) to liquidsoap I tried UDP for speed. The liquidsoap line

liquidsoap output.prefered(mksafe(input.udp(buffer=1.,host='192.168.1.4',port=8266,'audio/wave')))

results in

[udp://192(dot)168(dot)1(dot)4:8266:2] Feeding stopped: A message sent on a datagram socket was larger than the internal message buffer or some other network limit, or the buffer used to receive a datagram into was smaller than the datagram itself.
 in recvfrom().

Audio is 16bit@44.1 kHz, stereo. First I reduced the packet size to 256 where it was 512. Then I thought it is a Win10 problem, so I increased the buffers size there. To no avail. Checking data with wireshark or a simple python script shows no problem. Packets are received.

Searching the doc and web there was not much to find on UDP, nor a way to increase buffer in liquidsoap. Is there any?

Moaneschien commented 3 years ago

In addition, when reducing the packet size to two bytes, liquidsoap tells me it doesn't understand the format. When increasing to 4 bytes it readily gives the recfrom() Feeding stopped error.

smimram commented 3 years ago

UDP i/o is deprecated. Could you try with srt which should work much better?