-
Notifications
You must be signed in to change notification settings - Fork 1
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
Fix to play SDL_audio on current device by default #23
Conversation
dartfnm
commented
Aug 31, 2024
- There was no sound in quaesar because it uses the sound SDL_Audio device at index 0, not the current audio device in the OS. So now it will choose the current OS audio device unless the user has explicitly specified a different device in the config.
- There was no sound in quaesar because it uses the sound SDL_Audio device at index 0, not the current audio device in the OS. So now it will choose the current OS audio device unless the user has explicitly specified a different device in the config.
Thanks for the PR. It seems that the function is missing in some version (?) of SDL2
Any idea here? |
Yes, it is strange according to the documentation this function was added in 2022 in SDL version 2.24.0. Line 222 in d4ddb42
But I don't know how to do it correctly on Linux. |
The way it works is that the system version of SDL is used on Linux and for Windows an included version is used. As listed above
It seems to only happen on Ubuntu 20.04 which is an older version. I try to allow coming the code for older systems. My guess is that the older of Ubuntu has an older version of SDL2 installed, but maybe it's possible to to update the installed SDL2 version. Otherwise it might be possible with an #ifdef that checks the SDL version if the function is included or not. It seems that |
What I think the best approach here is to use #if SDL_VERSION_ATLEAST(2, 24, 0)
... code that uses SDL_GetDefaultAudioInfo(...)
#endif So older SDL2 versions will still work, but just not get the default audio device selected. |
- There was no sound in quaesar because it uses the sound SDL_Audio device at index 0, not the current audio device in the OS. So now it will choose the current OS audio device unless the user has explicitly specified a different device in the config.
All right, done. |
Fixed it in 2nd commit, but I don't know how to run the CI check again. It didn't start automatically. |
Yeah, the maintainer has to trigger the CI manually for new user PRs (it's because in the past bots open up tons of PR on many repos and because CI started the injected crypto mining and what not) |
Seems to pass now. Thanks for the fix! |
* Fix to play SDL_audio on current device by default - There was no sound in quaesar because it uses the sound SDL_Audio device at index 0, not the current audio device in the OS. So now it will choose the current OS audio device unless the user has explicitly specified a different device in the config. * Fix to play SDL_audio on current device by default - There was no sound in quaesar because it uses the sound SDL_Audio device at index 0, not the current audio device in the OS. So now it will choose the current OS audio device unless the user has explicitly specified a different device in the config.