ValveSoftware / steam-for-linux

Issue tracking for the Steam for Linux beta client
4.18k stars 173 forks source link

Remote Play Crackling Audio #6749

Closed Flameslice closed 1 year ago

Flameslice commented 4 years ago

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.
Gryxx commented 4 years ago

edit: what i meant more tests, i meant more tests same kernel to same kernel, prolly different distro same kernel. Also we might want to run older kernel to older kernel and new kernel to new kernel.

Yup, it seems like kernel. Linux Mint 17.3, kernel 5.3.0-46-generic as client, it does corrupt audio. Host is the same as previous, connection is Gigabit Ethernet. Also I've noticed few things:

  1. It is running encoding and decoding in software on both machines
  2. It was loosing quite a few frames (up to 11% according to overlay) right on start. It was sitting at 0% thou when audio was crackling.
  3. This one is subjective, but it feels like the sound wasn't corrupted as fast as on SteamLink (or WiFi thou speed exceeds 200 Mbps). To be clear, i mean it take more time from when i first heard corruption to complete distortion of sound.

As you edited, it would be nice if more people would join testing. Especially on old kernel, or maybe someone capable of hardware encoding/decoding. As it does not work on AMD GPUs on Linux (also Intel, I'm not sure). If I'm not mistaken (please, correct me if i'm wrong) software encoding/decoding (LLVM) is done in kernel?

vonWolfens commented 4 years ago

@ashtonx Thanks for the overview @Gryxx Maybe I'll have time to pull some old lts kernels from the aur and boot with them, I would then be streaming to the steam link hardware.

Also I still want to test streaming from the Laptop (Linux) to the Steam Link Hardware for an elongated period of time, since it has an Intel / Nvidia combo, and AMD has been mentioned quite a few times.

romanovzky commented 4 years ago

@ashtonx and @vonWolfens would it help if we collect CPU configurations? In my case the host is indeed AMD, which I haven't mentioned before. Also, would it help to keep track of kernels? In Manjaro I can easily switch between different LTS and could try different combinations next week, but not until then.

ashtonx commented 4 years ago

I don't think either is related, might be wrong but here.

I run with hardware encoding/decoding enabled, though can't confirm if it works, for all I know it's just checked on. I've been running client on Samsung Galaxy S9 which I'm guessing should have hardware decoding.

I doubt it's also related to mobo soundcard either since for example I'm using an sbz. That said not sure what steam is using for transmission. I think i once had an issue with having no sound at all and it was using nvidia gpu as an output, that said it's sbz that's being selected during streaming now, analog, headphone output.

From what I've seen we all have different hardware configurations so it's unlikely one specific thing is causing it. Doubt adding info hurts anyone though.

Kernel difference seems to be only thing we managed to find as likely posibility, which is weird but who knows what valve is using to manage streaming and syncing.

Gryxx commented 4 years ago

@ashtonx Don't know about android, but in Steam streaming options on client you can enable overlay that will show used encoding/decoding.

vonWolfens commented 4 years ago

@romanovzky, @ashtonx Yeah Hardware configuration might be completely irrelevant, but it can't hurt to have more information gathered here:

I actually do not think it is an encoding issue, since from my experience, when en-/decoding does not work, nothing works. What I can imagine, is that the software timestamping of frames runs out of sync. In my previous firm, we dealt primarily with time synchronization, which is crucial when streaming. I will explain further: Ethernet packets are timestamped on the host, and the resulting image / audio is put together on the client (normally), if the packets for Audio and Video are separate (which they usually are) the steam client has to implement the behaviour of fetching and transmitting the packets, as I do not know of any kernel level function, which might implement such behavior. Now, if those 2 parts (image and audio) use different hardware clocks for timestamping (which may very well be a possibility) or there is an increasing difference in the time the between the timestamping of those two things, they may run out of sync. What would happen then is that the image is likely prioritized by the client, which would lead to the client searching for the correct audio with the current timestamp, but since there would be none available after some time the audio would get distorted and at some point completely lost. What this idea does not explain is the working configuration of host - Linux and client - Windows, but it is something, which I have seen in the past. I hope, that this was understandable, although it is very difficult to determine the reason for this behavior, without source code (which we might never see). Best case it helps the engineers at Valve to know where they might look. Tl;dr: It might be a timestamping issue

romanovzky commented 4 years ago

Here it goes:

Host

Client

Next week I can run a few checks on LST Kernels 4.19 and 4.14, on combinations of host vs client version mismatches. I'll post the results here.

UndeadKernel commented 4 years ago

@romanovzky, I assume that with your test (using the same kernel in the host and client) you still had problems?

romanovzky commented 4 years ago

@UndeadKernel sorry for the delayed reply, but yes. I've tested

romanovzky commented 4 years ago

So, no one from Valve taking this? It seems to be easily reproducible if so many of us across so many distributions are experiencing this.

Gryxx commented 4 years ago

@romanovzky I'm willing to give them benefit of a doubt. It might be easier to reproduce the bug then to find what is causing it. Not to mention designing bugfix.

vonWolfens commented 4 years ago

Ok so I may have something new, yesterday I had the idea to run the runtime version of Steam (instead of the native binary). I tried it shortly with my phone, and for 2 hours today on the steam link hardware (same host as always). No problems occurred for me at all this time, normally it would stutter after ~20 minutes. This is still not enough testing. I will continue tomorrow, since I am not at home at the moment. Since there seems to be no regression in the kernel code there may be one in the "hundreds" of libraries, on which Steam depends. Maybe someone else can try this in the meantime. PS: Take this idea with a grain of salt since my ~3 hours of testing are not really enough in my opinion.

Also I agree with @Gryxx debugging this may be very difficult, but I would still appreciate some signal that this problem is not being disregarded.

Gryxx commented 4 years ago

@vonWolfens You mean SteamPlay " Steam Linux Runtime"? I think there might be something in it (EDIT: In idea of regression in one of libraries)- all of my core packages were exact match on my setup, as i've updated both machines before testing. I'll try to find a spare disk to do some more testing too.

Yes, it would be nice to have them reply. I just assume they don't have anything to say yet.

vonWolfens commented 4 years ago

@Gryxx No Arch serves two different .desktop files for steam, where it does not use the runtime (? which I think means, that it uses some system libraries instead of pre-packaged ones), and the Steam (Runtime) desktop file seems to work for me, I'll dump something to show you what i mean, steam.desktop is the one using the runtime.

~ $ cat /usr/share/applications/steam.desktop | grep Exec\=\/
Exec=/usr/bin/steam-runtime %U
~ $ cat /usr/share/applications/steam-native.desktop | grep Exec\=\/
Exec=/usr/bin/steam-native %U
~ $ cat /usr/bin/steam-runtime
#!/bin/sh
exec /usr/lib/steam/steam "$@"
~ $ cat /usr/bin/steam-native
#!/bin/bash
export STEAM_RUNTIME=0
export STEAM_RUNTIME_HEAVY=0
# Workaround for dbus fatal termination related coredumps (SIGABRT)
# https://github.com/ValveSoftware/steam-for-linux/issues/4464
export DBUS_FATAL_WARNINGS=0
# Override some libraries as these are what games linked against.
export LD_LIBRARY_PATH="/usr/lib/steam:/usr/lib32/steam${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
exec /usr/lib/steam/steam "$@"

Edit: But as I said I'm not yet completely sure this solves it consistently

Gryxx commented 4 years ago

@vonWolfens Now i understand. Although Steam should prefer system libraries by default. If I remember correctly export STEAM_RUNTIME=0 steam Should do the same thing on other distros (if someone is available to help testing, no luck finding spare drive ;) )

vonWolfens commented 4 years ago

@Gryxx The version without the export works for me. When running without this on the first run it opens a dialog (GTK) where the runtime is extracted, I'll look into it more tomorrow.

romanovzky commented 4 years ago

@vonWolfens That is a very interesting development. In Manjaro we have by default steam-manjaro which seems to be equivalent to the steam-runtime ref. This is the version I am running and on which I have the issues (which would somehow contradict your results). I will later try with steam-native.

vonWolfens commented 4 years ago

@romanovzky Yeah that would be weird, did the normal package (steam-manjaro) give you the Extracting runtime... dialog?

More information on the steam-native version on arch: for it to work you need a meta package, which lists all the needed packages as dependencies ref (or just install all libs mentioned by ldd manually if that's your thing)

But as mentioned as of this point I am still unsure as I have not yet done enough testing. Still I thought this may be shared already, since a kernel regression does seem very unlikely with the tests concluded by @romanovzky. (Thanks for that btw)

For summary I'll list them here as well, if this continues to work, I guess one of those libraries may be to blame for this: (Sorry for the long text, I just find it helpful to have information not hidden behind links)

``` alsa-lib alsa-plugins atk bash cairo curl dbus dbus-glib fontconfig freeglut freetype2 gdk-pixbuf2 glew1.10 glib2 glu gtk2 lib32-alsa-lib lib32-alsa-plugins lib32-atk lib32-cairo lib32-curl lib32-dbus lib32-dbus-glib lib32-fontconfig lib32-freeglut lib32-freetype2 lib32-gdk-pixbuf2 lib32-glew1.10 lib32-glib2 lib32-glu lib32-gtk2 lib32-libappindicator-gtk2 lib32-libcaca lib32-libcanberra lib32-libcups lib32-libcurl-compat lib32-libcurl-gnutls lib32-libdbusmenu-glib lib32-libdbusmenu-gtk2 lib32-libdrm lib32-libgcrypt15 lib32-libice lib32-libidn11 lib32-libindicator-gtk2 lib32-libjpeg6 (lib32-libjpeg6-turbo) lib32-libnm-glib lib32-libpng12 lib32-libpulse lib32-librtmp0 lib32-libsm lib32-libtheora lib32-libtiff4 lib32-libudev0-shim lib32-libusb lib32-libva lib32-libvdpau lib32-libvorbis lib32-libvpx1.3 lib32-libwrap lib32-libxcomposite lib32-libxcursor lib32-libxft lib32-libxi lib32-libxinerama lib32-libxmu lib32-libxrandr lib32-libxrender lib32-libxtst lib32-libxxf86vm lib32-nspr lib32-openal lib32-openssl-1.0 lib32-pango lib32-sdl lib32-sdl2 lib32-sdl2_image lib32-sdl2_mixer lib32-sdl2_ttf lib32-sdl_image lib32-sdl_mixer lib32-sdl_ttf lib32-vulkan-driver (lib32-nvidia-utils, lib32-vulkan-intel, lib32-vulkan-radeon, lib32-amdvlk, lib32-vulkan-intel, lib32-vulkan-radeon) lib32-vulkan-icd-loader libcaca libcanberra libcups libcurl-compat libcurl-gnutls libdrm libgcrypt15 libice libidn11 libjpeg6 (libjpeg6-turbo) libnm-glib libpng12 libpulse librsvg librtmp0 libsm libtheora libtiff4 libudev0-shim libusb libva libvdpau libvorbis libvpx1.3 libwrap libxcomposite libxcursor libxft libxi libxinerama libxmu libxrandr libxrender libxtst libxxf86vm nspr openal openssl-1.0 pango sdl sdl2 sdl2_image sdl2_mixer sdl2_ttf sdl_image sdl_mixer sdl_ttf steam vulkan-driver (nvidia-utils, vulkan-intel, vulkan-radeon, amdvlk, nvidia-utils, vulkan-intel, vulkan-radeon) vulkan-icd-loader ```

Matombo commented 4 years ago

I tried with both STEAM_RUNTIME=0 and STEAM_RUNTIME=1, both didn't help issue still there. I'm on Manjaro Linux.

romanovzky commented 4 years ago

I can report the same outcome as @Matombo , both native and runtime are broken on Manjaro.

However, Manjaro runtime (steam-manjaro) and arch runtime (steam-runtime) are different packages, which means that they might have different versioning for some dependencies. It could be productive to understand what are the differences if @vonWolfens behaviour persists (i.e. arch runtime package is not broken).

vonWolfens commented 4 years ago

Well that are not so happy results, I was not able to test much today, but still no crackling. Also there are no two different packages for the runtime and native version on arch, the native one just doesnt work usually, unless you have all libs installed already. I had a hunch that /usr/lib/steam/steam was yet another script so I'll post those contents quickly, as I do not have time atm to look into them.

`/usr/lib/steam/steam` ( This is the script launched by both the `$(which steam)` and `$(which steam-native)` launch scripts):

``` ~ $ cat /usr/lib/steam/steam #!/usr/bin/env bash # # bin_steam.sh - launcher script for Steam on Linux # Copyright Valve Corporation. All rights reserved # # This is the Steam script that typically resides in /usr/bin # It will create the Steam bootstrap if necessary and then launch steam. set -e # Get the full name of this script STEAMSCRIPT="$(cd "${0%/*}" && echo "$PWD")/${0##*/}" export STEAMSCRIPT bootstrapscript="$(readlink -f "$STEAMSCRIPT")" bootstrapdir="$(dirname "$bootstrapscript")" export STEAMSCRIPT_VERSION=1.0.0.61+deb1 # Set up domain for script localization export TEXTDOMAIN=steam function show_message() { style=$1 shift if ! zenity "$style" --text="$*" 2>/dev/null; then case "$style" in --error) title=$"Error" ;; --warning) title=$"Warning" ;; *) title=$"Note" ;; esac # Save the prompt in a temporary file because it can have newlines in it tmpfile="$(mktemp || echo "/tmp/steam_message.txt")" echo -e "$*" >"$tmpfile" xterm -T "$title" -e "cat $tmpfile; echo -n 'Press enter to continue: '; read input" rm -f "$tmpfile" fi } function detect_platform() { # Maybe be smarter someday # Right now this is the only platform we have a bootstrap for, so hard-code it. echo ubuntu12_32 } function setup_variables() { STEAMPACKAGE="${0##*/}" if [ "$STEAMPACKAGE" = bin_steam.sh ]; then STEAMPACKAGE=steam fi STEAMCONFIG=~/.steam STEAMDATALINK="$STEAMCONFIG/$STEAMPACKAGE" STEAMBOOTSTRAP=steam.sh LAUNCHSTEAMDIR="$(readlink -e -q "$STEAMDATALINK" || true)" LAUNCHSTEAMPLATFORM="$(detect_platform)" LAUNCHSTEAMBOOTSTRAPFILE="$bootstrapdir/bootstraplinux_$LAUNCHSTEAMPLATFORM.tar.xz" if [ ! -f "$LAUNCHSTEAMBOOTSTRAPFILE" ]; then LAUNCHSTEAMBOOTSTRAPFILE="/usr/lib/$STEAMPACKAGE/bootstraplinux_$LAUNCHSTEAMPLATFORM.tar.xz" fi # Get the default data path STEAM_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}" case "$STEAMPACKAGE" in steam) CLASSICSTEAMDIR="$HOME/Steam" DEFAULTSTEAMDIR="$STEAM_DATA_HOME/Steam" ;; steambeta) CLASSICSTEAMDIR="$HOME/SteamBeta" DEFAULTSTEAMDIR="$STEAM_DATA_HOME/SteamBeta" ;; *) echo $"Unknown Steam package '$STEAMPACKAGE'" exit 1 ;; esac # Create the config directory if needed if [[ ! -d "$STEAMCONFIG" ]]; then mkdir "$STEAMCONFIG" fi } function install_bootstrap() { STEAMDIR="$1" # Save the umask and set strong permissions omask="$(umask)" umask 0077 echo $"Setting up Steam content in $STEAMDIR" mkdir -p "$STEAMDIR" cd "$STEAMDIR" if ! tar xJf "$LAUNCHSTEAMBOOTSTRAPFILE" ; then echo $"Failed to extract $LAUNCHSTEAMBOOTSTRAPFILE, aborting installation." exit 1 fi ln -fns "$STEAMDIR" "$STEAMDATALINK" setup_variables # put the Steam icon on the user's desktop # try to read ~/.config/user-dirs.dirs to get the current desktop configuration # http://www.freedesktop.org/wiki/Software/xdg-user-dirs # shellcheck source=/dev/null test -f "${XDG_CONFIG_HOME:-$HOME/.config}/user-dirs.dirs" && source "${XDG_CONFIG_HOME:-$HOME/.config}/user-dirs.dirs" DESKTOP_DIR="${XDG_DESKTOP_DIR:-$HOME/Desktop}" if [ -d "$DESKTOP_DIR" ] && [ "x$bootstrapdir" = "x/usr/lib/$STEAMPACKAGE" ]; then cp "$bootstrapdir/$STEAMPACKAGE.desktop" "$DESKTOP_DIR" # Older .desktop implementations used the execute bits as # a marker for a .desktop being safe to treat as a shortcut chmod a+x "$DESKTOP_DIR/$STEAMPACKAGE.desktop" if command -v gio >/dev/null; then # Making it executable is not enough in recent # (Ubuntu 20.04) versions of # https://gitlab.gnome.org/World/ShellExtensions/desktop-icons gio set --type=string "$DESKTOP_DIR/$STEAMPACKAGE.desktop" metadata::trusted true || : # Generate an inotify event so the desktop # implementation reloads it touch "$DESKTOP_DIR/$STEAMPACKAGE.desktop" fi fi # Restore the umask umask "$omask" } function repair_bootstrap() { rm -f "$STEAMDATALINK" && ln -s "$1" "$STEAMDATALINK" setup_variables } function check_bootstrap() { if [[ -n "$1" && -x "$1/$STEAMBOOTSTRAP" ]]; then # Looks good... return 0 else return 1 fi } # Don't allow running as root if [ "$(id -u)" == "0" ]; then show_message --error $"Cannot run as root user" exit 1 fi # Look for the Steam data files setup_variables if ! check_bootstrap "$LAUNCHSTEAMDIR"; then # See if we just need to recreate the data link if check_bootstrap "$DEFAULTSTEAMDIR"; then echo $"Repairing installation, linking $STEAMDATALINK to $DEFAULTSTEAMDIR" repair_bootstrap "$DEFAULTSTEAMDIR" elif check_bootstrap "$CLASSICSTEAMDIR"; then echo $"Repairing installation, linking $STEAMDATALINK to $CLASSICSTEAMDIR" repair_bootstrap "$CLASSICSTEAMDIR" fi fi if [[ ! -L "$STEAMDATALINK" ]]; then # We don't have the data link and we couldn't find an existing bootstrap, so just install the bootstrap install_bootstrap "$DEFAULTSTEAMDIR" elif ! check_bootstrap "$LAUNCHSTEAMDIR"; then # We have the data link but we can't find the data, prompt the user if zenity --question --text=$"Couldn't find Steam content, did you move it?" --ok-label=$"Search" --cancel-label=$"Reinstall"; then while true; do STEAMDIR="$(zenity --file-selection --directory)" if [[ -z "$STEAMDIR" ]]; then # User canceled exit 0 fi if check_bootstrap "$STEAMDIR"; then repair_bootstrap "$STEAMDIR" break; else show_message --error $"Please pick a valid Steam content directory" fi done else install_bootstrap "$DEFAULTSTEAMDIR" fi fi if ! check_bootstrap "$LAUNCHSTEAMDIR"; then show_message --error $"Couldn't set up Steam data - please contact technical support" exit 1 fi # go to the install directory and run the client cp "$LAUNCHSTEAMBOOTSTRAPFILE" "$LAUNCHSTEAMDIR/bootstrap.tar.xz" cd "$LAUNCHSTEAMDIR" exec "$LAUNCHSTEAMDIR/$STEAMBOOTSTRAP" "$@" ```

Maybe this helps as a comparison point against Manajaro packages.

robkorv commented 4 years ago

After reading about you guys having different ways to start Steam, while Ubuntu doesn't have that... I thought lets try again and install it from the Ubuntu repo instead of getting the deb from the steam site. I noticed that it did something different in the background then the installer from the steam site. Don't know what yet, I currently do not have time to look at the sources for the Ubuntu steam installer.

But the good news is that I don't have the audio problems this way. I have been streaming to my Rasberry Pi 3 steam link for 6 hours now without any problems. This in on Ubuntu 20.04. See https://github.com/ValveSoftware/steam-for-linux/issues/6749#issuecomment-620723628 that I did have audio problems when using the deb from the steam site.

romanovzky commented 4 years ago

Not super happy results, but we are starting to observe some different outcomes depending on the package and the associated library versioning.

It seems that right now Manjaro users are stick to two options that neither work, but once the culprit is identified I can fill a bug with Manjaro package maintainers.

I'm eager to see further developments on this.

ashtonx commented 4 years ago

I'm on arch however afair I still had issues on native, will test it again when i have some more time. It might give a comparable setup.

vonWolfens commented 4 years ago

@ashtonx I too have issues running with steam-native the other version works for me

romanovzky commented 4 years ago

It feels like we are hitting a dead-end on debugging...

vonWolfens commented 4 years ago

Sadly yes, I still have not found the time to test my behaviour further, I still think we should investigate the library differences between my runtime and native version

ghost commented 4 years ago

As a Manjaro user I'd be happy to help out as well, if there is any testing I could be doing?

ashtonx commented 4 years ago

So I did some testing, for me the issue happens on both native and runtime.

ashtonx commented 4 years ago

and here's my log on native, i believe it began crackling around midnight, maybe a little before. https://gist.github.com/ashtonx/9f6dc3ef2eac1fb5ef213aef714791ff

it seems like around time it began to crackle delivery delay started increasing a lot.

romanovzky commented 4 years ago

Apart from preliminary results from @vonWolfens , anyone else has different behaviour by changing between steam-native and steam-runtime/manjaro? (for arch-based distros).

And are there reports of a working linux installation? If so, could we have a full list of dependencies and their versions of such working example, so that we can cross-check versioning.

robkorv commented 4 years ago

Ubuntu 20.04:

romanovzky commented 4 years ago

It's difficult to compare, as many packages are different and we don't know what the differences are between Steam's pacakge and debian repo packages in Ubuntu.

The arch (and variants) packages, which neither work (apart from some preliminary testing by @vonWolfens ) are listed hhere:

For Manjaro and Arch I found these:

The versions of each dependency will be the whatever highest is available in the repositories.

njfox commented 4 years ago

Sorry I don't have a whole lot to add, but I've been having this problem since forever streaming from an Arch Linux host to both an Arch Linux laptop and a steam link. I've always used steam-runtime so that version is definitely broken as well as native.

Trezamere commented 4 years ago

I was having this problem on Steam Link hardware and then bought an NVidia Shield and am still having this problem. The benefit that it's a lot easier to fix on the shield as I can just close the app and relaunch; whereas with the steam link I had to shut-down both the link and the host iirc.

Host system:

          /:-------------:\          
       :-------------------::        ------------- 
     :-----------/shhOHbmp---:\      OS: Fedora 32 (Thirty Two) x86_64 
   /-----------omMMMNNNMMD  ---:     Host: X570 AORUS MASTER -CF 
  :-----------sMMMMNMNMP.    ---:    Kernel: 5.7.7-200.fc32.x86_64 
 :-----------:MMMdP-------    ---\   Uptime: 31 mins 
,------------:MMMd--------    ---:   Packages: 2317 (rpm), 21 (flatpak) 
:------------:MMMd-------    .---:   Shell: bash 5.0.17 
:----    oNMMMMMMMMMNho     .----:   Resolution: 1920x1080, 1920x1080 
:--     .+shhhMMMmhhy++   .------/   DE: Xfce 
:-    -------:MMMd--------------:    WM: Xfwm4 
:-   --------/MMMd-------------;     WM Theme: Nordic 
:-    ------/hMMMy------------:      Theme: Nordic [GTK2], Adwaita [GTK3] 
:-- :dMNdhhdNMMNo------------;       Icons: korla [GTK2], Adwaita [GTK3] 
:---:sdNMMMMNds:------------:        Terminal: xfce4-terminal 
:------:://:-------------::          Terminal Font: Monospace 12 
:---------------------://            CPU: AMD Ryzen 9 3900X (24) @ 3.800GHz 
                                     GPU: NVIDIA GeForce RTX 2070 SUPER 
                                     Memory: 3387MiB / 32112MiB
romanovzky commented 4 years ago

I've just noticed a behaviour which is not similar across every case. In my case, where I stream to a laptop running Manjaro, I do not have to close the Steam application after the sounds goes completely, I just need to exit the game and restart it again through stream, but keep Steam running. For those of you running on Steam Link and/or other embedded devices, I get the impression that you have to completely reboot the device or the app. Is that right?

JustEnoughDucks commented 4 years ago

@romanovzky For my Linux/Link connecton, I have to shut down the stream and restart it. I do not have to restart Steam or the Steam Link. I have not tried restarting Steam, but that would have the same effect since I have to terminate to connection to fix it.

jp1995 commented 4 years ago

@romanovzky Same as @bpgerber, have to shut down the stream through the on screen menu, then reconnect to the Host through the steam link menu. No need to completely reboot anything.

romanovzky commented 4 years ago

That makes sense. Steam link streams the big picture from the host, therefore you'd need to stop the stream instead of just relaunching the game (which you can when streaming to a laptop client).

Sirnanigans commented 3 years ago

I have been experiencing this problem for a while, at least a year, on Arch myself. Just tonight I got fed up and tried some troubleshooting to determine if it's PulseAudio, Steam, or the Link. I first did the following:

  1. Began streaming via the Steam Link
  2. Set the audio recording device for the stream to Monitor of USB Audio Device (HTC Vive) in pavucontrol (Steam records a monitor of the game's output device and feeds that to the link)
  3. Waited until the audio distorted and cut out
  4. Switched the stream input from Monitor of USB Audio Device to Monitor of Schiit Hel (Amp/DAC for my speakers)
  5. Switched the game's output to Schiit Hel

The result was that the audio remained distorted even after switching to a different source for the stream and playing the game over that. I did test to confirm that it's not the game so this means that the distortion is affecting any and all audio capture by Steam. Still doesn't narrow things down much, so then I did...

  1. Began streaming via the Steam Link
  2. Set the recording device for the steam to Monitor of USB Audio Device
  3. Opened a media player to play music to USB Audio Device
  4. Confirmed that audio was playing clearly (although a tiny bit crackly) through the Steam Link
  5. Began recording Monitor of USB Audio Device via Audacity
  6. Waited until the audio became corrupted
  7. Played back the recording on Audacity

Through this I found that the recording by Audacity was still clear. The monitor device that Steam was using to send audio to the Link was functioning just fine. Steam must be the culprit here. All systems are functioning just fine up until somewhere between Steam handling the audio and the Link sending it to the TV. I'm no professional in computers or digital audio so hopefully this is helpful for someone who can use this information.

megatog615 commented 3 years ago

The issue occurs even with Remote Play Together. Audio on connecting player crackles and disappears after a period of time.

I think the problem lies with the host Steam application.

romanovzky commented 3 years ago

I have to admit that I'm disappointed that this issue is not getting enough attention from Steam maintainers... The problem persists, even after many driver, encoding/decoding libs, linux kernels, etc updates...

Flameslice commented 3 years ago

@romanovzky I do agree it is disappointing to have posted this issue 9 months ago and have heard absolutely nothing from a dev at Valve, even despite the logs, as much debugging as we can do, updates, etc. All I feel anyone can do on our end beyond what we've done now is wait for someone to give this a lookover.

robkorv commented 3 years ago

With Ubuntu (and many other distros judging from this thread) is that the problem is fixed when you use the steam installer that's in the repo of you distribution, instead of using the one on https://store.steampowered.com/about/. I don't have time to spit through the installer source of Ubuntu, but I just did a fresh install and I notice that something was running that was pinning some dependencies. Hmm, now I even can't find the source code anymore. Last time I could find the code base on launchpad by clicking on one of the links on this page: https://packages.ubuntu.com/focal/steam.

Flameslice commented 3 years ago

@robkorv I'd go out on a whim and say that with all the quality troubleshooting going on here the majority of us have installed steam through our distro's repos. In addition, the problem occurring even on SteamOS makes it fairly clear it's not just a packaging issue, even if that might contribute.

Sirnanigans commented 3 years ago

I hear that Steam offers the Link software for installation on a Linux machine, such as a Raspberry Pi. I suppose the next (and final?) step is to build the software for a device and tinker with that to confirm that it's not the Link.

I don't know what else can be done to troubleshoot the host client. Is it possible to reset pulseaudio mid-stream and thus reset the Steam host's audio capture? I'm not at my PC and iirc steam will fail to reset its audio streams if pulseaudio is terminated (pulseaudio - k) while it's running.

Fjoggs commented 3 years ago

I hear that Steam offers the Link software for installation on a Linux machine, such as a Raspberry Pi. I suppose the next (and final?) step is to build the software for a device and tinker with that to confirm that it's not the Link.

No need to build anything. Just launch Steam on a second device and remote play from there to verify. My personal experience is that the steam link is not relevant here. It happens on my laptop as well, running remote play through Steam.

Sirnanigans commented 3 years ago

I hear that Steam offers the Link software for installation on a Linux machine, such as a Raspberry Pi. I suppose the next (and final?) step is to build the software for a device and tinker with that to confirm that it's not the Link.

No need to build anything. Just launch Steam on a second device and remote play from there to verify. My personal experience is that the steam link is not relevant here. It happens on my laptop as well, running remote play through Steam.

Good thinking. I wonder if logs would show anything funny on the remote remote client then. I have a laptop that I might test this on later. Keyword might, I already setup a workaround with Bluetooth for my use case because this issue seems abandoned by Valve.

megatog615 commented 3 years ago

With Ubuntu (and many other distros judging from this thread) is that the problem is fixed when you use the steam installer that's in the repo of you distribution, instead of using the one on https://store.steampowered.com/about/.

$ sudo apt policy steam steam:i386: Installed: 1.0.0.64-1 Candidate: 1.0.0.64-1 Version table: *** 1.0.0.64-1 500 500 http://deb.debian.org/debian testing/non-free i386 Packages 100 /var/lib/dpkg/status

GitoMat commented 3 years ago

Not sure if I had exactly the same problem. I had cutting out sound on the Steam Link before, but could resolve this by setting the host from 4.0 to stereo sound. This then suddenly stopped working and I had then crackling and cutting out sound on the Steam Link consistently. As the crackling also happened to a lesser extent on the host directly I investigated further and finally found out that the speech-dispatcher package is the culprit. Removing it solved this for me on Ubuntu 20.04. I've now also played on the Steam Link for a bit and it seems the issue is gone. Maybe this helps someone else, too ...