[pulseaudio-discuss] My attempt to reduce latency with pacat and tvtime

Steven Elliott selliott4 at austin.rr.com
Sat May 19 20:44:32 PDT 2012


On Mon, 2012-03-26 at 23:54 -0500, Steven Elliott wrote:
> I use tvtime (an open source TV application) to watch TV on my Fedora 16
> system.  As some of you may know forwarding audio from the sound card
> built into the TV tuner card to the primary sound card is not done by
> tvtime.  There are various ways of forwarding the audio including SoX,
> module-loopback, etc. but I've had the best luck (least latency) using
> pacat in a manner similar to what this webpage describes:
> 
> http://thelinuxexperiment.com/guinea-pigs/tyler-b/fix-pulseaudio-loopback-delay/
> 
> But with a change that I've made to pacat that I'd like to share in case
> it's helpful.

Since I've posted the above I've refined my patch a bit, which I've
attached, but I've also explored an additional cause of latency in the
PulseAudio server.  I've found that, if for some reason, there
is an underrun the watermark or latency is increased via
increase_watermark() in alsa-source.c and alsa-sink.c.  That probably
makes sense in a lot of cases, but in the case of watching TV via tvtime
I'd rather suffer a fleeting glitch due to underrun than a longer
lasting A/V sync issue.

I don't think the attached
"pulseaudio-limited-watermark-experimental.diff" patch is ideal which
why I marked it "experimental".  Consequently I'm curious if there is
potential for it to evolve into a submitable patch.  Should the 50 msec
limit that I've imposed in fix_tsched_watermark() be configurable?
Would it be preferable to decrease the watermark more aggressively in
decrease_watermark()?

-- 
------------------------------------------------------------------------
|  Steven Elliott  |  http://selliott.org  |  selliott4 at austin.rr.com  |
------------------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pacat-drain-experimental.diff
Type: text/x-patch
Size: 4898 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20120519/b94734cf/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pulseaudio-limited-watermark-experimental.diff
Type: text/x-patch
Size: 2931 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20120519/b94734cf/attachment-0001.bin>


More information about the pulseaudio-discuss mailing list