AndreaOrru / LaiNES

Cycle-accurate NES emulator in ~1000 lines of code
BSD 2-Clause "Simplified" License
1.49k stars 115 forks source link

Debug assertion "Frame went past end of buffer" #32

Open ghost opened 6 years ago

ghost commented 6 years ago

Is this a known issue?

../lib/include/Blip_Buffer.h:230: void Blip_Buffer::end_frame(blip_time_t): Assertion `( "Blip_Buffer::end_frame(): Frame went past end of buffer", samples_avail() <= (long) buffer_size_ )' failed.

It happens here:

#4  0x00007fffed56903d in Blip_Buffer::end_frame (this=0x7fffed5ce0c0 <APU::buf>, t=29783) at ../lib/include/Blip_Buffer.h:229
#5  0x00007fffed568e31 in APU::run_frame (elapsed=29783) at ../src/apu.cpp:45
#6  0x00007fffed55da7d in CPU::run_frame () at ../src/cpu.cpp:273

For context, I was working on a libretro port of your emulator core, but I do not think that is the issue here. The frame count is always at 38 when this crash happens. I'm testing with SMB1 (World).

AndreaOrru commented 6 years ago

For context, I was working on a libretro port of your emulator core

That's cool!

I wasn't aware of this specific issue, however many people have reported problems with audio (especially on Linux). Rewriting the APU core from scratch is in my TODO list. Well, as soon as I can find some time to hack on my personal projects again.