CUzeBox - The new official Uzebox emulator

The Uzebox now have a fully functional emulator! Download and discuss it here.
User avatar
Artcfox
Posts: 1382
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Re: CUzeBox - a new Uzebox emulator in progress

Post by Artcfox »

Confirmed, it works for me now!

I really like the idea of a strict mode, to force games to implement things correctly.

I did know about T2K needing to find the file on the first part of the card, which is why for my previous tests I put the files in their own directory.

The audio for T2K sounds pretty bad, and it's also pretty bad with Bugz (tested natively). The console message indicate that the emulation speed varies between 97% and 107%. I thought the way that SDL audio works is you pick a sample rate, and as long as you keep the buffer filled, the audio will playback at a constant rate. Having the playback speed of the audio change constantly, means you can't really use the emulator for developing sound effects or music, and to be honest it makes it a bit annoying to play games.
User avatar
Jubatian
Posts: 1563
Joined: Thu Oct 01, 2015 9:44 pm
Location: Hungary
Contact:

Re: CUzeBox - a new Uzebox emulator in progress

Post by Jubatian »

What you describe indicates the problem possibly is not at the audio: the primary source might be something different.

At me when running native, the emulator is rock solid at 100%, the frame rate manager allowing it to run in sync with the video (60Hz). The audio's PD controller synchronizes to it correctly, and steadily maintains a constant audio frequency. You say at you it runs between 97% and 107%. That's something atrocious, something I only get with Emscripten when the garbage collector messes around, and then the audio's PD controller really starts wobbling around. That it runs on average faster than 100% would indicate that for some reason SDL_RENDERER_PRESENTVSYNC doesn't work at you (has no effect), so the emulator tries to limit itself to the system timer, and the same time the system timer for some reason isn't steady either (that is, the scheduler of the OS might give the emulator slots randomly some 10-30ms apart; I tested the thing without PRESENTVSYNC at me, and it works proper). Or maybe your monitor doesn't run at 60Hz, rather at 70Hz or something near enough to subtly mess up the frame rate manager (shouldn't happen, but I didn't test that).

What are the specs of the PC you are using? What OS? Could you give a dump of the emulator's console output (it prints out what it puts on its window's title bar every half second)?

I would like to know about others' experiences on this term. At me the method seems quite robust, and presently I can only imagine it failing if the target isn't capable for any steady 60Hz playback (not even for video or other games) for some scheduler shortcoming. So presently I am thinking about such a solution for Artcfox's case which made the emulator permanently falling back to 30Hz hoping for steady enough scheduling to run proper with that rate. (The scheduler's capabilities don't necessarily relate to the computer's raw performance, for example 60Hz video won't work if the scheduler only gave execution slots for the video player about 25 milliseconds apart no matter the hardware backing it)

The SDL audio works the way you described, the problem is that it is impossible to know how many samples a video frame takes on the PC (!). The ~60Hz given by the PRESENTVSYNC constraint if the monitor runs at that rate is provided by the video card which is not in any sync with the sound card. In native compiles if the frame rate manager figured out (in some way) that the OS's scheduler is rubbish and-or the monitor doesn't run at 60Hz, it could switch over to sync with the sound card (which would eliminate the wobbly sound at the cost of possibly jumpy video, but at that point it doesn't matter as the PC simply can't do it properly), however this is not that much possible with Emscripten (where the animation used as main loop is video synced). Complex stuff.
User avatar
Artcfox
Posts: 1382
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Re: CUzeBox - a new Uzebox emulator in progress

Post by Artcfox »

I'm running Debian 7 on a Lenovo T410 laptop.

Here is the console output:

Code: Select all

$ ./cuzebox bugz.uze 
UzeRom parser: Succesfully loaded program from bugz.uze:
	Name .......: Bugz
	Author .....: Matt Pandina
	Year .......: 2015
	Description : 
