Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

oshimai

macrumors member
Apr 7, 2020
53
31
Europe
Thank you! 🙏

I checked whether it was the Arduino using the control panel. I don't know if you've seen it, but I recently added a EEPROM value analyzer window to track down exactly this sort of thing and because I hoped it would help you get the protocol implemented easier.

If you grab the latest code and right-click inside a blank area of the control panel window, you can click "Show Settings Analyzer" to open a small tool window that prints the current values into a list if you click "Refresh". Hopefully it still compiles, since I also did a lot of changes to the test patterns. If it errors out again with Mono, let me know and I'll fix it ASAP.

It looks like this:
IMG_0261.JPEG

Maybe I can skirt around removing the CRT and PAV board for a little longer. I let everything cool over night and then used a pointy plastic trim tool to gently massage the wires on the neck board since I figured that's where the color channel wires go into. Then I booted up the PC and all colors were there. Knowing my luck as soon as I close the iMac up again the problem will come back.

IMG_0262.JPEG IMG_0260.JPEG

The GUI should set the RGB sliders according to what it gets from "02h Dump SRAM Config". There was a bug I recently fixed where the R and G sliders would use the value from the B slider because I was copy/pasting code without using my head when making the sliders do something.

Would you like me to add a baud rate selector underneath the COM port selector? It's no effort at all.
 
  • Like
Reactions: rockyhill

rockyhill

macrumors regular
Dec 24, 2016
214
67
Miami Fl, United States
Thank you! 🙏

I checked whether it was the Arduino using the control panel. I don't know if you've seen it, but I recently added a EEPROM value analyzer window to track down exactly this sort of thing and because I hoped it would help you get the protocol implemented easier.

If you grab the latest code and right-click inside a blank area of the control panel window, you can click "Show Settings Analyzer" to open a small tool window that prints the current values into a list if you click "Refresh". Hopefully it still compiles, since I also did a lot of changes to the test patterns. If it errors out again with Mono, let me know and I'll fix it ASAP.

It looks like this:
View attachment 914311

Maybe I can skirt around removing the CRT and PAV board for a little longer. I let everything cool over night and then used a pointy plastic trim tool to gently massage the wires on the neck board since I figured that's where the color channel wires go into. Then I booted up the PC and all colors were there. Knowing my luck as soon as I close the iMac up again the problem will come back.

View attachment 914310 View attachment 914309

The GUI should set the RGB sliders according to what it gets from "02h Dump SRAM Config". There was a bug I recently fixed where the R and G sliders would use the value from the B slider because I was copy/pasting code without using my head when making the sliders do something.

Would you like me to add a baud rate selector underneath the COM port selector? It's no effort at all.


Glad to hear green is back!
The new additions to the GUI look nice, I'll download and let you know how it goes.
 

rockyhill

macrumors regular
Dec 24, 2016
214
67
Miami Fl, United States
I just downloaded and tried to compile but unfortunately there were issues.

On first attemt, xbuild generates 1 error.

Bash:
rockyhill:~/Downloads/src/imacg3$ xbuild /p:Configuration=Mono crtcpl.sln

>>>> xbuild tool is deprecated and will be removed in future updates, use msbuild instead <<<<

XBuild Engine Version 14.0
Mono, Version 6.6.0.166
Copyright (C) 2005-2013 Various Mono authors

