You are not logged in.

#1 2020-03-29 13:53:45

shana133
Member
Registered: 2020-03-29
Posts: 4

[SOLVED] Pulseaudio surround51 with S/PDIF

EDIT: Solution in my last post in this topic.
Problem description:
surround51 profile doesn't output any sound. Profile iec985-stereo+input:analog-stereo outputs sound properly but stereo only(front left and front right) - logs attached below.

Setup:

  • Optical Cable connected from S/PDIF port on motherboard with Realtek ALC1220 chip to the S/PDIF on the receiver(onkyo tx nr-686)

  • Speakers are connected to the receiver in 5.1 configuration(with sub)

Current working sound configuration:

  • Clean and up to date system installation (5.5.13-arch1-1), session manager lightdm with i3wm

  • Default alsa with no /etc/asound.conf modifications, alsa-utils, pulseaudio and pavucontrol installed

  • Minor modifications to local pulseaudio configs in $HOME/.config/pulse

  • Sound is being played through all speakers despite stereo output

Modifications to local pulseaudio configs
client.conf:

autospawn = yes

daemon.conf

default-sample-rate = 48000
default-sample-channels = 6
default-channel-map = front-left,front-right,rear-left,rear-right,front-center,lfe

Pavucontrol set as follows:

  • Configuration tab: Digital Stereo (IEC958) Output + Analog Stereo Input (on the list have Analog Surround Output 5.1 + Analog Stereo Input)

  • Output Devices tab: Digital Output (S/PDIF) (S/PDIF available only when using profile mentioned in Configuration)

  • Channels in output devices show only 2 channels

  • Playback(any application) show 6 channels but only 2(front left, front right) change volume

aplay -l