Starting emulator
Found: audio.c (6047 bytes)
Found: guicore.h (3011 bytes)
Found: eepdump.c (1926 bytes)
Found: cu_spisd.c (21439 bytes)
Found: cu_ufile.c (3913 bytes)
Found: audio.h (1420 bytes)
Found: filesys.h (4532 bytes)
Found: avconv.h (2624 bytes)
Found: cu_types.h (7402 bytes)
Found: Make_defines.mk (2539 bytes)
Found: eeprom.bin (2048 bytes)
Found: cu_hfile.c (5204 bytes)
Found: avr_inst_table.txt (3251 bytes)
Found: README.rst (1795 bytes)
Found: cu_avrc.c (12627 bytes)
Found: cuzebox (60480 bytes)
Found: guicore.c (10822 bytes)
Found: main.c (10310 bytes)
Found: eepdump.h (1439 bytes)
Found: .gitignore (391 bytes)
Found: cu_spir.h (2530 bytes)
Found: frame.c (10783 bytes)
Found: cu_avrfg.h (1681 bytes)
Found: frame.h (1576 bytes)
Found: cu_vfat.c (14751 bytes)
Found: bugz.uze (59630 bytes)
Found: cu_avr.h (3632 bytes)
Found: cu_vfat.h (3013 bytes)
Found: Make_config.mk (2029 bytes)
Found: cu_ctr.h (2857 bytes)
Found: cu_spir.c (5869 bytes)
Found: cu_spi.c (2054 bytes)
Found: cu_spisd.h (3066 bytes)
Found: cu_spi.h (1806 bytes)
Found: cu_avr.c (46088 bytes)
Found: cu_hfile.h (1316 bytes)
Found: cu_ctr.c (3344 bytes)
Found: LICENSE (35141 bytes)
Found: cu_ufile.h (1944 bytes)
Found: cu_avrc.h (5168 bytes)
Found: Makefile (3080 bytes)
Found: types.h (2139 bytes)
Found: avconv.c (5211 bytes)
Found: filesys.c (10072 bytes)
Found: cu_avrfg.c (5469 bytes)
CUzeBox CPU: 100% (28.699 MHz); FPS: 61 
CUzeBox CPU: 100% (28.610 MHz); FPS: 61 
CUzeBox CPU: 100% (28.610 MHz); FPS: 61 
CUzeBox CPU: 100% (28.610 MHz); FPS: 61 
CUzeBox CPU:  93% (26.703 MHz); FPS: 29 
CUzeBox CPU: 110% (31.471 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 107% (30.517 MHz); FPS: 31 
CUzeBox CPU:  97% (27.656 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 59 
CUzeBox CPU: 107% (30.517 MHz); FPS: 61 
CUzeBox CPU: 103% (29.564 MHz); FPS: 61 
CUzeBox CPU: 100% (28.610 MHz); FPS: 61 
CUzeBox CPU: 100% (28.610 MHz); FPS: 61 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 103% (29.564 MHz); FPS: 30 
CUzeBox CPU: 103% (29.564 MHz); FPS: 61 
CUzeBox CPU: 100% (28.610 MHz); FPS: 61 
CUzeBox CPU: 100% (28.610 MHz); FPS: 61 
CUzeBox CPU:  97% (27.656 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 59 
CUzeBox CPU: 100% (28.610 MHz); FPS: 59 
CUzeBox CPU: 100% (28.610 MHz); FPS: 59 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 103% (29.564 MHz); FPS: 60 
CUzeBox CPU: 103% (29.564 MHz); FPS: 61 
CUzeBox CPU: 100% (28.610 MHz); FPS: 61 
CUzeBox CPU: 100% (28.610 MHz); FPS: 61 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 103% (29.564 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 103% (29.564 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 103% (29.564 MHz); FPS: 61 
CUzeBox CPU: 100% (28.610 MHz); FPS: 61 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 103% (29.564 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 103% (29.564 MHz); FPS: 61 
CUzeBox CPU: 100% (28.610 MHz); FPS: 61 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 103% (29.564 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 103% (29.564 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 103% (29.564 MHz); FPS: 60 
CUzeBox CPU: 103% (29.564 MHz); FPS: 61 
CUzeBox CPU: 100% (28.610 MHz); FPS: 61 
CUzeBox CPU: 100% (28.610 MHz); FPS: 61 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60
Here is /proc/cpuinfo:

Code: Select all

$ cat /proc/cpuinfo
processor	: 0
vendor_id	: GenuineIntel
cpu family	: 6
model		: 37
model name	: Intel(R) Core(TM) i5 CPU       M 560  @ 2.67GHz
stepping	: 5
microcode	: 0x3
cpu MHz		: 1199.000
cache size	: 3072 KB
physical id	: 0
siblings	: 4
core id		: 0
cpu cores	: 2
apicid		: 0
initial apicid	: 0
fpu		: yes
fpu_exception	: yes
cpuid level	: 11
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 popcnt aes lahf_lm ida arat dtherm tpr_shadow vnmi flexpriority ept vpid
bogomips	: 5320.63
clflush size	: 64
cache_alignment	: 64
address sizes	: 36 bits physical, 48 bits virtual
power management:

processor	: 1
vendor_id	: GenuineIntel
cpu family	: 6
model		: 37
model name	: Intel(R) Core(TM) i5 CPU       M 560  @ 2.67GHz
stepping	: 5
microcode	: 0x3
cpu MHz		: 1199.000
cache size	: 3072 KB
physical id	: 0
siblings	: 4
core id		: 0
cpu cores	: 2
apicid		: 1
initial apicid	: 1
fpu		: yes
fpu_exception	: yes
cpuid level	: 11
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 popcnt aes lahf_lm ida arat dtherm tpr_shadow vnmi flexpriority ept vpid
bogomips	: 5319.86
clflush size	: 64
cache_alignment	: 64
address sizes	: 36 bits physical, 48 bits virtual
power management:

processor	: 2
vendor_id	: GenuineIntel
cpu family	: 6
model		: 37
model name	: Intel(R) Core(TM) i5 CPU       M 560  @ 2.67GHz
stepping	: 5
microcode	: 0x3
cpu MHz		: 1199.000
cache size	: 3072 KB
physical id	: 0
siblings	: 4
core id		: 2
cpu cores	: 2
apicid		: 4
initial apicid	: 4
fpu		: yes
fpu_exception	: yes
cpuid level	: 11
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 popcnt aes lahf_lm ida arat dtherm tpr_shadow vnmi flexpriority ept vpid
bogomips	: 5319.88
clflush size	: 64
cache_alignment	: 64
address sizes	: 36 bits physical, 48 bits virtual
power management:

processor	: 3
vendor_id	: GenuineIntel
cpu family	: 6
model		: 37
model name	: Intel(R) Core(TM) i5 CPU       M 560  @ 2.67GHz
stepping	: 5
microcode	: 0x3
cpu MHz		: 1199.000
cache size	: 3072 KB
physical id	: 0
siblings	: 4
core id		: 2
cpu cores	: 2
apicid		: 5
initial apicid	: 5
fpu		: yes
fpu_exception	: yes
cpuid level	: 11
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 popcnt aes lahf_lm ida arat dtherm tpr_shadow vnmi flexpriority ept vpid
bogomips	: 5319.88
clflush size	: 64
cache_alignment	: 64
address sizes	: 36 bits physical, 48 bits virtual
power management:
Here is /proc/meminfo:

Code: Select all

$ cat /proc/meminfo
MemTotal:        7991488 kB
MemFree:         5114420 kB
Buffers:          201872 kB
Cached:          1372136 kB
SwapCached:            0 kB
Active:          1760216 kB
Inactive:         860508 kB
Active(anon):    1076288 kB
Inactive(anon):   111288 kB
Active(file):     683928 kB
Inactive(file):   749220 kB
Unevictable:          44 kB
Mlocked:              44 kB
SwapTotal:       6361084 kB
SwapFree:        6361084 kB
Dirty:                76 kB
Writeback:             0 kB
AnonPages:       1046816 kB
Mapped:           158252 kB
Shmem:            140860 kB
Slab:             180880 kB
SReclaimable:     152888 kB
SUnreclaim:        27992 kB
KernelStack:        3728 kB
PageTables:        25344 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:    10356828 kB
Committed_AS:    3940316 kB
VmallocTotal:   34359738367 kB
VmallocUsed:      564904 kB
VmallocChunk:   34359163168 kB
HardwareCorrupted:     0 kB
AnonHugePages:         0 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
DirectMap4k:       88064 kB
DirectMap2M:     8095744 kB
I even went as far as disabling my compositing manager, which can slow down Uzem, but with it enabled I see the same thing. I was also monitoring the output of top to make sure that nothing else was using the CPU.
User avatar
Artcfox
Posts: 1382
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Re: CUzeBox - a new Uzebox emulator in progress

Post by Artcfox »

I just tried it on a different T410 laptop I have, booted from a Debian 8 LiveUSB, and it seems pretty rock solid:

Code: Select all

$ ./cuzebox bugz.uze 
UzeRom parser: Succesfully loaded program from bugz.uze:
	Name .......: Bugz
	Author .....: Matt Pandina
	Year .......: 2015
	Description : 
Starting emulator
Found: cuzebox (48096 bytes)
Found: eeprom.bin (2048 bytes)
Found: bugz.uze (58094 bytes)
Found: types.h (2139 bytes)
Found: main.c (10310 bytes)
Found: guicore.h (3011 bytes)
Found: guicore.c (10822 bytes)
Found: frame.h (1576 bytes)
Found: frame.c (10783 bytes)
Found: filesys.h (4532 bytes)
Found: filesys.c (10072 bytes)
Found: eepdump.h (1439 bytes)
Found: eepdump.c (1926 bytes)
Found: cu_vfat.h (3013 bytes)
Found: cu_vfat.c (14751 bytes)
Found: cu_ufile.h (1944 bytes)
Found: cu_ufile.c (3913 bytes)
Found: cu_types.h (7402 bytes)
Found: cu_spisd.h (3066 bytes)
Found: cu_spisd.c (21439 bytes)
Found: cu_spir.h (2530 bytes)
Found: cu_spir.c (5869 bytes)
Found: cu_spi.h (1806 bytes)
Found: cu_spi.c (2054 bytes)
Found: cu_hfile.h (1316 bytes)
Found: cu_hfile.c (5204 bytes)
Found: cu_ctr.h (2857 bytes)
Found: cu_ctr.c (3344 bytes)
Found: cu_avrfg.h (1681 bytes)
Found: cu_avrfg.c (5469 bytes)
Found: cu_avrc.h (5168 bytes)
Found: cu_avrc.c (12627 bytes)
Found: cu_avr.h (3632 bytes)
Found: cu_avr.c (46088 bytes)
Found: avr_inst_table.txt (3251 bytes)
Found: avconv.h (2624 bytes)
Found: avconv.c (5211 bytes)
Found: audio.h (1420 bytes)
Found: audio.c (6047 bytes)
Found: README.rst (1795 bytes)
Found: Makefile (3080 bytes)
Found: Make_defines.mk (2539 bytes)
Found: Make_config.mk (2029 bytes)
Found: LICENSE (35141 bytes)
Found: .gitignore (391 bytes)
CUzeBox CPU: 100% (28.699 MHz); FPS: 61 
CUzeBox CPU: 100% (28.610 MHz); FPS: 61 
CUzeBox CPU: 100% (28.610 MHz); FPS: 61 
CUzeBox CPU: 100% (28.610 MHz); FPS: 61 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 103% (29.564 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 103% (29.564 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 103% (29.564 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 103% (29.564 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 103% (29.564 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 103% (29.564 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 103% (29.564 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 103% (29.564 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 103% (29.564 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 103% (29.564 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 103% (29.564 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 103% (29.564 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 103% (29.564 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
CUzeBox CPU: 100% (28.610 MHz); FPS: 60 
Now I'm very confused. :?
User avatar
Jubatian
Posts: 1563
Joined: Thu Oct 01, 2015 9:44 pm
Location: Hungary
Contact:

Re: CUzeBox - a new Uzebox emulator in progress

Post by Jubatian »

I see. For me it seems like some scheduling problem, the machine is obviously more than beefy enough to cope with the task. It is interesting that the emulator for short stretches even switches over into 30Hz output there detecting that it lagged more than 75ms to the real time provided by the system clock. I will look into that, but there is very little chance for a bug there. Are you totally sure there is nothing running in the background? Not even some kernel stuff? (I experienced such broken hardware which could subtly deadlock the kernel for short bursts, barely noticeable except when watching videos).

The big problem with that machine is that if there are really so significant random bursts of lag in there, it is not even realistically possible to work with that audio buffer size the natively compiled emulator has (with fixed output frequency eliminating the PD controller you would still get underruns, so skips when those lags happen).
User avatar
Artcfox
Posts: 1382
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Re: CUzeBox - a new Uzebox emulator in progress

Post by Artcfox »

Jubatian wrote:I see. For me it seems like some scheduling problem, the machine is obviously more than beefy enough to cope with the task. It is interesting that the emulator for short stretches even switches over into 30Hz output there detecting that it lagged more than 75ms to the real time provided by the system clock. I will look into that, but there is very little chance for a bug there. Are you totally sure there is nothing running in the background? Not even some kernel stuff? (I experienced such broken hardware which could subtly deadlock the kernel for short bursts, barely noticeable except when watching videos).

The big problem with that machine is that if there are really so significant random bursts of lag in there, it is not even realistically possible to work with that audio buffer size the natively compiled emulator has (with fixed output frequency eliminating the PD controller you would still get underruns, so skips when those lags happen).
I booted up my original T410 with the same Debian 8 LiveUSB, and did a full playthrough of Bugz. The emulator works great; no sound weirdness, and the emulation speed stays pretty stable—only varying between 97% and 103% very infrequently!

I'm thinking that it might be time to upgrade my Debian 7 install to version 8, and just solve the problem that way.
User avatar
Jubatian
Posts: 1563
Joined: Thu Oct 01, 2015 9:44 pm
Location: Hungary
Contact:

Re: CUzeBox - a new Uzebox emulator in progress

Post by Jubatian »

Try it now, though! I added a fast response stage to the audio PD controller which allows the actual controller to be much slower, so really staying behind to adjust for the long term frame rate. It should manage that glitchy scheduling you have on that machine (while it also gets you a smoother ride in Emscripten if your machine is just on the borderline of being able to do the emulation).
User avatar
Artcfox
Posts: 1382
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Re: CUzeBox - a new Uzebox emulator in progress

Post by Artcfox »

Jubatian wrote:Try it now, though! I added a fast response stage to the audio PD controller which allows the actual controller to be much slower, so really staying behind to adjust for the long term frame rate. It should manage that glitchy scheduling you have on that machine (while it also gets you a smoother ride in Emscripten if your machine is just on the borderline of being able to do the emulation).
Indeed it is much better!

Only when I first started the emulator did did the emulation speed spike to 107%, but then it behaves very well, similar to running under Debian 8.
User avatar
Artcfox
Posts: 1382
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Re: CUzeBox - a new Uzebox emulator in progress

Post by Artcfox »

One feature that would be super-awesome would be a hotkey to save the emulator state to a file, and another hotkey to reload that state (and maybe a way to change which slot the current state gets saved/loaded from). That way if it takes forever to get to a certain point in a game you're trying to debug, you can instantly jump to that part, and then play from there.
User avatar
D3thAdd3r
Posts: 3222
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: CUzeBox - a new Uzebox emulator in progress

Post by D3thAdd3r »

Totally agree on save states.
Post Reply