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

Steam Remote Play plays sound on both the client and the host, when the "Play sound on host" option is disabled.

Open baatochan opened this issue 5 years ago • 25 comments

Your system information

  • Steam client version (build number or date): steam-manjaro 1.0.0.61-5 (23 August 2019)
  • Distribution (e.g. Ubuntu): Manjaro
  • Opted into Steam client beta?: No
  • Have you checked for system updates?: Yes

Please describe your issue in as much detail as possible:

So the problem looks like Steam on Manjaro can't or don't create a fake output device. It plays the sound on one of the existing ones (you're lucky if it's not used). The situation looks like (when the chosen output is used) the sound is played on normal output and in fact the sound is played on normal speakers and remote TV speakers (the checkbox in settings to leave a sound on the host pc is unchecked).

The only workaround as for now is to leave sound on that output set to 1% because it's barely heard then and on TV speakers everything stays fine (you can't mute the output however because then the stream audio is muted as well).

I can confirm that this bug can be reproduced on 3 manjaro running PCs, while on one linux mint PC everything is fine and the fake output is getting created.

Steps for reproducing this issue:

  1. Install Steam on Manjaro
  2. Connect from Steam Link
  3. Try to play any audio on Manjaro PC

baatochan avatar Sep 19 '19 10:09 baatochan

I'm pretty sure that this reddit post is about that problem (it's not mine post): https://www.reddit.com/r/Steam_Link/comments/c1krmv/steam_link_on_manjaro_audio_issue/

baatochan avatar Sep 19 '19 10:09 baatochan

