steam-for-linux icon indicating copy to clipboard operation
steam-for-linux copied to clipboard

Remote Play Crackling Audio

Open Flameslice opened this issue 4 years ago • 217 comments

  • Steam client version (build number or date): Steam Client Beta, Dec 06, 2019
  • Distribution (e.g. Ubuntu): Arch
  • Opted into Steam client beta?: Yes
  • Have you checked for system updates?: Yes

Please describe your issue in as much detail as possible:

The expected behavior is that I can stream from my PC to my steam link indefinitely without audio issues. What happens is it works well initially for some variable period of time, but after that the audio will start crackling or popping until it eventually cuts out entirely. I've made sure Pulseaudio is set to the same sample rate as my TV. The stream log is here. Testing on a NixOS and Ubuntu based PC yielded the same results, but streaming from those same PC's running Windows worked fine.

Steps for reproducing this issue:

  1. Boot up a remote play session from a linux host to a steam link
  2. Wait for some undefined period of time
  3. Eventually, audio crackles and pops, until it eventually cuts out entirely.

Flameslice avatar Dec 08 '19 08:12 Flameslice

The same issue occurs when streaming to a Raspberry Pi 4 running the steam link software.

Flameslice avatar Dec 08 '19 21:12 Flameslice

Also experiencing this issue. On Manjaro (5.4 kernel), latest updates.

Audio starts to crackle / distort more and more after about 1h30min. Fix is to restart Steam and reconnect Steam Link.

If there is any other info I could provide, please let me know.

ghost avatar Jan 04 '20 17:01 ghost

Same issue kubuntu 19.10 client and host playing The Long Dark. After several hours of gameplay sounds begins to degrade.

jape42 avatar Jan 11 '20 19:01 jape42

Same here.

Sounds starts crackling/distorting after seemlingly random amount of ingame time (sometimes over 1:30h - sometimes less than an hour).

  • only occuring using Steam Link (original Steam Link)
    • in Big Picture and Desktop mode
  • occuring on:
    • Proton games (eg.: Crash Bandicoot™ N. Sane Trilogy)
    • Native Linux games (eg.: Moonlighter)
  • running on Windows is working fine

Workaround Steam Link:

  • stop streaming
  • reconnect to PC

System:    Host: my-manjaro Kernel: 4.19.97-1-MANJARO x86_64 bits: 64 Desktop: KDE Plasma 5.17.5 Distro: Manjaro Linux
Machine:   Type: Desktop Mobo: ASUSTeK model: ROG STRIX Z370-F GAMING v: Rev X.0x serial: <root required>
UEFI: American Megatrends v: 1601 date: 10/29/2018
CPU:       Topology: 6-Core model: Intel Core i7-8700K bits: 64 type: MT MCP L2 cache: 12.0 MiB
Speed: 800 MHz min/max: 800/4900 MHz Core speeds (MHz): 1: 800 2: 800 3: 800 4: 800 5: 800 6: 800 7: 800 8: 800
9: 800 10: 800 11: 800 12: 800
Graphics:  Device-1: NVIDIA GP104 [GeForce GTX 1080] driver: nvidia v: 440.44
Display: x11 server: X.Org 1.20.7 driver: nvidia tty: N/A
OpenGL: renderer: GeForce GTX 1080/PCIe/SSE2 v: 4.6.0 NVIDIA 440.44
Audio:     Device-1: Intel 200 Series PCH HD Audio driver: snd_hda_intel
Device-2: NVIDIA GP104 High Definition Audio driver: snd_hda_intel
Sound Server: ALSA v: k4.19.97-1-MANJARO
Network:   Device-1: Intel Ethernet I219-V driver: e1000e
IF: eth0 state: up speed: 1000 Mbps duplex: full mac: 18:31:bf:b7:fb:ef
Info:      Processes: 284 Uptime: 18m Memory: 31.35 GiB used: 2.09 GiB (6.7%) Shell: bash inxi: 3.0.37

