[0.12.33] sound effect distortion and echo

Bugs that are actually features.
Post Reply
quyxkh
Smart Inserter
Smart Inserter
Posts: 1028
Joined: Sun May 08, 2016 9:01 am
Contact:

[0.12.33] sound effect distortion and echo

Post by quyxkh »

This is on Arch Linux w/Steam and there's a workaround, so I'm posting only because it raises an odd question, plus, entertainment value, and maybe it'll jog a memory someday, who knows?

Sound effects but not music are distorted, and then echoed once, quieter, after two seconds.

I was going to record it to show the nature of it, so I installed obs-studio and made a movie. The movie recorded the correct sounds, even though I heard the distorted and echoed ones.

I tried shutting off the microphone, thinking that might be it. No difference. I tried the `padsp` method from an earlier report, no difference.

I plugged in a headset. That fixed it. I can switch the distortions and echo on and off by switching outputs, with or without a mic connected.

So far as I can tell, this happens only with factorio.

sillyfly
Smart Inserter
Smart Inserter
Posts: 1099
Joined: Sun May 04, 2014 11:29 am
Contact:

Re: [0.12.33] sound effect distortion and echo

Post by sillyfly »

Does it only happen when recording with OBS? If so it could be some weird interaction between OBS and Factorio...

Edit: Never mind, upon re-reading I see you only installed OBS _after_ you had the issue.

quyxkh
Smart Inserter
Smart Inserter
Posts: 1028
Joined: Sun May 08, 2016 9:01 am
Contact:

Re: [0.12.33] sound effect distortion and echo

Post by quyxkh »

This affects _all_ sound (including factorio's music, I just didn't notice it before), including for instance system beeps from an xterm ringing the terminal bell while factorio's running.

Something about factorio is rewiring pulseaudio's streams. I did a pacmd dump and later a pacmd list before and after starting factorio, here's the diffs. It seems it's explicitly activating the monitor and configuring max latency on index 0 -- I checked, it's doing that even when that's not the default or active card for anything.

Code: Select all

--- dump1	2016-05-11 07:59:46.829610732 -0700
+++ dump2	2016-05-11 08:00:10.525466698 -0700
@@ -1,4 +1,4 @@
-### Configuration dump generated at Wed May 11 07:59:46 2016
+### Configuration dump generated at Wed May 11 08:00:10 2016
 
 load-module module-device-restore
 load-module module-stream-restore
@@ -28,7 +28,7 @@
 
 set-sink-volume alsa_output.pci-0000_01_00.1.hdmi-stereo 0x10000
 set-sink-mute alsa_output.pci-0000_01_00.1.hdmi-stereo no
-suspend-sink alsa_output.pci-0000_01_00.1.hdmi-stereo yes
+suspend-sink alsa_output.pci-0000_01_00.1.hdmi-stereo no
 set-sink-volume alsa_output.usb-Logitech_Logitech_USB_Headset-00.analog-stereo 0x10000
 set-sink-mute alsa_output.usb-Logitech_Logitech_USB_Headset-00.analog-stereo no
 suspend-sink alsa_output.usb-Logitech_Logitech_USB_Headset-00.analog-stereo yes
@@ -38,7 +38,7 @@
 
 set-source-volume alsa_output.pci-0000_01_00.1.hdmi-stereo.monitor 0x000
 set-source-mute alsa_output.pci-0000_01_00.1.hdmi-stereo.monitor yes
-suspend-source alsa_output.pci-0000_01_00.1.hdmi-stereo.monitor yes
+suspend-source alsa_output.pci-0000_01_00.1.hdmi-stereo.monitor no
 set-source-volume alsa_output.usb-Logitech_Logitech_USB_Headset-00.analog-stereo.monitor 0x10000
 set-source-mute alsa_output.usb-Logitech_Logitech_USB_Headset-00.analog-stereo.monitor yes
 suspend-source alsa_output.usb-Logitech_Logitech_USB_Headset-00.analog-stereo.monitor yes