I dont suppose there has been any progress on this issue? I too have the same problem across different distros. audio plays on host and client (in this case steam link (and app) from Pop_Os/Manjaro

u83rmensch avatar Dec 21 '19 05:12 u83rmensch

Chiming in to say I have the same issue on two separate manjaro installs.

ghost avatar Jan 04 '20 17:01 ghost

I have this problem with Ubuntu, although I think my cause is a little different. I'm connecting from Ubuntu to Windows, and the audio will play on both or only the host. I found a little workaround by disabling the HDMI audio out on Windows but then I have no sound otherwise (when not streaming) because that's how my speakers are connected. I guess in my case it's not specifically related to Linux.

Not all games have issues, but two that do are Sega Mega Drive/Genesis Classics Collection and Atari Vault. On those I get sound only on the host (Windows) unless I disable HDMI audio. The Steam Link app doesn't have this issue and mutes the host correctly.

atylmo avatar Jan 07 '20 08:01 atylmo

Same issue on Pop_OS 19.10

devonallie avatar Feb 13 '20 16:02 devonallie

Experiencing the same problem using Arch. I tried copying the Pulseaudio configuration used in SteamOs into my Arch installation and I was still not able to fix the problem.

Has anybody being able to test if this issue is also there in SteamOs?

UndeadKernel avatar Feb 26 '20 12:02 UndeadKernel

I have the same problem when hosting Steam on any of my Arch installs (Vanilla Arch and Manjaro) - sound is played on Host when streaming via Steam Link or from another PC with steam on in. Corresponding checkbox is off. My workaround is to mute all sounds on Host machine before I try Streaming

ArtemSmaznov avatar Mar 20 '20 18:03 ArtemSmaznov

Another game I'm having this issue with is DiRT Rally 2.0. I'm streaming from my Windows 10 PC to Ubuntu 19.10 and the sound only plays on the Windows side.

Edit: Changing the client streaming quality to "Beautiful" makes it work.

Edit 2: Actually, changing the client quality setting to anything else seems to reset the audio to make it work. You can then change it back and it will still work. I should add that the host is connected to a KVM switch so that might throw a wrench into things.

atylmo avatar Mar 24 '20 01:03 atylmo

Same issue Arch to Arch and Arch to Steam Link. Audio plays on host no matter what. Changing streaming quality did not do anything for me.

joeknock90 avatar Mar 27 '20 19:03 joeknock90

Having the issue as well. "Play audio on Host" is not enabled (in fact, turning it on and off does absolutely nothing, it's a pointless button) and yet the host still plays the sound. I shouldn't have to go into the room the host is in and plug a set of headphones in to spot hearing the game noise in the distant background.

LarnuUK avatar May 31 '20 18:05 LarnuUK

I am on a vanilla install of Ubuntu 20.04 and am experiencing this issue as well. Play Audio on Host is unchecked, but streaming to any other device outputs sound from both the client and the host devices.

gamerminstrel avatar Jun 19 '20 00:06 gamerminstrel

Same here. Arch to Steam Link hardware/application. Never mutes host. Been an issue for as long as I can remember.

parkerlreed avatar Jun 29 '20 16:06 parkerlreed

My issue is similar - audio plays on the host but not on the client (which I have an android nvidia shield). Anyone have tips to getting the audio to play to the shield at least? I can manually turn down my monitor on the host. Host: Manjaro Kernel: 5.7.0.3-MANJARO

Update: July 13 - its working now. I didn't necessarily change anything obvious but maybe an update triggered it to work .

green3g avatar Jul 10 '20 21:07 green3g

Same happens for me on Opensuse Tumbleweed

pingubot avatar Jan 15 '21 19:01 pingubot

Encountering this issue on EndeavorOS (Arch based) with kernel 5.13. Play Audio on Host is unchecked but still audio comes from the host

DeviceLimit avatar Jul 24 '21 23:07 DeviceLimit

Same issue on macOS Mojave.

contentfree avatar Aug 05 '21 17:08 contentfree

Same. Windows 10 pro >>> Ubuntu 21.04 LTS

sunsetrain avatar Aug 07 '21 08:08 sunsetrain

Streaming from Linux Host to Steam Link on PopOS 21.04. I had the same issue. My build in speaker on my desktop was playing and so was my steam link/hdmi. Found a possible fix for this. I went to settings on my steam link and re ran the audio wizard. I changed the outpour from the built in speaker to the built in output (not headset or speaker). I’m thinking either the wizard just needed to be ran or in my case I had to switch the output device since by putting it on built in line out there is no speaker attached. So now all the sound comes through my steam link and works great. Not sure if this can help everyone but I hope it helps some people and please let me know if you want clarification. I wrote this on my phone so I apologize for any miss spellings or confusion.

goffy59 avatar Aug 07 '21 11:08 goffy59

It has been what two years now since this issue has been reported? Valve could easily fix this but don't seem to be interested to, so here is my workaround that I confirmed works with my Steam Link hardware and Manjaro and Pop OS.

NOTE: This automatically mutes the Linux host when you start remote play, but you have to manually restore audio on the host after you stop remote play. More details below. For this workaround, you need to have pulseaudio, pacmd and perl installed.

First, we need to add a null sink to redirect all the audio streams to. So add this line in /etc/pulse/default.pa for system wide or ~/.config/pulse/default.pa for per user settings, and reboot:

load-module module-null-sink sink_name=steamNullSink sink_properties="device.description='Steam Null Sink'"

Second, I had problems with some apps switching active audio streams to a different sink on the fly, so create a file ~/.alsoftrc with the following content to fix that:

[pulse]
allow-moves=yes

Next, create a directory to place all the scripts we are going to create. I placed them in /home/<your-username>/workspace/steam-null-sink.

switch-sink.sh:

This script takes in a sink name as an argument and sets it as the default sink, switches all the applications' audio streams to redirect to the specified sink, and then makes Steam's recorder to monitor this sink.

#!/usr/bin/env bash

case "${1:-}" in
  (""|list)
    pacmd list-sinks |
      grep -E 'index:|name:'
    ;;
  ([a-zA-Z0-9_.-]*)
    echo switching default
    pacmd set-default-sink $1 ||
      echo failed
    echo switching applications
    pacmd list-sink-inputs |
      awk '/index:/{print $2}' |
      xargs -r -I{} pacmd move-sink-input {} $1 ||
        echo failed
    echo switching steam recorder to monitor this source
    pacmd list-source-outputs |
      tr '\n' '\r' |
      perl -pe 's/.*? *index: ([0-9]+).+?application\.process\.binary = "([^\r]+)"\r.+?(?=index:|$)/\2:\1\r/g' |
      tr '\r' '\n'|
      awk -F ":" '/steam/ {print $2}'|
      xargs -r -I{} pacmd move-source-output {} $1.monitor ||
        echo failed
    ;;
  (*)
    echo "Usage: $0 [|list|<sink name to switch to>]"
    ;;
esac

steam-remote-play-monitor-start.sh:

This script monitors Steam's streaming log to check if remote play to Steam Link hardware has started, backs up the current audio device (sink) so that we can restore it later after remote play is stopped, and automatically switches the sink to the null sink we created in the first step using switch-sink.sh!

Now, change STEAMNULLSINK_HOME, STEAM_HOME according to what you are using, change $STEAM_HOME/steam/logs/streaming_log.txt to $STEAM_HOME/debian-installation/logs/streaming_log.txt for Pop OS, and you may have to change the search string "Streaming started to Steam Link" to something else if you aren't using Steam Link hardware like me, not sure.

#!/usr/bin/env bash

export XDG_RUNTIME_DIR="/run/user/$(id -u)"

USERNAME=$(whoami)
STEAMNULLSINK_HOME="/home/$USERNAME/workspace/steam-null-sink"
STEAM_HOME="/home/$USERNAME/.steam"

tail -n 0 -F $STEAM_HOME/steam/logs/streaming_log.txt |
grep --line-buffered 'Streaming started to Steam Link' |
while read; do DEFAULT_SINK=$(pacmd info |  awk -F ":" '/Default sink name:/ {print $2}'); if [[ $DEFAULT_SINK != " steamNullSink" ]]; then echo "$DEFAULT_SINK" > $STEAMNULLSINK_HOME/default-sink.backup; fi; $STEAMNULLSINK_HOME/switch-sink.sh steamNullSink; done

switch-to-default-sink.desktop:

Unfortunately, I couldn't find a way to automatically switch the audio sink back to the original one after stopping remote play on Steam Link. I couldn't find anything in Steam's logs that indicates that remote play has stopped. So I created this desktop shortcut and pinned it to my taskbar so that I can switch back to the original audio sink with just a click. Change all paths again as necessary.

[Desktop Entry]
Version=1.0
Exec=sh -c 'USERNAME=$(whoami); STEAMNULLSINK_HOME="/home/$USERNAME/workspace/steam-null-sink"; DEFAULT_SINK=$(cat $STEAMNULLSINK_HOME/default-sink.backup); $STEAMNULLSINK_HOME/switch-sink.sh $DEFAULT_SINK'
Name=Switch To Default Audio Sink
GenericName=Script
Path=/home/<your-username>/workspace/steam-null-sink
Icon=speaker-icon.jpg
Encoding=UTF-8
Terminal=false
Type=Application
Categories=Utilities;

Give executable permission to all these scripts we have created:

sudo chmod +x steam-remote-play-monitor-start.sh
sudo chmod +x switch-sink.sh
sudo chmod +x switch-to-default-sink.desktop

Finally, schedule cron job to start steam-remote-play-monitor-start.sh automatically at boot: crontab -e Then paste this line in the file, save and reboot: @reboot /home/<your-username>/workspace/steam-null-sink/steam-remote-play-monitor-start.sh

Hope this helps others as well.

pratith avatar Sep 13 '21 03:09 pratith

This issue hit me too...

SO:

$ uname -a

Linux USER-HOSTNAME 5.11.0-43-generic #47~20.04.2-Ubuntu SMP Mon Dec 13 11:06:56 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Steam client application:

Built: Dec 16 2021, at 22:39:26
Steam API: v020
Steam package version: 1639697812

J-Rios avatar Dec 18 '21 14:12 J-Rios

I'm seeing this issue as well on Fedora 35:

[user@host01 ~]$ uname -a Linux host01 5.16.7-200.fc35.x86_64 #1 SMP PREEMPT Sun Feb 6 19:53:54 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Built: Jan 16 2022, at 17:34:49 Steam API: v020 Steam package version: 1642451672

sontarin avatar Feb 12 '22 19:02 sontarin

Seeing the same issue on Endeavor OS

5.16.14-arch1-1

azlekayn avatar Mar 16 '22 22:03 azlekayn

Same issue on Steam Deck.

dusankx avatar Aug 31 '22 16:08 dusankx

Same issue.

YourHuckleberry avatar Sep 18 '22 18:09 YourHuckleberry

Potentially relevant detail from #8810 : using the volume buttons on a Steam Deck client gets passed through to the host to affect its volume settings (volume notification pops up on the host).

CKWarner avatar Sep 21 '22 20:09 CKWarner

I have this problem too, I came up with my own hacky work around, inspired by https://github.com/ValveSoftware/steam-for-linux/issues/6512#issuecomment-917795983 above. Mine is much simpler and may break at any moment.

I just ran ps aux before and during Steam streaming and looked for any new processes. The only new one I found was called steam_monitor. I confirmed that does not show up for me when playing a Steam game directly on my PC. If this breaks, then I may try parsing the logs like @pratith did above.

Then I wrote a shell script that looks for that process and then sets the volume to 10% if it sees it. That's it. You have to set to volume back up later when you are on your PC. 10% was low enough for me, but of course you can choose whatever you want, including 0%. I have the name of the process as an argument you pass into the script so that it's easier to change if that process gets renamed. I just run the script every minute with cron.

I use KDE with PulseAudio, if you use something else you may have to change the pactl command.

#!/bin/sh

# run in cron with:
# * * * * * ~/bin/steam_link_sound.sh steam_monitor >> ~/logs/steam_link_sound.log 2>&1

# ps aux lists all processes
# grep -v grep removes the grep command from that list
# grep -v `basename $0` remove this shell script from that list
# grep -c $1 gets the count of processes that match whatever was passed in as an argument when running this shell script
running=$(ps aux | grep -v grep | grep -v `basename $0` | grep -c $1)

# echo $running

if [ $running -ne 0 ]; then
  # if any processes were found, then set the volume level to 10%
  pactl set-sink-volume @DEFAULT_SINK@ 10%
fi

StephenWetzel avatar Sep 23 '22 21:09 StephenWetzel

Same thing on Mint Cinnamon. I'm guessing this just won't get addressed?

allstar87 avatar Oct 10 '22 07:10 allstar87

Same issue on Fedora 36

jeffshee avatar Oct 28 '22 17:10 jeffshee

Same issue on Ubuntu 22.04

joshsheedy avatar Nov 09 '22 22:11 joshsheedy

Same issue on EndeavourOS (6.0.9-arch1-1)

irfanhakim-as avatar Nov 28 '22 05:11 irfanhakim-as