Please let me know if you need more info/logs/whatever helps to get this resolved.

TheTee82 avatar Jan 26 '20 08:01 TheTee82

Hi,

same here

System: Host: Kernel: 5.5.2-1-MANJARO x86_64 bits: 64 Desktop: Awesome 4.3-580-g7440cf66 Distro: Manjaro Linux
Machine: Type: Desktop Mobo: MSI model: X99S SLI PLUS (MS-7885) v: 1.0 UEFI: American Megatrends v: 1.E0 date: 06/15/2018
CPU: Topology: 6-Core model: Intel Core i7-5820K bits: 64 type: MT MCP L2 cache: 15.0 MiB
Graphics: Device-1: Advanced Micro Devices [AMD/ATI] Ellesmere [Radeon RX 470/480/570/570X/580/580X/590] driver: amdgpu v: kernel
Display: x11 server: X.Org 1.20.7 driver: amdgpu resolution: 1920x1080~60Hz, 1920x1080~60Hz
OpenGL: renderer: AMD Radeon RX 480 Graphics (POLARIS10 DRM 3.36.0 5.5.2-1-MANJARO LLVM 9.0.1) v: 4.6 Mesa 20.0.0-rc1 (git-14c0d58c7f)
Audio: Device-1: Creative Labs EMU20k2 [Sound Blaster X-Fi Titanium Series] driver: snd_ctxfi
Device-2: AMD Ellesmere HDMI Audio [Radeon RX 470/480 / 570/580/590] driver: N/A Sound Server: ALSA v: k5.5.2-1-MANJARO
Network: Device-1: Intel Ethernet I218-V driver: e1000e
IF: eno1 state: up speed: 1000 Mbps duplex: full

As far as I remember, I had a very similar issue some time ago, the cause was something - who would have guessed that - messed up with the sound settings. I think is was something like setting up surround sound with digital output and pulseaudio. After reverting the changes the problem disappeared. Sorry that I can not deliver any more details.

hp-pepster avatar Feb 10 '20 08:02 hp-pepster

Having the same problem since day one. Is there an easy way to debug audio issues? All my audio devices are configured as 16bits @ 48000

UndeadKernel avatar Feb 16 '20 19:02 UndeadKernel

Tumbleweed here, same issue.

Gryxx avatar Apr 08 '20 21:04 Gryxx

Same behaviour using steam in home streaming to play local media. Sound starts to distort and cut out worsening quickly until there's no sound at all. Have to reconnect steam link every 15 minutes or so.

Using manjaro, pulseaudio, amd rx 570 on non-proprietary drivers. Everything up to date.

jp1995 avatar Apr 09 '20 21:04 jp1995

Same here, Manjaro host streaming to a raspberry pi 3. Audio starts to crackle immediately.

paperbenni avatar Apr 17 '20 19:04 paperbenni

Same here, host and client on Manjaro. Crackling until it goes mute.

romanovzky avatar Apr 25 '20 16:04 romanovzky

Same issue, I've had this for a long time. I thought this was an Ubuntu audio issue but now it turns out that I'm not the only one. I've had this issue on multiple Ubuntu versions while streaming to my raspberry pi3 (model B).

Everything seems fine until the first cracks in the audio starts happening. It gets worse and worse. After a reconnect it is ok again, until the first few cracks start happening again and the cycle repeats.

I've had this issue with:

  • ubuntu 18.04
  • ubuntu 19.10
  • ubuntu 20.04

On Windows 10, I don't have any issues.

robkorv avatar Apr 28 '20 16:04 robkorv

+1

I'm considering pulse audio to be a culprit but couldn't find any reasonable tweak to fix it, no issue on desktop etc.

Maybe some encoding lib ? Running on arch, runtime version. Had that issue for months, various vm's various kernels and settings. Didn't play steam link in a while but recently it became quite annoying.

