Pulse, Combined Sink, 5.1 + stereo = LAGS

Hello.

I need to have a dual output. My setup is 5.1 system via HDMI + setero output via USB DAC. I’ve tried to do it via pulseaudio, but it seems that something goes wrong.

CoreELEC settings: 5.1 output to combined sink.

Pulseaudio init:

pactl load-module module-alsa-card device_id=0
pactl load-module module-alsa-card device_id=1
pactl load-module module-combine-sink

By default first card (HDMI) is in surround51 profile. It works in such setup, but it sounds X times slower when it should be (like audio in slow motion video). It sounds OK if I switch card 0 to stereo profile. I’ve also tried to load combie sink with channels=6, but it doesn’t help. Also latency values are really big while playing something. Also I’ve tried just surround51 hdmi output via pulseaudio (without adding second card and combine sink) and it less slow, but it still slow. And it’s all OK with stereo…

Hopefully there is something that can be done in this case…

pactl cards.txt:

Card #0
	Name: alsa_card.0
	Driver: module-alsa-card.c
	Owner Module: 16
	Properties:
		alsa.card = "0"
		alsa.card_name = "AML-AUGESOUND"
		alsa.long_card_name = "AML-AUGESOUND"
		device.bus_path = "/devices/platform/auge_sound/sound/card0"
		sysfs.path = "/devices/platform/auge_sound/sound/card0"
		device.form_factor = "internal"
		device.string = "0"
		device.description = "Built-in Audio"
		device.icon_name = "audio-card"
	Profiles:
		input:iec958-stereo: Digital Stereo (IEC958) Input (sinks: 0, sources: 1, priority: 55, available: yes)
		output:analog-surround-71: Analog Surround 7.1 Output (sinks: 1, sources: 0, priority: 1200, available: yes)
		output:analog-surround-71+input:iec958-stereo: Analog Surround 7.1 Output + Digital Stereo (IEC958) Input (sinks: 1, sources: 1, priority: 1255, available: yes)
		output:iec958-stereo: Digital Stereo (IEC958) Output (sinks: 1, sources: 0, priority: 5500, available: yes)
		output:iec958-stereo+input:iec958-stereo: Digital Stereo Duplex (IEC958) (sinks: 1, sources: 1, priority: 5555, available: yes)
		output:hdmi-stereo: Digital Stereo (HDMI) Output (sinks: 1, sources: 0, priority: 5900, available: yes)
		output:hdmi-stereo+input:iec958-stereo: Digital Stereo (HDMI) Output + Digital Stereo (IEC958) Input (sinks: 1, sources: 1, priority: 5955, available: yes)
		output:hdmi-surround: Digital Surround 5.1 (HDMI) Output (sinks: 1, sources: 0, priority: 800, available: yes)
		output:hdmi-surround+input:iec958-stereo: Digital Surround 5.1 (HDMI) Output + Digital Stereo (IEC958) Input (sinks: 1, sources: 1, priority: 855, available: yes)
		output:hdmi-surround71: Digital Surround 7.1 (HDMI) Output (sinks: 1, sources: 0, priority: 800, available: yes)
		output:hdmi-surround71+input:iec958-stereo: Digital Surround 7.1 (HDMI) Output + Digital Stereo (IEC958) Input (sinks: 1, sources: 1, priority: 855, available: yes)
		off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
	Active Profile: output:hdmi-surround
	Ports:
		iec958-stereo-input: Digital Input (S/PDIF) (type: SPDIF, priority: 0, latency offset: 0 usec, availability unknown)
			Part of profile(s): input:iec958-stereo, output:analog-surround-71+input:iec958-stereo, output:iec958-stereo+input:iec958-stereo, output:hdmi-stereo+input:iec958-stereo, output:hdmi-surround+input:iec958-stereo, output:hdmi-surround71+input:iec958-stereo
		analog-output: Analog Output (type: Analog, priority: 9900, latency offset: 0 usec, availability unknown)
			Part of profile(s): output:analog-surround-71, output:analog-surround-71+input:iec958-stereo
		iec958-stereo-output: Digital Output (S/PDIF) (type: SPDIF, priority: 0, latency offset: 0 usec, availability unknown)
			Part of profile(s): output:iec958-stereo, output:iec958-stereo+input:iec958-stereo
		hdmi-output-0: HDMI / DisplayPort (type: HDMI, priority: 5900, latency offset: 0 usec, availability unknown)
			Properties:
				device.icon_name = "video-display"
			Part of profile(s): output:hdmi-stereo, output:hdmi-stereo+input:iec958-stereo, output:hdmi-surround, output:hdmi-surround+input:iec958-stereo, output:hdmi-surround71, output:hdmi-surround71+input:iec958-stereo

