Yellow-Dog-Man / Resonite-Issues

Issue repository for Resonite.
https://resonite.com
140 stars 2 forks source link

Exception processing audio clip: Didn't find suitable codec for ogg. #1321

Open RobertBaruch opened 9 months ago

RobertBaruch commented 9 months ago

Describe the bug?

I've recorded a bunch of audio, some just short words, some longer sentences. I import them, and normalize their volume. The longer sentences always result in an exception, while the shorter files normalize just fine.

To Reproduce

Expected behavior

The file normalizes. Instead, I get an error.

Screenshots

No response

Resonite Version Number

2024.2.5.848

What Platforms does this occur on?

Windows

What headset if any do you use?

Oculus Pro

Log Files

DESKTOP-83DJ9R8 - 2024.2.5.848 - 2024-02-08 14_44_29.log

Additional Context

The original file (zipped) la telero kaj la forko estas sur la tablo.zip

Reporters

Xekri

Frooxius commented 9 months ago

It looks like the Vorbis codec is having issue with this particular file for some reason.

It might be worth trying to validate it with this tool first to check if it's corrupted: https://www.xiph.org/oggz/

Either way, we'll likely have to escalate this to NVorbis library itself and see if they can fix the support there. However our NVorbis is in a weird state, where the newer version has a bunch of other issues, so we're using an older one, so it might take a bit of time to fix this.

TisFoolish commented 9 months ago

It might be worth trying to validate it with this tool first to check if it's corrupted

I had to dig through the wayback machine to find a working URL for the Oggz Windows binaries, but I validated it. No known errors.

Frooxius commented 9 months ago

Thanks!

We'll have to fix that with NVorbis. There's two ways: 1) We just report it to the upstream repo and see if they fix it, then port the fix to our fork 2) If anybody's interested into looking into this and opening PR for our fork directly: https://github.com/Yellow-Dog-Man/NVorbis

RobertBaruch commented 8 months ago

I compiled the latest NVorbis from upstream, tested its TestApp with the problematic file, and it read just fine. I'll take a look at the YDM fork.

RobertBaruch commented 8 months ago

And it works with the fork.

RobertBaruch commented 8 months ago

Doublechecked with latest Resonite (2024.2.12.1430). Still fails.

System.NotSupportedException: Didn't find suitable codec for ogg. Errors:
System.IO.InvalidDataException: Invalid data format.
  at NVorbis.Residue0.Init (NVorbis.Contracts.IPacket packet, System.Int32 channels, NVorbis.Contracts.ICodebook[] codebooks) [0x00125] in <56cad8aaf0024e71a2d5268d660e2493>:0 
  at NVorbis.StreamDecoder.LoadBooks (NVorbis.Contracts.IPacket packet) [0x000f5] in <56cad8aaf0024e71a2d5268d660e2493>:0 
  at NVorbis.StreamDecoder.ProcessHeaderPacket (NVorbis.Contracts.IPacket packet, System.Func`2[T,TResult] processAction, System.Action`1[T] doneAction) [0x00003] in <56cad8aaf0024e71a2d5268d660e2493>:0 
  at NVorbis.StreamDecoder.ProcessHeaderPackets (NVorbis.Contracts.IPacket packet) [0x0006c] in <56cad8aaf0024e71a2d5268d660e2493>:0 
  at NVorbis.StreamDecoder..ctor (NVorbis.Contracts.IPacketProvider packetProvider, NVorbis.Contracts.IFactory factory) [0x00058] in <56cad8aaf0024e71a2d5268d660e2493>:0 
  at NVorbis.VorbisReader+<>c.<.cctor>b__83_1 (NVorbis.Contracts.IPacketProvider pp) [0x00006] in <56cad8aaf0024e71a2d5268d660e2493>:0 
  at NVorbis.VorbisReader.ProcessNewStream (NVorbis.Contracts.IPacketProvider packetProvider) [0x00005] in <56cad8aaf0024e71a2d5268d660e2493>:0 
  at NVorbis.Ogg.ContainerReader.ProcessNewStream (NVorbis.Contracts.IPacketProvider packetProvider) [0x00016] in <56cad8aaf0024e71a2d5268d660e2493>:0 
  at NVorbis.Ogg.PageReader.AddPage (System.Int32 streamSerial, System.Byte[] pageBuf, System.Boolean isResync) [0x000cf] in <56cad8aaf0024e71a2d5268d660e2493>:0 
  at NVorbis.Ogg.PageReaderBase.AddPage (System.Byte[] pageBuf, System.Boolean isResync) [0x00017] in <56cad8aaf0024e71a2d5268d660e2493>:0 
  at NVorbis.Ogg.PageReaderBase.ReadNextPage () [0x0005e] in <56cad8aaf0024e71a2d5268d660e2493>:0 
  at NVorbis.Ogg.ContainerReader.FindNextStream () [0x00020] in <56cad8aaf0024e71a2d5268d660e2493>:0 
  at NVorbis.Ogg.ContainerReader.TryInit () [0x00000] in <56cad8aaf0024e71a2d5268d660e2493>:0 
  at NVorbis.VorbisReader..ctor (System.IO.Stream stream, System.Boolean closeOnDispose) [0x00030] in <56cad8aaf0024e71a2d5268d660e2493>:0 
  at CSCore.Codecs.OGG.NVorbisSource..ctor (System.IO.Stream stream) [0x00033] in <4165a20a5a074586b5273d9de2590291>:0 
  at CSCore.Codecs.CodecFactory+<>c.<.ctor>b__2_3 (System.IO.Stream s) [0x00000] in <4165a20a5a074586b5273d9de2590291>:0 
  at CSCore.Codecs.CodecFactory.GetCodec (System.IO.Stream stream, System.String extension) [0x00065] in <4165a20a5a074586b5273d9de2590291>:0 
