Extending Hardware Support

Cabinet specific discussion

Re: Extending Hardware Support

Postby neh » Sat Jul 23, 2016 8:36 am

I've spent some more time on this. I tried getting your vanilla code running (only replaced pindmd2 support with printf). The result:

Code: Select all
Message size 392
Message queue 'dmd_master_to_slave' opened.
Message queue 'dmd_slave_to_master' opened.
Message queue 'dmd_dot_matrix_display_data' opened.
Sending slave ready message
Error sending slave ready message: boost::interprocess_exception::library_error


Code is here. It compiles to a 816kb .exe (compared to your 77k .exe). Any ideas? "library_error" is not the most verbose error I have ever seen...
neh
VIP Tester
VIP Tester
 
Posts: 23
Joined: Fri Sep 20, 2013 1:38 pm

Re: Extending Hardware Support

Postby ChrissOnline » Sun Jul 24, 2016 1:45 am

I've got no idea how to get ledwiz-flashers working.
Has anybody already a solution?
User avatar
ChrissOnline
Member
 
Posts: 43
Joined: Fri Sep 27, 2013 1:48 pm
Location: Germany/Bavaria

Re: Extending Hardware Support

Postby neh » Sun Jul 24, 2016 8:56 am

ChrissOnline wrote:I've got no idea how to get ledwiz-flashers working.
Has anybody already a solution?


DOF needs to integrate it, but for that we need to get the example code working first...
neh
VIP Tester
VIP Tester
 
Posts: 23
Joined: Fri Sep 20, 2013 1:38 pm

Re: Extending Hardware Support

Postby neh » Tue Jul 26, 2016 7:55 am

So did anyone get the source code working? Still got the same problem: Compiles, executes, but exits with "boost::interprocess_exception::library_error" before polling from the message queue.
neh
VIP Tester
VIP Tester
 
Posts: 23
Joined: Fri Sep 20, 2013 1:38 pm

Re: Extending Hardware Support

Postby adpag » Tue Jul 26, 2016 10:36 pm

neh wrote:So did anyone get the source code working? Still got the same problem: Compiles, executes, but exits with "boost::interprocess_exception::library_error" before polling from the message queue.


I can reproduce the library_error using your project to build it. I'll have a proper look into it tomorrow.
adpag
Staff
Staff
 
Posts: 486
Joined: Thu Sep 12, 2013 11:29 am

Re: Extending Hardware Support

Postby neh » Tue Jul 26, 2016 10:37 pm

adpag wrote:I can reproduce the library_error using your project to build it. I'll have a proper look into it tomorrow.


Cool, thanks!
neh
VIP Tester
VIP Tester
 
Posts: 23
Joined: Fri Sep 20, 2013 1:38 pm

Re: Extending Hardware Support

Postby adpag » Wed Jul 27, 2016 4:52 pm

neh wrote:
adpag wrote:I can reproduce the library_error using your project to build it. I'll have a proper look into it tomorrow.


Cool, thanks!


The library error seems to be just a case of using a 32-bit slave with the 64-bit game. I think the message queue uses a size type that's 64 bits on 64-bit, otherwise 32. The 32-bit ProPinballSlave.exe seems to do what you'd expect when run from the 32-bit game:

Code: Select all
Message size 392
Message queue 'dmd_master_to_slave' opened.
Message queue 'dmd_slave_to_master' opened.
Message queue 'dmd_dot_matrix_display_data' opened.
Sending slave ready message
Received dmd data message!
Received dmd data message!
Received dmd data message!
Received dmd data message!
Received dmd data message!


Running the 32-bit ProPinballDmdSlave.exe with the 32-bit game wasn't working because it only checked for a message once. I've added a loop and also made it send the slave ready message on startup and check for the end message when it should terminate. I've put my changes on github at https://github.com/adpag/dmd-extensions on the ppslave branch.

Code: Select all
+++ Message queue opened.
+++ Message queue opened.
+++ Message queue opened.
Sending slave ready message
Bridge status: 0
Subscribing to Pro Pinball's message queue...
+++ Fetching frame from queue...
+++ No message received.
+++ Fetching frame from queue...
+++ No message received.
+++ Fetching frame from queue...
+++ No message received.
+++ Fetching frame from queue...
+++ No message received.
+++ Fetching frame from queue...
+++ No message received.
+++ Fetching frame from queue...
+++ No message received.
+++ Fetching frame from queue...
+++ No message received.
+++ Fetching frame from queue...
+++ Message received, calling delegate.
Got frame!
+++ Fetching frame from queue...
+++ Message received, calling delegate.
Got frame!
+++ Fetching frame from queue...
+++ Message received, calling delegate.
Got frame!
+++ Fetching frame from queue...
+++ Message received, calling delegate.
Got frame!
+++ Fetching frame from queue...
+++ Message received, calling delegate.
Got frame!
+++ Fetching frame from queue...
+++ Message received, calling delegate.
Got frame!
+++ Fetching frame from queue...
+++ Message received, calling delegate.
Got frame!
+++ Fetching frame from queue...
+++ Message received, calling delegate.
Got frame!
+++ Fetching frame from queue...
+++ Message received, calling delegate.
Got frame!
+++ Fetching frame from queue...
+++ Message received, calling delegate.
Got frame!
+++ Fetching frame from queue...
+++ Message received, calling delegate.
+++ Fetching frame from queue...
+++ Message received, calling delegate.
Got frame!
+++ Fetching frame from queue...
+++ Message received, calling delegate.
Got frame!
+++ Fetching frame from queue...
+++ Message received, calling delegate.
Got frame!
+++ Fetching frame from queue...
+++ No message received.
+++ Fetching frame from queue...
+++ No message received.
+++ Fetching frame from queue...
+++ No message received.
+++ Fetching frame from queue...
+++ No message received.
Received end message


It crashes when it ends, but I haven't looked into why.

Hopefully building a 64-bit version is straightforward. I'll try that next.
Edit: Yep, works ok.
adpag
Staff
Staff
 
Posts: 486
Joined: Thu Sep 12, 2013 11:29 am

Re: Extending Hardware Support

Postby neh » Wed Jul 27, 2016 5:38 pm

Ah, perfect! I've created a pull request with your code and merged it. Thanks a million times, will quit with a meaningful message then if bitsize is different between the slave and the master.

Cheers!
neh
VIP Tester
VIP Tester
 
Posts: 23
Joined: Fri Sep 20, 2013 1:38 pm

Re: Extending Hardware Support

Postby neh » Thu Jul 28, 2016 1:20 pm

@adpag: Any way that the "d" option could also look for a .bat file? The .bat file would call dmdext with the right options along with the message size it got from ProPinball.exe. The problem with an .exe is that:

  • I need to build it separately for every release of dmdext
  • People need to copy it to the Pro Pinball folder every time they want to update dmdext
A .bat wrapper would just stay in the Pro Pinball folder and launch the latest version.

A part from that, I got it working pretty well. Will paste a shot later :)

EDIT: Uh I managed to put the wrong path into my test .bat. Seems to work!
neh
VIP Tester
VIP Tester
 
Posts: 23
Joined: Fri Sep 20, 2013 1:38 pm

Re: Extending Hardware Support

Postby neh » Fri Jul 29, 2016 8:17 pm

So for those who have a PinDMDv1, PinDMDv3 or PIN2DMD display, I've released a beta that should work with all of them.

Image

You can download it here and setup instructions can be found here.

Note that this is a 64-bit build, so it won't work with a 32-bit ProPinball.exe or on a 32-bit OS. If you already had dmdext installed, make sure you don't forget to download and install the Visual C++ Redistributable for Visual Studio 2015.

Still on my TODO:
  • Supply a 32 bit binary as well
  • Send 4-bit images instead of RGB24 for better performance
  • Customize color per command line for those with an RGB display

Enjoy!
neh
VIP Tester
VIP Tester
 
Posts: 23
Joined: Fri Sep 20, 2013 1:38 pm

PreviousNext

Return to Cabinet

cron