Card #1
	Name: alsa_card.1
	Driver: module-alsa-card.c
	Owner Module: 17
	Properties:
		alsa.card = "1"
		alsa.card_name = "iFi (by AMR) HD USB Audio"
		alsa.long_card_name = "iFi (by AMR) iFi (by AMR) HD USB Audio at usb-xhci-hcd.0.auto-1.1, high speed"
		alsa.driver_name = "snd_usb_audio"
		device.bus_path = "platform-xhci-hcd.0.auto-usb-0:1.1:1.0"
		sysfs.path = "/devices/platform/ff500000.dwc3/xhci-hcd.0.auto/usb1/1-1/1-1.1/1-1.1:1.0/sound/card1"
		udev.id = "usb-iFi__by_AMR__iFi__by_AMR__HD_USB_Audio-00"
		device.bus = "usb"
		device.vendor.id = "20b1"
		device.vendor.name = "XMOS Ltd"
		device.product.id = "3008"
		device.product.name = "iFi (by AMR) HD USB Audio"
		device.serial = "iFi__by_AMR__iFi__by_AMR__HD_USB_Audio"
		device.string = "1"
		device.description = "iFi (by AMR) HD USB Audio"
		device.icon_name = "audio-card-usb"
	Profiles:
		output:analog-stereo: Analog Stereo Output (sinks: 1, sources: 0, priority: 6500, available: yes)
		output:iec958-stereo: Digital Stereo (IEC958) Output (sinks: 1, sources: 0, priority: 5500, available: yes)
		off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
	Active Profile: output:analog-stereo
	Ports:
		analog-output: Analog Output (type: Analog, priority: 9900, latency offset: 0 usec, availability unknown)
			Part of profile(s): output:analog-stereo
		iec958-stereo-output: Digital Output (S/PDIF) (type: SPDIF, priority: 0, latency offset: 0 usec, availability unknown)
			Part of profile(s): output:iec958-stereo

pactl sinks.txt:

Sink #1
	State: SUSPENDED
	Name: librespot
	Description: Null Output
	Driver: module-null-sink.c
	Sample Specification: s16le 2ch 44100Hz
	Channel Map: front-left,front-right
	Owner Module: 14
	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: librespot.monitor
	Latency: 0 usec, configured 0 usec
	Flags: DECIBEL_VOLUME LATENCY SET_FORMATS 
	Properties:
		device.description = "Null Output"
		device.class = "abstract"
		device.icon_name = "audio-card"
	Formats:
		pcm

