freezy / dmd-extensions

A toolbox for virtual pinball dot matrix displays.
GNU General Public License v2.0
126 stars 54 forks source link

dmdext play #33

Closed sverrewl closed 7 years ago

sverrewl commented 7 years ago

Just github latest 1.5, directly extracted to c:-test - no adjustments to ini-file, so everything is probed. If I run with demo param, it plays demo image, but still not on the dmd - only virtual. Adjust *.ini for pindmd3. Still same issue. Replaced the dll you gave me a couple of weeks ago. That code was very close to at least work for VP. Same issue.

I hope you could have a peek at this forum thread

http://vpuniverse.com/forums/forums/topic/2952-pindmd3-dmddevicedll-almost-there/

I can't use you code in either c:\pinballx or c:\visual_pinball\xdmd. Doing so, and the DMD will not show. I can however use the ones that comes with Pinmame 2.8b - but, I don't believe it wise to have several versions laying around :-)

I so wish for this to work - very close it seems.

thalamus@PINBALL C:\-test\dmdext-v1.5.0
$ dmdext.exe play --file "c:\Pinball_Resources\Company Logos\Williams.png"
[1] 2017/02/14 17:09:38.211 DEBUG | PinDMDv1 device not found.
[1] 2017/02/14 17:09:38.258 DEBUG | PinDMDv2 device not found.
[1] 2017/02/14 17:09:38.258 DEBUG | Checking port COM1 for PinDMDv3...
[1] 2017/02/14 17:09:38.336 DEBUG | Error: The parameter is incorrect.
[1] 2017/02/14 17:09:38.336 DEBUG | Checking port COM3 for PinDMDv3...
[1] 2017/02/14 17:09:38.476 INFO | Found PinDMDv3 device on COM3.
[1] 2017/02/14 17:09:38.476 DEBUG | Firmware: REV-vPin-01008
[1] 2017/02/14 17:09:38.476 DEBUG | Resolution: 128x32
[1] 2017/02/14 17:09:38.601 DEBUG | ******* device not found.
[1] 2017/02/14 17:09:38.601 INFO | Added PinDMDv3 renderer.
[1] 2017/02/14 17:09:38.648 INFO | Added VirtualDMD renderer.
[1] 2017/02/14 17:09:38.648 DEBUG | Resizing virtual DMD to 128x32
[1] 2017/02/14 17:09:38.663 INFO | Setting up Render Graph for 2 destination(s)
[1] 2017/02/14 17:09:38.679 INFO | Connecting Image Source to PinDMD v3 (Bitmap => Rgb24)
[1] 2017/02/14 17:09:38.710 INFO | Connecting Image Source to Dmd (Bitmap => Bitmap)
[1] 2017/02/14 17:09:38.710 INFO | Press CTRL+C to close.
[10] 2017/02/14 17:09:38.710 ERROR | The calling thread cannot access this object because a different thread owns it.
[10] 2017/02/14 17:09:38.710 ERROR | System.InvalidOperationException: The calling thread cannot access this object because a
different thread owns it.
at System.Windows.Threading.Dispatcher.VerifyAccess()
at System.Windows.Media.Imaging.BitmapSource.get_PixelWidth()
at LibDmd.Common.ImageUtil.ConvertToRgb24(BitmapSource bmp, Double lum) in C:\Development\dmd-extensions\LibDmd\Common\Imag
eUtil.cs:line 121
at System.Reactive.Linq.ObservableImpl.Select`2._.OnNext(TSource value)
--- End of stack trace from previous location where exception was thrown ---
at System.Reactive.PlatformServices.DefaultExceptionServices.Rethrow(Exception exception)
at System.Reactive.Stubs.<.cctor>b__1(Exception ex)
at System.Reactive.AnonymousSafeObserver`1.OnError(Exception error)
at System.Reactive.Linq.ObservableImpl.Select`2._.OnError(Exception error)
at System.Reactive.Linq.ObservableImpl.Select`2._.OnNext(TSource value)
at System.Reactive.ScheduledObserver`1.Dispatch(ICancelable cancel)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state,
Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean
preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()

Unhandled Exception: System.InvalidOperationException: The calling thread cannot access this object because a different thread
owns it.
at System.Windows.Threading.Dispatcher.VerifyAccess()
at System.Windows.Media.Imaging.BitmapSource.get_PixelWidth()
at LibDmd.Common.ImageUtil.ConvertToRgb24(BitmapSource bmp, Double lum) in C:\Development\dmd-extensions\LibDmd\Common\Imag
eUtil.cs:line 121
at System.Reactive.Linq.ObservableImpl.Select`2._.OnNext(TSource value)
--- End of stack trace from previous location where exception was thrown ---
at System.Reactive.PlatformServices.DefaultExceptionServices.Rethrow(Exception exception)
at System.Reactive.Stubs.<.cctor>b__1(Exception ex)
at System.Reactive.AnonymousSafeObserver`1.OnError(Exception error)
at System.Reactive.Linq.ObservableImpl.Select`2._.OnError(Exception error)
at System.Reactive.Linq.ObservableImpl.Select`2._.OnNext(TSource value)
at System.Reactive.ScheduledObserver`1.Dispatch(ICancelable cancel)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state,
Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean
preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()

