|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0006428||Spring engine||General||public||2020-11-30 00:36||2020-11-30 00:36|
|Product Version||104.0 +git|
|Target Version||Fixed in Version|
|Summary||0006428: Handle audio device changes while engine is running|
|Description||Tested while playing Beyond All Reason.|
Turning on my bluetooth headphonees changes the audio device in windows, audio continues to come out of my speakers rather than the headphones.
Im running Windows 10
|Steps To Reproduce||1. Open Beyond All Reason, listen to audio coming out of speakers|
2. Turn on bluetooth headphones or change default audio device in windows (see screenshot)
3. Notice audio continues to come out of speakers, doesnt change to the new default audio device.
|Additional Information||Other apps such as Spotify or Chrome correctly change to the new audio device.|
I have had a brief look at the code and see if it was something simple.
It looks like the engine uses OpenAL, unfortunately im not very familiar with it or CPP in general but from the looks of this Stack Overflow there is no obvious easy event to listen for in OpenAL: https://stackoverflow.com/questions/31171021/handling-device-change-in-openal
So im guessing an event would need to be listened for around here: https://github.com/spring/spring/blob/develop/rts/System/Sound/OpenAL/Sound.cpp#L62
Then the device would need to be re-initted somehow like it is done so here: https://github.com/spring/spring/blob/develop/rts/System/Sound/OpenAL/Sound.cpp#L363
Theres a lot of threading stuff going on in there so im really not sure.
|Checked infolog.txt for Errors||Irrelevant|
|2020-11-30 00:36||mikeysee||New Issue|
|2020-11-30 00:36||mikeysee||File Added: pNf0JRy1WC.png|
|2020-11-30 00:36||mikeysee||Tag Attached: audio|
|2020-11-30 00:36||mikeysee||Tag Attached: device|