Sink #2
	State: SUSPENDED
	Name: alsa_output.0.hdmi-surround
	Description: Built-in Audio Digital Surround 5.1 (HDMI)
	Driver: module-alsa-card.c
	Sample Specification: s16le 6ch 44100Hz
	Channel Map: front-left,front-right,rear-left,rear-right,front-center,lfe
	Owner Module: 16
	Mute: no
	Volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB,   rear-left: 65536 / 100% / 0.00 dB,   rear-right: 65536 / 100% / 0.00 dB,   front-center: 65536 / 100% / 0.00 dB,   lfe: 65536 / 100% / 0.00 dB
	        balance 0.00
	Base Volume: 65536 / 100% / 0.00 dB
	Monitor Source: alsa_output.0.hdmi-surround.monitor
	Latency: 0 usec, configured 0 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 = ""
		alsa.id = "SPDIF-B-dummy dummy-0"
		alsa.subdevice = "0"
		alsa.subdevice_name = "subdevice #0"
		alsa.device = "0"
		alsa.card = "0"
		alsa.card_name = "AML-AUGESOUND"
		alsa.long_card_name = "AML-AUGESOUND"
		device.bus_path = "/devices/platform/auge_sound/sound/card0"
		sysfs.path = "/devices/platform/auge_sound/sound/card0"
		device.form_factor = "internal"
		device.string = "hdmi:0"
		device.buffering.buffer_size = "262140"
		device.buffering.fragment_size = "131064"
		device.access_mode = "mmap+timer"
		device.profile.name = "hdmi-surround"
		device.profile.description = "Digital Surround 5.1 (HDMI)"
		device.description = "Built-in Audio Digital Surround 5.1 (HDMI)"
		device.icon_name = "audio-card"
	Ports:
		hdmi-output-0: HDMI / DisplayPort (type: HDMI, priority: 5900, availability unknown)
	Active Port: hdmi-output-0
	Formats:
		pcm

Sink #3
	State: SUSPENDED
	Name: alsa_output.1.analog-stereo
	Description: iFi (by AMR) HD USB Audio Analog Stereo
	Driver: module-alsa-card.c
	Sample Specification: s32le 2ch 44100Hz
	Channel Map: front-left,front-right
	Owner Module: 17
	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.1.analog-stereo.monitor
	Latency: 0 usec, configured 0 usec
	Flags: HARDWARE DECIBEL_VOLUME LATENCY 
	Properties:
		alsa.resolution_bits = "32"
		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 = "1"
		alsa.card_name = "iFi (by AMR) HD USB Audio"
		alsa.long_card_name = "iFi (by AMR) iFi (by AMR) HD USB Audio at usb-xhci-hcd.0.auto-1.1, high speed"
		alsa.driver_name = "snd_usb_audio"
		device.bus_path = "platform-xhci-hcd.0.auto-usb-0:1.1:1.0"
		sysfs.path = "/devices/platform/ff500000.dwc3/xhci-hcd.0.auto/usb1/1-1/1-1.1/1-1.1:1.0/sound/card1"
		udev.id = "usb-iFi__by_AMR__iFi__by_AMR__HD_USB_Audio-00"
		device.bus = "usb"
		device.vendor.id = "20b1"
		device.vendor.name = "XMOS Ltd"
		device.product.id = "3008"
		device.product.name = "iFi (by AMR) HD USB Audio"
		device.serial = "iFi__by_AMR__iFi__by_AMR__HD_USB_Audio"
		device.string = "front:1"
		device.buffering.buffer_size = "705600"
		device.buffering.fragment_size = "352800"
		device.access_mode = "mmap+timer"
		device.profile.name = "analog-stereo"
		device.profile.description = "Analog Stereo"
		device.description = "iFi (by AMR) HD USB Audio Analog Stereo"
		device.icon_name = "audio-card-usb"
	Ports:
		analog-output: Analog Output (type: Analog, priority: 9900, availability unknown)
	Active Port: analog-output
	Formats:
		pcm

Sink #4
	State: SUSPENDED
	Name: combined
	Description: Simultaneous output to Built-in Audio Digital Surround 5.1 (HDMI), iFi (by AMR) HD USB Audio Analog Stereo
	Driver: module-combine-sink.c
	Sample Specification: s16le 2ch 44100Hz
	Channel Map: front-left,front-right
	Owner Module: 18
	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: combined.monitor
	Latency: 0 usec, configured 0 usec
	Flags: DECIBEL_VOLUME LATENCY 
	Properties:
		device.class = "filter"
		device.description = "Simultaneous output to Built-in Audio Digital Surround 5.1 (HDMI), iFi (by AMR) HD USB Audio Analog Stereo"
		device.icon_name = "audio-card"
	Formats:
		pcm