Build started 5/12/2020 9:43:37 AM.
__________________________________________________
/home/rockyhill/Downloads/src/imacg3/crtcpl.sln:  warning : Ignoring vcproj 'crtcplres'.
/home/rockyhill/Downloads/src/imacg3/crtcpl.sln:  warning : Ignoring vcproj 'rightclickassist'.
/home/rockyhill/Downloads/src/imacg3/crtcpl.sln:  warning : Failed to find project 8351da02-4ea8-4505-b944-d5c6724b3af6
/home/rockyhill/Downloads/src/imacg3/crtcpl.sln:  warning : Failed to find project 3ea43c76-9821-43ba-ba3c-4e3c13c7c0f7
/home/rockyhill/Downloads/src/imacg3/crtcpl.sln:  warning : Don't know how to handle GlobalSection ExtensibilityGlobals, Ignoring.
Project "/home/rockyhill/Downloads/src/imacg3/crtcpl.sln" (default target(s)):
    Target ValidateSolutionConfiguration:
        Building solution configuration "Mono|Any CPU".
    Target Build:
        Project "/home/rockyhill/Downloads/src/imacg3/crtcpl/crtcpl.csproj" (default target(s)):
            Target PrepareForBuild:
                Configuration: Mono Platform: AnyCPU
                Created directory "bin/Mono/"
                Created directory "obj/Mono/"
            Target GenerateResources:
                Tool /usr/lib/mono/4.5/resgen.exe execution started with arguments: /useSourcePath /compile "AdvancedPage.resx,obj/Mono/crtcpl.AdvancedPage.resources"
                Tool /usr/lib/mono/4.5/resgen.exe execution started with arguments: /useSourcePath /compile "AppletForm.resx,obj/Mono/crtcpl.AppletForm.resources"
                Tool /usr/lib/mono/4.5/resgen.exe execution started with arguments: /useSourcePath /compile "ColorsPage.resx,obj/Mono/crtcpl.ColorsPage.resources"
                Tool /usr/lib/mono/4.5/resgen.exe execution started with arguments: /useSourcePath /compile "SettingsAnalyzerForm.resx,obj/Mono/crtcpl.SettingsAnalyzerForm.resources"
                Tool /usr/lib/mono/4.5/resgen.exe execution started with arguments: /useSourcePath /compile "GeometryPage.resx,obj/Mono/crtcpl.GeometryPage.resources"
                Tool /usr/lib/mono/4.5/resgen.exe execution started with arguments: /useSourcePath /compile "ImageRes/ImageRes.resx,obj/Mono/crtcpl.ImageRes.ImageRes.resources"
                Unhandled Exception:
                System.ArgumentException: No codec available for format:b96b3cac-0728-11d3-9d7b-0000f81ef32e
                  at System.Drawing.Image.Save (System.IO.Stream stream, System.Drawing.Imaging.ImageFormat format) [0x00029] in <fa3058d2db7e41b08d735ae82b67fb70>:0
                  at System.Drawing.Image.System.Runtime.Serialization.ISerializable.GetObjectData (System.Runtime.Serialization.SerializationInfo si, System.Runtime.Serialization.StreamingContext context) [0x0002e] in <fa3058d2db7e41b08d735ae82b67fb70>:0
                  at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize (System.Object obj, System.Runtime.Serialization.ISurrogateSelector surrogateSelector, System.Runtime.Serialization.StreamingContext context, System.Runtime.Serialization.Formatters.Binary.SerObjectInfoInit serObjectInfoInit, System.Runtime.Serialization.IFormatterConverter converter, System.Runtime.Serialization.Formatters.Binary.ObjectWriter objectWriter, System.Runtime.Serialization.SerializationBinder binder) <0x7f07eea1f1a0 + 0x002f9> in <ab4b6f8474df465bb9c200aa76d63763>:0
                  at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize (System.Object graph, System.Runtime.Remoting.Messaging.Header[] inHeaders, System.Runtime.Serialization.Formatters.Binary.__BinaryWriter serWriter, System.Boolean fCheck) <0x7f07eea256c0 + 0x003ea> in <ab4b6f8474df465bb9c200aa76d63763>:0
                  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize (System.IO.Stream serializationStream, System.Object graph, System.Runtime.Remoting.Messaging.Header[] headers, System.Boolean fCheck) <0x7f07eea1c0e0 + 0x000fa> in <ab4b6f8474df465bb9c200aa76d63763>:0
                  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize (System.IO.Stream serializationStream, System.Object graph) <0x7f07eea1c050 + 0x00036> in <ab4b6f8474df465bb9c200aa76d63763>:0
                  at System.Resources.ResourceWriter.WriteValue (System.Resources.ResourceTypeCode typeCode, System.Object value, System.IO.BinaryWriter writer, System.Runtime.Serialization.IFormatter objFormatter) <0x7f07eea545e0 + 0x00083> in <ab4b6f8474df465bb9c200aa76d63763>:0
                  at System.Resources.ResourceWriter.Generate () [0x00252] in <ab4b6f8474df465bb9c200aa76d63763>:0
                  at System.Resources.ResourceWriter.Dispose () <0x7f07eea542b0 + 0x0002a> in <ab4b6f8474df465bb9c200aa76d63763>:0
                  at ResGen.CompileResourceFile (System.String sname, System.String dname, System.Boolean useSourcePath) [0x00179] in <5769227c34414fe0861c1d3a1494c400>:0
                  at ResGen.Main (System.String[] args) [0x0038e] in <5769227c34414fe0861c1d3a1494c400>:0
                [ERROR] FATAL UNHANDLED EXCEPTION: System.ArgumentException: No codec available for format:b96b3cac-0728-11d3-9d7b-0000f81ef32e
                  at System.Drawing.Image.Save (System.IO.Stream stream, System.Drawing.Imaging.ImageFormat format) [0x00029] in <fa3058d2db7e41b08d735ae82b67fb70>:0
                  at System.Drawing.Image.System.Runtime.Serialization.ISerializable.GetObjectData (System.Runtime.Serialization.SerializationInfo si, System.Runtime.Serialization.StreamingContext context) [0x0002e] in <fa3058d2db7e41b08d735ae82b67fb70>:0
                  at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize (System.Object obj, System.Runtime.Serialization.ISurrogateSelector surrogateSelector, System.Runtime.Serialization.StreamingContext context, System.Runtime.Serialization.Formatters.Binary.SerObjectInfoInit serObjectInfoInit, System.Runtime.Serialization.IFormatterConverter converter, System.Runtime.Serialization.Formatters.Binary.ObjectWriter objectWriter, System.Runtime.Serialization.SerializationBinder binder) <0x7f07eea1f1a0 + 0x002f9> in <ab4b6f8474df465bb9c200aa76d63763>:0
                  at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize (System.Object graph, System.Runtime.Remoting.Messaging.Header[] inHeaders, System.Runtime.Serialization.Formatters.Binary.__BinaryWriter serWriter, System.Boolean fCheck) <0x7f07eea256c0 + 0x003ea> in <ab4b6f8474df465bb9c200aa76d63763>:0
                  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize (System.IO.Stream serializationStream, System.Object graph, System.Runtime.Remoting.Messaging.Header[] headers, System.Boolean fCheck) <0x7f07eea1c0e0 + 0x000fa> in <ab4b6f8474df465bb9c200aa76d63763>:0
                  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize (System.IO.Stream serializationStream, System.Object graph) <0x7f07eea1c050 + 0x00036> in <ab4b6f8474df465bb9c200aa76d63763>:0
                  at System.Resources.ResourceWriter.WriteValue (System.Resources.ResourceTypeCode typeCode, System.Object value, System.IO.BinaryWriter writer, System.Runtime.Serialization.IFormatter objFormatter) <0x7f07eea545e0 + 0x00083> in <ab4b6f8474df465bb9c200aa76d63763>:0
                  at System.Resources.ResourceWriter.Generate () [0x00252] in <ab4b6f8474df465bb9c200aa76d63763>:0
                  at System.Resources.ResourceWriter.Dispose () <0x7f07eea542b0 + 0x0002a> in <ab4b6f8474df465bb9c200aa76d63763>:0
                  at ResGen.CompileResourceFile (System.String sname, System.String dname, System.Boolean useSourcePath) [0x00179] in <5769227c34414fe0861c1d3a1494c400>:0
                  at ResGen.Main (System.String[] args) [0x0038e] in <5769227c34414fe0861c1d3a1494c400>:0
/usr/lib/mono/xbuild/14.0/bin/Microsoft.Common.targets: error : Tool exited with code: 1. Output: Read in 29 resources from '/home/rockyhill/Downloads/src/imacg3/crtcpl/ImageRes/ImageRes.resx'
Error: No codec available for format:b96b3cac-0728-11d3-9d7b-0000f81ef32e