Only fix i found so far is simply reconnecting to machine so it's clearly some syncing issues.

In case it's pulse related

  • ~/.config/pulse/daemon.conf
realtime-scheduling = no
resample-method = speex-float-10
enable-lfe-remixing = yes
flat-volumes = no
default-sample-channels=2
default-sample-format = float32le
default-sample-rate = 48000  
alternate-sample-rate = 44100
#default-fragments = 3
#default-fragment-size-msec = 7
#game mode?
#default-fragments = 5
#default-fragment-size-msec = 2
daemonize = no
  • /etc/pulse/daemon.conf
# This file is part of PulseAudio.
#
# PulseAudio is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# PulseAudio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.

## Configuration file for the PulseAudio daemon. See pulse-daemon.conf(5) for
## more information. Default values are commented out.  Use either ; or # for
## commenting.

; daemonize = no
; fail = yes
; allow-module-loading = yes
; allow-exit = yes
; use-pid-file = yes
; system-instance = no
; local-server-type = user
; enable-shm = yes
; enable-memfd = yes
; shm-size-bytes = 0 # setting this 0 will use the system-default, usually 64 MiB
; lock-memory = no
; cpu-limit = no

; high-priority = yes
; nice-level = -11

 realtime-scheduling = no
; realtime-priority = 5

; exit-idle-time = 20
; scache-idle-time = 20

; dl-search-path = (depends on architecture)

; load-default-script-file = yes
; default-script-file = /etc/pulse/default.pa

; log-target = auto
; log-level = notice
; log-meta = no
; log-time = no
; log-backtrace = 0

; resample-method = speex-float-1
; avoid-resampling = false
; enable-remixing = yes
; remixing-use-all-sink-channels = yes
; enable-lfe-remixing = no
; lfe-crossover-freq = 0

flat-volumes = no
; flat-volumes = yes

; rlimit-fsize = -1
; rlimit-data = -1
; rlimit-stack = -1
; rlimit-core = -1
; rlimit-as = -1
; rlimit-rss = -1
; rlimit-nproc = -1
; rlimit-nofile = 256
; rlimit-memlock = -1
; rlimit-locks = -1
; rlimit-sigpending = -1
; rlimit-msgqueue = -1
; rlimit-nice = 31
; rlimit-rtprio = 9
; rlimit-rttime = 200000

; default-sample-format = s16le
; default-sample-rate = 44100
; alternate-sample-rate = 48000
; default-sample-channels = 2
; default-channel-map = front-left,front-right

; default-fragments = 2
; default-fragment-size-msec = 125

; enable-deferred-volume = yes
; deferred-volume-safety-margin-usec = 8000
; deferred-volume-extra-delay-usec = 0
  • ~/.config/pulse/default.pa
#!/usr/bin/pulseaudio -nF
.include /etc/pulse/default.pa
load-module module-udev-detect tsched=0
unload-module module-suspend-on-idle
  • /etc/pulse/default.pa
#!/usr/bin/pulseaudio -nF
#
# This file is part of PulseAudio.
#
# PulseAudio is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# PulseAudio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.

# This startup script is used only if PulseAudio is started per-user
# (i.e. not in system mode)

.fail

### Automatically restore the volume of streams and devices
load-module module-device-restore
load-module module-stream-restore
load-module module-card-restore

### Automatically augment property information from .desktop files
### stored in /usr/share/application
load-module module-augment-properties

### Should be after module-*-restore but before module-*-detect
load-module module-switch-on-port-available

### Load audio drivers statically
### (it's probably better to not load these drivers manually, but instead
### use module-udev-detect -- see below -- for doing this automatically)
#load-module module-alsa-sink
#load-module module-alsa-source device=hw:1,0
#load-module module-oss device="/dev/dsp" sink_name=output source_name=input
#load-module module-oss-mmap device="/dev/dsp" sink_name=output source_name=input
#load-module module-null-sink
#load-module module-pipe-sink