RobertBaruch commented 8 months ago

Maybe the problem is further up in AudioX, after the normalization step? Maybe Elements.Assets.VorbisEncoder isn't doing the right thing?


  at CSCore.Codecs.CodecFactory.GetCodec (System.IO.Stream stream, System.String extension) [0x00160] in <4165a20a5a074586b5273d9de2590291>:0 
  at Elements.Assets.CSCoreSampleDecoder.Load (System.IO.Stream stream, System.String extension) [0x00080] in <9cb4cc28b40c4fab901157b3be0acbe6>:0 
  at Elements.Assets.CSCoreSampleDecoder..ctor (System.IO.Stream stream, System.String extension) [0x00006] in <9cb4cc28b40c4fab901157b3be0acbe6>:0 
  at Elements.Assets.AudioX.LoadFromStream (System.IO.Stream stream, System.String extension) [0x00000] in <9cb4cc28b40c4fab901157b3be0acbe6>:0 
  at Elements.Assets.AudioX.FinishEncode (Elements.Assets.ISampleEncoder encoder, Elements.Assets.AudioEncodeSettings encodeSettings) [0x00039] in <9cb4cc28b40c4fab901157b3be0acbe6>:0 
  at Elements.Assets.AudioX.TrimAndProcess[S] (System.Int32 start, System.Int32 count, Elements.Assets.SampleFilter`1[S] sampleFilter, Elements.Assets.SampleChunkFilter`1[S] chunkFilter, Elements.Assets.RawSampleFilter rawFilter) [0x0030e] in <9cb4cc28b40c4fab901157b3be0acbe6>:0 
  at Elements.Assets.AudioX.TrimAndProcess (System.Int32 start, System.Int32 count, Elements.Assets.RawSampleFilter rawFilter) [0x0001f] in <9cb4cc28b40c4fab901157b3be0acbe6>:0 
  at Elements.Assets.AudioX.ProcessRawSamples (Elements.Assets.RawSampleFilter filter) [0x00008] in <9cb4cc28b40c4fab901157b3be0acbe6>:0 
  at Elements.Assets.AudioX.AdjustVolume (System.Single multiply) [0x0000d] in <9cb4cc28b40c4fab901157b3be0acbe6>:0 
  at Elements.Assets.AudioX.Normalize () [0x00010] in <9cb4cc28b40c4fab901157b3be0acbe6>:0 
  at FrooxEngine.StaticAudioClip+<>c.<Normalize>b__22_0 (Elements.Assets.AudioX a) [0x00000] in <6450ba452eef4b15a58558870451eee7>:0 
  at FrooxEngine.StaticAudioClip+<>c__DisplayClass36_0.<Process>b__0 (Elements.Assets.AudioX a) [0x00000] in <6450ba452eef4b15a58558870451eee7>:0 
  at FrooxEngine.StaticAudioClip+<ProcessAsync>d__38.MoveNext () [0x00175] in <6450ba452eef4b15a58558870451eee7>:0 ```