Forget to mention - my device is ODROID-N2.

Try 7.1 and MultiChannel HDMI audio device.

For 7.1 there are profiles:
output:hdmi-surround71
and
output:hdmi-surround71+input:iec958-stereo

But I’m also wondering what is multi channel hdmi audio device, cause I can see this in core elec settings for alsa devices, but I’m not sure about alsa devices I can see:

> aplay -lL
null
    Discard all samples (playback) or generate zero samples (capture)
default:CARD=AMLAUGESOUND
    AML-AUGESOUND, 
    Default Audio Device
sysdefault:CARD=AMLAUGESOUND
    AML-AUGESOUND, 
    Default Audio Device
surround71:CARD=AMLAUGESOUND,DEV=0
    AML-AUGESOUND, 
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=AMLAUGESOUND,DEV=0
    AML-AUGESOUND, 
    IEC958 (S/PDIF) Digital Audio Output
hdmi:CARD=AMLAUGESOUND,DEV=0
    AML-AUGESOUND, 
    HDMI Audio Output
default:CARD=Audio
    iFi (by AMR) HD USB Audio, USB Audio
    Default Audio Device
sysdefault:CARD=Audio
    iFi (by AMR) HD USB Audio, USB Audio
    Default Audio Device
front:CARD=Audio,DEV=0
    iFi (by AMR) HD USB Audio, USB Audio
    Front output / input
surround21:CARD=Audio,DEV=0
    iFi (by AMR) HD USB Audio, USB Audio
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=Audio,DEV=0
    iFi (by AMR) HD USB Audio, USB Audio
    4.0 Surround output to Front and Rear speakers
surround41:CARD=Audio,DEV=0
    iFi (by AMR) HD USB Audio, USB Audio
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Audio,DEV=0
    iFi (by AMR) HD USB Audio, USB Audio
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Audio,DEV=0
    iFi (by AMR) HD USB Audio, USB Audio
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Audio,DEV=0
    iFi (by AMR) HD USB Audio, USB Audio
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=Audio,DEV=0
    iFi (by AMR) HD USB Audio, USB Audio
    IEC958 (S/PDIF) Digital Audio Output
**** List of PLAYBACK Hardware Devices ****
card 0: AMLAUGESOUND [AML-AUGESOUND], device 0: SPDIF-B-dummy dummy-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: AMLAUGESOUND [AML-AUGESOUND], device 1: TDM-B-T9015-audio-hifi T9015-audio-hifi-1 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: AMLAUGESOUND [AML-AUGESOUND], device 2: SPDIF-dummy dummy-2 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: AMLAUGESOUND [AML-AUGESOUND], device 3: TDM-C-dummy dummy-3 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Audio [iFi (by AMR) HD USB Audio], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Switching to surround71 profile leads to no sound at all…

Yes, it’s the surround71 profile.
I don’t know, maybe you can use the normal “HDMI” output, set channels to 2.0 and enable AC3 Transcoding in the passthrough settings.

I’ve managed to make it working !!!

Great thanks for helping!

For those who have same problem. Place this to .config/autostart.sh:

pactl load-module module-alsa-sink device="surround71:CARD=AMLAUGESOUND,DEV=0" channels=8
pactl load-module module-alsa-sink device="default:CARD=Audio"
pactl load-module module-combine-sink
1 Like

More details:

You should use names from aplay -L. For main (hdmi) output surround71:CARD=AMLAUGESOUND,DEV=0 device should be used with parameter channels=8 (7.1 sound).

About | FAQ | Terms of Service | Privacy Policy | Legal Notice