TASEmulators / TASEmulators/BizHawk

Alternate Sync causes FFmpeg dumping to crash for N64

Open
#2,376 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

App: EmuHawk Core: Mupen64Plus Repro: Affects 2.4 Repro: Affects 2.5
Dominant language
C#
Stars
2.8k
Forks
468
PR merge metrics
No merged PRs in 30d

Description

Summary

Dumping N64 video while using the Alternate Sync option causes FFmpeg to crash shortly after starting the dump. I have tested this only with Star Wars Episode 1 Racer for the N64. I tested Pink Panther: Pinkadelic Pursuit for GBA, and the bug did not manifest for that core/game. I tried changing the throttling option to Audio Throttling (I think this setting is related somehow to what alternate sync does) but it did not change the crash.

Audio is broken without the Alternate Sync setting for this game - it is not a continuous audio stream but broken up and skips constantly.

Repro
  1. Load Star Wars Episode I - Racer (U) [!]
  2. Pause the emulator
  3. File > AVI/WAV > Config and Record
  4. Check Alternate Sync
  5. Choose FFmpeg writer and click OK
  6. Choose MP4 profile (the crash happens for any profile I choose)
  7. Choose a place to save the file
  8. Unpause the emulator
  9. Wait a moment (usually about 5 seconds for me)
Output
System.Exception: A/V Desync?
   at BizHawk.Client.EmuHawk.NutMuxer.WriteAudioFrame(Int16[] samples)
   at BizHawk.Client.EmuHawk.NutMuxer.Finish()
   at BizHawk.Client.EmuHawk.FFmpegWriter.CloseFileSegment()
   at BizHawk.Client.EmuHawk.FFmpegWriter.Dispose()
   at BizHawk.Client.EmuHawk.MainForm.AbortAv()
   at BizHawk.Client.EmuHawk.MainForm.AvFrameAdvance()
   at BizHawk.Client.EmuHawk.MainForm.StepRunLoop_Core(Boolean force)
   at BizHawk.Client.EmuHawk.MainForm.ProgramRunLoop()
   at BizHawk.Client.EmuHawk.Program.SubMain(String[] args)

HOnIWpessY
EyLEDT33Og

Host env.
  • BizHawk 2.4.0; Win10 Home; Intel
  • BizHawk 2.4.2; Win10 Home; Intel
  • BizHawk 2.5.0; Win10 Home; Intel

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reported stack entry point, BizHawk.Client.EmuHawk.NutMuxer.WriteAudioFrame, and trace how FFmpegWriter.CloseFileSegment and MainForm.AbortAv handle the recording failure. Reproduce the listed N64 recording steps with Alternate Sync and verify that FFmpeg recording completes without the A/V Desync exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.