Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimized 16 color for pindmd3 #119

Closed
sverrewl opened this issue Jul 9, 2018 · 423 comments · Fixed by #217
Closed

Optimized 16 color for pindmd3 #119

sverrewl opened this issue Jul 9, 2018 · 423 comments · Fixed by #217

Comments

@sverrewl
Copy link

sverrewl commented Jul 9, 2018

There is still a small delay that makes mini games like the video mode in afm not playable with *.vni enabled. Possible to fix ?

http://vpuniverse.com/forums/topic/3461-sambuild31-beta-thread/?do=findComment&comment=39918

@djrobx
Copy link
Contributor

djrobx commented Aug 12, 2018

Specifically, it appears that "RenderColoredGray4(ColoredFrame frame)" currently just upscales to 24-bit color, instead of using a palette with a smaller stream of data, which is likely adding the latency.

Someone with access to a pindmd3 and knows its api could probably implement an indexed 16 color renderer instead.

@freezy
Copy link
Owner

freezy commented Aug 12, 2018

The problem is that PinDMD3's firmware doesn't support that. It's either 2-bit palette-based or full 24 bit...

@freezy
Copy link
Owner

freezy commented Aug 19, 2018

Well yes there is, but AFAIK there is no way to set the 16 colors of the palette individually. I think we talked about this and your answer was a firmware upgrade (which would be good too!).

@djrobx
Copy link
Contributor

djrobx commented Aug 20, 2018

VPM sends out frames up to 60fps. The lag goes away if colorizations are not used. Pin2DMD does not have this issue either in 16 indexed color mode. So I do think we need this feature added to solve the issue correctly.

@djrobx
Copy link
Contributor

djrobx commented Aug 20, 2018

Sure. The point is that it doesn't have the lag issue, so it rules out issues with the coloring system. Reviewing VPM recordings in the colorization tool, I regularly see frame changes at ~16ms. There are a lot of slower ones too, of course.

Freezy's code also will ignore and not send dupe frames. The particular sequence that triggered this request is AFM's video mode.

@djrobx
Copy link
Contributor

djrobx commented Aug 20, 2018

Yep sounds good.

@freezy
Copy link
Owner

freezy commented Aug 26, 2018

Cheers!

@djrobx
Copy link
Contributor

djrobx commented Aug 26, 2018

Development cobwebs are the worst to dust off. :)

@sverrewl
Copy link
Author

sverrewl commented Sep 4, 2018

I'm very happy to hear this Russell.

@freezy
Copy link
Owner

freezy commented Sep 4, 2018

Cheers! Got an example command how to flush?

EDIT: Also, does the new firmware return a different version? If so, what's the string? I'm currently matching the regex ^rev-vpin-\d+$, so I suppose it's 010010?

@freezy
Copy link
Owner

freezy commented Sep 16, 2018

@russdx any update? Will push out a new version soon and it would be great to have that in! I'm a bit hesitant to flush the firmware without instructions...

So just to be clear, the new frame format is:

  • 0x32 (instruction byte)
  • 48 bytes of palette data
  • 0x2098 (what's this?)
  • 2048 bytes of frame data (4 planes)

Which makes 2098 bytes per frame. So what's the [2098] between the palette and the frame data?

@djrobx
Copy link
Contributor

djrobx commented Oct 16, 2018

We appreciate you taking the time to work on the update. :)

@sverrewl
Copy link
Author

bump - not meaning you should jump on it. Just a reminder in case you've forgotten about it.

@sverrewl
Copy link
Author

One week plus two weeks should be 21 days. Any news ? You should never give a estimated time for something. Then people will start to nag a few days sooner ;)

@sverrewl
Copy link
Author

And I'll keep reminding you <3
Thanks again Russel.

@freezy
Copy link
Owner

freezy commented Jan 11, 2019

I can provide a build that implements your "specs" if that helps. Just need to patch the test image, because currently it's rgb24 which doesn't help much in that case.

