Yellow-Dog-Man / Resonite-Issues

Issue repository for Resonite.
https://resonite.com
111 stars 0 forks source link

Changing audio output by unplugging and plugging heaphones right after (no matter what type, wireless or not) freezes the client and crashes. #1739

Closed mrkbx closed 1 week ago

mrkbx commented 1 month ago

Describe the bug?

Title explains.

To Reproduce

Unplug headphones from your PC when using them as an audio output for resonite, then replug them in.

Expected behavior

Resonite doesn't freeze or crash and continues normally.

Screenshots

No response

Resonite Version Number

2024.4.17.208

What Platforms does this occur on?

Windows

What headset if any do you use?

Desktop

Log Files

DESKTOP-4RMO1K3.-.2024.4.17.208.-.2024-04-17.12_40_56.log

Additional Context

No response

Reporters

mrkbx

Frooxius commented 1 month ago

1) Is the toggle to use the system output audio device on or off? 2) If it's off, what is your second device after your primary one in the priority list? 3) Can you provide Player.log file for this as well?

mrkbx commented 1 month ago
  1. It's on
  2. Speakers in my second monitor
  3. Player.log
shiftyscales commented 1 month ago

Hmm- unplugging my headphones from my laptop didn't seem to immediately cause this issue- it switched from outputting to my headphones "Headphones Realtek(R) Audio" to outputting to my Quest 1 "Headphones Oculus Virtual Audio Device", but the client stopped responding after I entered the sound settings in Windows and manually changed the output device to my laptop speakers "Speakers Realtek(R) Audio. Resonite remained uresponsive, so I had to manually force-close it.

Attached are my logs from that session, @Frooxius:

SHIFTY-LAPTOP - 2024.4.17.1420 - 2024-04-18 12_50_04.log Player.log

ohzee00 commented 1 month ago

Just to add my two cents, I've been noticing a uptick of users having freezes and when helping them debug it, it keeps pointing to this issue in particular with disconnecting or reconnecting audio devices as of recently.

Shifty's logs in particular seem really useful, it is weirdly spammed with XR: Error setting active audio output driver. Falling back to default which doesn't seem to stop til Resonite dies

niddey commented 1 month ago

I can make this happen just by toggling bluetooth off and on, while not even having any audio devices currently connected there. Reava_ in the Discord reported having a similar issue. Crashed my game multiple times yesterday when disconnecting a bluetooth headset, but only now figured out why.

I saw nothing in the logs but here they are anyway: Player.log, DESKTOP-OPIM9SR - 2024.4.22.1366 - 2024-04-23 22_26_22.log

Frooxius commented 1 month ago

I can't really get this to happen or glean much useful from the logs.

When you unplug the audio device, is there any other device present in the system? Or is Resonite left with no audio-devices?

The error in Shifty's log seems relevant to Oculus SDK code maybe? But the original report is just desktop, rather than VR/XR.

shiftyscales commented 1 month ago

From some quick testing in desktop mode, Resonite seems to continue running even once all output devices have been disconnected/disabled in Windows.

I'm curious if this could potentially be related to #1704?

Can you give more context on the audio devices that are present on your system (in particular, the number of channels they have, their bit depth/frequency, etc.) @mrkbx @niddey?

If this issue is happening consistently, could you try disabling outputs in Windows one by one until you isolate which audio device seems to be causing the problem?

shiftyscales commented 1 month ago

Actually- I think that might be part of it. I looked into @niddey's log and found: Speakers (Yeti Nano) ChannelsAvailable: 8 Could you disable that particular device and see if the issue persists, @niddey?

In @mrkbx's log however, it seems there isn't any devices with more than two channels- however, there are devices with considerably lower sample rates, e.g. 16KHz Zestaw słuchawkowy (Philips TAH8506 Hands-Free AG Audio) and Zestaw słuchawkowy (Philips TAH8506 Hands-Free AG Audio). Those sound like they could be microphone inputs from the headphones you are disconnecting, @mrkbx(?) Could you also try to eliminate devices to isolate which one in particular causes you to crash?

All of the devices on my machine are between 44.1KHz, and 48KHz with a 16 or 24 bit bit depth- but those all seemed to cause no issues when switching between them- so I'm uncertain why I had crashed that one time- it might be a separate issue.

mrkbx commented 1 month ago

