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

Added support for ALSA dmix audio output (thanks @sylware!) #9753

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

slouken
Copy link
Collaborator

@slouken slouken commented May 10, 2024

Fixes #8577

@slouken
Copy link
Collaborator Author

slouken commented May 14, 2024

I did some testing and this appears to work here, except for hotplug. @sylware, did you test hotplugging different devices?

@sylware
Copy link

sylware commented May 25, 2024

(I will need some time to get used to that code again)

As far as I can recall, I did a bit of hotplug testing-ish with an USB soundcard when I was working that part of the code and I used text logging because dota2 seemed to query the device list only once.

If I recall properly, I used adev->name to give to SDL the "$ctl_card_info_get_name:$pcm_info_get_name" string for its device name via SDL_AddAudioDevice (it seems I presumed SDL to take over the life-cyle of that string then did not add the SDL_free you added, wrong?), but internaly I only keep $pcm_info_get_name in adev->name. If I don't miss anything I can recall, I should have used a different variable name for that.

What is the "git clone" URL for this pull request with your commits? (or is there specific mangled branch name to pull from the main repo?)

(I use noscript/basic (x)hmtl browsers, then I can access only github features which were implemented to interop with those browsers)

@sylware

This comment was marked as duplicate.

@sylware
Copy link

sylware commented May 25, 2024

(oops, I posted twice)

That said, I remember I had to restart dota2 to get it to re-list the audio devices to output sound on the USB soundcard, but text-logging showed but that "internally" the device list seemed to be updated fine by the hotplug code.

@sylware
Copy link

sylware commented May 26, 2024

I did check the SDL_AddAudioDevice call graph, it is properly SDL_strdup the name, so that SDL_free seems missing (amazing you got used to that code that fast and already are catching bugs).

I found how to git clone a github pull request on the web.

Regarding hotplug, we need to test it with $SDL_src/test/testaudiohotplug.c or be sure dota2/cs2 are re-query-ing their audio device list from SDL.

I'll give a try to $SDL_src/test/testaudiohotplug.c soon.

@sylware
Copy link

sylware commented May 28, 2024

by the way, I send you an email about this months ago (don't trust spam filters too much, as they filter out home hosted smtp servers... which benefits a lot big tech email services). icculus email is bluntly blocked to home hosted smtp servers, missing grey listing....

@sylware
Copy link

sylware commented May 28, 2024

I retested dota2 SDL3 build but with your modifications and with your SDL test code which I did minimal-ized.

Hotplug is working fine on my end, tested with a USB soundcard.

The minimal-ized testing code is here,
testaudiohotplug_minimal.c :

https://paste.c-net.org/PodiumAdvice

(note, I added SDL_AUDIO_ALSA_PCM_CAPTURE and SDL_AUDIO_ALSA_PCM_PLAYBACK environment variables to allow a user to be able force specific alsa pcms different for capture and playback)

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

Successfully merging this pull request may close these issues.

[dota2][PATCH][Draft] alsa broken,
2 participants