Code: Select all

--- list1	2016-05-11 10:10:51.067949548 -0700
+++ list2	2016-05-11 10:11:09.344007670 -0700
@@ -1,18 +1,18 @@
-Memory blocks currently allocated: 3, size: 88.2 KiB.
-Memory blocks allocated during the whole lifetime: 47172743, size: 3.6 GiB.
-Memory blocks imported from other processes: 0, size: 0 B.
+Memory blocks currently allocated: 2783, size: 435.7 KiB.
+Memory blocks allocated during the whole lifetime: 47225105, size: 3.6 GiB.
+Memory blocks imported from other processes: 128, size: 16.0 KiB.
 Memory blocks exported to other processes: 0, size: 0 B.
 Total sample cache size: 24.0 KiB.
 Default sample spec: s16le 2ch 44100Hz
 Default channel map: front-left,front-right
 Default sink name: alsa_output.pci-0000_01_00.1.hdmi-stereo
 Default source name: alsa_input.usb-Logitech_Logitech_USB_Headset-00.analog-mono
-Memory blocks of type POOL: 3 allocated/21222830 accumulated.
+Memory blocks of type POOL: 1024 allocated/21240402 accumulated.
 Memory blocks of type POOL_EXTERNAL: 0 allocated/0 accumulated.
-Memory blocks of type APPENDED: 0 allocated/17696103 accumulated.
+Memory blocks of type APPENDED: 1631 allocated/17722686 accumulated.
 Memory blocks of type USER: 0 allocated/0 accumulated.
-Memory blocks of type FIXED: 0 allocated/7534511 accumulated.
-Memory blocks of type IMPORTED: 0 allocated/719299 accumulated.
+Memory blocks of type FIXED: 0 allocated/7541822 accumulated.
+Memory blocks of type IMPORTED: 128 allocated/720195 accumulated.
 25 module(s) loaded.
     index: 0
 	name: <module-device-restore>
@@ -69,7 +69,7 @@
     index: 6
 	name: <module-alsa-card>
 	argument: <device_id="1" name="pci-0000_01_00.1" card_name="alsa_card.pci-0000_01_00.1" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes card_properties="module-udev-detect.discovered=1">
-	used: 0
+	used: 1
 	load once: no
 	properties:
 		module.author = "Lennart Poettering"
@@ -242,24 +242,24 @@
 	name: <alsa_output.pci-0000_01_00.1.hdmi-stereo>
 	driver: <module-alsa-card.c>
 	flags: HARDWARE DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
-	state: SUSPENDED
-	suspend cause: IDLE 
+	state: RUNNING
+	suspend cause: 
 	priority: 9050
 	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
 	volume steps: 65537
 	muted: no
-	current latency: 0.00 ms
+	current latency: 3.98 ms
 	max request: 0 KiB
-	max rewind: 0 KiB
+	max rewind: 344 KiB
 	monitor source: 0
 	sample spec: s16le 2ch 44100Hz
 	channel map: front-left,front-right
 	             Stereo
-	used by: 0
-	linked by: 0
-	configured latency: 0.00 ms; range is 0.50 .. 1999.82 ms
+	used by: 1
+	linked by: 1
+	configured latency: 4.99 ms; range is 0.50 .. 1999.82 ms
 	card: 0 <alsa_card.pci-0000_01_00.1>
 	module: 6
 	properties:
@@ -437,8 +437,8 @@
 	name: <alsa_output.pci-0000_01_00.1.hdmi-stereo.monitor>
 	driver: <module-alsa-card.c>
 	flags: DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
-	state: SUSPENDED
-	suspend cause: IDLE 
+	state: IDLE
+	suspend cause: 
 	priority: 1050
 	volume: front-left: 0 /   0% / -inf dB,   front-right: 0 /   0% / -inf dB
 	        balance 0.00
@@ -446,13 +446,13 @@
 	volume steps: 65537
 	muted: yes
 	current latency: 0.00 ms