In @mrkbx's log however, it seems there isn't any devices with more than two channels- however, there are devices with considerably lower sample rates, e.g. 16KHz Zestaw słuchawkowy (Philips TAH8506 Hands-Free AG Audio) and Zestaw słuchawkowy (Philips TAH8506 Hands-Free AG Audio). Those sound like they could be microphone inputs from the headphones you are disconnecting, @mrkbx(?) Could you also try to eliminate devices to isolate which one in particular causes you to crash?

I don't think that is causing that? I have set my microphone to a virtual cable. Also, Zestaw słuchawkowy (Philips TAH8506 Hands-Free AG Audio) are the headphones.

niddey commented 1 month ago

My audio output devices are

Input

In the audio enchancements of the Yeti Nano it shows a "Logitech HX2E Surround Sound Effect" so I guess virtual surround thing and thats why it shows up as 8 channels. I disconnected this device and the game still freezes when I disconnect the airpods. If the issue was the same as #1704 I would expect it to also have the unity crash but here the game only freezes forever, maybe still related though.

shiftyscales commented 1 month ago

As mentioned above, could you try disabling your other audio output/input devices one at a time in Windows prior to launching Resonite and see if you can isolate the problem to a particular audio device, @mrkbx, @niddey?

shiftyscales commented 1 month ago

E.g. disable a device, launch Resonite, try disconnecting the headphones/replicating the freeze, and repeat as necessary until all other devices are disabled, or you've found the one that causes the issue.

Dusty-Sprinkles commented 1 month ago

I've been able to replicate this also but instead of plugging in and unplugging an audio device, if I close and reopen nvidia broadcast because I use it as my default output (or it is not open on launch) the game will freeze, though I don't completely crash out it just never comes back

Two logs where I had the issue occur are below

DESKTOP-GCR6JOJ - 2024.4.26.1258 - 2024-04-28 16_11_23.log DESKTOP-GCR6JOJ - 2024.4.26.1258 - 2024-04-28 16_02_11.log

Oh also just for clarity I was also not using system default and when it is on broadcast is my default device on desktop, which is where I was replicating the freeze/crash (Maybe it has to do with a device being added and immediately used?)

(Forgot to grab my player.log but this is very consistent so I can replicate it pretty quickly if it'd help)

niddey commented 1 month ago

I tested disabling all of the audio playback devices and it does not seem to make a difference on what device I leave enabled. If there is no other device enabled except the airpods, then the game does not freeze when they are connected but if there is even a single one enabled it will freeze. Disabling all of the recoding revices also did not make a difference, the result was similar. Game settings were set to use the default output device.

Frooxius commented 3 weeks ago

@Dusty-Sprinkles I'll need the Player.log one for this unfortunately. The normal logs don't show anything.

dragos240 commented 3 weeks ago

I'm getting the same thing. I always have to choose between turning my earbuds off to charge or keep Resonite running.

Here's my Player.log

EDIT, context: I actually started exiting the game, then took off my earbuds and forgot this happened. I'm not sure if that helps.

Frooxius commented 3 weeks ago

Hmm... I'm not really seeing any sort of pattern in any of this yet.

Some parts that complicate this is that I'm not fully clear on replication steps for other reports too. Notably if the default system output device is enabled or disabled, what are the other audio devices on the system and which action specifically causes the freeze.

I'd ideally need some clear way to replicate this behavior on my end, but given that a lot of these reports seem device specific, I'm not sure how to make this happen reliably on my end. I tried turning devices on and off, changing default and so on, but nothing causes Resonite to freeze on my end.

Dusty-Sprinkles commented 3 weeks ago

Here's my player.log Player.log

The steps I personally did were as follows:

  1. Launch resonite with Nvidia Broadcast not open
  2. Playing on desktop so set my default PC devices to my headset microphone and speakers after steamvr finishes launching
  3. Wait for the initial loading lag to go away
  4. Go to Audio settings in Resonite and verify that nvidia broadcast is still shown as a device by default
  5. Open Nvidia Broadcast and Freeze the game

Also potentially notable is that when I launch nvidia broadcast it disappears from the list before freezing

Inucune2 commented 1 week ago

This appears to be caused when an active audio output is connected/disconnected. I have recorded a demonstration of it. In this case i am switching on a set of Jpop Bluetooth earbuds. https://youtu.be/KYI6D-9NNl4

log from this testing attached. Player.log

Frooxius commented 1 week ago

This should be fixed in 2024.5.23.1416 now! I think I found the root cause to be a deadlock.

If this still occurs, comment and we'll reopen this.