[pulseaudio-discuss] Best way to add a delay to playback

hector at convivencial.org hector at convivencial.org
Sat Jun 13 16:58:33 PDT 2015



On 2015-06-12 07:29, Georg Chini wrote:
> On 11.06.2015 22:58, hector at convivencial.org wrote:
>> Hello,
>> 
>> I would like to add a 2-5 second delay to the sound playback from a 
>> stream.
>> 
>> That is, the sound comes out from an application at time X, and the 
>> sound can be heard from my speakers at X+5 secs.
>> 
>> Is this possible somehow? I have been trying to play with the latency 
>> offset without much luck, plus it only seems to allow a maximum of 
>> 2000 msecs.
>> 
>> Of course, most of the internet is trying to find how to eliminate 
>> latency, not how to create it, so I haven't found anything useful.
>> 
>> Thanks in advance,
>> 
>> Hector
>> _______________________________________________
>> pulseaudio-discuss mailing list
>> pulseaudio-discuss at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
> Hello Hector,
> 
> you can use module-loopback with the patches from
> http://thread.gmane.org/gmane.comp.audio.pulseaudio.general/22956
> to introduce the delay you need. (Play back to a null-sink and use
> module-loopback to connect null-sink.monitor to your real sink). For
> large delays it only works properly with timer based scheduling. With
> batch cards I have seen lots of error messages in the debug log at
> latencies  >  2- 5 seconds, although the audio still seems to be OK.
> 
> Regards
>              Georg
> _______________________________________________
> pulseaudio-discuss mailing list
> pulseaudio-discuss at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss

Hello Georg,

thanks! I get the idea. After checking, it seems current loopback module 
does not really honor the requested latency.

After applying your patches, it works! I wonder, what is stopping them 
from being upstream? I see they're a few months old.

Another question, what is your recommendation regarding 
buffer_latency_msec vs latency_msec for these ranges (say 5 secs).

Cheers,

Hector


More information about the pulseaudio-discuss mailing list