the best time to do win32 development is when microsoft's entire cloud has shit the bed
gotta pull out my visual studio 6 MSDN CD because the online stuff keeps timing out
and lets see if the internet archive has WinObj, because sysinternals is not responding

I'm just trying to read sectors off a floppy drive that's not mounted because it doesn't have a FAT12 filesystem!

surely this is an everyday occurrence in windows 11, why is this so hard?

ah-ha!

r"\\.\GLOBALROOT\Device\Floppy0"

I'm benchmarking how long it takes to read a floppy disk, for my video player. test one is calling read(512) 2880 times
305 seconds, that's five minutes.
My video is 252s/floppy, so that's sub-realtime. NOT GOOD
½kb: 305s
1kb: 161s
2kb: 89s
4kb: 58s
8kb: 42s
16kb: 34s
32kb: 30s
64kb: 28s
128kb: 28s
256kb: 28s
512kb: 28s
1024kb: 28s
1440kb: 28s
That's speeds on a Teac FD-05PUW

a reasonable thing to do would be to adjust my video bitrate so that it stores something like 45-60s instead of 252s, since I can read one disk every 28s.

this'd get me MAXIMUM VIDEO QUALITY at the expense of increasing the video size from 12 floppies to 51-68

Greaseweazle + TEAC FD-235HF:

default settings: 97s
--revs 1: 66s

that makes sense. The USB Teac is a 2X drive, so it's running the disk at 600 RPM instead of the intended 300 RPM, and it gets roughly twice the speed.
there are 4x drives, but they're rare and I think they've mainly been used inside mavicas
I've got one but I'm not gonna build a video player that runs off a camera, that's just silly.
but it's good to know I have plenty of headroom on this 2x drive. even if the user takes a full minute to find and insert the next floppy disk, I can load it fast enough to keep the video going
next step would obviously be to measure how long it takes me to swap through 12 floppy disks
if I could instantly load the next floppy disk that'd be 336s to read all 12. obviously it's going to be more than that, but how much more?
maybe I'll run two tests: one with the disks sorted, and one with them shuffled.
I should mod a card shuffler to work on floppy disks

"The 4x USB Floppy Drive is 400% faster than a typical 1x floppy drive, making it the fastest drive available today. "

NOT HOW MATH WORKS

I just realized I'm writing a file/disk marker to each floppy that consists of "FLOP"

yes, of course they're a floppy, foone! this is not a useful distinguishing signature!

there we go, reading the metadata too:

>python readdisk.py
Reading 12 chunks of 131072 bytes each
FlopPlayer 0.1 video AMOKTIME disk 1 of 12
Exact file size is 16504149 bytes
Read 1474560 bytes in in 28.71s

I wonder if I can autodetect the next disk insertion. The drive definitely does detect new disks, it spins them up as soon as you put them in.

but does that info make it all the way to windows? I'm not sure.

and I don't want to do read(1) in a loop until it succeeds, that's nasty. and can be noisy on floppy drives

annoyingly I had mostly solved this problem in software I wrote back in 2018 but it's all python2 so adapting it to py3 would take a minute
fortunately my desktop has enough old python versions installed that I can get 2to3 to help me

okay I now have a working disk-swap-detector.

It basically just calls DeviceIoControl(IOCTL_DISK_GET_DRIVE_GEOMETRY) in a loop. That'll fail if the drive is empty.

It starts "full", waits for it to go empty, then waits for it to go back to full.

what if the user puts in the wrong disk?

PANIC