Unhandled Exception:
System.ArgumentException: No codec available for format:b96b3cac-0728-11d3-9d7b-0000f81ef32e
  at System.Drawing.Image.Save (System.IO.Stream stream, System.Drawing.Imaging.ImageFormat format) [0x00029] in <fa3058d2db7e41b08d735ae82b67fb70>:0
  at System.Drawing.Image.System.Runtime.Serialization.ISerializable.GetObjectData (System.Runtime.Serialization.SerializationInfo si, System.Runtime.Serialization.StreamingContext context) [0x0002e] in <fa3058d2db7e41b08d735ae82b67fb70>:0
  at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize (System.Object obj, System.Runtime.Serialization.ISurrogateSelector surrogateSelector, System.Runtime.Serialization.StreamingContext context, System.Runtime.Serialization.Formatters.Binary.SerObjectInfoInit serObjectInfoInit, System.Runtime.Serialization.IFormatterConverter converter, System.Runtime.Serialization.Formatters.Binary.ObjectWriter objectWriter, System.Runtime.Serialization.SerializationBinder binder) <0x7f07eea1f1a0 + 0x002f9> in <ab4b6f8474df465bb9c200aa76d63763>:0
  at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize (System.Object graph, System.Runtime.Remoting.Messaging.Header[] inHeaders, System.Runtime.Serialization.Formatters.Binary.__BinaryWriter serWriter, System.Boolean fCheck) <0x7f07eea256c0 + 0x003ea> in <ab4b6f8474df465bb9c200aa76d63763>:0
  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize (System.IO.Stream serializationStream, System.Object graph, System.Runtime.Remoting.Messaging.Header[] headers, System.Boolean fCheck) <0x7f07eea1c0e0 + 0x000fa> in <ab4b6f8474df465bb9c200aa76d63763>:0
  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize (System.IO.Stream serializationStream, System.Object graph) <0x7f07eea1c050 + 0x00036> in <ab4b6f8474df465bb9c200aa76d63763>:0
  at System.Resources.ResourceWriter.WriteValue (System.Resources.ResourceTypeCode typeCode, System.Object value, System.IO.BinaryWriter writer, System.Runtime.Serialization.IFormatter objFormatter) <0x7f07eea545e0 + 0x00083> in <ab4b6f8474df465bb9c200aa76d63763>:0
  at System.Resources.ResourceWriter.Generate () [0x00252] in <ab4b6f8474df465bb9c200aa76d63763>:0
  at System.Resources.ResourceWriter.Dispose () <0x7f07eea542b0 + 0x0002a> in <ab4b6f8474df465bb9c200aa76d63763>:0
  at ResGen.CompileResourceFile (System.String sname, System.String dname, System.Boolean useSourcePath) [0x00179] in <5769227c34414fe0861c1d3a1494c400>:0
  at ResGen.Main (System.String[] args) [0x0038e] in <5769227c34414fe0861c1d3a1494c400>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.ArgumentException: No codec available for format:b96b3cac-0728-11d3-9d7b-0000f81ef32e
  at System.Drawing.Image.Save (System.IO.Stream stream, System.Drawing.Imaging.ImageFormat format) [0x00029] in <fa3058d2db7e41b08d735ae82b67fb70>:0
  at System.Drawing.Image.System.Runtime.Serialization.ISerializable.GetObjectData (System.Runtime.Serialization.SerializationInfo si, System.Runtime.Serialization.StreamingContext context) [0x0002e] in <fa3058d2db7e41b08d735ae82b67fb70>:0
  at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize (System.Object obj, System.Runtime.Serialization.ISurrogateSelector surrogateSelector, System.Runtime.Serialization.StreamingContext context, System.Runtime.Serialization.Formatters.Binary.SerObjectInfoInit serObjectInfoInit, System.Runtime.Serialization.IFormatterConverter converter, System.Runtime.Serialization.Formatters.Binary.ObjectWriter objectWriter, System.Runtime.Serialization.SerializationBinder binder) <0x7f07eea1f1a0 + 0x002f9> in <ab4b6f8474df465bb9c200aa76d63763>:0
  at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize (System.Object graph, System.Runtime.Remoting.Messaging.Header[] inHeaders, System.Runtime.Serialization.Formatters.Binary.__BinaryWriter serWriter, System.Boolean fCheck) <0x7f07eea256c0 + 0x003ea> in <ab4b6f8474df465bb9c200aa76d63763>:0
  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize (System.IO.Stream serializationStream, System.Object graph, System.Runtime.Remoting.Messaging.Header[] headers, System.Boolean fCheck) <0x7f07eea1c0e0 + 0x000fa> in <ab4b6f8474df465bb9c200aa76d63763>:0
  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize (System.IO.Stream serializationStream, System.Object graph) <0x7f07eea1c050 + 0x00036> in <ab4b6f8474df465bb9c200aa76d63763>:0
  at System.Resources.ResourceWriter.WriteValue (System.Resources.ResourceTypeCode typeCode, System.Object value, System.IO.BinaryWriter writer, System.Runtime.Serialization.IFormatter objFormatter) <0x7f07eea545e0 + 0x00083> in <ab4b6f8474df465bb9c200aa76d63763>:0
  at System.Resources.ResourceWriter.Generate () [0x00252] in <ab4b6f8474df465bb9c200aa76d63763>:0
  at System.Resources.ResourceWriter.Dispose () <0x7f07eea542b0 + 0x0002a> in <ab4b6f8474df465bb9c200aa76d63763>:0
  at ResGen.CompileResourceFile (System.String sname, System.String dname, System.Boolean useSourcePath) [0x00179] in <5769227c34414fe0861c1d3a1494c400>:0
  at ResGen.Main (System.String[] args) [0x0038e] in <5769227c34414fe0861c1d3a1494c400>:0

                Tool /usr/lib/mono/4.5/resgen.exe execution started with arguments: /useSourcePath /compile "ScreenPage.resx,obj/Mono/crtcpl.ScreenPage.resources"
                Tool /usr/lib/mono/4.5/resgen.exe execution started with arguments: /useSourcePath /compile "ColorGradient.resx,obj/Mono/crtcpl.ColorGradient.resources"
                Tool /usr/lib/mono/4.5/resgen.exe execution started with arguments: /useSourcePath /compile "StringRes/StringRes.resx,obj/Mono/crtcpl.StringRes.StringRes.resources"
                Tool /usr/lib/mono/4.5/resgen.exe execution started with arguments: /useSourcePath /compile "TestPatternForm.resx,obj/Mono/crtcpl.TestPatternForm.resources"
            Task "GenerateResource" execution -- FAILED
            Done building target "GenerateResources" in project "/home/rockyhill/Downloads/src/imacg3/crtcpl/crtcpl.csproj".-- FAILED
        Done building project "/home/rockyhill/Downloads/src/imacg3/crtcpl/crtcpl.csproj".-- FAILED
    Task "MSBuild" execution -- FAILED
    Done building target "Build" in project "/home/rockyhill/Downloads/src/imacg3/crtcpl.sln".-- FAILED
Done building project "/home/rockyhill/Downloads/src/imacg3/crtcpl.sln".-- FAILED

Build FAILED.

Warnings:

/home/rockyhill/Downloads/src/imacg3/crtcpl.sln:  warning : Ignoring vcproj 'crtcplres'.
/home/rockyhill/Downloads/src/imacg3/crtcpl.sln:  warning : Ignoring vcproj 'rightclickassist'.
/home/rockyhill/Downloads/src/imacg3/crtcpl.sln:  warning : Failed to find project 8351da02-4ea8-4505-b944-d5c6724b3af6
/home/rockyhill/Downloads/src/imacg3/crtcpl.sln:  warning : Failed to find project 3ea43c76-9821-43ba-ba3c-4e3c13c7c0f7
/home/rockyhill/Downloads/src/imacg3/crtcpl.sln:  warning : Don't know how to handle GlobalSection ExtensibilityGlobals, Ignoring.

Errors:

/home/rockyhill/Downloads/src/imacg3/crtcpl.sln (default targets) ->
(Build target) ->
/home/rockyhill/Downloads/src/imacg3/crtcpl/crtcpl.csproj (default targets) ->
/usr/lib/mono/xbuild/14.0/bin/Microsoft.Common.targets (GenerateResources target) ->

    /usr/lib/mono/xbuild/14.0/bin/Microsoft.Common.targets: error : Tool exited with code: 1. Output: Read in 29 resources from '/home/rockyhill/Downloads/src/imacg3/crtcpl/ImageRes/ImageRes.resx'
Error: No codec available for format:b96b3cac-0728-11d3-9d7b-0000f81ef32e

