Placeholder-Software / Dissonance

Unity Voice Chat Asset
69 stars 5 forks source link

[bug] Crashes on Windows Standalone Unity HLAPI #142

Closed ro-anders closed 5 years ago

ro-anders commented 5 years ago

Context

Added Dissonance to an existing Unity HLAPI project. Worked great on Mac (both in the editor and as a standalone application) and works on Windows in the editor, but when I run it as a standalone application it crashes a couple seconds after the NetworkManager connects. I created a brand new project from scratch on Windows following the Dissonance Quick Start docs and that worked. Standalone Windows application did not crash. I created a second brand new project again following the Dissonance Quick Start only this one had the same project name as my original project - that was the only difference. This one crashes.

Steps to Reproduce

Provide a detailed set of steps to reproduce the problem

  1. Created brand new project following Dissonance Quick start guide https://dissonance.readthedocs.io/en/latest/Basics/Quick-Start-UNet-HLAPI/ (though I selected a 2D game instead of the default 3D)
  2. Clicked Build & Run
  3. Chose output folder
  4. When application came up, clicked on "LAN Host (H)" on Network Manager HUD
  5. Windows firewall popup comes up about allowing listening on a port, but before I can even allow it the application crashes
  6. Tried building and running again now that Windows knows it can allow listening, but application still dies with 1-2 seconds

Your Environment

Include as many relevant details about the environment you experienced the bug in

The PC has no internal microphone, but a USB headset.

The logs are not much help

Initialize engine version: 2018.2.16f1 (39a4ac3d51f6)
GfxDevice: creating device client; threaded=1
Direct3D:
    Version:  Direct3D 11.0 [level 11.1]
    Renderer: Intel(R) HD Graphics 530 (ID=0x1912)
    Vendor:   
    VRAM:     1639 MB
    Driver:   23.20.16.4973
Begin MonoManager ReloadAssembly
- Completed reload, in  2.184 seconds
<RI> Initializing input.

<RI> Input initialized.

<RI> Initialized touch support.

UnloadTime: 4.674770 ms
[Dissonance:Core] (16:49:45.461) DissonanceComms: Loading default playback prefab

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

[Dissonance:Core] (16:49:46.100) DissonanceComms: Starting Dissonance Voice Comms
- Network: [DissonanceSetup (Dissonance.Integrations.UNet_HLAPI.HlapiCommsNetwork)]
- Quality Settings: [Quality: Medium, FrameSize: Medium, FEC: True, DenoiseAmount: High, VoiceDuckLevel: 0.75]
- Codec: [Codec: Opus, FrameSize: 1920, SampleRate: 48kHz]

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

[Dissonance:Network] (16:49:49.695) HlapiServer: Constructing host. SessionId:572579242

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

[Dissonance:Network] (16:49:49.697) HlapiServer: Connected

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

[Dissonance:Recording] (16:49:50.167) BasicMicrophoneCapture: Began mic capture (SampleRate:44100Hz, FrameSize:882, Buffer Limit:2^13, Latency:20ms, Device:'')

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

[Dissonance:Network] (16:49:50.754) ConnectionNegotiator`1: Received handshake response from server, joined session '572579242'

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

[Dissonance:Recording] (16:49:51.127) BasePreprocessingPipeline: Lost 258 samples in the preprocessor (buffer full), injecting silence to compensate

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

[Dissonance:Recording] (16:49:51.142) BasePreprocessingPipeline: Lost 882 samples in the preprocessor (buffer full), injecting silence to compensate

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

[Dissonance:Recording] (16:49:51.158) BasePreprocessingPipeline: Lost 882 samples in the preprocessor (buffer full), injecting silence to compensate

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

[Dissonance:Recording] (16:49:51.192) BasePreprocessingPipeline: Lost 882 samples in the preprocessor (buffer full), injecting silence to compensate

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

[Dissonance:Recording] (16:49:51.209) BasePreprocessingPipeline: Lost 882 samples in the preprocessor (buffer full), injecting silence to compensate

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

[Dissonance:Recording] (16:49:51.242) BasePreprocessingPipeline: Lost 882 samples in the preprocessor (buffer full), injecting silence to compensate

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

[Dissonance:Recording] (16:49:51.259) BasePreprocessingPipeline: Lost 882 samples in the preprocessor (buffer full), injecting silence to compensate

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

[Dissonance:Recording] (16:49:51.275) BasePreprocessingPipeline: Lost 882 samples in the preprocessor (buffer full), injecting silence to compensate

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

[Dissonance:Recording] (16:49:51.292) BasePreprocessingPipeline: Lost 882 samples in the preprocessor (buffer full), injecting silence to compensate

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

[Dissonance:Recording] (16:49:51.309) BasePreprocessingPipeline: Lost 882 samples in the preprocessor (buffer full), injecting silence to compensate

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

[Dissonance:Recording] (16:49:51.342) BasePreprocessingPipeline: Lost 882 samples in the preprocessor (buffer full), injecting silence to compensate

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

[Dissonance:Recording] (16:49:51.359) BasePreprocessingPipeline: Lost 882 samples in the preprocessor (buffer full), injecting silence to compensate

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

[Dissonance:Recording] (16:49:51.359) BasePreprocessingPipeline: Lost 882 samples in the preprocessor (buffer full), injecting silence to compensate

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

[Dissonance:Recording] (16:49:51.444) BasePreprocessingPipeline: Lost 882 samples in the preprocessor (buffer full), injecting silence to compensate

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

[Dissonance:Recording] (16:49:51.444) BasePreprocessingPipeline: Lost 882 samples in the preprocessor (buffer full), injecting silence to compensate

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

[Dissonance:Recording] (16:49:51.444) BasePreprocessingPipeline: Lost 882 samples in the preprocessor (buffer full), injecting silence to compensate

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

[Dissonance:Recording] (16:49:51.444) BasePreprocessingPipeline: Lost 882 samples in the preprocessor (buffer full), injecting silence to compensate

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

[Dissonance:Recording] (16:49:51.475) BasePreprocessingPipeline: Lost 882 samples in the preprocessor (buffer full), injecting silence to compensate

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

[Dissonance:Recording] (16:49:51.492) BasePreprocessingPipeline: Lost 882 samples in the preprocessor (buffer full), injecting silence to compensate

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

[Dissonance:Recording] (16:49:52.681) BasePreprocessingPipeline: Lost 882 samples in the preprocessor (buffer full), injecting silence to compensate

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Those last lines are repeated about twenty times until the log suddenly ends.

ro-anders commented 5 years ago

Follow up: If I change the name of my original project (which mains changing the top level folder name AND changing Product Name in Player Settings) it runs without crashing. I know Unity stores some settings in the Windows registry under the project name. My best guess is that one of those settings (wish I knew what it was) is causing it to crash. But a fresh set of settings is ok.

Would really feel more comfortable if I knew why it was just crashing, but can move forward with workaround of renaming project.

martindevans commented 5 years ago

What is the name of the project which breaks things?

If you're interesting in narrowing it down Dissonance does all of it's serialization in one of two ways:

You could easily copy VoiceSettings.cs/Preferences.cs into a new project with the broken name and see if any of that breaks.

Unfortunately I don't think there's anything we can do to fix this, even if we worked out the key that's breaking things we can't change it without breaking settings for every single end user of Dissonance. You should definitely report it to Unity though - submit the repro project you made including Dissonance as a bug report and references this issue. Hopefully they will fix it in 2019.2.

ro-anders commented 5 years ago

The name wasn't anything special. "H2HAdventure". I'll look at those files, but those are under the project directory, so would be used regardless of the name. I was thinking of settings Unity stores outside of the project, though on more research, the number of settings they stick in the registry is extremely limited, and mostly to do with window size. So I am back to having no idea why it works when I rename it.

But, I was hoping maybe you'd have a "Oh yeah, we've seen this before" response. It does seem to be a Unity issue, and though I'm terrified it will crop up again, I don't think there's much more you can do.

Feel free to close the issue. Thanks.

martindevans commented 5 years ago

I'll have a fiddle with this to see if I can reproduce+narrow it down and report something to Unity. Definitely not something we've seen before though!