freezy / dmd-extensions

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

dmdext 2.2.1 error with play command #442

Open lglinux3d opened 11 months ago

lglinux3d commented 11 months ago

Hello, if i test this command : C:\spinner>C:\spinner\VisualPinball\VPinMAME\dmdext play --f=C:\spinner\VisualPinball\VPinMAME\default.png -d zedmd on 2.2.1 x64 the command doesn't work

LOG :

`C:\spinner>C:\spinner\VisualPinball\VPinMAME\dmdext play --f=C:\spinner\VisualPinball\VPinMAME\default.png -d zedmd [1] 2023/10/11 16:59:30.521 INFO | Launching console tool v2.2.1 [4] 2023/10/11 16:59:31.738 INFO | Starting ZeDMD frame thread. [1] 2023/10/11 16:59:32.295 INFO | ZeDMD device found on port COM4 with a resolution of 128x32 LEDs [1] 2023/10/11 16:59:32.295 INFO | Added ZeDMD renderer. [1] 2023/10/11 16:59:32.307 INFO | Setting up Render Graph for 1 destination(s) [ ZeDMD ] [1] 2023/10/11 16:59:32.307 INFO | -> Connecting Image Source to ZeDMD (Bitmap -> Rgb24) [1] 2023/10/11 16:59:32.322 INFO | Press CTRL+C to close.

[17] 2023/10/11 16:59:32.322 ERROR | The calling thread cannot access this object because a different thread owns it. [17] 2023/10/11 16:59:32.322 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, Int32 offset, Double lum) at LibDmd.Frame.BmpFrame.ConvertToRgb24() at LibDmd.RenderGraph.<>cDisplayClass62_0.b_14(BmpFrame frame) 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>b1(Exception ex) at System.Reactive.AnonymousSafeObserver1.OnError(Exception error) at System.Reactive.Linq.ObservableImpl.Select2..OnNext(TSource value) at System.Reactive.Linq.ObservableImpl.Select`2..OnNext(TSource value) at System.Reactive.ScheduledObserver1.Dispatch(ICancelable cancel) at System.Reactive.Concurrency.Scheduler.<ScheduleLongRunning>b__72(Action1 a, ICancelable c) at System.Reactive.Concurrency.DefaultScheduler.LongRunning.<>cDisplayClassc`1.bb(Object arg) at System.Reactive.Concurrency.DefaultConcurrencyAbstractionLayer.<>cDisplayClass5.b4() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) 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()

Exception non gérée : 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, Int32 offset, Double lum) at LibDmd.Frame.BmpFrame.ConvertToRgb24() at LibDmd.RenderGraph.<>cDisplayClass62_0.b_14(BmpFrame frame) 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>b1(Exception ex) at System.Reactive.AnonymousSafeObserver1.OnError(Exception error) at System.Reactive.Linq.ObservableImpl.Select2..OnNext(TSource value) at System.Reactive.Linq.ObservableImpl.Select`2..OnNext(TSource value) at System.Reactive.ScheduledObserver1.Dispatch(ICancelable cancel) at System.Reactive.Concurrency.Scheduler.<ScheduleLongRunning>b__72(Action1 a, ICancelable c) at System.Reactive.Concurrency.DefaultScheduler.LongRunning.<>cDisplayClassc`1.bb(Object arg) at System.Reactive.Concurrency.DefaultConcurrencyAbstractionLayer.<>cDisplayClass5.b4() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) 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()`

if i test on 2.1.1 that's works No error. but pinup still doesn't close the Zedmd correctly and the same goes for Pin2dmd, the image remains displayed until a new table is launched, and only on Altcolor.

gustavoalara commented 9 months ago

Same error using a ZeDMD 256x64 panel too

ginzu2077 commented 1 month ago

Same error, 128x32 matrix led DMD

