[pulseaudio-discuss] Toslink capture looback latency problem

Nico pulseaudio-discuss at nicohood.de
Mon Jan 29 11:52:11 UTC 2018


Hi,
I want to capture the audio stream of my TV with my PCI-E Toslink sound
card and play it back on my usb XLR soundcard. The reason why I do that
is to use my own music boxes rather than the TV speakers. With toslink +
XLR I do not have problems with ground loops etc.

I am using the pulseaudio loopback module with its default
configuration. The problem is, that the delay between picture and sound
is about one second off, and the longer I wait, the more delay it gets
(30 seconds and more). It is no usable like this.

I tried to play with the latencies of source, sink and the tv delay
itself without sucess. I also tried streaming with pacat directly as
described here:
https://thelinuxexperiment.com/fix-pulseaudio-loopback-delay/

I also tried to change different parameters of the loopback module or
the sources/sinks, but that did not help. I never changed any global
pulseaudio config to avoid larger configuration issues. The CPU usage of
pulseaudio is at 3% with the loopback module

Can anyone help me to get rid of this lag?

Here are some additional information:

Source device:
Source #1
	State: RUNNING
	Name: alsa_input.pci-0000_01_00.0.iec958-stereo
	Description: CM8888 [Oxygen Express] (HDA Controller) Digital Stereo
(IEC958)
	Driver: module-alsa-card.c
	Sample Specification: s16le 2ch 44100Hz
	Channel Map: front-left,front-right
	Owner Module: 7
	Mute: no
	Volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100%
/ 0.00 dB
	        balance 0.00
	Base Volume: 65536 / 100% / 0.00 dB
	Monitor of Sink: n/a
	Latency: 34402 usec, configured 40000 usec
	Flags: HARDWARE DECIBEL_VOLUME LATENCY
	Properties:
		alsa.resolution_bits = "16"
		device.api = "alsa"
		device.class = "sound"
		alsa.class = "generic"
		alsa.subclass = "generic-mix"
		alsa.name = "Generic Digital"
		alsa.id = "Generic Digital"
		alsa.subdevice = "0"
		alsa.subdevice_name = "subdevice #0"
		alsa.device = "1"
		alsa.card = "2"
		alsa.card_name = "HDA C-Media"
		alsa.long_card_name = "HDA C-Media at 0xfea00000 irq 24"
		alsa.driver_name = "snd_hda_intel"
		device.bus_path = "pci-0000:01:00.0"
		sysfs.path = "/devices/pci0000:00/0000:00:02.1/0000:01:00.0/sound/card2"
		device.bus = "pci"
		device.vendor.id = "13f6"
		device.vendor.name = "C-Media Electronics Inc"
		device.product.id = "5011"
		device.product.name = "CM8888 [Oxygen Express] (HDA Controller)"
		device.string = "iec958:2"
		device.buffering.buffer_size = "352768"
		device.buffering.fragment_size = "176384"
		device.access_mode = "mmap+timer"
		device.profile.name = "iec958-stereo"
		device.profile.description = "Digital Stereo (IEC958)"
		device.description = "CM8888 [Oxygen Express] (HDA Controller) Digital
Stereo (IEC958)"
		alsa.mixer_name = "C-Media Generic"
		alsa.components = "HDA:13f68828,13f68280,00109900"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-pci"
	Ports:
		iec958-stereo-input: Digital Input (S/PDIF) (priority: 0)
	Active Port: iec958-stereo-input
	Formats:
		pcm

Sink device:
Sink #1
	State: RUNNING
	Name: alsa_output.usb-M-AUDIO_M-Track_Hub-00.analog-stereo
	Description: M-Track Hub Analog Stereo
	Driver: module-alsa-card.c
	Sample Specification: s24le 2ch 44100Hz
	Channel Map: front-left,front-right
	Owner Module: 8
	Mute: no
	Volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100%
/ 0.00 dB
	        balance 0.00
	Base Volume: 65536 / 100% / 0.00 dB
	Monitor Source:
alsa_output.usb-M-AUDIO_M-Track_Hub-00.analog-stereo.monitor
	Latency: 25099 usec, configured 23220 usec
	Flags: HARDWARE DECIBEL_VOLUME LATENCY
	Properties:
		alsa.resolution_bits = "24"
		device.api = "alsa"
		device.class = "sound"
		alsa.class = "generic"
		alsa.subclass = "generic-mix"
		alsa.name = "USB Audio"
		alsa.id = "USB Audio"
		alsa.subdevice = "0"
		alsa.subdevice_name = "subdevice #0"
		alsa.device = "0"
		alsa.card = "3"
		alsa.card_name = "M-Track Hub"
		alsa.long_card_name = "M-AUDIO M-Track Hub at usb-0000:00:12.0-1.2.4,
full speed"
		alsa.driver_name = "snd_usb_audio"
		device.bus_path = "pci-0000:00:12.0-usb-0:1.2.4:1.0"
		sysfs.path =
"/devices/pci0000:00/0000:00:12.0/usb1/1-1/1-1.2/1-1.2.4/1-1.2.4:1.0/sound/card3"
		udev.id = "usb-M-AUDIO_M-Track_Hub-00"
		device.bus = "usb"
		device.vendor.id = "0763"
		device.vendor.name = "M-Audio"
		device.product.id = "400d"
		device.product.name = "M-Track Hub"
		device.serial = "M-AUDIO_M-Track_Hub"
		device.string = "front:3"
		device.buffering.buffer_size = "529200"
		device.buffering.fragment_size = "264600"
		device.access_mode = "mmap+timer"
		device.profile.name = "analog-stereo"
		device.profile.description = "Analog Stereo"
		device.description = "M-Track Hub Analog Stereo"
		alsa.mixer_name = "USB Mixer"
		alsa.components = "USB0763:400d"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-usb"
	Ports:
		analog-output: Analog Output (priority: 9900)
	Active Port: analog-output
	Formats:
		pcm




Regards
Nico


More information about the pulseaudio-discuss mailing list