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

Alexander E. Patrakov patrakov at gmail.com
Mon May 21 08:09:02 PDT 2012


2012/5/21 Pierre-Louis Bossart <pierre-louis.bossart at linux.intel.com>:
> I am not sure if there's really a problem. Increasing the audio latency
> doesn't necessarily result in A/V sync issues. As long as the A/V sync is
> done by querying how many samples are queued instead of using the number of
> samples pushed into PulseAudio, you should be able to use pretty much
> whatever buffer size you want. It's the same issue with ALSA, if you use
> large buffers and base the A/V on the number of samples written to the ring
> buffer, A/V sync will be off. Use snd_pcm_delay() and you'll be fine.

Dear Pierre-Louis,

this thread is based on a misunderstanding. The original poster,
instead of asking someone to fix the original problem (see below),
asks you about workarounds, and you don't see the big picture.

The original problem that needs to be solved is that there are no
fully-working analog TV viewers or FM radio players for today's linux,
at all. Here is an overview of the existing software:

1) TVtime (that's what the original poster uses): doesn't handle audio
at all (but I was told that there is a fork that does), assumes that
there is a zero-latency analog wire coming from the TV tuner audio
output to the sound card's "TV" input. That's why the OP asks about
module-loopback and/or parec|pacat solution, as a replacement of the
said wire. Due to the now-invalid assumption about the wire, zero
latency is needed. Because the audio chain is external to tvtime,
there is no possibility for any A/V sync queries.

2) MPlayer (that's what I use for watching analog TV): can be
configured to transfer audio from the tuner to the sound card
digitally, but cannot be configured to record from the tuner via
PulseAudio (uses plain ALSA instead). Here is my config (valid for
Russia and SAA7134-based cards, change SECAM to PAL or NTSC in other
parts of the world):

[protocol.tv]
vf=crop=720:574:0:2,pp=fd,hqdn3d=20:15:30,expand=720:576
tv=driver=v4l2:width=720:height=578:device=/dev/video1:audiorate=32000:norm=SECAM:chanlist=russia:alsa=1:amode=1:adevice=plughw.SAA7134:immediatemode=0:forcechan=2:tdevice=/dev/vbi0:buffersize=256
aspect=4:3
mc=0

mplayer tv://8

3) VLC: last time I tried it, it worked for TV (but recorded via
ALSA). But it has an awkward interface (needs frequencies instead of
channel numbers), can record via ALSA only, has no good denoising
filter, and doesn't support FM radio. That's why I use MPlayer.

-- 
Alexander E. Patrakov


More information about the pulseaudio-discuss mailing list