Unhandled Exception:
System.ArgumentException: No codec available for format:b96b3cac-0728-11d3-9d7b-0000f81ef32e
  at System.Drawing.Image.Save (System.IO.Stream stream, System.Drawing.Imaging.ImageFormat format) [0x00029] in <fa3058d2db7e41b08d735ae82b67fb70>:0
  at System.Drawing.Image.System.Runtime.Serialization.ISerializable.GetObjectData (System.Runtime.Serialization.SerializationInfo si, System.Runtime.Serialization.StreamingContext context) [0x0002e] in <fa3058d2db7e41b08d735ae82b67fb70>:0
  at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize (System.Object obj, System.Runtime.Serialization.ISurrogateSelector surrogateSelector, System.Runtime.Serialization.StreamingContext context, System.Runtime.Serialization.Formatters.Binary.SerObjectInfoInit serObjectInfoInit, System.Runtime.Serialization.IFormatterConverter converter, System.Runtime.Serialization.Formatters.Binary.ObjectWriter objectWriter, System.Runtime.Serialization.SerializationBinder binder) <0x7f07eea1f1a0 + 0x002f9> in <ab4b6f8474df465bb9c200aa76d63763>:0
  at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize (System.Object graph, System.Runtime.Remoting.Messaging.Header[] inHeaders, System.Runtime.Serialization.Formatters.Binary.__BinaryWriter serWriter, System.Boolean fCheck) <0x7f07eea256c0 + 0x003ea> in <ab4b6f8474df465bb9c200aa76d63763>:0
  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize (System.IO.Stream serializationStream, System.Object graph, System.Runtime.Remoting.Messaging.Header[] headers, System.Boolean fCheck) <0x7f07eea1c0e0 + 0x000fa> in <ab4b6f8474df465bb9c200aa76d63763>:0
  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize (System.IO.Stream serializationStream, System.Object graph) <0x7f07eea1c050 + 0x00036> in <ab4b6f8474df465bb9c200aa76d63763>:0
  at System.Resources.ResourceWriter.WriteValue (System.Resources.ResourceTypeCode typeCode, System.Object value, System.IO.BinaryWriter writer, System.Runtime.Serialization.IFormatter objFormatter) <0x7f07eea545e0 + 0x00083> in <ab4b6f8474df465bb9c200aa76d63763>:0
  at System.Resources.ResourceWriter.Generate () [0x00252] in <ab4b6f8474df465bb9c200aa76d63763>:0
  at System.Resources.ResourceWriter.Dispose () <0x7f07eea542b0 + 0x0002a> in <ab4b6f8474df465bb9c200aa76d63763>:0
  at ResGen.CompileResourceFile (System.String sname, System.String dname, System.Boolean useSourcePath) [0x00179] in <5769227c34414fe0861c1d3a1494c400>:0
  at ResGen.Main (System.String[] args) [0x0038e] in <5769227c34414fe0861c1d3a1494c400>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.ArgumentException: No codec available for format:b96b3cac-0728-11d3-9d7b-0000f81ef32e
  at System.Drawing.Image.Save (System.IO.Stream stream, System.Drawing.Imaging.ImageFormat format) [0x00029] in <fa3058d2db7e41b08d735ae82b67fb70>:0
  at System.Drawing.Image.System.Runtime.Serialization.ISerializable.GetObjectData (System.Runtime.Serialization.SerializationInfo si, System.Runtime.Serialization.StreamingContext context) [0x0002e] in <fa3058d2db7e41b08d735ae82b67fb70>:0
  at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize (System.Object obj, System.Runtime.Serialization.ISurrogateSelector surrogateSelector, System.Runtime.Serialization.StreamingContext context, System.Runtime.Serialization.Formatters.Binary.SerObjectInfoInit serObjectInfoInit, System.Runtime.Serialization.IFormatterConverter converter, System.Runtime.Serialization.Formatters.Binary.ObjectWriter objectWriter, System.Runtime.Serialization.SerializationBinder binder) <0x7f07eea1f1a0 + 0x002f9> in <ab4b6f8474df465bb9c200aa76d63763>:0
  at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize (System.Object graph, System.Runtime.Remoting.Messaging.Header[] inHeaders, System.Runtime.Serialization.Formatters.Binary.__BinaryWriter serWriter, System.Boolean fCheck) <0x7f07eea256c0 + 0x003ea> in <ab4b6f8474df465bb9c200aa76d63763>:0
  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize (System.IO.Stream serializationStream, System.Object graph, System.Runtime.Remoting.Messaging.Header[] headers, System.Boolean fCheck) <0x7f07eea1c0e0 + 0x000fa> in <ab4b6f8474df465bb9c200aa76d63763>:0
  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize (System.IO.Stream serializationStream, System.Object graph) <0x7f07eea1c050 + 0x00036> in <ab4b6f8474df465bb9c200aa76d63763>:0
  at System.Resources.ResourceWriter.WriteValue (System.Resources.ResourceTypeCode typeCode, System.Object value, System.IO.BinaryWriter writer, System.Runtime.Serialization.IFormatter objFormatter) <0x7f07eea545e0 + 0x00083> in <ab4b6f8474df465bb9c200aa76d63763>:0
  at System.Resources.ResourceWriter.Generate () [0x00252] in <ab4b6f8474df465bb9c200aa76d63763>:0
  at System.Resources.ResourceWriter.Dispose () <0x7f07eea542b0 + 0x0002a> in <ab4b6f8474df465bb9c200aa76d63763>:0
  at ResGen.CompileResourceFile (System.String sname, System.String dname, System.Boolean useSourcePath) [0x00179] in <5769227c34414fe0861c1d3a1494c400>:0
  at ResGen.Main (System.String[] args) [0x0038e] in <5769227c34414fe0861c1d3a1494c400>:0


     5 Warning(s)
     1 Error(s)

Time Elapsed 00:00:01.6851630



However, if you issue xbuild again, it compiles but the executable does not run.


Bash:
rockyhill:~/Downloads/src/imacg3$ mono crtcpl/bin/Mono/crtcpl.exe

