Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default audio sink not respect by gamescope session #1195

Open
Kidswiss opened this issue Jun 1, 2024 · 10 comments
Open

Default audio sink not respect by gamescope session #1195

Kidswiss opened this issue Jun 1, 2024 · 10 comments

Comments

@Kidswiss
Copy link

Kidswiss commented Jun 1, 2024

Describe the bug

When I change my default audio sink via:

pactl set-default-sink alsa_output.pci-0000_0b_00.1.hdmi-surround-extra3

and then start a gamescope-session, it will reset it to another sink.

What did you expect to happen?

That the default sink set by pactl is not changed.

Output of rpm-ostree status

Deployments:
● ostree-image-signed:docker://ghcr.io/ublue-os/bazzite-deck-gnome:stable
                   Digest: sha256:2fe1600a06aa6827efcdb9854b5349d50c685629655125732ccb42c6758925bd
                  Version: 40.20240427.0 (2024-04-27T22:40:11Z)
          LayeredPackages: eza gparted htop kitty ncdu zsh
            LocalPackages: lact-libadwaita-0.5.4-0.x86_64

Hardware

AMD Ryzen 7 5800X, AMD 6800

Extra information or context

No response

@KyleGospo
Copy link
Member

Default audio is set by Wireplumber. This matches how SteamOS handles this. You'll need to configure that.

@Kidswiss
Copy link
Author

Kidswiss commented Jun 2, 2024

Thanks for the answer.

Unfortunately with wpctl it doesn't work either. As soon as the gamescope session starts, the default gets reset.

it happens either when rebooting or switching to desktop and back to gamescope session.

@ChaosBlades
Copy link

Wireplumber is the most convoluted thing that a normal user would need to use I have ran across in my time using linux. It is like needing to change cam timing in order to turn on your windshield wipers. Spent a week trying to get it to work with no success.

For whatever reason wpctl status does not list inactive sinks. Need to go old school in order to avoid further convoluted nonsense.

You don't need to use sudo for any of this.

pactl list

You are looking for the name and output you want to use. Change yours to whatever you need them to be. I will just list what I need to use.

Name: alsa_card.pci-0000_09_00.1
output:hdmi-surround-extra3

nano ~/.config/systemd/user/set-surround.service

[Unit]
Description=Set Sink in PipeWire (user session)

[Service]
Type=oneshot
ExecStart=sh -c "sleep 30; /usr/bin/pactl set-card-profile alsa_card.pci-0000_09_00.1 output:hdmi-surround-extra3"

[Install]
WantedBy=default.target

systemctl --user daemon-reload
systemctl --user enable set-surround.service
systemctl --user start set-surround.service

On boot it will wait 30 seconds and switch the audio sink.

@WeslyG
Copy link

WeslyG commented Jun 26, 2024

@ChaosBlades Thank you so much for this detailed guide, I managed to do it a little differently.

For some reason, the output option didn't work for me, I tried different options, but it worked strangely.
i use this command

pactl list sinks short

46      alsa_output.pci-0000_03_00.1.hdmi-stereo-extra3 PipeWire        s32le 2-channel 4800  SUSPENDED
47      alsa_output.pci-0000_00_1f.3.iec958-stereo      PipeWire        s32le 2-channel 4800  SUSPENDED

my systemd unit looks like this

[Unit]
Description=Set Sink in PipeWire (user session)

[Service]
Type=oneshot
ExecStart=sh -c "sleep 30; /usr/bin/pactl set-default-sink alsa_output.pci-0000_03_00.1.hdmi-stereo-extra3"

[Install]
WantedBy=default.target

Of course, you need to make sure that everything works

systemctl --user daemon-reload
systemctl --user enable set-surround.service
systemctl --user start set-surround.service

and now the sound appears steadily after turning on the system after 30 seconds. It's much better than switching it every time)

@RayBa82
Copy link

RayBa82 commented Aug 14, 2024

There are so many audio issues since the update to Fedora 40, this cant be the solution.
There is defintely an issue, witch breaks anything. I cant't get to manage 5.1 audio to work since the update to Fedora 40.

And this worked before the update perfectly without telling all the users to fiddle around with any configuration files. Absolutley annoying...

Telling your users to handle some configuration files for a feature which worked before without that shit is not acceptable.

@KyleGospo
Copy link
Member

Telling your users to handle some configuration files for a feature which worked before without that shit is not acceptable.

PRs are open

@RayBa82
Copy link

RayBa82 commented Aug 14, 2024

Sorry my language, but I am struggling with this issue since a long time. Found a first workaround after the update to Fedora 40, but this is not working anymore. And now I can`t use my nice sound setup anymore :-(

But I really appreciate your response, and I will definetly give you feedback if my issues are resolved.
Try to identify the PRs now ;-)

@RayBa82
Copy link

RayBa82 commented Aug 20, 2024

@KyleGospo I could not find any PRs related to this issue, could you tell me which they are?
Because I am really eager to test them.

This issue is for me related to #912 where I am struggling to get my sound setup working

@GloriousEggroll
Copy link

GloriousEggroll commented Sep 21, 2024

@KyleGospo I could not find any PRs related to this issue, could you tell me which they are? Because I am really eager to test them.

This issue is for me related to #912 where I am struggling to get my sound setup working

He was stating that PRs are open as in -- if you think something can be done better, you're welcome to create a PR to try to fix it.

This is an open project. The devs do not owe you anything. Being disrespectful will get you nowhere.

@Kidswiss
Copy link
Author

This feels somewhat related:

40.20240922.0 completely breaks surround for me in gamescope session. Usually it works when setting it to surround in desktop mode and then switching back to gamescope. I can still set surround in desktop mode, but switching to gamescope will only produce stereo sound. I tried some solutions from #912, but they don't seem to work.

Rolling back to any version prior to seems to fix it again. Checking the commits, I see that gamescope got bumped, maybe that broke it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants