Simulator upload to device, "Waiting for Disk" step takes a long time

I'm using the Playdate Simulator on a M1 Macbook and lately I've been having two issues when starting the "Upload to Device" command:

  1. The "Waiting for disk" prompt takes a few minutes before the upload starts. However, when it finds the disk the files copy quickly as usual.
  2. When the copy is complete and the simulator attempts to run the game on device, I get the error "Unmount: The operation couldn’t be completed. (OSStatus error -47.) (null)". So I have to manually eject the Playdate volume and run the game from the system launcher manually.

I'm not sure if these two issues are related or not, but it doesn't happen all the time. Sometimes I'll get lucky and the disk will mount quickly and the game will auto-start when the copy is complete. Other times I'm left waiting for minutes instead of seconds for the process to happen.

I've had unmounting issues before but those were due to a phantom Playdate volume somehow being created under my /Volumes/ directory and the simulator not detecting the new "PLAYDATE 1" volume that was auto-created. I've checked and there are no hidden volumes in my system this time.

Well, error -47 means it tried to delete a file that was in use. Do you have anything else on your system that might be opening files on the PLAYDATE volume? Maybe antivirus software that scans mounted volumes for malware? Could Spotlight or Time Machine or maybe something like Backblaze be indexing or backing up external volumes?

If not, then this is probably our bug, but I want to rule out other causes before filing it.

I checked on these suggestions and didn't find anything. Time Machine auto-backups are disabled and there is a .metadata_never_index file in the PLAYDATE volume that should be preventing Spotlight from indexing it. I do have Dropbox, but also had backups disabled for that and even when quitting the Dropbox helper I still have the issue. I don't have any antivirus software either.

It's possible there could be some other native MacOS process that I'm missing that is scanning the volume but I don't know what it would be.

Does the problem persist after rebooting?

Also, do you have access to another Mac? If the problem happens there too, then we'll know it's something to do with your Playdate and we can go from there.

A reboot didn't help, actually it seemed to make it slower (but this issue is very inconsistent already). I'm also noticing it takes a long time for the Finder to recognize the external disk when I boot to data disk mode manually (without the Simulator), so I'm sure that's related. I ran the "Disk Utility" first aid feature on the PLAYDATE volume, and as a result the mounting seemed faster, but I still have the OSStatus Error -47 when the SDK unmounts to run the game.

I also did a fresh install of the SDK on my work Macbook which has very similar specs and has almost the same config/suite of apps as my personal computer, and I didn't see the issue there at all. Very strange. I guess it's not a device issue? I guess the problem wasn't happening on my personal computer initially either, when I first installed the SDK several months ago. It only started within the last couple of weeks.

OK, one last desperate stab: are you plugging your Playdate into your computer directly, or through a hub (this includes keyboards or monitors with USB ports)? If so, see if a direct connection improves things.

I always use direct connection, USB-C to USB-C

Interestingly, my work laptop is now also taking a very long time to recognize the Playdate data disk, and I don't think anything other that the passage of time changed on my end. Either earlier tests were flukes or I'm just experiences wild inconsistencies. I wonder if I'm the only one with this issue?

Have you tried a different USB cable by any chance? Sorry for all the questions, just trying to rule out easy fixes.

Also, to clarify, are you seeing the -47 error on the work laptop as well, or is slow mounting the only problem there?

I wonder if somehow your Playdate filesystem has become corrupt?

If this is the case on macOS it does a fsck-like repair after the device has been connected (device shows in diskutil) but before it is mounted (icon appears on desktop). You'd be able to see messages about this in your macOS system log.

1 Like

Yes I have tried different USB cables. And the -47 error only appears on my personal computer. The work machine doesn't have that one (yet).

And thanks @matt for that tip. I looked in the system logs and am not sure which log files are relevant, but I do notice a pattern of this message in the fsck_hfs.log file:

/dev/rdisk4s2: fsck_hfs started at Thu Aug 18 16:30:46 2022
/dev/rdisk4s2: /dev/rdisk4s2: ** /dev/rdisk4s2 (NO WRITE)
/dev/rdisk4s2:    Executing fsck_hfs (version hfs-583.100.10).
QUICKCHECK ONLY; FILESYSTEM CLEAN
/dev/rdisk4s2: fsck_hfs completed at Thu Aug 18 16:30:46 2022

This message repeats a lot and the timestamps seem to match up with when I was mounting/unmounting the device, but I haven't yet been able to replicate the log line while keeping track of what exactly I'm doing when it occurs.

Also from what I can tell, the Playdate appears in the disk util at the same time it is mounted in the Finder/desktop. Do you have any ideas on what I can search for directly in the logs to tell if it's disk corruption issue?

Hi I have the same issue with an iMac M1 connecting the Playdate via a dongle to the usb.
This problems seems to start happening after trying to delete some long files generated with the emulator and transferred to the playdate. The Playdate was unable to delete the files and they stay corrupted inside the consol memory.
Not sure if this has been the cause, but I can't delete those files I mentioned and now the 'waiting for disk' message appears every time I tried to connect the Playdate to the Mac and takes several minutes to transfer even short files.
Any idea?

Are you on Ventura, by chance? We've seen some performance degradation there when using the Finder to transfer or delete files on the device. We're still not sure what's going on or if there will be a way around it, other than using Terminal.app to copy and delete files without all of Finder's metadata nonsense. :confused: