ValveSoftware / Dota-2

Tracker for issues specific to Linux and Mac in the Reborn client. If you have a general issue or non-system-specific feature request please go to dev.dota2.com
470 stars 38 forks source link

SDL Audio Driver issue, not defaulting to pipewire and attempting to use ALSA #2491

Closed alou-S closed 9 months ago

alou-S commented 1 year ago

There seems to be a new issue that causes Dota2 to try and use ALSA as a backend instead of trying pipewire or pulse first.

Similar issue can be seen in Counter Strike 2 too. -sdlaudiodriver pipewire seems to be a bandaid fix for the issue.

ghost commented 1 year ago

I can also confirm this and it is really annoying! As you can't control the game volume from the system itself.

Using -sdlaudiodriver pipewire or -sdlaudiodriver pulseaudio results in the game detecting no audio devices in my end.

safield commented 1 year ago

I have no audio at all on ubuntu 22.04. Is this related, or should I create a new issue?

MisterrrX commented 1 year ago

I have no audio at all on ubuntu 22.04. Is this related, or should I create a new issue?

It's probably a result of this issue.

nh2 commented 1 year ago

Same here on Ubuntu 22.04, no sound and using -sdlaudiodriver pipewire or -sdlaudiodriver pulseaudio results in no audio devices being detected. Using the default shows the audio devices, but no sound is audible.

Notably, there is no entry for Dota 2 in pavucontrol any more, when before it did exist.

petebowden commented 1 year ago

Same on Fedora 37. -sdlaudiodriver pipewire did work to restore system control of the audio

n0rc commented 1 year ago

I'm using Pipewire on NixOS and had no sound on my default sound device after the patch.

Another sound device worked for me but then I could not use it with my voice chat software anymore. It seems that Dota currently puts an exclusive lock on the sound device, at least with my config.

Starting Dota with -sdlaudiodriver pipewire worked for me to get the sound back on my default device without any other issues.

nh2 commented 1 year ago

@alou-S, on which Linux distribution did -sdlaudiodriver pipewire help for you?

Based on @n0rc's and @petebowden's comments I suspect this workaround only works on distros that have PipeWire (Ubuntu 22.04 does not by default).

alou-S commented 1 year ago

Yes ofc it only works on distros that have pipewire. I am using Arch Linux.

andrelbc commented 1 year ago

Same here, I have pulseaudio and using -sdlaudiodriver pulseaudio results in no device detected as well.

rogermparent commented 1 year ago

Confirmed with -sdlaudiodriver pipewire fixing it for me on Arch.

Ori-Pixel commented 1 year ago

Confirmed all possible -sdlaudiodriver commands do not work on pulseaudio systems (but they are recognized in launch options in console without errors).

XANi commented 1 year ago

Same on Debian 12, no sound with or without those switches (system running on pulseaudio)

icculus commented 1 year ago

I'm assigning this to myself under the assumption this is an SDL bug.

Qunas101 commented 1 year ago

Have this problem on EndeavourOS with pipewire. Game just ignores pipewire and plays sound with my monitor's speakers with no way to control it

Edit: My device selection looks like this зображення

"HD-Audio Generic..." actually makes the game use my earphones. Still, pipewire doesn't know about dota and can't adjust audio levels.

neimovirne commented 1 year ago

https://github.com/ValveSoftware/Dota2-Gameplay/issues/12247

same here

rkmax commented 1 year ago

I have the same issue. I have installed pipewire. fixed with -sdlaudiodriver pipewire

dssouza-ti commented 1 year ago

Same here. I use Ubuntu Mate 23.04, which comes with pipewire, so using -sdlaudiodriver pipewire solved the issue for me.

lewisdiamond commented 1 year ago

-sdlaudiodriver pipewire helps, however the game now crashes randomly which might be due to audio issues since there's audible audio artifacts (audio sounding stuck).

tgabore commented 1 year ago

Sound works now, but it prevents playback of other audio while DotA is running(Ubuntu 22.04).

EDIT: Starting the game with while other audio plays results in no ingame audio.

paboum commented 1 year ago

dmesg output:

[799804.726833] snd_hda_intel 0000:01:00.1: IRQ timing workaround is activated for card #1. Suggest a bigger bdl_pos_adj.
[799882.181111] snd_hda_intel 0000:06:00.0: IRQ timing workaround is activated for card #2. Suggest a bigger bdl_pos_adj.
deppong commented 1 year ago

I can also confirm this and it is really annoying! As you can't control the game volume from the system itself.

Using -sdlaudiodriver pipewire or -sdlaudiodriver pulseaudio results in the game detecting no audio devices in my end.

Same issue here, running Arch Linux.

ConnahGriffin commented 1 year ago

Same issue on Manjaro.

-sdlaudiodriver pipewire nor -sdlaudiodriver pulseaudio does nothing.

