You are not logged in.

#1 2024-01-14 13:09:34

casualinfrared
Member
Registered: 2021-06-24
Posts: 3

Distorted S/PDIF output on MSI X670-P Wi-Fi

Hi,
I have put together a new PC with a MSI X670-P Wi-Fi motherboard. The S/PDIF output produces distorted audio on sample rates other than 48,000KHz. The S/PDIF output is connected to an iPod Hi-Fi speaker, which has a TI PCM1754 DAC, with supported sample rates up to 24-bit, 192,000KHz. This setup worked perfectly on my last machine (Asus B350-F Gaming) with no distortion, and also works without issue on the new system under Windows. I'm using Pipewire with pipewire-pulse under KDE if that helps.
FWIW I have two other audio devices connected, my monitor (which also produces distorted audio), and a FiiO K5 Pro ESS (which works perfectly).

Last edited by casualinfrared (2024-01-14 13:24:27)

Offline

#2 2024-04-12 12:13:05

casualinfrared
Member
Registered: 2021-06-24
Posts: 3

Re: Distorted S/PDIF output on MSI X670-P Wi-Fi

bumping because I still have this issue, and I have discovered it also happens when using only ALSA.
I also discovered the iPod Hi-Fi is detected as a 5.1 device by ALSA (it isn't), is there a way for ALSA to see it as a stereo device?

Last edited by casualinfrared (2024-04-12 12:14:31)

Offline

#3 2024-04-12 13:42:40

just4arch
Member
Registered: 2023-01-07
Posts: 84

Re: Distorted S/PDIF output on MSI X670-P Wi-Fi

Shot in the dark here, but have you tried increasing the alsa headroom?
If you're using wireplumber, you can try something like this (adapt to your hardware & output):

$ cat ~/.config/wireplumber/wireplumber.conf.d/alsa_output.iec958-ac3-surround-51.conf
monitor.alsa.rules = [{
    matches = [{node.name = "~alsa_output.*.iec958-ac3-surround-51"}]
    actions = {update-props = {api.alsa.headroom = 2048}}
}]

Maybe you'll need

$ cat ~/.config/pipewire/pipewire.conf.d/context.properties.default.clock.allowed-rates.conf
context.properties = {default.clock.allowed-rates = [ 32000 44100 48000 88200 96000 192000 ]}

User services need to be restarted for changes to take effect (systemctl restart --user pipewire* wireplumber.service).

You might be able to switch the profile of you iPod, but you haven't provided any detailed output (something like "pactl list cards")

Offline

#4 2024-04-12 16:35:56

casualinfrared
Member
Registered: 2021-06-24
Posts: 3

Re: Distorted S/PDIF output on MSI X670-P Wi-Fi

Hi, thanks for the reply. I've tried increasing the ALSA headroom and that didn't change anything. I already have multiple sample rates set at ~/.config/pipewire/pipewire.conf for use with the FiiO Amp.
Here is the output of pactl list cards:

Card #45
	Name: alsa_card.pci-0000_03_00.1
	Driver: alsa
	Owner Module: n/a
	Properties:
		api.acp.auto-port = "false"
		api.alsa.card = "0"
		api.alsa.card.longname = "HDA ATI HDMI at 0xf6d20000 irq 115"
		api.alsa.card.name = "HDA ATI HDMI"
		api.alsa.path = "hw:0"
		api.alsa.use-acp = "true"
		api.dbus.ReserveDevice1 = "Audio0"
		api.dbus.ReserveDevice1.Priority = "-20"
		device.api = "alsa"
		device.bus = "pci"
		device.bus_path = "pci-0000:03:00.1"
		device.description = "Navi 21/23 HDMI/DP Audio Controller"
		device.enum.api = "udev"
		device.icon_name = "audio-card-analog-pci"
		device.name = "alsa_card.pci-0000_03_00.1"
		device.nick = "HDA ATI HDMI"
		device.plugged.usec = "8124997"
		device.product.id = "0xab28"
		device.product.name = "Navi 21/23 HDMI/DP Audio Controller"
		device.subsystem = "sound"
		sysfs.path = "/devices/pci0000:00/0000:00:01.1/0000:01:00.0/0000:02:00.0/0000:03:00.1/sound/card0"
		device.vendor.id = "0x1002"
		device.vendor.name = "Advanced Micro Devices, Inc. [AMD/ATI]"
		media.class = "Audio/Device"
		factory.id = "14"
		client.id = "43"
		object.id = "45"
		object.serial = "45"
		object.path = "alsa:pcm:0"
		alsa.card = "0"
		alsa.card_name = "HDA ATI HDMI"
		alsa.long_card_name = "HDA ATI HDMI at 0xf6d20000 irq 115"
		alsa.driver_name = "snd_hda_intel"
		device.string = "0"
	Profiles:
		off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
		output:hdmi-stereo: Digital Stereo (HDMI) Output (sinks: 1, sources: 0, priority: 5900, available: no)
		output:hdmi-stereo-extra1: Digital Stereo (HDMI 2) Output (sinks: 1, sources: 0, priority: 5700, available: no)
		output:hdmi-stereo-extra2: Digital Stereo (HDMI 3) Output (sinks: 1, sources: 0, priority: 5700, available: no)
		output:hdmi-stereo-extra3: Digital Stereo (HDMI 4) Output (sinks: 1, sources: 0, priority: 5700, available: no)
		output:hdmi-stereo-extra4: Digital Stereo (HDMI 5) Output (sinks: 1, sources: 0, priority: 5700, available: yes)
		output:hdmi-stereo-extra5: Digital Stereo (HDMI 6) Output (sinks: 1, sources: 0, priority: 5700, available: no)
		output:hdmi-surround: Digital Surround 5.1 (HDMI) Output (sinks: 1, sources: 0, priority: 800, available: no)
		output:hdmi-surround71: Digital Surround 7.1 (HDMI) Output (sinks: 1, sources: 0, priority: 800, available: no)
		output:hdmi-surround-extra1: Digital Surround 5.1 (HDMI 2) Output (sinks: 1, sources: 0, priority: 600, available: no)
		output:hdmi-surround71-extra1: Digital Surround 7.1 (HDMI 2) Output (sinks: 1, sources: 0, priority: 600, available: no)
		output:hdmi-surround-extra2: Digital Surround 5.1 (HDMI 3) Output (sinks: 1, sources: 0, priority: 600, available: no)
		output:hdmi-surround71-extra2: Digital Surround 7.1 (HDMI 3) Output (sinks: 1, sources: 0, priority: 600, available: no)
		output:hdmi-surround-extra3: Digital Surround 5.1 (HDMI 4) Output (sinks: 1, sources: 0, priority: 600, available: no)
		output:hdmi-surround71-extra3: Digital Surround 7.1 (HDMI 4) Output (sinks: 1, sources: 0, priority: 600, available: no)
		output:hdmi-surround-extra5: Digital Surround 5.1 (HDMI 6) Output (sinks: 1, sources: 0, priority: 600, available: no)
		output:hdmi-surround71-extra5: Digital Surround 7.1 (HDMI 6) Output (sinks: 1, sources: 0, priority: 600, available: no)
		pro-audio: Pro Audio (sinks: 6, sources: 0, priority: 1, available: yes)
	Active Profile: output:hdmi-stereo-extra4
	Ports:
		hdmi-output-0: HDMI / DisplayPort (type: HDMI, priority: 5900, latency offset: 0 usec, availability group: Legacy 1, not available)
			Properties:
				port.type = "hdmi"
				port.availability-group = "Legacy 1"
				device.icon_name = "video-display"
				card.profile.port = "0"
			Part of profile(s): output:hdmi-stereo, output:hdmi-surround, output:hdmi-surround71
		hdmi-output-1: HDMI / DisplayPort 2 (type: HDMI, priority: 5800, latency offset: 0 usec, availability group: Legacy 2, not available)
			Properties:
				port.type = "hdmi"
				port.availability-group = "Legacy 2"
				device.icon_name = "video-display"
				card.profile.port = "1"
			Part of profile(s): output:hdmi-stereo-extra1, output:hdmi-surround-extra1, output:hdmi-surround71-extra1
		hdmi-output-2: HDMI / DisplayPort 3 (type: HDMI, priority: 5700, latency offset: 0 usec, availability group: Legacy 3, not available)
			Properties:
				port.type = "hdmi"
				port.availability-group = "Legacy 3"
				device.icon_name = "video-display"
				card.profile.port = "2"
			Part of profile(s): output:hdmi-stereo-extra2, output:hdmi-surround-extra2, output:hdmi-surround71-extra2
		hdmi-output-3: HDMI / DisplayPort 4 (type: HDMI, priority: 5600, latency offset: 0 usec, availability group: Legacy 4, not available)
			Properties:
				port.type = "hdmi"
				port.availability-group = "Legacy 4"
				device.icon_name = "video-display"
				card.profile.port = "3"
			Part of profile(s): output:hdmi-stereo-extra3, output:hdmi-surround-extra3, output:hdmi-surround71-extra3
		hdmi-output-4: HDMI / DisplayPort 5 (type: HDMI, priority: 5500, latency offset: 0 usec, availability group: Legacy 5, available)
			Properties:
				port.type = "hdmi"
				port.availability-group = "Legacy 5"
				device.icon_name = "video-display"
				card.profile.port = "4"
				device.product.name = "ASUS MG28U"
			Part of profile(s): output:hdmi-stereo-extra4
		hdmi-output-5: HDMI / DisplayPort 6 (type: HDMI, priority: 5400, latency offset: 0 usec, availability group: Legacy 6, not available)
			Properties:
				port.type = "hdmi"
				port.availability-group = "Legacy 6"
				device.icon_name = "video-display"
				card.profile.port = "5"
			Part of profile(s): output:hdmi-stereo-extra5, output:hdmi-surround-extra5, output:hdmi-surround71-extra5

Card #46
	Name: alsa_card.usb-Generic_USB_Audio-00
	Driver: alsa
	Owner Module: n/a
	Properties:
		api.acp.auto-port = "false"
		api.alsa.card = "1"
		api.alsa.card.longname = "Generic USB Audio at usb-0000:14:00.0-6, high speed"
		api.alsa.card.name = "USB Audio"
		api.alsa.path = "hw:1"
		api.alsa.use-acp = "true"
		api.dbus.ReserveDevice1 = "Audio1"
		api.dbus.ReserveDevice1.Priority = "-20"
		device.api = "alsa"
		device.bus = "usb"
		device.bus-id = "usb-Generic_USB_Audio-00"
		device.bus_path = "pci-0000:14:00.0-usb-0:6:1.0"
		device.description = "USB Audio"
		device.enum.api = "udev"
		device.icon_name = "audio-card-analog-usb"
		device.name = "alsa_card.usb-Generic_USB_Audio-00"
		device.nick = "USB Audio"
		device.plugged.usec = "13594038"
		device.product.id = "0x3130"
		device.product.name = "USB Audio"
		device.serial = "Generic_USB_Audio"
		device.subsystem = "sound"
		sysfs.path = "/devices/pci0000:00/0000:00:02.1/0000:04:00.0/0000:05:0c.0/0000:14:00.0/usb3/3-6/3-6:1.0/sound/card1"
		device.vendor.id = "0x0db0"
		device.vendor.name = "Micro Star International"
		media.class = "Audio/Device"
		factory.id = "14"
		client.id = "43"
		object.id = "46"
		object.serial = "46"
		object.path = "alsa:pcm:1"
		alsa.card = "1"
		alsa.card_name = "USB Audio"
		alsa.long_card_name = "Generic USB Audio at usb-0000:14:00.0-6, high speed"
		alsa.driver_name = "snd_usb_audio"
		device.string = "1"
	Profiles:
		off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
		HiFi: HiFi 2.0 channels (sinks: 3, sources: 2, priority: 8000, available: yes)
		HiFi 7+1: HiFi 7.1 channels (sinks: 3, sources: 2, priority: 1, available: yes)
		HiFi 5+1: HiFi 5.1 channels (sinks: 3, sources: 2, priority: 1, available: yes)
		pro-audio: Pro Audio (sinks: 4, sources: 3, priority: 1, available: yes)
	Active Profile: HiFi
	Ports:
		[Out] SPDIF: S/PDIF Output (type: SPDIF, priority: 100, latency offset: 0 usec, availability unknown)
			Properties:
				port.type = "spdif"
				device.icon_name = "audio-speakers"
				card.profile.port = "0"
			Part of profile(s): HiFi 7+1, HiFi 5+1, HiFi
		[Out] Headphones: Front Headphones (type: Headphones, priority: 300, latency offset: 0 usec, availability group: Headphone - Output, not available)
			Properties:
				port.type = "headphones"
				port.availability-group = "Headphone - Output"
				device.icon_name = "audio-headphones"
				card.profile.port = "1"
			Part of profile(s): HiFi 7+1, HiFi 5+1, HiFi
		[Out] Speaker: Speakers (type: Speaker, priority: 200, latency offset: 0 usec, availability group: Speaker - Output, not available)
			Properties:
				port.type = "speaker"
				port.availability-group = "Speaker - Output"
				device.icon_name = "audio-speakers"
				card.profile.port = "2"
			Part of profile(s): HiFi 7+1, HiFi 5+1, HiFi
		[In] Mic1: Microphone (type: Mic, priority: 300, latency offset: 0 usec, availability group: Mic - Input, not available)
			Properties:
				port.type = "mic"
				port.availability-group = "Mic - Input"
				device.icon_name = "audio-input-microphone"
				card.profile.port = "3"
			Part of profile(s): HiFi 7+1, HiFi 5+1, HiFi
		[In] Line1: Line Input (type: Line, priority: 100, latency offset: 0 usec, availability group: Line - Input, not available)
			Properties:
				port.type = "line"
				port.availability-group = "Line - Input"
				device.icon_name = "audio-input-microphone"
				card.profile.port = "4"
			Part of profile(s): HiFi 7+1, HiFi 5+1, HiFi

EDIT: I exported a 96K FLAC to wav, stopped pipewire and wireplumber and played the file back with aplay. It sounds fine. So the issue is pipewire?

Last edited by casualinfrared (2024-04-12 16:55:58)

Offline

#5 2024-04-18 12:48:13

just4arch
Member
Registered: 2023-01-07
Posts: 84

Re: Distorted S/PDIF output on MSI X670-P Wi-Fi

I've tried increasing the ALSA headroom and that didn't change anything.

How did you verify it was set on the right interface?

I already have multiple sample rates set at ~/.config/pipewire/pipewire.conf for use with the FiiO Amp.

Have you tried moving ~/.config/pipewire/pipewire.conf away and/or using config dropins instead?
There might have been changes in the defaults; maybe diff it with /usr/share/pipewire/pipewire.conf.

Here is the output of pactl list cards:

Maybe I misunderstood - you connect the iPod via S/PDIF and it is "detected" as 5.1?
That's not how S/PDIF works, it's unidirectional; the output supports 5.1, but you currently set it to stereo.

Offline

Board footer

Powered by FluxBB