Page 1 of 1
[Donion] [2.0.11] Long black screen wait before loading screen when no audio device available
Posted: Sat Oct 26, 2024 11:30 pm
by Usul
When launching the game with no audio device available, there is a long (ca. 40 seconds) unresponsive wait with a black screen, before the loading/logo screen appears.
Upon reaching the main menu, the usual and familiar message "could not initialize audio" appears.
In 1.1, when no audio devices are available, the game launches near-instantly to the loading/logo screen regardless, and then shows that message in the main menu. There is no long wait with black screen!
Please fix this.
I am often required to play the game without sound (USB Loudspeakers switched off, USB Headphone Amp switched off, Windows 11 showing "no audio device installed" in taskbar).
Re: [2.0.11] Long black screen wait before loading screen when no audio device available
Posted: Sun Oct 27, 2024 1:13 am
by robot256
I saw this as well and reported it during the beta. The logfile shows a series of five "Failed to open audio device X. Retrying with default audio device". Which makes no sense because it was the default device that failed the last four times too.
Re: [2.0.11] Long black screen wait before loading screen when no audio device available
Posted: Sun Oct 27, 2024 3:59 am
by AstralPhoenix
I'd like to note that I alt-tabbed to change audio device in bottom right with windows 10 and crashed my factorio. Possibly unrelated, but worth mentioning, imo.
Re: [2.0.11] Long black screen wait before loading screen when no audio device available
Posted: Sun Nov 03, 2024 12:52 pm
by Rseding91
Looking at the logic - the issue is coming from SDL's audio system specifically I found this part:
Code: Select all
const Uint64 timeout = SDL_GetTicks64() + 8000; /* intel's audio drivers can fail for up to EIGHT SECONDS after a device is connected or we wake from sleep. */
Which suggests to me that it's working as intended however the intent is that - you have an audio device installed - and if you don't, you get to wait for this crazy timeout. I don't have a nice answer for that. You could always pass --disable-audio which will skip all of this logic and just start with audio disabled.
Re: [2.0.11] Long black screen wait before loading screen when no audio device available
Posted: Sun Nov 03, 2024 9:19 pm
by Usul
Rseding91 wrote: ↑Sun Nov 03, 2024 12:52 pm
Looking at the logic - the issue is coming from SDL's audio system specifically I found this part:
Code: Select all
const Uint64 timeout = SDL_GetTicks64() + 8000; /* intel's audio drivers can fail for up to EIGHT SECONDS after a device is connected or we wake from sleep. */
Which suggests to me that it's working as intended however the intent is that - you have an audio device installed - and if you don't, you get to wait for this crazy timeout. I don't have a nice answer for that. You could always pass --disable-audio which will skip all of this logic and just start with audio disabled.
Thanks but nah, I will not use a start parameter to bypass a 40 second wait, that simply was non-existant before 2.0. To accept this as intended behaviour and a workaround instead of a fix is sadly a step backwards.
Re: [Donion] [2.0.11] Long black screen wait before loading screen when no audio device available
Posted: Mon Nov 04, 2024 11:50 am
by Donion
Thanks for the report, the issue is fixed for the next release, 2.0.15.
When there is no audio device found, the game will no longer try to initialize one anyway.
Re: [Donion] [2.0.11] Long black screen wait before loading screen when no audio device available
Posted: Wed Nov 06, 2024 5:45 pm
by Donion
Sigh. I've introduced a new crash when trying to switch audio device when initially there were none. That is now fixed for the next release, 2.0.16.
Re: [Donion] [2.0.11] Long black screen wait before loading screen when no audio device available
Posted: Wed Nov 06, 2024 5:51 pm
by Usul
Thanks for the fix and fix of the regression!