@sverrewl
Copy link
Author

Just my semi regular poke ... I understand you are busy. Just in case you forgot I guess.

@sverrewl
Copy link
Author

sverrewl commented Mar 2, 2019

Bump

@dgrace13
Copy link

Any updates on this? I just ordered a pindmd3 so just curious. Thank you!

@Tempest43528
Copy link

Russ is this needed for existing PinDMDV3 owners too for the upcoming firemware or is this for new boards only with protection?

@loganchihuahua
Copy link

loganchihuahua commented Apr 7, 2019

I own a pindmdv3 and actually was going to get another for a second build. Should I grab the zip file from this thread and apply the update to my current Pindmdv3. Not feeling confident to go ahead and do that since it hasn't been tested and it was mentioned the firmware needing to be generated for specific serial #s? There doesn't seem to be any new information on pindmd.com about a new firmware?? Not wanting to make my currrent pindmdv3 useless by doing the wrong thing?? So i am holding off. Thank you for any clarity you can give.

@loganchihuahua
Copy link

loganchihuahua commented Apr 7, 2019

Thank you. Where will announcements be made about any firmware upgrades? I am interested because i am getting some slowdown in video mode on colorizations from time to time. Thanks so much!!

@sverrewl
Copy link
Author

sverrewl commented Apr 8, 2019

I suggest you ask this question in VPF. This is info that most PindmdX users would love to get some more info about and this isn't really the best place to discuss this.

@djrobx
Copy link
Contributor

djrobx commented Apr 8, 2019

I think the very specific case this bug is about is the AFM video mode. I imagine lag in other aspects of the DMD are less noticeable to users. Users with Pin2DMD with an indexed color mode, and LCD users do not have issues. Users who use a fixed color palette with PindDMDv3 also do not have a problem, so this very clearly points to the 24 bit mode not keeping up. VPM produces frames at 60fps so it's pretty easy to see why this could be the case for ROM-generated action.

@djrobx
Copy link
Contributor

djrobx commented Apr 8, 2019

Yes Freezy's code drops redundant frames before rendering.

The AFM video mode is a lot of tiny sprites, so I suspect the real ROM updates it at more than 24fps. What I see in the colorization tool that captures frame rates is that WPC roms frequently make changes in 16ms intervals but it is usually only updating only one of the two planes in that cycle.

@djrobx
Copy link
Contributor

djrobx commented Apr 8, 2019

Yeah I think the code which compares and only renders changed frames is in this module, so we could look to see if it's been less than 25ms (~40fps) and skip rendering if so. I think VPM keeps sending frames so this could be workable.

There's some risk though, that we might never render the final frame of something if nothing new comes down the pipe right after we drop a frame (remember not all sources are VPM, even colorization sequences can cause us to playback "videos" with variable framerates internally). Fixing that would be messier... (issue last frame if nothing changed in over ~50 ms...). If that is necessary it's probably better to just wait for the fix than add a complex workaround.

@djrobx
Copy link
Contributor

djrobx commented Apr 8, 2019

Unfortunately those long runs of still frames tend to be things like "YOU WERE DEFEATED!" following some heavy motion sequence. I only know because these are the same sorts of issues that trip you up when creating VNI colorizations (and bugs I had to fix in the coloring engine). :)

@loganchihuahua
Copy link

I have an example of another dmd colorization that runs into problems as described above. FT colorization by Martin. The game sequence where you need to shoot down water skiers. It lags and falls behind so much, that by the end of it, the dmd is playing catch up to the game. Pindmdv3.

@loganchihuahua
Copy link

So i played the Fish Tales colorization on a pindmdv3 and pin2dmd. The video game sequence does not slow down at all in pin2dmd and does in the pindmdv3 as stated above. Not sure if this helps, but it seems like any video game sequence is when the pindmdv3 with current firmware trips up.,

@loganchihuahua
Copy link

