Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Low latency audio capture with gstreamer

I need (almost) real-time audio capturing on Linux with gstreamer. My problem is that I cannot reduce the latency below ~210ms. I tried a simple loopback from mic to headphone:

gst-launch-1.0 pulsesrc ! alsasink
gst-launch-1.0 alsasrc ! alsasink

Both produced the same delay. The latency-time property of alsasrc did not help (it did add the given latency). I could produce the effect I need with

pactl load-module module-loopback latency_msec=1

But I could not figure out whether it is possible to set the device latency for the pulsesrc plug-in of gstreamer. I guess, if it is possible, I should add something to the stream-properties, but could not figure out what (I searched for it here) and how.

Is it possible to set this device latency for any gstreamer sources, and if yes, how?

like image 334
gertom Avatar asked Oct 29 '22 12:10

gertom


1 Answers

Using pulsesink instead of alsasink may solve the problem. Try this:

gst-launch-1.0 -v alsasrc buffer-time=35000 !  pulsesink
like image 108
Tibor Bakota - FrontEndART Avatar answered Nov 04 '22 09:11

Tibor Bakota - FrontEndART