ValveSoftware / SteamOS

SteamOS community tracker
1.6k stars 70 forks source link

Screen Sharing in Game Mode from Discord, Firefox, Google Meet, etc shows only black screen for some games #1659

Open IsaacFehr opened 1 month ago

IsaacFehr commented 1 month ago

Your system information

Please describe your issue in as much detail as possible:

Screen sharing features of various applications work as expected in Desktop Mode. But in Game Mode, many games show only a black screen, yet stream audio correctly. A few games do stream correctly in Game Mode. But interestingly, this behavior is consistent accross many applications that support screensharing, pointing to a problem with SteamOS's Game Mode.

I have experienced the same problem with these screen sharing clients:

Group 1: Games I've tested that stream their window correctly in both Game Mode and Desktop Mode:

Group 2: Games that stream only in Desktop mode but show only a black screen in Game Mode (but audio comes through) :

I have tested all combinations of Game Mode and Dekstop Mode for Discord Desktop Client, Discord on Firefox, Google Meet on Firefox, and Zoom with Resident Evil, Bomb Rush Cyberfunk, and Fear and Hunger 2. Their results were consistent with the categories above. The exception was Zoom, which worked on Desktop, but in Game Mode wouldn't recognize any windows to stream.

Notes:

Steps for reproducing this issue:

  1. In Steam, download the games listed above
  2. In Desktop Mode, go to the discover store and install Firefox, and the combination of streaming apps you'd like to test
  3. In the Steam Client, add the streaming apps as non-steam games
  4. Open Games for Testing from the list above (preferably one from Group 1 and one from Group 2, e.g. Fear and Hunger and Hades)
  5. Open streaming apps for testing:
    1. Discord:
      1. Join an empty voice channel in a server to test, or call a test account
      2. Click "Share Screen"
      3. You should see a selection window pop up with preview screens showing the apps you have open.
      4. All games in both categories above should show the contents of their windows correctly
      5. Optional: You can test the full pipeline by starting the screen share and using a test account to verify the windows are being streamed properly. But in my experience, the other user's view has matched the preview windows that come up before sharing a screen.
    2. Discord on Firefox: Complete the same steps above in Firefox
    3. Google Meet:
      1. Go to meet.google.com, click "start an instant meeting"
      2. Click the "Share Screen Button"
      3. A firefox dialogue will pop up asking you to select a window.
      4. From the drop down, select a window, and their preview will show up.
      5. Verify each window works as expected
    4. Zoom
      1. Start an empty meeting
      2. Click "Share screen"
      3. Verify the window previews show up correctly in the new window
  6. Switch to Game Mode
  7. Open 2 games for testing
  8. Follow the same steps as above to test the streaming apps. This time, verify that the games in Group 1 preview their windows correctly, while the games in Group 2 show only a black screen.

As a side note: my Steam Deck handled having 3 streaming apps and 2 games open at once in both Game Mode and Desktop mode with no issues. That's pretty incredible in terms of system stability and performance.

matte-schwartz commented 1 month ago

for some additional context on why this happens and is not a simple implementation in gamescope, this may be helpful: https://github.com/ValveSoftware/gamescope/issues/1563#issuecomment-2395263411

L0um15 commented 3 weeks ago

This is wayland issue that gamemode runs on, try using desktop mode which uses X11. To workaround discord on wayland try using Vesktop from flatpak repository

pixelyloaf commented 1 week ago

I used the default discord flatpak and disabled hardware acceleration then it worked, no audio though