csgo-osx-linux icon indicating copy to clipboard operation
csgo-osx-linux copied to clipboard

[Linux] Microphone selected via "mic setup" not used in-game

Open Ur0s opened this issue 12 years ago • 6 comments

I have 2 sound cards configured with ALSA on my system.

First (system default) is used for 7.1 output to speakers (hw:0,0). Second is used for microphone input (hw:1,0).

When selecting second device (non default) via "steam voice" or in-game "mic setup", everything works as expected and I can hear myself just fine with "test microphone" feature. Once I get in-game, everyone only hears static when I use "push-to-talk".

One of recent updates broke ability to use microphone from device selected via in-game "mic setup" or "steam voice". As it seems, input and output sound can only be used from one device - "system default" or the one defined via SDLs AUDIODEV env argument.

If I start csgo with

SDL_AUDIODRIVER="alsa" AUDIODEV="hw:1,0"

my second card is selected as "default" for in-game use and other players can hear me fine.

Using two sound cards with CS:GO worked at some point in the past on linux and I could use sound input from one device and output on another - same setup is still used in windows and it works.

Could you please fix this, so that in-game voice would use microphone from device selected via "mic setup" and not from "system default"/AUDIODEV device? Thanks.

steam sysinfo 2014-11-24

Ur0s avatar Nov 05 '14 01:11 Ur0s

Updated issue with some recent SDL param testing.

Ur0s avatar Nov 24 '14 22:11 Ur0s

If anyone else is using similar setup - output via onboard card and microphone from usb headset for instance - is this working for you? How did you make it work?

Ur0s avatar Jan 16 '15 11:01 Ur0s

The in-game voice follows steam's voice config and uses OpenAL under the hood. You may be able to make a custom .alsoftrc config for your user that gives you the desired behavior. Beyond that you can get alsa to give you the behavior you are looking for with a custom .asoundrc, or remove openal from the steam runtime and try a newer system version. Details on how to do this is beyond the scope of this issue tracker.

Closing as there is nothing actionable for a valve dev.

Tele42 avatar Jun 24 '16 18:06 Tele42

Thanks for info, but that doesn't change the fact that in-game "mic setup" uses steam mic settings where you can select desired recording device (everything works as expected with that), but the game itself uses default settings on openal/alsa/pulseaudio directly and completely ignores "mic setup" settings.

That's what was reported here and I for one, consider this a bug.

Also, I am aware of .asoundrc and "capture.pcm" workaround because I've been using it for the past 2 years just for this specific case.

Please reopen the issue.

Ur0s avatar Jun 24 '16 19:06 Ur0s

If it helps anyone else, I was able to set the default mic in PulseAudio from commandline with some insight from https://unix.stackexchange.com/questions/65246/change-pulseaudio-input-output-from-shell. Even if Steam's choice doesn't persist, the "default" from PulseAudio should persist.

The commands:

pactl list short sources
pacmd set-default-source <source_name or source_id>

In my case that turned out to look like:

tricky@desktop ~ % pactl list short sources
1	alsa_output.pci-0000_00_1b.0.analog-surround-21.monitor	module-alsa-card.c	s16le 3ch 44100Hz	RUNNING
2	alsa_input.usb-046d_080a_75075A5C-02.analog-mono	module-alsa-card.c	s16le 1ch 48000Hz	RUNNING
3	alsa_output.usb-Logitech_Logitech_G930_Headset-00.iec958-stereo.monitor	module-alsa-card.c	s16le 2ch 48000Hz	RUNNING
4	alsa_input.usb-Logitech_Logitech_G930_Headset-00.analog-mono	module-alsa-card.c	s16le 1ch 16000Hz	RUNNING
12	alsa_output.pci-0000_01_00.1.hdmi-stereo-extra2.monitor	module-alsa-card.c	s16le 2ch 44100Hz	RUNNING
tricky@desktop ~ % pacmd set-default-source 4

zatricky avatar Jan 06 '19 11:01 zatricky

I noticed that CSGO creates a JACK client called "alsoft", but no sound comes out. All the actual audio is done though Pulse. Adding SDL_AUDIODRIVER="jack" creates an "SDL" client, but its output is messed up, probably because I have a quad channel DAC, and the SDL client has 4 channels as a result, and CSGO is packing stereo interleaved data into a quad channel buffer.

Zipdox2 avatar May 11 '23 14:05 Zipdox2