Unhandled Exception:
System.BadImageFormatException: Corrupt .resources file. Unable to read resources from this file because of invalid header information. Try regenerating the .resources file. ---> System.IO.EndOfStreamException: Unable to read beyond the end of the stream.
  at System.IO.__Error.EndOfFile () <0x7f0cd728d200 + 0x00032> in <ab4b6f8474df465bb9c200aa76d63763>:0
  at System.IO.BinaryReader.FillBuffer (System.Int32 numBytes) <0x7f0cd728f2a0 + 0x000ad> in <ab4b6f8474df465bb9c200aa76d63763>:0
  at System.IO.BinaryReader.ReadInt32 () <0x7f0cd728df20 + 0x000c2> in <ab4b6f8474df465bb9c200aa76d63763>:0
  at System.Resources.ResourceReader._ReadResources () <0x7f0cd71e4a60 + 0x0003b> in <ab4b6f8474df465bb9c200aa76d63763>:0
  at System.Resources.ResourceReader.ReadResources () [0x00015] in <ab4b6f8474df465bb9c200aa76d63763>:0
  at System.Resources.ResourceReader.ReadResources () [0x0002e] in <ab4b6f8474df465bb9c200aa76d63763>:0
  at System.Resources.ResourceReader..ctor (System.IO.Stream stream, System.Collections.Generic.Dictionary`2[TKey,TValue] resCache) <0x7f0cd71e2640 + 0x000fd> in <ab4b6f8474df465bb9c200aa76d63763>:0
  at System.Resources.RuntimeResourceSet..ctor (System.IO.Stream stream) <0x7f0cd71dd440 + 0x00096> in <ab4b6f8474df465bb9c200aa76d63763>:0
  at System.Resources.ManifestBasedResourceGroveler.CreateResourceSet (System.IO.Stream store, System.Reflection.Assembly assembly) [0x00173] in <ab4b6f8474df465bb9c200aa76d63763>:0
  at System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet (System.Globalization.CultureInfo culture, System.Collections.Generic.Dictionary`2[TKey,TValue] localResourceSets, System.Boolean tryParents, System.Boolean createIfNotExists, System.Threading.StackCrawlMark& stackMark) <0x7f0cd71de720 + 0x0026b> in <ab4b6f8474df465bb9c200aa76d63763>:0
  at System.Resources.ResourceManager.InternalGetResourceSet (System.Globalization.CultureInfo requestedCulture, System.Boolean createIfNotExists, System.Boolean tryParents, System.Threading.StackCrawlMark& stackMark) [0x00099] in <ab4b6f8474df465bb9c200aa76d63763>:0
  at System.Resources.ResourceManager.InternalGetResourceSet (System.Globalization.CultureInfo culture, System.Boolean createIfNotExists, System.Boolean tryParents) <0x7f0cd71e13f0 + 0x00043> in <ab4b6f8474df465bb9c200aa76d63763>:0
  at System.Resources.ResourceManager.GetObject (System.String name, System.Globalization.CultureInfo culture, System.Boolean wrapUnmanagedMemStream) [0x00071] in <ab4b6f8474df465bb9c200aa76d63763>:0
  at System.Resources.ResourceManager.GetObject (System.String name, System.Globalization.CultureInfo culture) <0x7f0cd71e1e00 + 0x00033> in <ab4b6f8474df465bb9c200aa76d63763>:0
  at crtcpl.ImageRes.ImageRes.get_SCREEN () [0x00005] in <8e5f527e66f446fea748401b2b27adc1>:0
  at crtcpl.GeometryPage.InitializeComponent () [0x00330] in <8e5f527e66f446fea748401b2b27adc1>:0
  at crtcpl.GeometryPage..ctor () [0x00006] in <8e5f527e66f446fea748401b2b27adc1>:0
  at (wrapper remoting-invoke-with-check) crtcpl.GeometryPage..ctor()
  at crtcpl.AppletForm.InitializeComponent () [0x00047] in <8e5f527e66f446fea748401b2b27adc1>:0
  at crtcpl.AppletForm..ctor () [0x0001c] in <8e5f527e66f446fea748401b2b27adc1>:0
  at (wrapper remoting-invoke-with-check) crtcpl.AppletForm..ctor()
  at crtcpl.Program.Main () [0x000b2] in <8e5f527e66f446fea748401b2b27adc1>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.BadImageFormatException: Corrupt .resources file. Unable to read resources from this file because of invalid header information. Try regenerating the .resources file. ---> System.IO.EndOfStreamException: Unable to read beyond the end of the stream.
  at System.IO.__Error.EndOfFile () <0x7f0cd728d200 + 0x00032> in <ab4b6f8474df465bb9c200aa76d63763>:0
  at System.IO.BinaryReader.FillBuffer (System.Int32 numBytes) <0x7f0cd728f2a0 + 0x000ad> in <ab4b6f8474df465bb9c200aa76d63763>:0
  at System.IO.BinaryReader.ReadInt32 () <0x7f0cd728df20 + 0x000c2> in <ab4b6f8474df465bb9c200aa76d63763>:0
  at System.Resources.ResourceReader._ReadResources () <0x7f0cd71e4a60 + 0x0003b> in <ab4b6f8474df465bb9c200aa76d63763>:0
  at System.Resources.ResourceReader.ReadResources () [0x00015] in <ab4b6f8474df465bb9c200aa76d63763>:0
  at System.Resources.ResourceReader.ReadResources () [0x0002e] in <ab4b6f8474df465bb9c200aa76d63763>:0
  at System.Resources.ResourceReader..ctor (System.IO.Stream stream, System.Collections.Generic.Dictionary`2[TKey,TValue] resCache) <0x7f0cd71e2640 + 0x000fd> in <ab4b6f8474df465bb9c200aa76d63763>:0
  at System.Resources.RuntimeResourceSet..ctor (System.IO.Stream stream) <0x7f0cd71dd440 + 0x00096> in <ab4b6f8474df465bb9c200aa76d63763>:0
  at System.Resources.ManifestBasedResourceGroveler.CreateResourceSet (System.IO.Stream store, System.Reflection.Assembly assembly) [0x00173] in <ab4b6f8474df465bb9c200aa76d63763>:0
  at System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet (System.Globalization.CultureInfo culture, System.Collections.Generic.Dictionary`2[TKey,TValue] localResourceSets, System.Boolean tryParents, System.Boolean createIfNotExists, System.Threading.StackCrawlMark& stackMark) <0x7f0cd71de720 + 0x0026b> in <ab4b6f8474df465bb9c200aa76d63763>:0
  at System.Resources.ResourceManager.InternalGetResourceSet (System.Globalization.CultureInfo requestedCulture, System.Boolean createIfNotExists, System.Boolean tryParents, System.Threading.StackCrawlMark& stackMark) [0x00099] in <ab4b6f8474df465bb9c200aa76d63763>:0
  at System.Resources.ResourceManager.InternalGetResourceSet (System.Globalization.CultureInfo culture, System.Boolean createIfNotExists, System.Boolean tryParents) <0x7f0cd71e13f0 + 0x00043> in <ab4b6f8474df465bb9c200aa76d63763>:0
  at System.Resources.ResourceManager.GetObject (System.String name, System.Globalization.CultureInfo culture, System.Boolean wrapUnmanagedMemStream) [0x00071] in <ab4b6f8474df465bb9c200aa76d63763>:0
  at System.Resources.ResourceManager.GetObject (System.String name, System.Globalization.CultureInfo culture) <0x7f0cd71e1e00 + 0x00033> in <ab4b6f8474df465bb9c200aa76d63763>:0
  at crtcpl.ImageRes.ImageRes.get_SCREEN () [0x00005] in <8e5f527e66f446fea748401b2b27adc1>:0
  at crtcpl.GeometryPage.InitializeComponent () [0x00330] in <8e5f527e66f446fea748401b2b27adc1>:0
  at crtcpl.GeometryPage..ctor () [0x00006] in <8e5f527e66f446fea748401b2b27adc1>:0
  at (wrapper remoting-invoke-with-check) crtcpl.GeometryPage..ctor()
  at crtcpl.AppletForm.InitializeComponent () [0x00047] in <8e5f527e66f446fea748401b2b27adc1>:0
  at crtcpl.AppletForm..ctor () [0x0001c] in <8e5f527e66f446fea748401b2b27adc1>:0
  at (wrapper remoting-invoke-with-check) crtcpl.AppletForm..ctor()
  at crtcpl.Program.Main () [0x000b2] in <8e5f527e66f446fea748401b2b27adc1>:0



Hopefully it's an easy fix on your end, I'll poke around the code later on the afternoon to see if I can make sense
of the error.
 

oshimai

macrumors member
Apr 7, 2020
53
31
Europe
sigh

It's because two of the more complicated test patterns (the one in the photo and the SMPTE color bars) are in EMF format, which is MS' own version of SVG. .NET on Windows has a decoder for it, which means it can render the test patterns correctly regardless of screen resolution. Mono appeared to support it too, but I guess it's not so.

Those patterns are more of a gimmick anyway. Sure, it's cute to have them available but they were designed for TVs and the idiosyncrasies of PAL and NTSC.

So time for plan B: the CRT supports 640x480, 800x600, and 1024x768 only, so I'll just ship the control panel with prerendered bitmaps at the appropriate resolutions and call it a day.

Baud rate selection is also available now.

It compiles with Mono but I need to close the iMac case before I can test the changes on a live system.

But the code is in the repo now. Hope it works for you.
 

rockyhill

macrumors regular
Dec 24, 2016
214
67
Miami Fl, United States

I know, the joys of cross platform development!