thalamus@PINBALL C:\-test\dmdext-v1.5.0 
sverrewl commented 7 years ago

Btw - get the same error with

$ dmdext.exe test

But, the virtual DMD does show up.

freezy commented 7 years ago

Try this build:

DmdDevice.zip

sverrewl commented 7 years ago

Replaced the dll and ran both "dmdext test" and with "play file" option. Unfortunately doesn't seem to have change anything. Clean boot of computer, frist test is the dmdext.exe. So, should be "clean" environment.

 dmdext.exe play --file "c:\Pinball_Resources\Company Logos\Williams.png"
 [1] 2017/02/15 01:46:17.504 DEBUG | PinDMDv1 device not found.
 [1] 2017/02/15 01:46:17.535 DEBUG | PinDMDv2 device not found.
 [1] 2017/02/15 01:46:17.550 DEBUG | Checking port COM1 for PinDMDv3...
 [1] 2017/02/15 01:46:17.628 DEBUG | Error: The parameter is incorrect.
 [1] 2017/02/15 01:46:17.628 DEBUG | Checking port COM3 for PinDMDv3...
 [1] 2017/02/15 01:46:17.753  INFO | Found PinDMDv3 device on COM3.
 [1] 2017/02/15 01:46:17.753 DEBUG |    Firmware:    REV-vPin-01008
 [1] 2017/02/15 01:46:17.753 DEBUG |    Resolution:  128x32
 [1] 2017/02/15 01:46:17.878 DEBUG | PIN2DMD device not found.
 [1] 2017/02/15 01:46:17.878  INFO | Added PinDMDv3 renderer.
 [1] 2017/02/15 01:46:17.925  INFO | Added VirtualDMD renderer.
 [1] 2017/02/15 01:46:17.940 DEBUG | Resizing virtual DMD to 128x32
 [1] 2017/02/15 01:46:17.940  INFO | Setting up Render Graph for 2 destination(s)
 [1] 2017/02/15 01:46:17.956  INFO | Connecting Image Source to PinDMD v3 (Bitmap => Rgb24)
 [1] 2017/02/15 01:46:17.987  INFO | Connecting Image Source to Dmd (Bitmap => Bitmap)
 [1] 2017/02/15 01:46:18.003  INFO | Press CTRL+C to close.