C:\Program Files\DMD Extensions>dmdext.exe play -f "chasehq.gif" -d zedmd [1] 2024/08/08 23:32:15.103 INFO | Launching console tool v2.2.1 [1] 2024/08/08 23:32:16.240 INFO | Reading 144 frames from chasehq.gif... [1] 2024/08/08 23:32:16.274 INFO | GIF animation is looped. [5] 2024/08/08 23:32:16.291 INFO | Starting ZeDMD frame thread. [1] 2024/08/08 23:32:17.282 INFO | ZeDMD device found on port COM3 with a resolution of 128x32 LEDs [1] 2024/08/08 23:32:17.282 INFO | Added ZeDMD renderer. [1] 2024/08/08 23:32:17.300 INFO | Setting up Render Graph for 1 destination(s) [ ZeDMD ] [1] 2024/08/08 23:32:17.306 INFO | -> Connecting GIF Source to ZeDMD (Bitmap -> Rgb24) [1] 2024/08/08 23:32:17.341 INFO | Press CTRL+C to close. [14] 2024/08/08 23:32:17.341 ERROR | The calling thread cannot access this object because a different thread owns it. [14] 2024/08/08 23:32:17.341 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, Int32 offset, Double lum) at LibDmd.Frame.BmpFrame.ConvertToRgb24() at LibDmd.RenderGraph.<>cDisplayClass62_0.b_14(BmpFrame frame) at System.Reactive.Linq.ObservableImpl.Select`2..OnNext(TSource value) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Reactive.Stubs.<.cctor>b1(Exception ex) at System.Reactive.AnonymousSafeObserver1.OnError(Exception error) at System.Reactive.Linq.ObservableImpl.Select2..OnNext(TSource value) 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()

Exception non gérée : 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, Int32 offset, Double lum) at LibDmd.Frame.BmpFrame.ConvertToRgb24() at LibDmd.RenderGraph.<>cDisplayClass62_0.b_14(BmpFrame frame) at System.Reactive.Linq.ObservableImpl.Select`2..OnNext(TSource value) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Reactive.Stubs.<.cctor>b1(Exception ex) at System.Reactive.AnonymousSafeObserver1.OnError(Exception error) at System.Reactive.Linq.ObservableImpl.Select2..OnNext(TSource value) 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()

on the other hand, if i launch the following command, my gif appear on a virtual DMD on the main screen (not what i want) : C:\Program Files\DMD Extensions>dmdext.exe play -f "chasehq.gif" [1] 2024/08/08 23:37:04.399 INFO | Launching console tool v2.2.1 [1] 2024/08/08 23:37:05.527 INFO | Reading 144 frames from chasehq.gif... [1] 2024/08/08 23:37:05.561 INFO | GIF animation is looped. [1] 2024/08/08 23:37:05.644 INFO | Added virtual DMD renderer. [1] 2024/08/08 23:37:05.662 INFO | Setting up Render Graph for 1 destination(s) [ Virtual DMD ] [1] 2024/08/08 23:37:05.668 INFO | -> Connecting GIF Source to Virtual DMD (Bitmap -> Bitmap) [1] 2024/08/08 23:37:05.705 INFO | Press CTRL+C to close. [1] 2024/08/08 23:37:05.884 INFO | Creating FBOs for 128x32

ojacques commented 1 month ago

You may want to try one of the snapshot release from : https://ci.appveyor.com/project/freezy/dmd-extensions/builds/50030013

(Also issued a very new PR #493 to get snapshot builds directly in GitHub).

gustavoalara commented 1 month ago

Hi @ojacques

I just tested these snapshot and now the dmdext play command works correctly

Thanks a lot

VincentMolinie commented 3 weeks ago

Hi @ojacques,

Could you do a release with the fix or put a link to the installer with the fix here 👼 ?

ojacques commented 2 days ago

@VincentMolinie - you could grab the artifact (scroll at the very bottom) from PR #493, which generates dmdext with GitHub Actions : https://github.com/ojacques/dmd-extensions/actions/runs/10340494351

Caution : it won't be the latest release, but it is fresher than 2.2.2, and has the fix for the issue above.