Hello I'm wonder if anyone has a good solution for quickly sending bitmaps to a app during runtime?
For context, I've been playing around with using a 3D game engine - that runs on my computer - taking the frames it renders and streaming them to my app on the Playdate. Ideally the end result would be being able to stream these frames from 20 -30 frames per second and then the Playdate would send any input back to the computer. Meaning in essence it would effectively act as a really cool terminal with a crank.
The solution I've tired so far has been sending the data via the msg usb serial command but it is slow, sending a bitmap of the 400 by 240 render takes roughly 0.2 seconds, and clearly isn't ideal. I also looked into the bitmap command you can send over serial but it's clear that is only for previewing images on the device. Given that you can stream from the playdate to a pc I'm assuming it's possible to do it the other way. Anyone have any ideas how to send bitmap faster?
Additional Context:
I'm using the SDK on Windows and finally if it isn't possible due to hardware or software limitations. Or this idea is just way to out there, no problem. Was just wondering if someone had a way around this.
Why not just use the bitmap serial command for displaying the bitmap and the controller command (if you can figure out how it works) rather than manually using the msg command, you don't even need a special app in that case.
So I gave using the bitmap command a go and it works pretty well. It seems to run at anywhere from 20 to 27 fps but not very stable. I haven't been able to get the controller command to work so far though. The other issue with doing it that way is there doesn't seem to be a way to send audio.
What I may end up doing is waiting for 2.7 since apparently there's going to be the ability to stream video and audio to the playdate, I'm not sure how performant that will be though.
I don't think there is anything for streaming in the 2.7.0-beta.11 version right now, only standard HTTP requests (I might be wrong, as I haven't had the time to look too deeply), so streaming would be very slow.
I tried something like this previously while working on Playlink Pong. I found that the issue with using serial in this way wasn't the speed per se, but the fact that playdate has trouble receiving serial messages while it is sending serial messages.
Any time I wrote a function that printed too often, it would result in the serial callback running sporadically, meaning that the program would not receive data regularly enough. It's possible that this is totally normal for how "serial" connections function, but as a newbie this surprised me. Isn't the whole point of 'serial' that the devices broadcast one after another?
I assume there is some way of syncing up the playdate and PC components to overcome this problem, but it was above my head.
Glad to know that I'm not the only person running into that issue. I haven't worked on the project for a few weeks now but in my last test the issue I was running into was that the messages coming from the playdate would quickly become garbled.
I'm in the same boat.
If I get an itch to work more on this I think I'm going to try the eval command and just skip using the usb serial callback. I might make more progress there.
I'd be curious to know how that goes! The playdate reverse engineering project contains a note that USB eval "takes time" to run, so I worry it may have the same delay issue.