[10] 2017/02/15 01:46:18.003 ERROR | The calling thread cannot access this object because a different thread owns it.
[10] 2017/02/15 01:46:18.003 ERROR | System.InvalidOperationException: The calling thread cannot access this object because a different thread owns it.
   at System.Windows.Threading.Dispatcher.VerifyAccess()
   at System.Windows.Media.Imaging.BitmapSource.get_PixelWidth()
   at LibDmd.Common.ImageUtil.ConvertToRgb24(BitmapSource bmp, Double lum) in C:\Development\dmd-extensions\LibDmd\Common\ImageUtil.cs:line 121
   at System.Reactive.Linq.ObservableImpl.Select`2._.OnNext(TSource value)
--- End of stack trace from previous location where exception was thrown ---
   at System.Reactive.PlatformServices.DefaultExceptionServices.Rethrow(Exception exception)
   at System.Reactive.Stubs.<.cctor>b__1(Exception ex)
   at System.Reactive.AnonymousSafeObserver`1.OnError(Exception error)
   at System.Reactive.Linq.ObservableImpl.Select`2._.OnError(Exception error)
   at System.Reactive.Linq.ObservableImpl.Select`2._.OnNext(TSource value)
   at System.Reactive.ScheduledObserver`1.Dispatch(ICancelable cancel)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

Loading table in VP and exit - works great. Over PBX, as before, doesn't save state so eg. Grand Champion will not be saved. As explained on VPU, replacing your dmddevice.dll in pinballx or ultradmd folder gives only black screen.

In PBX I populate table image on dmd if it is a EM or a SS with score in backglass. UltraDMD/XDMD works with color but, on exit it needs to be killed. Wish there was an option to exit UltraDMD on table1_exit()

Maybe you could mention it to Tom if you talk to him about the PBX exit problem. Thank you so much for your hard work.

freezy commented 7 years ago

Argh of course, the DLL is irrelevant when using dmdext.exe. Here's another build with the .exe included:

DmdDevice.zip

sverrewl commented 7 years ago

dmdext.exe play == success

Your awesome.

Status for VP, no changes. But, this case is resolved, so, I close it and continue in the other bug report.

thalamus@PINBALL C:-test\dmdext-v1.5.0 $ dmdext.exe play --file "c:\Pinball_Resources\Company Logos\Williams.png" [1] 2017/02/15 15:22:00.659 INFO | Launching console tool. [1] 2017/02/15 15:22:00.706 DEBUG | PinDMDv1 device not found. [1] 2017/02/15 15:22:00.737 DEBUG | PinDMDv2 device not found. [1] 2017/02/15 15:22:00.737 DEBUG | Checking port COM1 for PinDMDv3... [1] 2017/02/15 15:22:00.815 DEBUG | Error: The parameter is incorrect. [1] 2017/02/15 15:22:00.815 DEBUG | Checking port COM3 for PinDMDv3... [1] 2017/02/15 15:22:00.940 INFO | Found PinDMDv3 device on COM3. [1] 2017/02/15 15:22:00.940 DEBUG | Firmware: REV-vPin-01008 [1] 2017/02/15 15:22:00.940 DEBUG | Resolution: 128x32 [1] 2017/02/15 15:22:01.065 DEBUG | PIN2DMD device not found. [1] 2017/02/15 15:22:01.065 INFO | Added PinDMDv3 renderer. [1] 2017/02/15 15:22:01.127 INFO | Added VirtualDMD renderer. [1] 2017/02/15 15:22:01.143 DEBUG | Resizing virtual DMD to 128x32 [1] 2017/02/15 15:22:01.158 INFO | Setting up Render Graph for 2 destination(s) [1] 2017/02/15 15:22:01.190 INFO | Connecting Image Source to PinDMD v3 (Bitmap => Rgb24) [1] 2017/02/15 15:22:01.268 INFO | Connecting Image Source to Dmd (Bitmap => Bitmap) [1] 2017/02/15 15:22:01.268 INFO | Press CTRL+C to close. [12] 2017/02/15 15:22:10.004 INFO | Source for 2 renderer(s) stopped. [12] 2017/02/15 15:22:10.004 DEBUG | Disposing render graph. ^C

freezy commented 7 years ago

Thanks for the report!