[shana@nyx ~]$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC1220 Analog [ALC1220 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 1: ALC1220 Digital [ALC1220 Digital]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 8: HDMI 2 [HDMI 2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 9: HDMI 3 [HDMI 3]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 10: HDMI 4 [HDMI 4]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 11: HDMI 5 [HDMI 5]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 12: HDMI 6 [HDMI 6]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

aplay -L

[shana@nyx ~]$ aplay -L
surround21
    2.1 Surround output to Front and Subwoofer speakers
surround40
    4.0 Surround output to Front and Rear speakers
surround41
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50
    5.0 Surround output to Front, Center and Rear speakers
surround51
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
null
    Discard all samples (playback) or generate zero samples (capture)
samplerate
    Rate Converter Plugin Using Samplerate Library
speexrate
    Rate Converter Plugin Using Speex Resampler
jack
    JACK Audio Connection Kit
oss
    Open Sound System
pulse
    PulseAudio Sound Server
speex
    Plugin using Speex DSP (resample, agc, denoise, echo, dereverb)
upmix
    Plugin for channel upmix (4,6,8)
vdownmix
    Plugin for channel downmix (stereo) with a simple spacialization
default
    Default ALSA Output (currently PulseAudio Sound Server)
sysdefault:CARD=PCH
    HDA Intel PCH, ALC1220 Analog
    Default Audio Device
front:CARD=PCH,DEV=0
    HDA Intel PCH, ALC1220 Analog
    Front speakers
surround21:CARD=PCH,DEV=0
    HDA Intel PCH, ALC1220 Analog
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=PCH,DEV=0
    HDA Intel PCH, ALC1220 Analog
    4.0 Surround output to Front and Rear speakers
surround41:CARD=PCH,DEV=0
    HDA Intel PCH, ALC1220 Analog
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=PCH,DEV=0
    HDA Intel PCH, ALC1220 Analog
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=PCH,DEV=0
    HDA Intel PCH, ALC1220 Analog
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=PCH,DEV=0
    HDA Intel PCH, ALC1220 Analog
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=PCH,DEV=0
    HDA Intel PCH, ALC1220 Digital
    IEC958 (S/PDIF) Digital Audio Output
usbstream:CARD=PCH
    HDA Intel PCH
    USB Stream Output
hdmi:CARD=NVidia,DEV=0
    HDA NVidia, HDMI 0
    HDMI Audio Output
hdmi:CARD=NVidia,DEV=1
    HDA NVidia, HDMI 1
    HDMI Audio Output
hdmi:CARD=NVidia,DEV=2
    HDA NVidia, HDMI 2
    HDMI Audio Output
hdmi:CARD=NVidia,DEV=3
    HDA NVidia, HDMI 3
    HDMI Audio Output
hdmi:CARD=NVidia,DEV=4
    HDA NVidia, HDMI 4
    HDMI Audio Output
hdmi:CARD=NVidia,DEV=5
    HDA NVidia, HDMI 5
    HDMI Audio Output
hdmi:CARD=NVidia,DEV=6
    HDA NVidia, HDMI 6
    HDMI Audio Output
usbstream:CARD=NVidia
    HDA NVidia
    USB Stream Output

/etc/asound.conf

[shana@nyx ~]$ cat /etc/asound.conf 
# Use PulseAudio by default
pcm.!default {
  type pulse
  fallback "sysdefault"
  hint {
    show on
    description "Default ALSA Output (currently PulseAudio Sound Server)"
  }
}

ctl.!default {
  type pulse
  fallback "sysdefault"
}

# vim:set ft=alsaconf:

sudo fuser -v /dev/snd/*

                     USER        PID ACCESS COMMAND
/dev/snd/controlC0:  shana      1332 F.... pulseaudio
/dev/snd/controlC1:  shana      1332 F.... pulseaudio
/dev/snd/pcmC0D0c:   shana      1332 F...m pulseaudio
/dev/snd/pcmC0D1p:   shana      1332 F...m pulseaudio

speaker-test -Dpulse -c 6 #same goes for -Ddefault -c 6

[shana@nyx ~]$ speaker-test -Dpulse -c 6

speaker-test 1.2.2

Playback device is pulse
Stream parameters are 48000Hz, S16_LE, 6 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 32 to 349525
Period size range from 10 to 116509
Using max buffer size 349524
Periods = 4
was set period_size = 87381
was set buffer_size = 349524
 0 - Front Left
 4 - Center
 1 - Front Right
 3 - Rear Right
 2 - Rear Left
 5 - LFE

Barely can hear those channels even up close during speaker-test
3 - Rear Right
2 - Rear Left
5 - LFE - no sound

speaker-test

[shana@nyx ~]$ speaker-test

speaker-test 1.2.2

Playback device is default
Stream parameters are 48000Hz, S16_LE, 1 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 192 to 2097152
Period size range from 64 to 699051
Using max buffer size 2097152
Periods = 4
was set period_size = 524288
was set buffer_size = 2097152
 0 - Front Left
^CTime per period = 10.934343

amixer -c 0 # -c 1 not relevant - nvidia sound device

[shana@nyx ~]$ amixer -c 0
Simple mixer control 'Master',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback 0 - 87
  Mono: Playback 87 [100%] [0.00dB] [on]
Simple mixer control 'Headphone',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 87
  Mono:
  Front Left: Playback 0 [0%] [-65.25dB] [off]
  Front Right: Playback 0 [0%] [-65.25dB] [off]
Simple mixer control 'PCM',0
  Capabilities: pvolume
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 255
  Mono:
  Front Left: Playback 255 [100%] [0.00dB]
  Front Right: Playback 255 [100%] [0.00dB]
Simple mixer control 'Front',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 87
  Mono:
  Front Left: Playback 87 [100%] [0.00dB] [on]
  Front Right: Playback 87 [100%] [0.00dB] [on]
Simple mixer control 'Front Mic',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 31
  Mono:
  Front Left: Playback 0 [0%] [-34.50dB] [off]
  Front Right: Playback 0 [0%] [-34.50dB] [off]
Simple mixer control 'Front Mic Boost',0
  Capabilities: volume
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 3
  Front Left: 0 [0%] [0.00dB]
  Front Right: 0 [0%] [0.00dB]
Simple mixer control 'Surround',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 87
  Mono:
  Front Left: Playback 87 [100%] [0.00dB] [on]
  Front Right: Playback 87 [100%] [0.00dB] [on]
Simple mixer control 'Center',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback 0 - 87
  Mono: Playback 87 [100%] [0.00dB] [on]
Simple mixer control 'LFE',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback 0 - 87
  Mono: Playback 87 [100%] [0.00dB] [on]
Simple mixer control 'Line',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 31
  Mono:
  Front Left: Playback 0 [0%] [-34.50dB] [off]
  Front Right: Playback 0 [0%] [-34.50dB] [off]
Simple mixer control 'Line Boost',0
  Capabilities: volume
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 3
  Front Left: 0 [0%] [0.00dB]
  Front Right: 0 [0%] [0.00dB]
Simple mixer control 'IEC958',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [off]
Simple mixer control 'IEC958 Default PCM',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'Capture',0
  Capabilities: cvolume cswitch
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 63
  Front Left: Capture 59 [94%] [27.00dB] [on]
  Front Right: Capture 59 [94%] [27.00dB] [on]
Simple mixer control 'Capture',1
  Capabilities: cvolume cswitch
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 63
  Front Left: Capture 0 [0%] [-17.25dB] [off]
  Front Right: Capture 0 [0%] [-17.25dB] [off]
Simple mixer control 'Auto-Mute Mode',0
  Capabilities: enum
  Items: 'Disabled' 'Enabled'
  Item0: 'Enabled'
Simple mixer control 'Input Source',0
  Capabilities: cenum
  Items: 'Front Mic' 'Rear Mic' 'Line'
  Item0: 'Rear Mic'
Simple mixer control 'Input Source',1
  Capabilities: cenum
  Items: 'Front Mic' 'Rear Mic' 'Line'
  Item0: 'Front Mic'
Simple mixer control 'Loopback Mixing',0
  Capabilities: enum
  Items: 'Disabled' 'Enabled'
  Item0: 'Disabled'
Simple mixer control 'Rear Mic',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 31
  Mono:
  Front Left: Playback 0 [0%] [-34.50dB] [off]
  Front Right: Playback 0 [0%] [-34.50dB] [off]
Simple mixer control 'Rear Mic Boost',0
  Capabilities: volume
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 3
  Front Left: 0 [0%] [0.00dB]
  Front Right: 0 [0%] [0.00dB]

dmesg | grep codec

[shana@nyx ~]$ dmesg | grep codec
[    5.315982] snd_hda_codec_realtek hdaudioC0D0: autoconfig for ALC1220: line_outs=3 (0x14/0x15/0x16/0x0/0x0) type:line
[    5.315985] snd_hda_codec_realtek hdaudioC0D0:    speaker_outs=0 (0x0/0x0/0x0/0x0/0x0)
[    5.315986] snd_hda_codec_realtek hdaudioC0D0:    hp_outs=1 (0x1b/0x0/0x0/0x0/0x0)
[    5.315987] snd_hda_codec_realtek hdaudioC0D0:    mono: mono_out=0x0
[    5.315988] snd_hda_codec_realtek hdaudioC0D0:    dig-out=0x1e/0x0
[    5.315989] snd_hda_codec_realtek hdaudioC0D0:    inputs:
[    5.315990] snd_hda_codec_realtek hdaudioC0D0:      Front Mic=0x19
[    5.315991] snd_hda_codec_realtek hdaudioC0D0:      Rear Mic=0x18
[    5.315992] snd_hda_codec_realtek hdaudioC0D0:      Line=0x1a
[    6.236288] Modules linked in: acpi_cpufreq(-) btusb btrtl btbcm btintel bluetooth uas ecdh_generic usb_storage razerkbd(OE+) razermouse(OE+) ecc intel_rapl_msr snd_hda_codec_hdmi(+) intel_rapl_common nls_iso8859_1 nls_cp437 vfat fat iwlmvm snd_sof_pci snd_sof_intel_byt snd_sof_intel_ipc snd_sof_xtensa_dsp snd_sof_intel_hda_common snd_soc_hdac_hda snd_sof_intel_hda mac80211 snd_sof snd_soc_skl x86_pkg_temp_thermal intel_powerclamp coretemp snd_soc_sst_ipc kvm_intel snd_soc_sst_dsp snd_hda_ext_core snd_soc_acpi_intel_match snd_soc_acpi snd_soc_core mei_hdcp libarc4 snd_hda_codec_realtek kvm snd_hda_codec_generic ucsi_ccg iwlwifi typec_ucsi iTCO_wdt ledtrig_audio typec iTCO_vendor_support snd_compress ac97_bus snd_pcm_dmaengine snd_hda_intel snd_intel_dspcfg wmi_bmof intel_wmi_thunderbolt mxm_wmi irqbypass snd_hda_codec crct10dif_pclmul cfg80211 crc32_pclmul ghash_clmulni_intel snd_hda_core snd_hwdep aesni_intel snd_pcm ofpart crypto_simd cryptd cmdlinepart glue_helper intel_spi_pci

pacmd list-sinks

[shana@nyx ~]$ pacmd list-sinks
1 sink(s) available.
  * index: 12
	name: <alsa_output.pci-0000_00_1f.3.iec958-stereo>
	driver: <module-alsa-card.c>
	flags: HARDWARE HW_MUTE_CTRL DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
	state: RUNNING
	suspend cause: (none)
	priority: 9038
	volume: front-left: 45686 /  70% / -9.40 dB,   front-right: 45686 /  70% / -9.40 dB
	       balance 0.00
	base volume: 65536 / 100% / 0.00 dB
	volume steps: 65537
	muted: no
	current latency: 20.00 ms
	max request: 4 KiB
	max rewind: 4 KiB
	monitor source: 14
	sample spec: s16le 2ch 48000Hz
	channel map: front-left,front-right
	            Stereo
	used by: 1
	linked by: 3
	configured latency: 21.33 ms; range is 0.50 .. 2000.00 ms
	card: 1 <alsa_card.pci-0000_00_1f.3>
	module: 8
	properties:
		alsa.resolution_bits = "16"
		device.api = "alsa"
		device.class = "sound"
		alsa.class = "generic"
		alsa.subclass = "generic-mix"
		alsa.name = "ALC1220 Digital"
		alsa.id = "ALC1220 Digital"
		alsa.subdevice = "0"
		alsa.subdevice_name = "subdevice #0"
		alsa.device = "1"
		alsa.card = "0"
		alsa.card_name = "HDA Intel PCH"
		alsa.long_card_name = "HDA Intel PCH at 0x55430000 irq 166"
		alsa.driver_name = "snd_hda_intel"
		device.bus_path = "pci-0000:00:1f.3"
		sysfs.path = "/devices/pci0000:00/0000:00:1f.3/sound/card0"
		device.bus = "pci"
		device.vendor.id = "8086"
		device.vendor.name = "Intel Corporation"
		device.product.id = "a348"
		device.product.name = "Cannon Lake PCH cAVS"
		device.form_factor = "internal"
		device.string = "iec958:0"
		device.buffering.buffer_size = "384000"
		device.buffering.fragment_size = "192000"
		device.access_mode = "mmap+timer"
		device.profile.name = "iec958-stereo"
		device.profile.description = "Digital Stereo (IEC958)"
		device.description = "Built-in Audio Digital Stereo (IEC958)"
		alsa.mixer_name = "Realtek ALC1220"
		alsa.components = "HDA:10ec1220,1458a0c3,00100101"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-pci"
	ports:
		iec958-stereo-output: Digital Output (S/PDIF) (priority 0, latency offset 0 usec, available: unknown)
			properties:
				
	active port: <iec958-stereo-output>

pacmd list-cards

[shana@nyx ~]$ pacmd list-cards
2 card(s) available.
    index: 0
	name: <alsa_card.pci-0000_01_00.1>
	driver: <module-alsa-card.c>
	owner module: 7
	properties:
		alsa.card = "1"
		alsa.card_name = "HDA NVidia"
		alsa.long_card_name = "HDA NVidia at 0x55080000 irq 17"
		alsa.driver_name = "snd_hda_intel"
		device.bus_path = "pci-0000:01:00.1"
		sysfs.path = "/devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card1"
		device.bus = "pci"
		device.vendor.id = "10de"
		device.vendor.name = "NVIDIA Corporation"
		device.product.id = "10f7"
		device.product.name = "TU102 High Definition Audio Controller"
		device.string = "1"
		device.description = "TU102 High Definition Audio Controller"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-pci"
	profiles:
		output:hdmi-stereo: Digital Stereo (HDMI) Output (priority 900, available: unknown)
		output:hdmi-stereo-extra1: Digital Stereo (HDMI 2) Output (priority 700, available: unknown)
		output:hdmi-stereo-extra2: Digital Stereo (HDMI 3) Output (priority 700, available: no)
		output:hdmi-surround-extra2: Digital Surround 5.1 (HDMI 3) Output (priority 3600, available: no)
		output:hdmi-surround71-extra2: Digital Surround 7.1 (HDMI 3) Output (priority 600, available: no)
		output:hdmi-stereo-extra3: Digital Stereo (HDMI 4) Output (priority 700, available: no)
		output:hdmi-surround-extra3: Digital Surround 5.1 (HDMI 4) Output (priority 3600, available: no)
		output:hdmi-surround71-extra3: Digital Surround 7.1 (HDMI 4) Output (priority 600, available: no)
		output:hdmi-stereo-extra4: Digital Stereo (HDMI 5) Output (priority 700, available: no)
		output:hdmi-surround-extra4: Digital Surround 5.1 (HDMI 5) Output (priority 3600, available: no)
		output:hdmi-surround71-extra4: Digital Surround 7.1 (HDMI 5) Output (priority 600, available: no)
		output:hdmi-stereo-extra5: Digital Stereo (HDMI 6) Output (priority 700, available: no)
		output:hdmi-surround-extra5: Digital Surround 5.1 (HDMI 6) Output (priority 3600, available: no)
		output:hdmi-surround71-extra5: Digital Surround 7.1 (HDMI 6) Output (priority 600, available: no)
		output:hdmi-stereo-extra6: Digital Stereo (HDMI 7) Output (priority 700, available: no)
		output:hdmi-surround-extra6: Digital Surround 5.1 (HDMI 7) Output (priority 3600, available: no)
		output:hdmi-surround71-extra6: Digital Surround 7.1 (HDMI 7) Output (priority 600, available: no)
		off: Off (priority 0, available: unknown)
	active profile: <off>
	ports:
		hdmi-output-0: HDMI / DisplayPort (priority 5900, latency offset 0 usec, available: yes)
			properties:
				device.icon_name = "video-display"
				device.product.name = "Dell S2716DG
"
		hdmi-output-1: HDMI / DisplayPort 2 (priority 5800, latency offset 0 usec, available: yes)
			properties:
				device.icon_name = "video-display"
				device.product.name = "Dell S2716DG
"
		hdmi-output-2: HDMI / DisplayPort 3 (priority 5700, latency offset 0 usec, available: no)
			properties:
				device.icon_name = "video-display"
		hdmi-output-3: HDMI / DisplayPort 4 (priority 5600, latency offset 0 usec, available: no)
			properties:
				device.icon_name = "video-display"
		hdmi-output-4: HDMI / DisplayPort 5 (priority 5500, latency offset 0 usec, available: no)
			properties:
				device.icon_name = "video-display"
		hdmi-output-5: HDMI / DisplayPort 6 (priority 5400, latency offset 0 usec, available: no)
			properties:
				device.icon_name = "video-display"
		hdmi-output-6: HDMI / DisplayPort 7 (priority 5300, latency offset 0 usec, available: no)
			properties:
				device.icon_name = "video-display"
    index: 1
	name: <alsa_card.pci-0000_00_1f.3>
	driver: <module-alsa-card.c>
	owner module: 8
	properties:
		alsa.card = "0"
		alsa.card_name = "HDA Intel PCH"
		alsa.long_card_name = "HDA Intel PCH at 0x55430000 irq 166"
		alsa.driver_name = "snd_hda_intel"
		device.bus_path = "pci-0000:00:1f.3"
		sysfs.path = "/devices/pci0000:00/0000:00:1f.3/sound/card0"
		device.bus = "pci"
		device.vendor.id = "8086"
		device.vendor.name = "Intel Corporation"
		device.product.id = "a348"
		device.product.name = "Cannon Lake PCH cAVS"
		device.form_factor = "internal"
		device.string = "0"
		device.description = "Built-in Audio"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-pci"
	profiles:
		input:analog-stereo: Analog Stereo Input (priority 15, available: unknown)
		output:analog-stereo: Analog Stereo Output (priority 1500, available: unknown)
		output:analog-stereo+input:analog-stereo: Analog Stereo Duplex (priority 1515, available: unknown)
		output:analog-surround-21: Analog Surround 2.1 Output (priority 1300, available: unknown)
		output:analog-surround-21+input:analog-stereo: Analog Surround 2.1 Output + Analog Stereo Input (priority 1315, available: unknown)
		output:analog-surround-40: Analog Surround 4.0 Output (priority 1200, available: unknown)
		output:analog-surround-40+input:analog-stereo: Analog Surround 4.0 Output + Analog Stereo Input (priority 1215, available: unknown)
		output:analog-surround-41: Analog Surround 4.1 Output (priority 1300, available: unknown)
		output:analog-surround-41+input:analog-stereo: Analog Surround 4.1 Output + Analog Stereo Input (priority 1315, available: unknown)
		output:analog-surround-50: Analog Surround 5.0 Output (priority 1200, available: unknown)
		output:analog-surround-50+input:analog-stereo: Analog Surround 5.0 Output + Analog Stereo Input (priority 1215, available: unknown)
		output:analog-surround-51: Analog Surround 5.1 Output (priority 4300, available: unknown)
		output:analog-surround-51+input:analog-stereo: Analog Surround 5.1 Output + Analog Stereo Input (priority 4315, available: unknown)
		output:iec958-stereo: Digital Stereo (IEC958) Output (priority 500, available: unknown)
		output:iec958-stereo+input:analog-stereo: Digital Stereo (IEC958) Output + Analog Stereo Input (priority 515, available: unknown)
		off: Off (priority 0, available: unknown)
	active profile: <output:iec958-stereo+input:analog-stereo>
	sinks:
		alsa_output.pci-0000_00_1f.3.iec958-stereo/#12: Built-in Audio Digital Stereo (IEC958)
	sources:
		alsa_input.pci-0000_00_1f.3.analog-stereo/#10: Built-in Audio Analog Stereo
		alsa_output.pci-0000_00_1f.3.iec958-stereo.monitor/#14: Monitor of Built-in Audio Digital Stereo (IEC958)
	ports:
		analog-input-front-mic: Front Microphone (priority 8500, latency offset 0 usec, available: no)
			properties:
				device.icon_name = "audio-input-microphone"
		analog-input-rear-mic: Rear Microphone (priority 8200, latency offset 0 usec, available: yes)
			properties:
				device.icon_name = "audio-input-microphone"
		analog-input-linein: Line In (priority 8100, latency offset 0 usec, available: no)
			properties:
				
		analog-output-lineout: Line Out (priority 9000, latency offset 0 usec, available: yes)
			properties:
				
		analog-output-headphones: Headphones (priority 9900, latency offset 0 usec, available: no)
			properties:
				device.icon_name = "audio-headphones"
		iec958-stereo-output: Digital Output (S/PDIF) (priority 0, latency offset 0 usec, available: unknown)
			properties:
				

pactl info

[shana@nyx ~]$ pactl info
Server String: /run/user/1000/pulse/native
Library Protocol Version: 33
Server Protocol Version: 33
Is Local: yes
Client Index: 50
Tile Size: 65472
User Name: shana
Host Name: nyx
Server Name: pulseaudio
Server Version: 13.0
Default Sample Specification: s16le 6ch 48000Hz
Default Channel Map: front-left,front-left-of-center,front-center,front-right,front-right-of-center,rear-center
Default Sink: alsa_output.pci-0000_00_1f.3.iec958-stereo
Default Source: alsa_input.pci-0000_00_1f.3.analog-stereo
Cookie: c850:8375

When profile output:analog-surround-51+input:analog-stereo is active

pacmd list-sinks

[shana@nyx ~]$ pacmd list-sinks
1 sink(s) available.
  * index: 14
	name: <alsa_output.pci-0000_00_1f.3.analog-surround-51>
	driver: <module-alsa-card.c>
	flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
	state: RUNNING
	suspend cause: (none)
	priority: 9039
	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
	volume steps: 65537
	muted: no
	current latency: 18.44 ms
	max request: 12 KiB
	max rewind: 12 KiB
	monitor source: 16
	sample spec: s16le 6ch 48000Hz
	channel map: front-left,front-right,rear-left,rear-right,front-center,lfe
	            Surround 5.1
	used by: 1
	linked by: 3
	configured latency: 21.33 ms; range is 0.50 .. 2000.00 ms
	card: 1 <alsa_card.pci-0000_00_1f.3>
	module: 8
	properties:
		alsa.resolution_bits = "16"
		device.api = "alsa"
		device.class = "sound"
		alsa.class = "generic"
		alsa.subclass = "generic-mix"
		alsa.name = "ALC1220 Analog"
		alsa.id = "ALC1220 Analog"
		alsa.subdevice = "0"
		alsa.subdevice_name = "subdevice #0"
		alsa.device = "0"
		alsa.card = "0"
		alsa.card_name = "HDA Intel PCH"
		alsa.long_card_name = "HDA Intel PCH at 0x55430000 irq 166"
		alsa.driver_name = "snd_hda_intel"
		device.bus_path = "pci-0000:00:1f.3"
		sysfs.path = "/devices/pci0000:00/0000:00:1f.3/sound/card0"
		device.bus = "pci"
		device.vendor.id = "8086"
		device.vendor.name = "Intel Corporation"
		device.product.id = "a348"
		device.product.name = "Cannon Lake PCH cAVS"
		device.form_factor = "internal"
		device.string = "surround51:0"
		device.buffering.buffer_size = "1152000"
		device.buffering.fragment_size = "576000"
		device.access_mode = "mmap+timer"
		device.profile.name = "analog-surround-51"
		device.profile.description = "Analog Surround 5.1"
		device.description = "Built-in Audio Analog Surround 5.1"
		alsa.mixer_name = "Realtek ALC1220"
		alsa.components = "HDA:10ec1220,1458a0c3,00100101"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-pci"
	ports:
		analog-output-lineout: Line Out (priority 9000, latency offset 0 usec, available: yes)
			properties:
				
	active port: <analog-output-lineout>]

pacmd list-cards

[shana@nyx ~]$ pacmd list-cards
2 card(s) available.
    index: 0
	name: <alsa_card.pci-0000_01_00.1>
	driver: <module-alsa-card.c>
	owner module: 7
	properties:
		alsa.card = "1"
		alsa.card_name = "HDA NVidia"
		alsa.long_card_name = "HDA NVidia at 0x55080000 irq 17"
		alsa.driver_name = "snd_hda_intel"
		device.bus_path = "pci-0000:01:00.1"
		sysfs.path = "/devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card1"
		device.bus = "pci"
		device.vendor.id = "10de"
		device.vendor.name = "NVIDIA Corporation"
		device.product.id = "10f7"
		device.product.name = "TU102 High Definition Audio Controller"
		device.string = "1"
		device.description = "TU102 High Definition Audio Controller"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-pci"
	profiles:
		output:hdmi-stereo: Digital Stereo (HDMI) Output (priority 900, available: unknown)
		output:hdmi-stereo-extra1: Digital Stereo (HDMI 2) Output (priority 700, available: unknown)
		output:hdmi-stereo-extra2: Digital Stereo (HDMI 3) Output (priority 700, available: no)
		output:hdmi-surround-extra2: Digital Surround 5.1 (HDMI 3) Output (priority 3600, available: no)
		output:hdmi-surround71-extra2: Digital Surround 7.1 (HDMI 3) Output (priority 600, available: no)
		output:hdmi-stereo-extra3: Digital Stereo (HDMI 4) Output (priority 700, available: no)
		output:hdmi-surround-extra3: Digital Surround 5.1 (HDMI 4) Output (priority 3600, available: no)
		output:hdmi-surround71-extra3: Digital Surround 7.1 (HDMI 4) Output (priority 600, available: no)
		output:hdmi-stereo-extra4: Digital Stereo (HDMI 5) Output (priority 700, available: no)
		output:hdmi-surround-extra4: Digital Surround 5.1 (HDMI 5) Output (priority 3600, available: no)
		output:hdmi-surround71-extra4: Digital Surround 7.1 (HDMI 5) Output (priority 600, available: no)
		output:hdmi-stereo-extra5: Digital Stereo (HDMI 6) Output (priority 700, available: no)
		output:hdmi-surround-extra5: Digital Surround 5.1 (HDMI 6) Output (priority 3600, available: no)
		output:hdmi-surround71-extra5: Digital Surround 7.1 (HDMI 6) Output (priority 600, available: no)
		output:hdmi-stereo-extra6: Digital Stereo (HDMI 7) Output (priority 700, available: no)
		output:hdmi-surround-extra6: Digital Surround 5.1 (HDMI 7) Output (priority 3600, available: no)
		output:hdmi-surround71-extra6: Digital Surround 7.1 (HDMI 7) Output (priority 600, available: no)
		off: Off (priority 0, available: unknown)
	active profile: <off>
	ports:
		hdmi-output-0: HDMI / DisplayPort (priority 5900, latency offset 0 usec, available: yes)
			properties:
				device.icon_name = "video-display"
				device.product.name = "Dell S2716DG
"
		hdmi-output-1: HDMI / DisplayPort 2 (priority 5800, latency offset 0 usec, available: yes)
			properties:
				device.icon_name = "video-display"
				device.product.name = "Dell S2716DG
"
		hdmi-output-2: HDMI / DisplayPort 3 (priority 5700, latency offset 0 usec, available: no)
			properties:
				device.icon_name = "video-display"
		hdmi-output-3: HDMI / DisplayPort 4 (priority 5600, latency offset 0 usec, available: no)
			properties:
				device.icon_name = "video-display"
		hdmi-output-4: HDMI / DisplayPort 5 (priority 5500, latency offset 0 usec, available: no)
			properties:
				device.icon_name = "video-display"
		hdmi-output-5: HDMI / DisplayPort 6 (priority 5400, latency offset 0 usec, available: no)
			properties:
				device.icon_name = "video-display"
		hdmi-output-6: HDMI / DisplayPort 7 (priority 5300, latency offset 0 usec, available: no)
			properties:
				device.icon_name = "video-display"
    index: 1
	name: <alsa_card.pci-0000_00_1f.3>
	driver: <module-alsa-card.c>
	owner module: 8
	properties:
		alsa.card = "0"
		alsa.card_name = "HDA Intel PCH"
		alsa.long_card_name = "HDA Intel PCH at 0x55430000 irq 166"
		alsa.driver_name = "snd_hda_intel"
		device.bus_path = "pci-0000:00:1f.3"
		sysfs.path = "/devices/pci0000:00/0000:00:1f.3/sound/card0"
		device.bus = "pci"
		device.vendor.id = "8086"
		device.vendor.name = "Intel Corporation"
		device.product.id = "a348"
		device.product.name = "Cannon Lake PCH cAVS"
		device.form_factor = "internal"
		device.string = "0"
		device.description = "Built-in Audio"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-pci"
	profiles:
		input:analog-stereo: Analog Stereo Input (priority 15, available: unknown)
		output:analog-stereo: Analog Stereo Output (priority 1500, available: unknown)
		output:analog-stereo+input:analog-stereo: Analog Stereo Duplex (priority 1515, available: unknown)
		output:analog-surround-21: Analog Surround 2.1 Output (priority 1300, available: unknown)
		output:analog-surround-21+input:analog-stereo: Analog Surround 2.1 Output + Analog Stereo Input (priority 1315, available: unknown)
		output:analog-surround-40: Analog Surround 4.0 Output (priority 1200, available: unknown)
		output:analog-surround-40+input:analog-stereo: Analog Surround 4.0 Output + Analog Stereo Input (priority 1215, available: unknown)
		output:analog-surround-41: Analog Surround 4.1 Output (priority 1300, available: unknown)
		output:analog-surround-41+input:analog-stereo: Analog Surround 4.1 Output + Analog Stereo Input (priority 1315, available: unknown)
		output:analog-surround-50: Analog Surround 5.0 Output (priority 1200, available: unknown)
		output:analog-surround-50+input:analog-stereo: Analog Surround 5.0 Output + Analog Stereo Input (priority 1215, available: unknown)
		output:analog-surround-51: Analog Surround 5.1 Output (priority 4300, available: unknown)
		output:analog-surround-51+input:analog-stereo: Analog Surround 5.1 Output + Analog Stereo Input (priority 4315, available: unknown)
		output:iec958-stereo: Digital Stereo (IEC958) Output (priority 500, available: unknown)
		output:iec958-stereo+input:analog-stereo: Digital Stereo (IEC958) Output + Analog Stereo Input (priority 515, available: unknown)
		off: Off (priority 0, available: unknown)
	active profile: <output:analog-surround-51+input:analog-stereo>
	sinks:
		alsa_output.pci-0000_00_1f.3.analog-surround-51/#14: Built-in Audio Analog Surround 5.1
	sources:
		alsa_input.pci-0000_00_1f.3.analog-stereo/#10: Built-in Audio Analog Stereo
		alsa_output.pci-0000_00_1f.3.analog-surround-51.monitor/#16: Monitor of Built-in Audio Analog Surround 5.1
	ports:
		analog-input-front-mic: Front Microphone (priority 8500, latency offset 0 usec, available: no)
			properties:
				device.icon_name = "audio-input-microphone"
		analog-input-rear-mic: Rear Microphone (priority 8200, latency offset 0 usec, available: yes)
			properties:
				device.icon_name = "audio-input-microphone"
		analog-input-linein: Line In (priority 8100, latency offset 0 usec, available: no)
			properties:
				
		analog-output-lineout: Line Out (priority 9000, latency offset 0 usec, available: yes)
			properties:
				
		analog-output-headphones: Headphones (priority 9900, latency offset 0 usec, available: no)
			properties:
				device.icon_name = "audio-headphones"
		iec958-stereo-output: Digital Output (S/PDIF) (priority 0, latency offset 0 usec, available: unknown)
			properties:
				

pactl info

[shana@nyx ~]$ pactl info
Server String: /run/user/1000/pulse/native
Library Protocol Version: 33
Server Protocol Version: 33
Is Local: yes
Client Index: 51
Tile Size: 65472
User Name: shana
Host Name: nyx
Server Name: pulseaudio
Server Version: 13.0
Default Sample Specification: s16le 6ch 48000Hz
Default Channel Map: front-left,front-left-of-center,front-center,front-right,front-right-of-center,rear-center
Default Sink: alsa_output.pci-0000_00_1f.3.analog-surround-51
Default Source: alsa_input.pci-0000_00_1f.3.analog-stereo
Cookie: c850:8375

Might be related somewhat:
https://bbs.archlinux.org/viewtopic.php?id=250070

Last edited by shana133 (2020-03-29 18:47:22)

Offline

#2 2020-03-29 14:08:00

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 23,201

Re: [SOLVED] Pulseaudio surround51 with S/PDIF

You can enable passthrough for supported formats (pop open the advanced settings on the output devices tab in pavucontrol), standard PCM will afaik always be stereo over IEC and the 5.1 upmix must happen on the receiver end.  (And of course regardless, your source should be 5.1 to actually take advantage...) What's the output of

pacmd list-sink-inputs

during a playback attempt?

Last edited by V1del (2020-03-29 14:16:56)

Offline

#3 2020-03-29 14:14:57

shana133
Member
Registered: 2020-03-29
Posts: 4

Re: [SOLVED] Pulseaudio surround51 with S/PDIF

I have enabled PCM, AC3, EAC3, DTS, MPEG and AAC in Output Devices advanced settings.

pacmd list-sink-inputs during playback

[shana@nyx ~]$ pacmd list-sink-inputs 
1 sink input(s) available.
    index: 0
	driver: <protocol-native.c>
	flags: START_CORKED 
	state: RUNNING
	sink: 0 <alsa_output.pci-0000_00_1f.3.iec958-stereo>
	volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB,   front-center: 65536 / 100% / 0.00 dB,   lfe: 65536 / 100% / 0.00 dB,   side-left: 65536 / 100% / 0.00 dB,   side-right: 65536 / 100% / 0.00 dB
	       balance 0.00
	muted: no
	current latency: 34.44 ms
	requested latency: 21.33 ms
	sample spec: float32le 6ch 48000Hz
	channel map: front-left,front-right,front-center,lfe,side-left,side-right
	resample method: copy
	module: 9
	client: 4 <Chromium>
	properties:
		application.icon_name = "google-chrome"
		media.name = "Playback"
		application.name = "Chromium"
		native-protocol.peer = "UNIX socket client"
		native-protocol.version = "33"
		application.process.id = "1316"
		application.process.user = "shana"
		application.process.host = "nyx"
		application.process.binary = "chrome"
		application.language = "en_US.UTF-8"
		window.x11.display = ":0"
		application.process.machine_id = "f920ec28d9614e70a75f40fb6cce2e8b"
		application.process.session_id = "2"
		module-stream-restore.id = "sink-input-by-application-name:Chromium"

In Playback tab when unlocking channels for example client(from the output above) only Front Left and Front right make any volume changes.

Offline

#4 2020-03-29 14:18:27

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 23,201

Re: [SOLVED] Pulseaudio surround51 with S/PDIF

That does look okayish.

Something else you can try is actually sampling into an ac3 encoded stream and sending that over, see e.g. https://bbs.archlinux.org/viewtopic.php?id=251467 because you will need an out of repo alsa-lib package to configure this and then load that sink into pulse.

Offline

#5 2020-03-29 18:45:12

shana133
Member
Registered: 2020-03-29
Posts: 4

Re: [SOLVED] Pulseaudio surround51 with S/PDIF

Attaching my attempts might help somebody who has trouble with a52 setup.
Used package alsa-lib-a52pcm and libavresample
Modified /etc/asound.conf

[shana@nyx ~]$ cat /etc/asound.conf 
pcm.a52 {
  @args [CARD]
  @args.CARD {
    type string
  }
  type rate
  slave {
    pcm {
      type a52
      bitrate 448
      channels 6
      card $CARD
    }
  rate 48000 #required somehow, otherwise nothing happens in PulseAudio
  }
}

# Use PulseAudio by default
pcm.!default {
  type pulse
  fallback "sysdefault"
  hint {
    show on
    description "Default ALSA Output (currently PulseAudio Sound Server)"
  }
}

ctl.!default {
  type pulse
  fallback "sysdefault"
}

# vim:set ft=alsaconf:

Tried to load new sink in $HOME/.config/pulse/default.pa with

load-module module-alsa-sink device=a52 rate=48000 channels=6 tsched=0 sink_properties=device.description=SPDIF sink_name=SPDIF channel_map=front-left,front-right,rear-left,rear-right,front-center,lfe

Loadmodule fails due to missing file(not present anywhere - checked with locate utility)

[shana@nyx ~]$ systemctl --user status pulseaudio
● pulseaudio.service - Sound Service
     Loaded: loaded (/usr/lib/systemd/user/pulseaudio.service; disabled; vendor preset: enabled)
     Active: active (running) since Sun 2020-03-29 17:43:48 CEST; 20min ago
TriggeredBy: ● pulseaudio.socket
   Main PID: 1387 (pulseaudio)
     CGroup: /user.slice/user-1000.slice/user@1000.service/pulseaudio.service
             ├─1387 /usr/bin/pulseaudio --daemonize=no
             └─1530 /usr/lib/pulse/gsettings-helper

Mar 29 17:43:43 nyx systemd[772]: Starting Sound Service...
Mar 29 17:43:44 nyx pulseaudio[1387]: E: [pulseaudio] module.c: Failed to load module "module-alsa-sink" (argument: "device=a52 rate=48000 c>
Mar 29 17:43:48 nyx systemd[772]: Started Sound Service.

Same with aplay -Da52 -c 6 sound.wav

[shana@nyx ~]$ aplay -Da52 -c 6 sound.wav 
ALSA lib dlmisc.c:283:(snd_dlobj_cache_get0) Cannot open shared library /usr/lib/alsa-lib/libasound_module_pcm_a52.so ((null): /usr/lib/alsa-lib/libasound_module_pcm_a52.so: cannot open shared object file: No such file or directory)
aplay: main:830: audio open error: No such device or address

Due to missing libasound_module_pcm_a52.so I built packages according to workaround
https://aur.archlinux.org/packages/alsa-lib-a52pcm/
https://bbs.archlinux.org/viewtopic.php … 1#p1814351

Now after rebooting a52 device was properly loaded

systemctl --user status pulseaudio

[shana@nyx flac-test-files]$ systemctl --user status pulseaudio
● pulseaudio.service - Sound Service
     Loaded: loaded (/usr/lib/systemd/user/pulseaudio.service; disabled; vendor preset: enabled)
     Active: active (running) since Sun 2020-03-29 18:20:43 CEST; 12min ago
TriggeredBy: ● pulseaudio.socket
   Main PID: 1237 (pulseaudio)
     CGroup: /user.slice/user-1000.slice/user@1000.service/pulseaudio.service
             ├─1237 /usr/bin/pulseaudio --daemonize=no
             └─1334 /usr/lib/pulse/gsettings-helper

Mar 29 18:20:39 nyx systemd[786]: Starting Sound Service...
Mar 29 18:20:43 nyx systemd[786]: Started Sound Service.

Although alsa card0 is no longer present(probably busy?)(not present in Pavucontrol under Configuration except disabled Nvidia TU102 audio controller)
The Output Devices show SPDIF(as in provided logs) but Advanced settings are locked(eg can't even set specific formats with pactl set-sink-formats 0 "pcm; ac3-iec61937;" )

pacmd list-cards

[shana@nyx flac-test-files]$ pacmd list-cards
1 card(s) available.
    index: 0
	name: <alsa_card.pci-0000_01_00.1>
	driver: <module-alsa-card.c>
	owner module: 7
	properties:
		alsa.card = "1"
		alsa.card_name = "HDA NVidia"
		alsa.long_card_name = "HDA NVidia at 0x55080000 irq 17"
		alsa.driver_name = "snd_hda_intel"
		device.bus_path = "pci-0000:01:00.1"
		sysfs.path = "/devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card1"
		device.bus = "pci"
		device.vendor.id = "10de"
		device.vendor.name = "NVIDIA Corporation"
		device.product.id = "10f7"
		device.product.name = "TU102 High Definition Audio Controller"
		device.string = "1"
		device.description = "TU102 High Definition Audio Controller"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-pci"
	profiles:
		output:hdmi-stereo: Digital Stereo (HDMI) Output (priority 900, available: unknown)
		output:hdmi-stereo-extra1: Digital Stereo (HDMI 2) Output (priority 700, available: unknown)
		output:hdmi-stereo-extra2: Digital Stereo (HDMI 3) Output (priority 700, available: no)
		output:hdmi-surround-extra2: Digital Surround 5.1 (HDMI 3) Output (priority 3600, available: no)
		output:hdmi-surround71-extra2: Digital Surround 7.1 (HDMI 3) Output (priority 600, available: no)
		output:hdmi-stereo-extra3: Digital Stereo (HDMI 4) Output (priority 700, available: no)
		output:hdmi-surround-extra3: Digital Surround 5.1 (HDMI 4) Output (priority 3600, available: no)
		output:hdmi-surround71-extra3: Digital Surround 7.1 (HDMI 4) Output (priority 600, available: no)
		output:hdmi-stereo-extra4: Digital Stereo (HDMI 5) Output (priority 700, available: no)
		output:hdmi-surround-extra4: Digital Surround 5.1 (HDMI 5) Output (priority 3600, available: no)
		output:hdmi-surround71-extra4: Digital Surround 7.1 (HDMI 5) Output (priority 600, available: no)
		output:hdmi-stereo-extra5: Digital Stereo (HDMI 6) Output (priority 700, available: no)
		output:hdmi-surround-extra5: Digital Surround 5.1 (HDMI 6) Output (priority 3600, available: no)
		output:hdmi-surround71-extra5: Digital Surround 7.1 (HDMI 6) Output (priority 600, available: no)
		output:hdmi-stereo-extra6: Digital Stereo (HDMI 7) Output (priority 700, available: no)
		output:hdmi-surround-extra6: Digital Surround 5.1 (HDMI 7) Output (priority 3600, available: no)
		output:hdmi-surround71-extra6: Digital Surround 7.1 (HDMI 7) Output (priority 600, available: no)
		off: Off (priority 0, available: unknown)
	active profile: <off>
	ports:
		hdmi-output-0: HDMI / DisplayPort (priority 5900, latency offset 0 usec, available: yes)
			properties:
				device.icon_name = "video-display"
				device.product.name = "Dell S2716DG
"
		hdmi-output-1: HDMI / DisplayPort 2 (priority 5800, latency offset 0 usec, available: yes)
			properties:
				device.icon_name = "video-display"
				device.product.name = "Dell S2716DG
"
		hdmi-output-2: HDMI / DisplayPort 3 (priority 5700, latency offset 0 usec, available: no)
			properties:
				device.icon_name = "video-display"
		hdmi-output-3: HDMI / DisplayPort 4 (priority 5600, latency offset 0 usec, available: no)
			properties:
				device.icon_name = "video-display"
		hdmi-output-4: HDMI / DisplayPort 5 (priority 5500, latency offset 0 usec, available: no)
			properties:
				device.icon_name = "video-display"
		hdmi-output-5: HDMI / DisplayPort 6 (priority 5400, latency offset 0 usec, available: no)
			properties:
				device.icon_name = "video-display"
		hdmi-output-6: HDMI / DisplayPort 7 (priority 5300, latency offset 0 usec, available: no)
			properties:
				device.icon_name = "video-display"

Sink seems fine
pacmd list-sinks

[shana@nyx flac-test-files]$ pacmd list-sinks
1 sink(s) available.
  * index: 0
	name: <SPDIF>
	driver: <module-alsa-sink.c>
	flags: HARDWARE DECIBEL_VOLUME LATENCY 
	state: RUNNING
	suspend cause: (none)
	priority: 9000
	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
	volume steps: 65537
	muted: no
	current latency: 3.19 ms
	max request: 54 KiB
	max rewind: 0 KiB
	monitor source: 0
	sample spec: s16le 6ch 48000Hz
	channel map: front-left,front-right,rear-left,rear-right,front-center,lfe
	            Surround 5.1
	used by: 1
	linked by: 3
	fixed latency: 96.00 ms
	module: 5
	properties:
		alsa.resolution_bits = "16"
		device.api = "alsa"
		device.class = "sound"
		alsa.class = "generic"
		alsa.subclass = "generic-mix"
		alsa.name = ""
		alsa.id = ""
		alsa.subdevice = "0"
		alsa.subdevice_name = ""
		alsa.device = "0"
		device.string = "a52"
		device.buffering.buffer_size = "55296"
		device.buffering.fragment_size = "18432"
		device.access_mode = "mmap"
		device.description = "SPDIF"
		device.icon_name = "audio-card"

Alsamixer now shows 4 separate channels instead of one - Master Front,Rear,Center,Woofer(Lfe)

[shana@nyx flac-test-files]$ amixer
Simple mixer control 'Master',0
  Capabilities: pvolume pswitch pswitch-joined
  Playback channels: Front Left - Front Right - Rear Left - Rear Right - Front Center - Woofer
  Limits: Playback 0 - 65536
  Mono:
  Front Left: Playback 65536 [100%] [on]
  Front Right: Playback 65536 [100%] [on]
  Rear Left: Playback 65536 [100%] [on]
  Rear Right: Playback 65536 [100%] [on]
  Front Center: Playback 65536 [100%] [on]
  Woofer: Playback 65536 [100%] [on]
Simple mixer control 'Capture',0
  Capabilities: cvolume cswitch cswitch-joined
  Capture channels: Front Left - Front Right - Rear Left - Rear Right - Front Center - Woofer
  Limits: Capture 0 - 65536
  Front Left: Capture 65536 [100%] [on]
  Front Right: Capture 65536 [100%] [on]
  Rear Left: Capture 65536 [100%] [on]
  Rear Right: Capture 65536 [100%] [on]
  Front Center: Capture 65536 [100%] [on]
  Woofer: Capture 65536 [100%] [on]

speaker-test -c6 # rear channels and LFE can be heard now

[shana@nyx flac-test-files]$ speaker-test -c 6

speaker-test 1.2.2

Playback device is default
Stream parameters are 48000Hz, S16_LE, 6 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 32 to 349525
Period size range from 10 to 116509
Using max buffer size 349524
Periods = 4
was set period_size = 87381
was set buffer_size = 349524
 0 - Front Left
 4 - Center
 1 - Front Right
 3 - Rear Right
 2 - Rear Left
 5 - LFE

Used prepared surround51.flac file to verify all channels and their volumes with

mpv -v --audio-device="pulse/SPDIF" --audio-channels="6" ./surround51.flac
mpv surround51.flac #worked the same way - ensure default setup outputs properly

Marking this topic as solved - thanks a lot for your help!

Offline

#6 2020-04-01 06:58:09

shana133
Member
Registered: 2020-03-29
Posts: 4

Re: [SOLVED] Pulseaudio surround51 with S/PDIF

Follow up after spending some more time on this setup.
Configuring a52 device only exposes sink and monitor to Pulseaudio. This means no sound input through that card or Pulseaudio module loading.
I resolved this issue by not loading modules immediately in $HOME/config/pulse/default.pa but manually.

  1. Select card as Analog Input in PulseAudio Volume Control

  2. Load source directly referencing hardware

    pacmd load-module module-alsa-source device=hw:0,0 rate=48000 channels=2 source_name=SPDIF_in
  3. Load a52 configuration

    pacmd load-module module-alsa-sink device=a52 rate=48000 channels=6 tsched=0 sink_properties=device.description=SPDIF_out sink_name=SPDIF_out channel_map=front-left,front-right,rear-left,rear-right,front-center,lfe

    This will make alsa 6channel sink instead of previously alsa stereo to pulseaudio virtual surround which didn't have control over every channel

  4. Finally load echocancel to take advantage of sound supression from speakers

    pacmd load-module module-echo-cancel source_name=echosource sink_name=echosink aec_method=webrtc aec_args="analog_gain_control=0"

On some devices there might be issued with echo-cancel module killing sink to frequently due to desyncs.

Offline

Board footer

Powered by FluxBB