After trying different things. It seems the sound doesn't work properly if other programs are using it at the same time. I'm using headphones alone as sound so that may be part of the problem. It worked when I have nothing else use the sound, but only partially ie some sounds will not play at all.

Edit: Forgot to add that it sometimes crashes out of the blue mid game. with dmesg dota2[65039]: segfault at 38 ip 00007fd7a13d23e4 sp 00007ffe3c36a9b0 error 4 in libclient.so[7fd79fca7000+2f5e000]

epssy commented 1 year ago

Running with -sdlaudiodriver pipewire works on Ubuntu 23.04.

Though after 5-15 minutes the sound will cut out anyway and the odd time the game will crash to desktop! :rocket:

sixpounder commented 1 year ago

I can confirm -sdlaudiodriver pipewire works on Fedora 38, otherwise the "default device" points to the wrong device (headphones instead of line out in my case)

Josjfs commented 1 year ago

It does not work on bluetooth headphones but works on laptop.

Like a separate entity. All other games, browser and etc audios go straight to bluetooth headphones. Only dota go straight to laptop.

MacOxJunDude commented 1 year ago

I can also confirm this and it is really annoying! As you can't control the game volume from the system itself.

Using -sdlaudiodriver pipewire or -sdlaudiodriver pulseaudio results in the game detecting no audio devices in my end.

I have the same problem

filipejunqueira commented 1 year ago

Same here. Using pop-os. Only dota2 is audioless. Started since the last update.

MacOxJunDude commented 1 year ago

The problem is easily solved by installing pipewire using the commands:

pactl info - (Server name: PulseAudio) sudo apt install pipewire-audio-client-libraries libspa-0.2-bluetooth libspa-0.2-jack wireplumber sudo apt remove pulseaudio-module-bluetooth systemctl --user --now enable wireplumber.service reboot After reboot => pactl info - (Server name: PulseAudio (on PipeWire 0.3.48)) Adding launch key -sdlaudiodriver pipewire. After these steps everything worked for me.

bendanm commented 1 year ago

I had the same issue after the 2023 TI compendium announcement update.

I was in Fedora 38 with Steam installed via flatpak. Neither -sdlaudiodriver pipewire or -sdlaudiodriver pulseaudio worked for me, even with the socket=pulseaudio enabled when I checked flatseal.

Uninstalled steam from flatpak and installed it from rpmfusion-nonfree. The sound was still bugged after a clean install, but using -sdlaudiodriver pipewire fixed things for me.

sixpounder commented 1 year ago

I suspect the problem is not with Dota itself, Counter-Strike 2 shows the same exact problem

alou-S commented 1 year ago

I had the same issue after the 2023 TI compendium announcement update.

I was in Fedora 38 with Steam installed via flatpak. Neither -sdlaudiodriver pipewire or -sdlaudiodriver pulseaudio worked for me, even with the socket=pulseaudio enabled when I checked flatseal.

Uninstalled steam from flatpak and installed it from rpmfusion-nonfree. The sound was still bugged after a clean install, but using -sdlaudiodriver pipewire fixed things for me.

There is another method for making it work via flatpak Either use flatpak override --user --filesystem=$XDG_RUNTIME_DIR/pipewire-0 com.valvesoftware.Steam

Or if you use flat-seal permissions use this xdg-run/pipewire-0

smcv commented 1 year ago

This will probably need looking at separately for users of Steam via Flatpak, and users of Steam without Flatpak (installed via .deb or rpmfusion or equivalent). We do not need any more reports saying "me too": to keep the signal-to-noise ratio high enough that we can find a proper solution to this, please only comment here if you have significant new information to add.