### Automatically load driver modules depending on the hardware available
.ifexists module-udev-detect.so
load-module module-udev-detect tsched=0
.else
### Use the static hardware detection module (for systems that lack udev support)
load-module module-detect
.endif

### Automatically connect sink and source if JACK server is present
.ifexists module-jackdbus-detect.so
.nofail
load-module module-jackdbus-detect channels=2
.fail
.endif

### Automatically load driver modules for Bluetooth hardware
.ifexists module-bluetooth-policy.so
load-module module-bluetooth-policy
.endif

.ifexists module-bluetooth-discover.so
load-module module-bluetooth-discover
.endif

### Load several protocols
load-module module-dbus-protocol
.ifexists module-esound-protocol-unix.so
load-module module-esound-protocol-unix
.endif
load-module module-native-protocol-unix

### Network access (may be configured with paprefs, so leave this commented
### here if you plan to use paprefs)
#load-module module-esound-protocol-tcp
#load-module module-native-protocol-tcp
#load-module module-zeroconf-publish

### Load the RTP receiver module (also configured via paprefs, see above)
#load-module module-rtp-recv

### Load the RTP sender module (also configured via paprefs, see above)
#load-module module-null-sink sink_name=rtp format=s16be channels=2 rate=44100 sink_properties="device.description='RTP Multicast Sink'"
#load-module module-rtp-send source=rtp.monitor

### Load additional modules from GSettings. This can be configured with the paprefs tool.
### Please keep in mind that the modules configured by paprefs might conflict with manually
### loaded modules.
.ifexists module-gsettings.so
.nofail
load-module module-gsettings
.fail
.endif


### Automatically restore the default sink/source when changed by the user
### during runtime
### NOTE: This should be loaded as early as possible so that subsequent modules
### that look up the default sink/source get the right value
load-module module-default-device-restore

### Automatically move streams to the default sink if the sink they are
### connected to dies, similar for sources
load-module module-rescue-streams

### Make sure we always have a sink around, even if it is a null sink.
load-module module-always-sink

### Honour intended role device property
load-module module-intended-roles

### Automatically suspend sinks/sources that become idle for too long
load-module module-suspend-on-idle

### If autoexit on idle is enabled we want to make sure we only quit
### when no local session needs us anymore.
.ifexists module-console-kit.so
load-module module-console-kit
.endif
.ifexists module-systemd-login.so
load-module module-systemd-login
.endif

### Enable positioned event sounds
load-module module-position-event-sounds

### Cork music/video streams when a phone stream is active
load-module module-role-cork

### Modules to allow autoloading of filters (such as echo cancellation)
### on demand. module-filter-heuristics tries to determine what filters
### make sense, and module-filter-apply does the heavy-lifting of
### loading modules and rerouting streams.
load-module module-filter-heuristics
load-module module-filter-apply

### Make some devices default
#set-default-sink output
#set-default-source input

also sound hwinfo

hwinfo --sound
16: PCI 600.0: 0403 Audio device                                
  [Created at pci.386]
  Unique ID: vTuk.aI0zRHBQWr8
  Parent ID: 96M4.3B3cj6r6AT6
  SysFS ID: /devices/pci0000:00/0000:00:1c.6/0000:06:00.0
  SysFS BusID: 0000:06:00.0
  Hardware Class: sound
  Model: "Creative SB1570 SB Audigy Fx"
  Vendor: pci 0x1102 "Creative Labs"
  Device: pci 0x0012 "Sound Core3D [Sound Blaster Recon3D / Z-Series]"
  SubVendor: pci 0x1102 "Creative Labs"
  SubDevice: pci 0x0010 "SB1570 SB Audigy Fx"
  Revision: 0x01
  Driver: "snd_hda_intel"
  Driver Modules: "snd_hda_intel"
  Memory Range: 0xf7104000-0xf7107fff (rw,non-prefetchable)
  Memory Range: 0xf7100000-0xf7103fff (rw,non-prefetchable)
  IRQ: 18 (1853231 events)
  Module Alias: "pci:v00001102d00000012sv00001102sd00000010bc04sc03i00"
  Driver Info #0:
    Driver Status: snd_hda_intel is active
    Driver Activation Cmd: "modprobe snd_hda_intel"
  Config Status: cfg=new, avail=yes, need=no, active=unknown
  Attached to: #19 (PCI bridge)