The baud rate selector is a nice touch, really convenient. Today I plan on finally stitching in the rest of the code.
Once I have something stable I'll put it up on the repo.


I'll let you know how it goes.
[automerge]1589304554[/automerge]
@oshimai

The program compiles and the baud rate selector works.
I just created a pull request to make a small addition.
 
Last edited:

oshimai

macrumors member
Apr 7, 2020
53
31
Europe
Thank you. I've merged it and slightly modified it. I think it doesn't exit cleanly when running with Mono because Mono is waiting for the serial port read to finish (its running async on another thread). .NET on Windows doesn't care for some reason and exits cleanly.
I've added code to Program.cs to explicitly close the COM port when the main window has gone away but I'll keep the Process.Kill() in as well as a last resort if nothing else works. Application.Exit doesn't hurt Windows users so they get that called too now.

If anyone out there can capture the I2C communication for the advanced settings changeable using the Apple Display Service Utility (download at https://macintoshgarden.org/apps/apple-service-manuals) I will gladly add them! I just need to know the IVAD commands and if possible the min and max values.

I'm talking about this stuff (e.g. the color drive settings):
1589307407556.png


The service manual mentions that you need a jumper adjustment tool to make certain settings permanent, but with the Arduino there's no need for them to be permanent since they can be sent to the IVAD whenever its necessary.
 

rockyhill

macrumors regular
Dec 24, 2016
214
67
Miami Fl, United States
Thank you. I've merged it and slightly modified it. I think it doesn't exit cleanly when running with Mono because Mono is waiting for the serial port read to finish (its running async on another thread). .NET on Windows doesn't care for some reason and exits cleanly.
I've added code to Program.cs to explicitly close the COM port when the main window has gone away but I'll keep the Process.Kill() in as well as a last resort if nothing else works. Application.Exit doesn't hurt Windows users so they get that called too now.

If anyone out there can capture the I2C communication for the advanced settings changeable using the Apple Display Service Utility (download at https://macintoshgarden.org/apps/apple-service-manuals) I will gladly add them! I just need to know the IVAD commands and if possible the min and max values.

I'm talking about this stuff (e.g. the color drive settings):
View attachment 914427

The service manual mentions that you need a jumper adjustment tool to make certain settings permanent, but with the Arduino there's no need for them to be permanent since they can be sent to the IVAD whenever its necessary.


I've merged it and slightly modified it


I just tested the change and they work, thanks. I just encountered another issue that seems like it's a mono bug.
If you close the serial port and then open it again. you get the following exception.

C#:
System.InvalidOperationException: Either the IAsyncResult object did not come from the corresponding async method on this type, or EndRead was called multiple times with the same IAsyncResult.

This is thrown in UCCom.cs line 96.

What confuses me and leads me to believe it's a problem with mono is that there is no exception when debugging the
application, it closes and opens the serial port without issue.


If anyone out there can capture the I2C communication for the advanced settings changeable using the Apple Display Service Utility

I'll try and get a capture for you with my working iMac.
 

rockyhill

macrumors regular
Dec 24, 2016
214
67
Miami Fl, United States
@oshimai

I've pushed a stable version of my sketch that heavily borrows from yours so that your GUI can communicate
with it and and still allow people to change settings via a terminal with the original character
anotherelise implemented.

There are still many changes I need to make but for now it works.

Also, I have a couple of pull requests one of which I think would be helpful to approve.

This pull request is to change the values of the "CONFIG_OFFSET" values so that they mirror
the "IVAD_SETTING" values. I realize this requires changing the values in the sketch as well
but the added symmetry makes the code easier to read and to clean up, at least on my end.
The added symmetry is a plus and there is no impact on how the code works.

GUI works great!!!!!!
 

oshimai

macrumors member
Apr 7, 2020
53
31
Europe
I don't really mind changing the values of the offset constants if it avoids having to fork the control panel code, but I'll have to bump CONFIG_EEPROM_VERSION to 2. Otherwise the control panel or an updated sketch flashed into the Arduino would screw up the CRT configuration on my end since whats stored right now is no longer in the right place.

I'll approve the changes in a bit and also make the change so the control panel only works with EEPROM version 2 going forward.

Please also change CONFIG_EEPROM_VERSION to 2 in your sketch so it stays compatible with the updated control panel. You don't have to make any other changes. Since you used the EEPROM Wear Level library, it will act as if the EEPROM is blank once you bump up the version.

To keep the control panel working after you bumped the constant up to 2, just set

public const byte SUPPORTED_EEPROM_VERSION = 0x02;

near the top of Program.cs

For the mono issue, I may have found the underlying cause. It's a race condition. I'll push an experimental fix for that instead of just swallowing all exceptions on Mono (other it would also swallow exceptions if the serial connection goes away suddenly due to a bad cable, for example)
 

rockyhill

macrumors regular
Dec 24, 2016
214
67
Miami Fl, United States
I don't really mind changing the values of the offset constants if it avoids having to fork the control panel code, but I'll have to bump CONFIG_EEPROM_VERSION to 2. Otherwise the control panel or an updated sketch flashed into the Arduino would screw up the CRT configuration on my end since whats stored right now is no longer in the right place.

I'll approve the changes in a bit and also make the change so the control panel only works with EEPROM version 2 going forward.

Please also change CONFIG_EEPROM_VERSION to 2 in your sketch so it stays compatible with the updated control panel. You don't have to make any other changes. Since you used the EEPROM Wear Level library, it will act as if the EEPROM is blank once you bump up the version.

To keep the control panel working after you bumped the constant up to 2, just set

public const byte SUPPORTED_EEPROM_VERSION = 0x02;

near the top of Program.cs

For the mono issue, I may have found the underlying cause. It's a race condition. I'll push an experimental fix for that instead of just swallowing all exceptions on Mono (other it would also swallow exceptions if the serial connection goes away suddenly due to a bad cable, for example)


That's great, bumping up the config EEPROM_VERSION to 2 makes sense and hopefully the experimental fix works.
I'll make the changes and test it all in a bit.
 

rockyhill

macrumors regular
Dec 24, 2016
214
67
Miami Fl, United States
@oshimai

Please also change CONFIG_EEPROM_VERSION to 2 in your sketch so it stays compatible with the updated control panel. You don't have to make any other changes. Since you used the EEPROM Wear Level library, it will act as if the EEPROM is blank once you bump up the version

Just did that and tested it and it works.


For the mono issue, I may have found the underlying cause. It's a race condition. I'll push an experimental fix for that instead of just swallowing all exceptions on Mono (other it would also swallow exceptions if the serial connection goes away suddenly due to a bad cable, for example)

Unfortunately the issue remains.... I'll play with it some more as well.........
 

oshimai

macrumors member
Apr 7, 2020
53
31
Europe
Is it still
System.InvalidOperationException: Either the IAsyncResult object did not come from the corresponding async method on this type, or EndRead was called multiple times with the same IAsyncResult.

and did the line number change?
 

rockyhill

macrumors regular
Dec 24, 2016
214
67
Miami Fl, United States
Is it still
System.InvalidOperationException: Either the IAsyncResult object did not come from the corresponding async method on this type, or EndRead was called multiple times with the same IAsyncResult.

and did the line number change?


The line number did change, it is 89 and the exception is the same.

Screenshot from 2020-05-13 16-03-04.png




Also, I tried to install several versions of the Apple Display Service Utility with no luck..........
My system is running 10.2 so there are issues.....
I think I have a HD with OS9 installed on it but I'm not sure. I'll look around and pop it in to see
if it's the case.

Looking at the image you posted though, it seems that we already have most of those.

The ones I'm not sure of are the cutoff ones.
 

oshimai

macrumors member
Apr 7, 2020
53
31
Europe
The cutoff ones are referred to in the service manual. They apparently aren't saved unless you do some procedure to the IVAD board so it allows you to permanently write to the factory memory area (instead of temporarily). IIRC after you display the gray bars test pattern, you can tweak the SCREEN potentiometer, and afterwards you're supposed to fine tune the R, G and B cutoff values so the picture doesn't get messed up at max brightness/contrast.

I've quickly rewritten the serial code to not use a seperate reading thread (BeginRead/EndRead) anymore. The changes are in the repo. It was pointless to use a separate thread anyway since the main thread would wait for the reading thread to finish before continuing. I also temporarily removed that the Mono process is killed at the very end since that was very likely also related that separate thread hanging around. If that causes a regression though, it'll go back in.

But with any luck, the Mono crash problem will now be gone since the basis for it no longer exists. I'll give the GUI a thorough test on Linux, but I can only do so later this week.
 

rockyhill

macrumors regular
Dec 24, 2016
214
67
Miami Fl, United States
If anyone out there can capture the I2C communication for the advanced settings changeable using the Apple Display Service Utility (download at https://macintoshgarden.org/apps/apple-service-manuals) I will gladly add them! I just need to know the IVAD commands and if possible the min and max values.


After lots of searching I finally found and old IDE drive that I had in my attic installed it into the iMac and loaded
OS9.

Tomorrow I'll try to install the utility and capture the comms.

Also, I tested the the GUI with the latest changes and it seems more stable. However, every now and then it throws the same exception.

I'll do some more testing tomorrow.
 

rockyhill

macrumors regular
Dec 24, 2016
214
67
Miami Fl, United States
@oshimai

After much time, I have the captures from the display adjustment utility
hooray.jpg


They are in the repo in the captures folder.

We now know 5 of the 6 unknown register offsets with the max and mins as per the display adjustment utility itself.
I've updated my sketch with the register offset names.


C++:
enum IVAD_REGISTER_OFFSET : const byte
{
                                   //   OFFSET  MIN  -  MAX
                                   //   ===================
  IVAD_SETTING_CONTRAST,           // = 0x00    0XB5 - 0XFF
  IVAD_SETTING_RED_DRIVE,          // = 0x01    0X00 - 0XFF
  IVAD_SETTING_GREEN_DRIVE,        // = 0x02    0X00 - 0XFF
  IVAD_SETTING_BLUE_DRIVE,         // = 0x03    0X00 - 0XFF
  IVAD_SETTING_RED,                // = 0x04    0X00 - 0XFF
  IVAD_SETTING_GREEN,              // = 0x05    0X00 - 0XFF
  IVAD_SETTING_BLUE,               // = 0x06    0X00 - 0XFF
  IVAD_SETTING_HORIZONTAL_POS,     // = 0x07    0X80 - 0XFF
  IVAD_SETTING_HEIGHT,             // = 0x08    0X80 - 0XFF
  IVAD_SETTING_VERTICAL_POS,       // = 0x09    0X00 - 0X7F
  IVAD_SETTING_S_CORRECTION,       // = 0x0A    0X80 - 0XFF
  IVAD_SETTING_KEYSTONE,           // = 0x0B    0X80 - 0XFF
  IVAD_SETTING_PINCUSHION,         // = 0x0C    0X80 - 0XFF
  IVAD_SETTING_WIDTH,              // = 0x0D    0X00 - 0X7F
  IVAD_SETTING_PINCUSHION_BALANCE, // = 0x0E    0X80 - 0XFF
  IVAD_SETTING_PARALLELOGRAM,      // = 0x0F    0X80 - 0XFF
  IVAD_SETTING_RESERVED6,          // = 0x10
  IVAD_SETTING_BRIGHTNESS,         // = 0x11    0X00 - 0X0A
  IVAD_SETTING_ROTATION,           // = 0x12    0X00 - 0X7F
  IVAD_SETTING_END                 // always last

The offsets currently named

IVAD_SETTING_RED
IVAD_SETTING_GREEN
IVAD_SETTING_BLUE

are named red cutoff green cutoff and blue cutoff in the program so
in order to reflect the names in the program, I propose we change the variable names to.

IVAD_SETTING_RED_CUTOFF
IVAD_SETTING_GREEN_CUTOFF
IVAD_SETTING_BLUE_CUTOFF

What do you think ?
 

oshimai

macrumors member
Apr 7, 2020
53
31
Europe
When accessing the display_adjustment_utility folder:
Failed to load latest commit information.
Looks like you broke GitHub. :]

Awesome work getting all of these extra settings along with their min and max values. I'm already hard at work getting them added to the control panel. Thank you so much for your help!

I spend most of the afternoon adding fixes and workarounds for Mono. Among other things, the settings analyzer no longer crashes if you open it twice and, the main window remembers the serial port and auto connects on launch like it was always supposed to. I was not able to get it to crash during the actual serial communications though. That part is stable for me and the app also terminates properly for me when closing the main window.

It'll probably take me another day or so to get all the new settings added and tested. Stay tuned!

Yes, let's rename the settings to IVAD_SETTING_RED_CUTOFF, IVAD_SETTING_GREEN_CUTOFF, and IVAD_SETTING_BLUE_CUTOFF as you suggested.

I'd also bump the settings version to 3.

Do you have the default values for the new settings (rgb drive, s correction, and pincushion balance)?
I tried to make them out from your photo but it was too blurry. nvm found them in your repo. :D

That would be the final puzzle piece to make the Defaults button work as well.
 
Last edited:

rockyhill

macrumors regular
Dec 24, 2016
214
67
Miami Fl, United States
When accessing the display_adjustment_utility folder:

Looks like you broke GitHub. :]

Awesome work getting all of these extra settings along with their min and max values. I'm already hard at work getting them added to the control panel. Thank you so much for your help!

I spend most of the afternoon adding fixes and workarounds for Mono. Among other things, the settings analyzer no longer crashes if you open it twice and, the main window remembers the serial port and auto connects on launch like it was always supposed to. I was not able to get it to crash during the actual serial communications though. That part is stable for me and the app also terminates properly for me when closing the main window.

It'll probably take me another day or so to get all the new settings added and tested. Stay tuned!

Yes, let's rename the settings to IVAD_SETTING_RED_CUTOFF, IVAD_SETTING_GREEN_CUTOFF, and IVAD_SETTING_BLUE_CUTOFF as you suggested.

I'd also bump the settings version to 3.

Do you have the default values for the new settings (rgb drive, s correction, and pincushion balance)?
I tried to make them out from your photo but it was too blurry. nvm found them in your repo. :D

That would be the final puzzle piece to make the Defaults button work as well.

Don't mention it!

Oh, yes, I meant to send you the default values but they are in the repo as well.
That said I did read in the included notes for the display adjustment utility that
those are not default values but rather the values for that computer. We could
modify the default values to reflect those in the pictures but it's probably o.k.
as it is because it will change slightly from machine to machine .


Today I plan on getting the GUI running on my raspberry pi 3. Hopefully it's trivial since mono
is supported on the rpi. Hopefully soon , there will be an example of your GUI running on an ARM processor!
 

rockyhill

macrumors regular
Dec 24, 2016
214
67
Miami Fl, United States
I spend most of the afternoon adding fixes and workarounds for Mono. Among other things, the settings analyzer no longer crashes if you open it twice and, the main window remembers the serial port and auto connects on launch like it was always supposed to. I was not able to get it to crash during the actual serial communications though. That part is stable for me and the app also terminates properly for me when closing the main window.


Can't wait to test it !

display adjustment utility

will do.
[automerge]1589488005[/automerge]
@oshmai

I forgot to ask earlier but which resource files should I edit to add another language?
are they all hand editable?
 
Last edited:

oshimai

macrumors member
Apr 7, 2020
53
31
Europe
Alright, the new control panel code is available on my repo now. It's late but I wanted to dump the code before I vanish into the night. It passed an initial smoke test. I could change settings, doing so did something, and the CRT didn't blow up in my face.

To get the good stuff you have to turn on "Advanced controls" below the COM port selector and confirm a warning. Next time you launch it, you get access to the RGB drive controls, S correction, and pin balance. Until then they remain grayed out.

For some reason Mono has decided that it will now align all the color sliders nicely too and I also just fixed the last visual glitch in the main window by getting rid of the useless frame that just said "Geometry Settings" on the geometry page.

To add another language you just add new RESX files and translate them. You could do that by hand but that's reeeealy painful. Do you think you could push yourself to use Windows just once? If so you can enjoy the comfort of https://github.com/HakanL/resxtranslator

This makes translating (or correcting my English) super easy. You run the app, go to File > Open directory and point it at the crtcpl source folder, and open it. Then just go through the files shown, and add your language via Languages > Add new language. Then you just translate away and send me the files when you're done.

Once you recompile the code, your translation is available for use. It should pick the correct language based on your system language, but I can easily add a language selector if that helps.

This is what the resxtranslator tool looks like:
It's this version: https://github.com/HakanL/resxtranslator/releases/tag/v2.9
1589493218562.png
 

rockyhill

macrumors regular
Dec 24, 2016
214
67
Miami Fl, United States
@oshimai

First off, great work on the latest additions, fancy and useful!

o.k. so I've done some testing.

The version of the GUI reading serial on a separate thread is the definitely the stable one, at least under mono. This is the case even though it's swallowing the exceptions. I can't get it to crash.....

The more recent versions do crash when exercising the controls even when used mildly. I vote for a return to reading the serial port in a separate thread for further testing and debugging, I think you were on the right track using that method.

I was also able to get it to start on the raspberry pi. I only needed the mono runtime and the winforms library from the repos.
didn't even have to recompile.

That said, I could not get it to communicate with the board............ The serial ports were enumerated however.

I'll have to do some more troubleshooting.

I'll make a video so you can see what I am talking about.

Oh and yes, I'll pull out my dusty Windows 10 machine from the attic and run rextranslator........ if it doesn't run under wine.
lol

Great work!
 

oshimai

macrumors member
Apr 7, 2020
53
31
Europe
I've been trying and trying, both with VirtualBox and a real "physical" Debian install and I cannot reproduce your issue. What you're describing should be pretty much impossible since if it works with the async method it must also work with the traditional method. The actual send/receive logic is essentially the same.

Things I've tried:
  • Revert to async UCCom: Works fine. Usually hangs at exit. Sometimes crashes on port close.
  • Go back to non-async UCCom: Works fine, doesn't hang at exit, doesn't crash.
  • Increase baud rate to 115200, retry the above: same behavior, except the control panel feels snappier and I can shorten the CRT's life even faster now, wiggling the brightness, contrast and color sliders like a maniac.
I found one Linux issue, which I documented in the readme as follows:
Linux being Linux, it considers your Arduino to be a typewriter/modem and will pull the DTR line of the USB serial port high. Doing this will reset the Arduino. To stop this retarded behavior, use stty -F /dev/ttyACM0 -hupcl, where ttyACM0 has to be replaced with whatever the OS assigned as the device for your arduino. Hint: try looking at the output of dmesg to find it.

I almost lost my sanity thinking the Arduino was crashing due to a bug in the sketch, or the 5V trickle circuit failing due to old age, or the relay board pulling too much power and overloading the trickle circuit, ... No, Linux was resetting the Arduino every time I opened crtcpl because Mono can't turn off that behavior even though I tell it to using DtrEnable = false.

Would that apply to your environment too? Does pulling DTR or RTS high reset your microcontroller?


I'm picking up an eMac this weekend for modding some day in the future or to salvage most of the parts in case the iMac CRT decides to die after all. Apparently it has a higher quality CRT that supports luxurious resolutions like 1280x1024. Also the white plastic they used for it doesn't seem to yellow as much. Looking at teardowns it feels like it should also be slightly easier to mod, and you've already done all the difficult work of figuring out the correct wiring.
 

rockyhill

macrumors regular
Dec 24, 2016
214
67
Miami Fl, United States
I've been trying and trying, both with VirtualBox and a real "physical" Debian install and I cannot reproduce your issue. What you're describing should be pretty much impossible since if it works with the async method it must also work with the traditional method. The actual send/receive logic is essentially the same.

I just tried your latest pushes and it's responding as intended so I don't know why you can't reproduce it......
Could it be that I am using Ubuntu 18.04 and your using straight Debian? I know Ubuntu is a Debian derivative
but it tends to use newer packages.

Here is the version of mono I/m using.

Bash:
Mono JIT compiler version 6.6.0.166 (tarball Mon Mar  2 18:12:59 UTC 2020)


Increase baud rate to 115200, retry the above: same behavior, except the control panel feels snappier and I can shorten the CRT's life even faster now, wiggling the brightness, contrast and color sliders like a maniac.


Lol, I know, it's fun to move the sliders really fast and see it change.


Would that apply to your environment too? Does pulling DTR or RTS high reset your microcontroller?

Yes, the arduino boards tie RTS to the reset pin in order to put the micro-controller in a state for programming.
I think this is expected behavior and I've seen it reset when using hyperterminal on windows.
If memory serves me I think the same thing happens whenever you open the serial monitor in the
arduino IDE. Give it a shot when you get a chance and let me know.

Most RS232 communication these days is asynchronous requiring only 3 lines, TX, RX and GND which
means that for the vast majority of applications, the control lines are left unused.
I assume the arduino board developers took this statistic into account when designing
RS232 programming.





I'm picking up an eMac this weekend for modding some day in the future or to salvage most of the parts in case the iMac CRT decides to die after all. Apparently it has a higher quality CRT that supports luxurious resolutions like 1280x1024. Also the white plastic they used for it doesn't seem to yellow as much. Looking at teardowns it feels like it should also be slightly easier to mod, and you've already done all the difficult work of figuring out the correct wiring.

The eMac was my first...... It is definitely higher quality as you'll see and it's something I want to revisit in the
future. I made my eMac mod in a rush so there many things I would like to polish.


I just finished an tested spanish translation so I'll push the changes soon. I didn't translate pincushion because I don't think
the term for pincushion is the same for that property so I'll have to do some more research.

Hopefully I'll have time today to do some more testing with the raspberry pi
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.