PC [BUG] Game hangs when audio output changes in Win10

Noordzee

Newcomer
First noticed when my bluetooth earbuds died and the pc automatically changed audio output to the built in speakers. The game immediately stopped responding. It happens whether the earbuds die or whether I manually change the output to speakers. If the audio is already on speakers and I turn on earbuds, then every other sound from the laptop is coming through the earbuds but the game is stuck on speakers with no way to change it. The earbuds in question are JBL Free. The game doesn’t generate a crash report. The game is bought from steam, version 1.5.4
 

Attachments

UlyanaLeyana

Planter
First noticed when my bluetooth earbuds died and the pc automatically changed audio output to the built in speakers. The game immediately stopped responding. It happens whether the earbuds die or whether I manually change the output to speakers. If the audio is already on speakers and I turn on earbuds, then every other sound from the laptop is coming through the earbuds but the game is stuck on speakers with no way to change it. The earbuds in question are JBL Free. The game doesn’t generate a crash report. The game is bought from steam, version 1.5.4
Check the audio settings in the system:
Run the game, then
Start Menu->Settings->System->Sound->App volume and device preferences->StardewValley
set StardewValley to default
If that doesn't work, try putting forced output through a specific device or use Reset button
or you can adjust master output for sounds manually


If you have any program that chooses where to output sound, then the settings must be applied there too.
After that restart you game.
 

Noordzee

Newcomer
Run the game, then
Start Menu->Settings->System->Sound->App volume and device preferences->StardewValley
set StardewValley to default
If that doesn't work, try putting forced output through a specific device or use Reset button
Thanks for your help, but it didn't work, including reset button. The game doesn't see the earbuds unless they were connected before it was launched, and changing between the two through the settings still makes it crash :frown:
 

UlyanaLeyana

Planter
Thanks for your help, but it didn't work, including reset button. The game doesn't see the earbuds unless they were connected before it was launched, and changing between the two through the settings still makes it crash :frown:
The game pick up the sound settings at the start of the launch (exactly at this moment) and the sound output for game can't be switched while playing. That is how game works! Just stop changing audio devices while playing and it will be fine. LOL
 

Avium

Newcomer
The game pick up the sound settings at the start of the launch (exactly at this moment) and the sound output for game can't be switched while playing. That is how game works! Just stop changing audio devices while playing and it will be fine. LOL
And what about people using wireless headsets when the battery dies? Windows removes the device at that point and the game locks up. This is bad.

There are notification events in the MMDeviceAPI using the IMMNotificationClient that can be used to catch the device change. I'm not sure how tricky that would be to add to the codebase but Windows expects the program to register that callback and handle the change internally.

I will note that Stardew Valley is not the only game I've played that doesn't handle the device change gracefully.

EDIT to add the game only hangs when the default device is removed. If you add a device - like plugging in a new headset - Windows changes the default device and Stardew Valley stops playing sounds but it doesn't crash.
 
Last edited:

Noordzee

Newcomer
And what about people using wireless headsets when the battery dies? Windows removes the device at that point and the game locks up. This is bad.
Yeah, this was exactly my problem and it's sad to see that there is no way to fix it (yet?). I've never come across it in other programs or games so it just completely threw me. It's also made worse by the fact that SDV has no save on exit and the headset's window of when it starts to beep warning of low battery is about a full in-game day. So it always turns that last day into a countdown clock to do the things I already started and not lose the whole day to either saving or crashing
 
Top