20: PCI 100.1: 0403 Audio device
  [Created at pci.386]
  Unique ID: NXNs.Ty2Or0RSvP1
  Parent ID: vSkL.OXv6hi5TXAE
  SysFS ID: /devices/pci0000:00/0000:00:01.0/0000:01:00.1
  SysFS BusID: 0000:01:00.1
  Hardware Class: sound
  Model: "nVidia GM204 High Definition Audio Controller"
  Vendor: pci 0x10de "nVidia Corporation"
  Device: pci 0x0fbb "GM204 High Definition Audio Controller"
  SubVendor: pci 0x1458 "Gigabyte Technology Co., Ltd"
  SubDevice: pci 0x366f 
  Revision: 0xa1
  Driver: "snd_hda_intel"
  Driver Modules: "snd_hda_intel"
  Memory Range: 0xf7080000-0xf7083fff (rw,non-prefetchable)
  IRQ: 17 (601 events)
  Module Alias: "pci:v000010DEd00000FBBsv00001458sd0000366Fbc04sc03i00"
  Driver Info #0:
    Driver Status: snd_hda_intel is active
    Driver Activation Cmd: "modprobe snd_hda_intel"
  Config Status: cfg=new, avail=yes, need=no, active=unknown
  Attached to: #10 (PCI bridge)

as for my network it goes pc-[ethernet]->router-[5ghz wifi]->android smartphone

ashtonx avatar May 01 '20 22:05 ashtonx

As a reference, I tested configuring pulse audio using the same configuration files and settings that come with SteamOs. I still saw the same audio sync problems. My assumption is that the problem goes beyond correctly configuring PulseAudio.

@ashtonx, I've observed many problems, not related to this issue, because of this line:

load-module module-udev-detect tsched=0

For which reason did you set tsched=0 for?

UndeadKernel avatar May 01 '20 23:05 UndeadKernel

For which reason did you set tsched=0 for?

At this point I'm not sure but i believe it was one of recommended fixes for audio getting choppy in games. (unrelated to this bug, doesn't fix it)

edit: https://wiki.archlinux.org/index.php/PulseAudio/Troubleshooting#Glitches.2C_skips_or_crackling it's reference to question to about tsched=0 in my config. It's unrelated to current bug and sadly it does it help.

~~edit2: still didn't test this solution, but might be worth trying. https://wiki.archlinux.org/index.php/PulseAudio/Troubleshooting#Sound_stuttering_when_streaming_over_network~~

edit3: sadly solution in edit 2 didn't help in my case.

ashtonx avatar May 01 '20 23:05 ashtonx

@ashtonx adding tsched=0 in host didn't change anything for me.

romanovzky avatar May 04 '20 21:05 romanovzky

@ashtonx adding tsched=0 in host didn't change anything for me.

Yes it's related to a different bug with a crackling sound that involves wine/proton and afair it depends on sound card. I only mentioned it since there was a question about it being in my setting. Feel free to remove it if you didn't encounter any crackling outside of steam link it's clearly unrelated to that and might cause problems in the future.

ashtonx avatar May 04 '20 21:05 ashtonx

I have noticed that this issue has generated many reports in the past recent months (notice for example also here and here ).

I have also noticed that many reporters are on a rolling distro such as debian or arch-based. This makes me wonder if there has been a regression in Pulse Audio. If so, there might be other bug reports about this same issue without mentioning steam remote play or steam link.

romanovzky avatar May 06 '20 08:05 romanovzky