-	max rewind: 0 KiB
+	max rewind: 344 KiB
 	sample spec: s16le 2ch 44100Hz
 	channel map: front-left,front-right
 	             Stereo
 	used by: 0
 	linked by: 0
-	configured latency: 0.00 ms; range is 0.50 .. 1999.82 ms
+	configured latency: 1999.82 ms; range is 0.50 .. 1999.82 ms
 	monitor_of: 0
 	card: 0 <alsa_card.pci-0000_01_00.1>
 	module: 6
@@ -529,7 +529,7 @@
 	base volume: 21535 /  33% / -29.00 dB
 	volume steps: 65537
 	muted: yes
-	current latency: 0.02 ms
+	current latency: 2.82 ms
 	max rewind: 0 KiB
 	sample spec: s16le 1ch 44100Hz
 	channel map: mono
@@ -689,7 +689,7 @@
 			properties:
 				
 	active port: <analog-input-linein>
-10 client(s) logged in.
+11 client(s) logged in.
     index: 47
 	driver: <module-systemd-login.c>
 	owner module: 17
@@ -821,7 +821,22 @@
 		application.process.machine_id = "f4a22151b8894985b59872b16296ae15"
 		application.process.session_id = "c3"
 		application.icon_name = "steam"
-    index: 109
+    index: 111
+	driver: <protocol-native.c>
+	owner module: 10
+	properties:
+		application.name = "ALSA plug-in [factorio]"
+		native-protocol.peer = "UNIX socket client"
+		native-protocol.version = "30"
+		application.process.id = "12736"
+		application.process.user = "quyxkh"
+		application.process.host = "gadabout"
+		application.process.binary = "factorio"
+		application.language = "C"
+		window.x11.display = ":0"
+		application.process.machine_id = "f4a22151b8894985b59872b16296ae15"
+		application.process.session_id = "c3"
+    index: 112
 	driver: <cli.c>
 	owner module: 22
 	properties:
@@ -949,7 +964,37 @@
 		analog-output-headphones: Headphones (priority 9000, latency offset 0 usec, available: no)
 			properties:
 				device.icon_name = "audio-headphones"
-0 sink input(s) available.
+1 sink input(s) available.
+    index: 108
+	driver: <protocol-native.c>
+	flags: 
+	state: RUNNING
+	sink: 0 <alsa_output.pci-0000_01_00.1.hdmi-stereo>
+	volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB
+	        balance 0.00
+	muted: no
+	current latency: 15.71 ms
+	requested latency: 4.99 ms
+	sample spec: s16le 2ch 44100Hz
+	channel map: front-left,front-right
+	             Stereo
+	resample method: (null)
+	module: 10
+	client: 111 <ALSA plug-in [factorio]>
+	properties:
+		media.name = "ALSA Playback"
+		application.name = "ALSA plug-in [factorio]"
+		native-protocol.peer = "UNIX socket client"
+		native-protocol.version = "30"
+		application.process.id = "12736"
+		application.process.user = "quyxkh"
+		application.process.host = "gadabout"
+		application.process.binary = "factorio"
+		application.language = "C"
+		window.x11.display = ":0"
+		application.process.machine_id = "f4a22151b8894985b59872b16296ae15"
+		application.process.session_id = "c3"
+		module-stream-restore.id = "sink-input-by-application-name:ALSA plug-in [factorio]"
 1 source output(s) available.
     index: 0
 	driver: <protocol-native.c>
Attachments
list2.log
pacmd list output when factorio's running
(36.23 KiB) Downloaded 80 times

quyxkh
Smart Inserter
Smart Inserter
Posts: 1028
Joined: Sun May 08, 2016 9:01 am
Contact:

Re: [0.12.33] sound effect distortion and echo

Post by quyxkh »

This has gone away, by the way. In the interim I've switched from an AMD card to a Nvidia, using the vendor HDMI audio, so it could easily have been a driver issue.

Post Reply

Return to “Not a bug”