0%| | 0/1474560 [00:00<?, ?it/s]FlopPlayer 0.1 video 2j▐TDMí disk 2 of 12
Exact file size is 4039327740 bytes
Disk info mismatch! Expected title to be AMOKTIME, but was 2j▐TDMí
0%| | 0/1474560 [00:00<?, ?it/s]
Traceback (most recent call last

oh I was trying to check that the title was the same on later disks, but the title is only saved on the first disk (can't waste 8 bytes)

whooops

this is arguably a mis-design of my disk format and I should fix it and make it use the same metadata format for all the disks

but consider:
that'd require rewriting 12 floppy disks

@foone
The solution is simple.

Build a floppy disk library with a robot arm to feed the disks to the drive at the perfect interval.

That's all.

How hard can it be? 😈

@Smingleigh jokes on you, I already built one of those years ago
@foone
Curses, your time travel shenanigans have defeated me again for the first time.
@foone in a vacuum this post sounds cursed 😂
@foone as long as things don't reach this point, that shouldn't be too much to worry about https://xkcd.com/1987
@littlemisssynth I think my desktop passed that point long ago. a quick search shows 68 separate non-symlink python.exe files
@foone oh, god... i think it might be past the point of throwing in a lake, and straight to entombing in concrete and then burying deep under a mountain

@foone Digression: would that be true if you'd written it in C89? Meh, probably only if you didn't use any libraries.

Still, I've never really forgiven Python for Python3. Such a lot of unnecessary work.

Windows 95 almost had floppy insertion detection

One feature which Windows 95 almost had was floppy disk insertion detection. In other words, Windows 95 almost had the ability to detect when a floppy disk was present in the drive without spinning up the drive. The person responsible for Windows 95's 32-bit floppy driver studied the floppy...

Vintage Computer Federation Forums

@foone

I'd imagine that it could but nobody wanted to deal with de-bouncing the cheapest switch in unknown drives.

@foone 400% faster is 500% as fast.
@foone reminds me of how the LSI disk readers are noticeably faster with standard floppies
Mob used X-ray tables, contact lenses and ex-NBA stars to cheat NYC poker games, feds say

Prosecutors say three New York crime families used high-tech gadgets and celebrity bait to rig poker games, scamming wealthy players out of at least $7 million.

Gothamist
@kaced waow, I didn't know the mob was shuffling floppies!
@foone can you blue-green two drives like a dual-clutch transmission? Swap one while the program reads from the other drive?
@babble_endanger yeah. but I don't need to at current bitrates.
I Built a RAID of Floppy Disks. Oh no.

YouTube
@gloriouscow exceptionally unreliable in my experience. a bunch of floppy drives via usb rarely works.
@foone so you're saying it does occasionally work

@foone i wonder if i can read a usb floppy from the arduino giga's host port

just need to make a simple protocol to read sectors via wifi

then you have a wireless floppy

@gloriouscow wireless floppy drive is on my todo, so I'd love to see you finish it before me (just so I don't have to do it )
@foone i know right it's just important that these things come into existence somehow
@gloriouscow I was actually thinking of (I have some PCB designs somewhere) making a stand-alone floppy reader, where you have a "READ" button on the device itself, it's got a little LCD to show you progress, and it stores them on internal memory, plus serves a webpage containing a list of read images
@foone thats better than my idea of making a floppy drive that holds the disk still and spins the jacket

i am gobsmacked to learn that there exists a project @foone considers too silly to attempt

</affectionate>

@foone
YE Data sold a USB 4x floppy drive, and it wasn't even too expensive. I have one, and if I'd had any idea they were going to disappear so quickly, I'd have bought a bunch more. Now they're impossible to find.
If you're interested, I could measure the time to dd an entire floppy on Linux. Or, if you want a test on Windows 10, I'd need a program to do it.
@foone I wonder if you could make a floppy drive that just has 80 heads per side and reads every track simultaneously
Reading floppy disks? GOTTA GO FAST!

YouTube
@Jhynjhiruu have you seen the thumbnail for that video? and the icon in it?
@foone huhhhh???? (i reflexively posted a video i remember watching without thinking about it, so imma need some more hints to understand the issue)
@foone Don't you need to factor in disk-swap time, or are you assuming at least 2 floppy drives? Although then how much time are you actually WATCHING the video if you're constantly switching disks?
@TomF I was factoring 15-30s per disk swap time