Re: [Bug] IDE HDD stuttering emulation
Posted: Mon 03 Feb, 2020 6:34 pm
I have this issue too, see this thread for details:
https://pcem-emulator.co.uk/phpBB3/viewtopic.php?f=2&t=3376&p=13162#p13162
For me its connected even with often DOS FAT32 disk image corruptions.. sometimes same game become unplayable at the moment when is usually fine.. for example Q1Dos level loading is taking minutes instead of seconds.. Q2DOS first loading take few minutes, instead of few seconds on real machine.. and assets loading take forever.
Im never fully understood it, but its used disk geometry with - 16 Heads, 63-Sectors.. and zillion of cylinder optimal from performance point of view?
Is possible to capture PCem ouput on ASM level and do the same on real HW and just compare these 2 codes?
I did some testing with proven Rayers - RAWSPEED.EXE (http://rayer.g6.cz/programm/programe.htm) and FIC 503 MB, and its reporting nonsenses - very high writing speeds - 38 MB/s.. without any enhancers, even without smartdrive etc.. it can copy 256 MB file within 12 second (~22 MB/S).. but its recording speed for 6-7 second(38 MB/s).. Rayer told me that its probably something wrong on emulated machine timer. Reading speed seems to calculate fine.
Other strange thing is that even when i disable UDMA in bios, speed is the same, if im not wrong PIO mode theoretical max is 16 MB/s, there has to be something wrong..
Here is some video (i know that emulation speed is bad, but it doesnt means that disc speed such report nonsenses), you can also see big delays at the start and end of disk operations, they are also not here when im using Dos within real machine, or even Vmware / Virtual Dos machine:
https://www.dropbox.com/s/tcwi7s6nshik14q/20200203135245-3.mkv?dl=0
I dont thing that it primary problem, but to be sure that problem is not part of code which is handle hdd operation on host OS.. it would be nice to add option to load all disk image (they are quite small in from todays point of view, i can give emulator lot of ram whole 2Gb, or 8GB disk could be in ram easily even without some quick compression.. within some inteligent to load unused disc space it could be even better ) to ram and make write operations in other asynch thread.. to not block emulation - it will at least show that everything is fine.
Update: I just checked QEMU just for info, it has block I/O on own thread too.. I thing that it make sense, because IO on MBs is handled by own microchip(s).. and from point of view own microchip is ideal place to make it own thread, especially if some operations are handled asynchronously with other operations - it this is IDE and SCSI specs if yes, own thread would make sense?
https://pcem-emulator.co.uk/phpBB3/viewtopic.php?f=2&t=3376&p=13162#p13162
For me its connected even with often DOS FAT32 disk image corruptions.. sometimes same game become unplayable at the moment when is usually fine.. for example Q1Dos level loading is taking minutes instead of seconds.. Q2DOS first loading take few minutes, instead of few seconds on real machine.. and assets loading take forever.
Im never fully understood it, but its used disk geometry with - 16 Heads, 63-Sectors.. and zillion of cylinder optimal from performance point of view?
Is possible to capture PCem ouput on ASM level and do the same on real HW and just compare these 2 codes?
I did some testing with proven Rayers - RAWSPEED.EXE (http://rayer.g6.cz/programm/programe.htm) and FIC 503 MB, and its reporting nonsenses - very high writing speeds - 38 MB/s.. without any enhancers, even without smartdrive etc.. it can copy 256 MB file within 12 second (~22 MB/S).. but its recording speed for 6-7 second(38 MB/s).. Rayer told me that its probably something wrong on emulated machine timer. Reading speed seems to calculate fine.
Other strange thing is that even when i disable UDMA in bios, speed is the same, if im not wrong PIO mode theoretical max is 16 MB/s, there has to be something wrong..
Here is some video (i know that emulation speed is bad, but it doesnt means that disc speed such report nonsenses), you can also see big delays at the start and end of disk operations, they are also not here when im using Dos within real machine, or even Vmware / Virtual Dos machine:
https://www.dropbox.com/s/tcwi7s6nshik14q/20200203135245-3.mkv?dl=0
I dont thing that it primary problem, but to be sure that problem is not part of code which is handle hdd operation on host OS.. it would be nice to add option to load all disk image (they are quite small in from todays point of view, i can give emulator lot of ram whole 2Gb, or 8GB disk could be in ram easily even without some quick compression.. within some inteligent to load unused disc space it could be even better ) to ram and make write operations in other asynch thread.. to not block emulation - it will at least show that everything is fine.
Update: I just checked QEMU just for info, it has block I/O on own thread too.. I thing that it make sense, because IO on MBs is handled by own microchip(s).. and from point of view own microchip is ideal place to make it own thread, especially if some operations are handled asynchronously with other operations - it this is IDE and SCSI specs if yes, own thread would make sense?