I would love to give this a try. Do you console in using the usb cable and something like putty? How do I access the pindmdv3 to run the command?

@bmongiovi
Copy link

@russdx . Greetings, I do need the firmware upgrade: KUID=0780CA98-023E0132-03D48D16
My PINDMDv3 is on COM5. Does this matter?

@RunningMan-01
Copy link

@russdx Just checking, are you still doing the thing where we send in our serial number in order to get Freezy installed on pindmd3? Haven't seen a post since April, just checking before I go dig up my serial.

@bmongiovi
Copy link

bmongiovi commented Sep 21, 2022 via email

@tluppens
Copy link

@russdx Hi i have also a pindmdv3 since 2016 i have still version 1008, do you still make does bin files ? i have my kuid number

@tluppens
Copy link

@russdx that's great good news i buy you a beer for that

KUID=05FCCAAE-020D5139-05A48D16

tnx

@tluppens
Copy link

tluppens commented Feb 16, 2023 via email

@voodooDX
Copy link

I'd really love to make use of all the amazing alt colors : )
KUID=0F68CAB2-022D412B-0FAC8D16

@tluppens
Copy link

@russdx ok i have sent you a mail from [email protected]

@voodooDX
Copy link

Works like a champ. Thank you!

@shdadstl
Copy link

Hello, any chance I could get a firmware build?
KUID=0933CA97-022E2136-03F18D16.

Thanks!

@dig65
Copy link

dig65 commented Dec 31, 2023

I would like to get updated firmware for my PINDMD3.

KUID is 0EDBCAE4-023DE123-0F178D16

Thanks!

@Aldiode
Copy link

Aldiode commented Sep 10, 2024

Hi Russ,

I need to get an updated firmware for my PinDMD3 please.
KUID=0E70CABE-023C3124-0F128D16

Thanks.
AL

@Redwings12345
Copy link

Hi Russ, I recently purchased a new pindmd v3.1 dmd. It will not reset itself after I play a table. I have to reset it manually after every table. Is there a way to make it reset automatically after the table is played. I bought it from Virtuapin in October 2024.
thanks. Mike

@Aldiode
Copy link

Aldiode commented Oct 23, 2024 via email

@russdx
Copy link

russdx commented Oct 23, 2024

Switched github accounts this is my new one.

@Redwings12345
Copy link

Redwings12345 commented Oct 23, 2024

Hi Russ, I recently purchased a new pindmd v3.1 dmd. It will not reset itself after I play a table. I have to reset it manually after every table. Is there a way to make it reset automatically after the table is played. I bought it from Virtuapin in October 2024.
thanks. Mike

@russdx
Copy link

russdx commented Oct 23, 2024

Hi Russ, I recently purchased a new pindmd v3.1 dmd. It will not reset itself after I play a table. I have to reset it manually after every table. Is there a way to make it reset automatically after the table is played. I bought it from Virtuapin in October 2024. thanks. Mike I hope this is the right one.

Hello

I am not quite sure why this is. It feels like a firmware or software issue? The hardware has not changed since we launched the pinDMD ZeDMD in 2023? so don’t think it’s a hardware issue? Paul says there are a few customers with this issue recently so looks like it started with a recent firmware or DLL release maybe? (Not pointing fingers!!) just saying the hardware has not changed since day one.

@Redwings12345
Copy link

Redwings12345 commented Oct 23, 2024

Thanks Russ, I wish I knew what to do about it.

@russdx
Copy link

russdx commented Oct 24, 2024

Thanks Russ, I wish I knew what to do about it.

I think its going to be a bit of trial and error to see what version number it stop working and if its an issue with the ESP32 firmware? or with the Freezy DLL? I have no experience with either system so can't help much there sadly.

@Redwings12345
Copy link

Thanks Russ

@zesinger
Copy link
Contributor

