This project has moved and is read-only. For the latest updates, please go here.

Intermittent Crash with NVorbis + Unity

Jul 14, 2016 at 6:15 PM
First I want to preface this with a thank you for maintaining this project! It's been a lifesaver.

Unfortunately, I'm running into issues with NVorbis with Unity though. Audio samples are read into unity using VorbisReader.ReadSamples, and for the most part it runs great. Unfortunately, rarely I've been getting audio related crashes, and the crash log seems to indicate the possibility of an error with NVorbis. The stack trace is as follows:
  ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 38062266)
0x38062266 (steamclient) 
0x0622A99C (Mono JIT Code) NVorbis.BufferedReadStream:set_Position (long)
0x0622A935 (Mono JIT Code) NVorbis.Ogg.ContainerReader:PacketReadByte (long)
0x0622A8D0 (Mono JIT Code) NVorbis.Ogg.Packet:ReadNextByte ()
0x0622A6D4 (Mono JIT Code) NVorbis.DataPacket:TryPeekBits (int,int&)
0x062352B1 (Mono JIT Code) NVorbis.VorbisCodebook:DecodeScalar (NVorbis.DataPacket)
0x062353AE (Mono JIT Code) NVorbis.VorbisResidue/Residue2:WriteVectors (NVorbis.VorbisCodebook,NVorbis.DataPacket,single[][],int,int,int)
0x062339A9 (Mono JIT Code) NVorbis.VorbisResidue/Residue0:Decode (NVorbis.DataPacket,bool[],int,int)
0x06233727 (Mono JIT Code) NVorbis.VorbisResidue/Residue2:Decode (NVorbis.DataPacket,bool[],int,int)
0x06232FE5 (Mono JIT Code) NVorbis.VorbisStreamDecoder:UnpackPacket (NVorbis.DataPacket)
0x062328AD (Mono JIT Code) NVorbis.VorbisStreamDecoder:DecodeNextPacket ()
0x06232569 (Mono JIT Code) NVorbis.VorbisStreamDecoder:ReadSamples (single[],int,int)
0x06232324 (Mono JIT Code) NVorbis.VorbisReader:ReadSamples (single[],int,int)
0x06230DED (Mono JIT Code) Assets.Scripts.Core.Audio.AudioLayer:OnAudioFilterRead (single[],int)
I'm not actually sure if this is NVorbis related or not, but I thought I'd put this out since I'm not certain exactly what else could be causing a crash with that kind of stack trace.
Jul 14, 2016 at 6:33 PM

I don't _think_ this is NVorbis, but is there a way you could upload a stripped down repro project so I can look at it? Send me the link privately if you need to.

Jul 16, 2016 at 9:39 PM
I'm trying to create a repo case, but it seems rather intermittent so I'm having trouble reproducing it reliably. I do have another stack trace, which is a little different. It could be a unity audio handling bug, wouldn't be the first time that's been the case. Here's the stack trace again though.
  ERROR: SymGetSymFromAddr64, GetLastError: 'The specified module could not be found.' (Address: 4806E158)
  ERROR: SymGetModuleInfo64, GetLastError: 'A dynamic link library (DLL) initialization routine failed.' (Address: 4806E158)
0x4806E158 ((<unknown>)) 
0x06E19BB0 (Mono JIT Code) NVorbis.BufferedReadStream:ReadByte ()
0x06E19AEA (Mono JIT Code) NVorbis.Ogg.ContainerReader:PacketReadByte (long)
0x06E19A70 (Mono JIT Code) NVorbis.Ogg.Packet:ReadNextByte ()
0x06E19874 (Mono JIT Code) NVorbis.DataPacket:TryPeekBits (int,int&)
0x06E24539 (Mono JIT Code) NVorbis.VorbisCodebook:DecodeScalar (NVorbis.DataPacket)
0x06E24636 (Mono JIT Code) NVorbis.VorbisResidue/Residue2:WriteVectors (NVorbis.VorbisCodebook,NVorbis.DataPacket,single[][],int,int,int)
0x06E22B49 (Mono JIT Code) NVorbis.VorbisResidue/Residue0:Decode (NVorbis.DataPacket,bool[],int,int)
0x06E228C7 (Mono JIT Code) NVorbis.VorbisResidue/Residue2:Decode (NVorbis.DataPacket,bool[],int,int)
0x06E22185 (Mono JIT Code) NVorbis.VorbisStreamDecoder:UnpackPacket (NVorbis.DataPacket)
0x06E21A4D (Mono JIT Code) NVorbis.VorbisStreamDecoder:DecodeNextPacket ()
0x06E21709 (Mono JIT Code) NVorbis.VorbisStreamDecoder:ReadSamples (single[],int,int)
0x06E214C4 (Mono JIT Code) NVorbis.VorbisReader:ReadSamples (single[],int,int)
0x06E212AD (Mono JIT Code) Assets.Scripts.Core.Audio.AudioLayer:OnAudioFilterRead (single[],int)
0x06E2141F (Mono JIT Code) (wrapper runtime-invoke) <Module>:runtime_invoke_void__this___object_int (object,intptr,intptr,intptr)
0x100F12E9 (mono) mono_set_defaults
0x1005D968 (mono) mono_runtime_invoke