For users of Steam without Flatpak, it's the Steam Linux Runtime framework that is responsible for making your PulseAudio or Pipewire socket available to the container where Dota 2 runs. The code that is used here is very similar to what Flatpak uses, but is under Steam Linux Runtime's control (it's part of the pressure-vessel tool).

For users of Steam via Flatpak, it's Flatpak that is responsible for this. If we end up needing code changes in pressure-vessel to make this work, then Flatpak will likely need similar changes.

cristianofurtadoba commented 1 year ago

I have the same problem after yesterday's update. In other games everything works, but in Dota, when I open it, the sound on discord, YouTube doesn't work. The bug is in Dota. Fedora 38 and Opensuse TW. Here Pipeware

cristianofurtadoba commented 1 year ago

There seems to be a new issue that causes Dota2 to try and use ALSA as a backend instead of trying pipewire or pulse first.

Similar issue can be seen in Counter Strike 2 too. -sdlaudiodriver pipewire seems to be a bandaid fix for the issue.

this command does not resolve it. disables the sound.

icculus commented 1 year ago

Ok, I can see what's going wrong now, stay tuned everyone.

cristianofurtadoba commented 1 year ago

Ok, I can see what's going wrong now, stay tuned everyone.

I am 100% available

ConnahGriffin commented 1 year ago

Ok, I can see what's going wrong now, stay tuned everyone.

stares intensely

Edit: This is/was meant as a joke.

cristianofurtadoba commented 1 year ago

here the solution to csgo2 and dota 2. Working with discord + speechchat + dota 2 + Obs Studio. SDL_AUDIO_DRIVER=pipewire %command% -nojoy -novid

safield commented 1 year ago

here the solution to csgo2 and dota 2. Working with discord + speechchat + dota 2 + Obs Studio. SDL_AUDIO_DRIVER=pipewire %command% -nojoy -novid

This is not a complete solution, as Ubuntu LTS does not even use pipewire yet.

cristianofurtadoba commented 1 year ago

SDL_AUDIO_DRIVER=pipewire %command% -nojoy -novid

SDL_AUDIO_DRIVER=pulseaudio %command% -nojoy -novid

test

cm-t commented 1 year ago

Same result here:

Ubuntu 22.04 LTS with installed with the Steam installer package.

No sound on default devices (analog device headset), I can still see sound devices in dota2 audio option, but switching to my headset doesnt work. (Steam in-game overlay on dota2 can display a webrowser with sound successfuly in headset).

Dota2 not listed anymore in applications using the sound in gnome settings

vlc, discord, teamspeak, firefox, everywhere the sound works fine in headset, dota2 can only output on others devices such as screen stereo or usb sound card loud speaker…

-sdlaudiodriver pipewire or -sdlaudiodriver pulseaudio did not work.


Note: I made the sound work once by doing this: on session opening, choose headset device in gnome panel, launch dota2. But this end by muting all the other apps on the headset, means i will have people on discord on loud speakers…
not solving the issue, not an acceptable workaround.

deppong commented 1 year ago

Arch Linux with pulseaudio installed here, SDL_AUDIO_DRIVER=pulseaudio %command% -novid -nojoy results in the same issue where it says no devices. With this parameter not included I can only select from my hardware like others and it overrides the hardware device.

icculus commented 1 year ago

(We're working on it, it's definitely a bug on our end that we are staring at intensely right now, and not something wrong on your system, so we don't need any more reports until we push a new build. Thanks everyone!)

lewisdiamond commented 1 year ago

(We're working on it, it's definitely a bug on our end that we are staring at intensely right now, and not something wrong on your system, so we don't need any more reports until we push a new build. Thanks everyone!)

Are the crashes related to this or should a different issue be created?

icculus commented 1 year ago

Are the crashes related to this or should a different issue be created?

Let's revisit this question after we push a fix; it possible that we're finding out there's a bug in our pipewire code (or PipeWire has a bug) from all the people that temporarily started using that instead of PulseAudio, but otherwise, I'm assuming the crashes are NOT directly related. Sit tight and if there are still crashes once this bug is settled, open new issues.

cristianofurtadoba commented 1 year ago

SDL_AUDIO_DRIVER=pulseaudio %command% -nojoy -novid

test

SDL_AUDIO_DRIVER=pulseaudio %command% -nojoy -novid

cristianofurtadoba commented 1 year ago

Arch Linux with pulseaudio installed here, SDL_AUDIO_DRIVER=pulseaudio %command% results in the same issue where it says no devices. With this parameter not included I can only select from my hardware like others and it overrides the hardware device.

This is command. Fedora 38 and OpenSuse Tw Working SDL_AUDIO_DRIVER=pulseaudio %command% -nojoy -novid

or

SDL_AUDIO_DRIVER=pipewire %command% -nojoy -novid

drmmwlt commented 1 year ago

Exacty same issue of @ConnahGriffin , on Manjaro Gnome with pulseaudio

cm-t commented 1 year ago

image

I just had this dota2 update, it this update is supposed to fix the bug?

(if no, it seems it fixed the issue on my ubuntu 22.04 LTS, so it is was not supposed to fix it, maybe it's because i did something i don't remember as a workaround)

(if yes, thank you for the fast patch !)


Edit: after all, not sure it is fixed, alt tabbed to firefox and the sound wasnt working there.
Closing dota2 made the sound re work in firefox, and sound was like it was queued, and only satrted to be played after dota2 has been closed :/
Re-launching dota2 : sound still muted , waiting for another update, good luck !!

werefkin commented 1 year ago

A solution that worked for me. For ubuntu users (e.g. 22.04) where pipewire is not (fully) installed.

  1. Install pipewire sudo apt install pipewire-media-session- wireplumber
  2. reboot sudo reboot
  3. Force Dota with a launching option: -sdlaudiodriver pipewire

optional: check with pactl info, in my case Server Name: PulseAudio (on PipeWire 0.3.48)