As said in the mail:
Hi Russel
The firmware AND software are exactly the same for him and me. I remotely controlled his cab and we managed to install the exact same firmware from PPUC Github. I have tested these ones on my 2 zedmd (HD and SD).
On the PC side, he has the same VPinMame, the same VPX and the same Dmd-Ext installed as mine.
The first time he runs a table, everything is working perfectly as it should, tested with VNI/PAL, Serum v1 and Serum v2. On all the ZeDMD made from a standard ESP32 dev board (with or without a shield), as soon as you exit a table, it resets automatically (displaying the ZeDMD logo again), but yours don't seem to reset. And so, if he runs another table, it doesn't work and the dmddevice.log shows "ZeDMD device not found", certainly because the device was not released. If he resets manually (either disconnecting the device or pressing the Reset button), if he runs a table again, it works.
Markus said that it could be due to a different USB to serial converter, but we have no clue on what your system is.
If it can help fixing this, it would be great, we all want our users to be happy ZeDMD users!

@mkalkbrenner
Copy link
Contributor

A reset happens when a program like VPX releases the COM port and a different one takes over.
Resets are performed by RTS DTS sequences which seem to be specific for the USB to serial converters.
Libzedmd contains the sequences for the ESP32 Room and the S3 Dev Kits.

@russdx
Copy link

russdx commented Oct 24, 2024

Hello @mkalkbrenner & @zesinger

So we use the CP2102N USB serial chip, but don't have any of its various reset signals wired up to the ESP32 reset pin. This was not in the original requirements? Has something changed in recent versions which now require this? Can the firmware not be reset via software how come its done at a physical hardware level? This was working before (as not had any reports of this issues before) so I can only think something has changed to swap over to using the physical firmware resetting rather then software which I assumed it used before?

@mkalkbrenner
Copy link
Contributor

mkalkbrenner commented Oct 24, 2024

Requirements? We never published requirements for custom PCBs. ZeDMD uses ESP32 dev-kit boards.

But as you can check in the git history, the hardware reset was part of the first commit ever to libzedmd. So it has not been added recently.

What has changed over time is when it gets called. And we added a additional reset to solve issues with some frontends.

I remember that earlier versions of the ESP framework had issues with the software reset. But you could try to implement it. But that won't replace the hardware reset entirely. The hardware reset is also called under specific error or connection conditions.

The only good way I see is to leverage dmdserver. This program holds a permanent connection to the DMDs and other programs like DMDext, VPX, frontends can connect to it. I assume adding a dmdserver as DMD device to dmdext is the simplest change.

Or you fix the hardware.

@russdx
Copy link

russdx commented Oct 24, 2024

Fixing hardware is not an option, it is what it is and can’t be updated. There is only 100 of these made and won’t be any more.

If there is a software fix that would be fantastic. Having to fire a physical ESP32 reset when switching tables does seem a little odd to me though. Resetting hardware should always be a last resort. Usually everything can be handled in software. The pinDMD initially did everything though software commands. I never had to physically reboot it… is this because of the virtual comport handle having to swap between different pc processes? Even then can’t one close it and another open it and just say hello to the DMD firmware? I don’t understand the need for the hardware reboot?

@mkalkbrenner
Copy link
Contributor

ESP.restart() should be the soft reset. We had that in the code in an early version, but there was an issue. I think the hardware reset is needed to reset the USB converter itself.
I think the main issue was that dmdext did not release the device in 2.2.2 when VPX was terminated.
So maybe some resets could be avoided with the next dmdext version.
Feel free to contribute patches to either libzedmd and ZeDMD or to dmdext to change the reset behaviour or to avoid resets.

@Redwings12345
Copy link

So you think there might be a chance it’ll work if(when) a newer version comes out?

@russdx
Copy link

russdx commented Oct 28, 2024

So you think there might be a chance it’ll work if(when) a newer version comes out?

Yes, But an easier fix might be to go back a revision or 2 as it was working at some point, this seems to be a recent change?

@mkalkbrenner is this a ESP32 firmware update or pc side DLL update?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.