I have also noticed that many reporters are on a rolling distro such as debian or arch-based. This makes me wonder if there has been a regression in Pulse Audio. If so, there might be other bug reports about this same issue without mentioning steam remote play or steam link.

If you take a look there's a report on kubuntu here from january, that's not what i'd call a rolling release. Nor debian btw.

Also it's unlikely issue is related to pulse audio, it's most likely related to encoding or sync between the client and server. Though pulse audio had issues with crackling it's what most people would suspect first. Also if you take a look at submissions some people are running alsa rather than pulse audio also have the issue.

ashtonx avatar May 06 '20 09:05 ashtonx

The issue might indeed not be related to pulse audio. In one of my experiments, I copied all the pulse audio configuration from SteamOS into my Arch setup and experienced the exact same problem. I also experience the issue while using the original Steam link or the new (Samsung) TV app steam link.

Could anyone test booting SteamOS and checking if the problem is also there? I'm sure it will also be present there, but a confirmation would help to narrow the issue down.

UndeadKernel avatar May 06 '20 10:05 UndeadKernel

Same issue streaming from my Arch host lets the audio deteriorate after some time until it disappears. Tested clients were my Arch Laptop and the Steam Link hardware. When the streaming host is Windows no problems arise. My guess is that the Steam Link software does something wrong with Linux hosts.

vonWolfens avatar May 12 '20 09:05 vonWolfens

I have this when client is my laptop running Manjaro. The same laptop has no issues if host is Windows.

I must also say, to me the problem only arouse when I reinstalled my host linux from Manjaro XFCE to Manjaro GNOME (fresh installation, I was able to brick it with a stupid sudo misuse and wanted to switch to GNOME for a while).

romanovzky avatar May 12 '20 09:05 romanovzky

I also did a fresh reinstall recently (~3 weeks), but since I am using xmonad, I do not think this has anything to do with GNOME, the only components I use from GNOME are the keyring, geary, nautilus and evince. Which are mostly front end projects, developed by the GNOME project. Also i forgot to mention that all systems, including the Steam Link Hardware are up to date.

vonWolfens avatar May 12 '20 10:05 vonWolfens

So I tried it today again with a fresh install of Ubuntu 20.04 LTS on the same host, and it did not work either. Will try with my Laptop, which uses different hardware, as host tomorrow.

vonWolfens avatar May 13 '20 16:05 vonWolfens

@vonWolfens, if you have the time, it would also be great to test if this bug is present when using SteamOs 1. Unfortunately I don't have the hard drive space to test it.

UndeadKernel avatar May 13 '20 16:05 UndeadKernel

yeah sure i will put it onto the hdd i found for ubuntu, will try to do that tomorrow

vonWolfens avatar May 13 '20 17:05 vonWolfens

I have the same issue with Steam client running on Android TV and Steam host on Arch Linux

kerabromsmu avatar May 14 '20 16:05 kerabromsmu

@UndeadKernel So I fiddled around with SteamOS for a few hours yesterday, did not get it working, and today after another hour I found out, there isn't any GPU driver for my card in SteamOS' repositories atm (RX 5700XT), maybe I'll try to build them manually or something but for now I sadly can neither confirm or deny the bug on SteamOS

vonWolfens avatar May 15 '20 11:05 vonWolfens

I can confirm the bug happens under SteamOS.

Flameslice avatar May 22 '20 01:05 Flameslice

@Kristian-Brucaj, no wonder why copying the pulse audio configuration from SteamOS to my Arch installation didn't do anything then. @kisak-valve, do you happen to know if this SteamOS bug is also known? Is there a place to report such a bug?

UndeadKernel avatar May 22 '20 10:05 UndeadKernel

@UndeadKernel I was referring to the audio streaming issue the thread was created for. That seems rather distro-agnostic, so I'm under the impression the issue is with how steam is capturing audio from the host pc

Flameslice avatar May 22 '20 13:05 Flameslice