arvehj / jvcprojectortools

Apache License 2.0
12 stars 8 forks source link

Support other model years #7

Open arvehj opened 7 years ago

arvehj commented 7 years ago

Most commands are the same for 2014, 2015 and 2017 model years but not all.

arvehj commented 7 years ago

'Gamma Correction Data' is one byte for 2014 for two for 2015

arvehj commented 7 years ago

Please try the test2014 branch if you have a 2014 model year projector and report any problems by commenting on this issue. zip file download

dcchan2 commented 7 years ago

The test2014 script eliminated the 'Gamma Correction Data' error but still does not load the gamma table correctly. From what I can see, Green and Blue data do not seem to be loaded at all. Red data is loaded, but is clipped to 0 about 50%, even when selecting 1886 eotf.

arvehj commented 7 years ago

The 2015 model year projectors use a 10 bit 256 point gamma table. The documents don't say anything about this so, it is possible the 2014 projectors don't have this. I added a change to the test branch to limit the output to 8 bit. Please let me know if this works better.

dcchan2 commented 7 years ago

The new script made it worse. Green and Blue are still not loaded; i.e., they retain their default values corresponding to Normal. Red is clipped to 0 at all levels (the previous version only clipped at 50 and above).

arvehj commented 7 years ago

I need to see the data then. Can you run jvc_command.py (you may have to do this from python shell or the cmdline to see the output)? It will read the red gamma table and print it. If you can report the result of this with the custom curve you tried to input and another one that still looks correct on the screen, then I might be able to tell what is different.

dcchan2 commented 7 years ago

I got this when running jvc_command.py from the command prompt:

C:\Users\domin\Downloads\JVC_AutoCal\jvcprojectortools-master\jvcprojectortools-master>jvc_command.py test jvc command class Model: b'ILAFPJ -- XHK2' Power: PowerState.LampOn Input InputState.HDMI2 InputState.HDMI2 Traceback (most recent call last): File "C:\Users\domin\Downloads\JVC_AutoCal\jvcprojectortools-master\jvcprojectortools-master\jvc_command.py", line 510, in main() File "C:\Users\domin\Downloads\JVC_AutoCal\jvcprojectortools-master\jvcprojectortools-master\jvc_command.py", line 490, in main print('Source:', jvc.get_info_source()) File "C:\Users\domin\Downloads\JVC_AutoCal\jvcprojectortools-master\jvcprojectortools-master\jvc_command.py", line 446, in get_info_source }[self.cmd_ref(Command.InfoSource)] KeyError: b'A'

C:\Users\domin\Downloads\JVC_AutoCal\jvcprojectortools-master\jvcprojectortools-master> On Thu, Feb 23, 2017 at 6:21 PM Arve Hjønnevåg notifications@github.com wrote:

I need to see the data then. Can you run jvc_command.py (you may have to do this from python shell or the cmdline to see the output)? It will read the red gamma table and print it. If you can report the result of this with the custom curve you tried to input and another one that still looks correct on the screen, then I might be able to tell what is different.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/arvehj/jvcprojectortools/issues/7#issuecomment-282154234, or mute the thread https://github.com/notifications/unsubscribe-auth/AYx6SRzwqc6k0W2U9Pakh5pJvnp-QUC3ks5rfhR9gaJpZM4MJiMz .

arvehj commented 7 years ago

Please try again. It should hopefully get the actual gamma table now (I have not tested it though)

dcchan2 commented 7 years ago

3 log file:

arvehj commented 7 years ago

Your normal table looks identical to the tables I get. So it looks like the 10 bit table is correct. Did you get a timeout error when to programmed the custom curve? I increased the timeout to wait up to 30 seconds, in case this just takes longer on the older model,

dcchan2 commented 7 years ago

No timeout error. It takes about 2 seconds to upload the gamma.

arvehj commented 7 years ago

That seems too quick. Did you not get an error message for the green and blue tables either?

dcchan2 commented 7 years ago

No. Am I supposed to load red, green, blue, separately?

arvehj commented 7 years ago

No it loads red, then green then blue. If you run a python shell you can load them individually. You said the green and blue don't work though, so I expect they don't work because the red table already failed. It is odd that it would not report an error though.

I enabled tracing if you want to send a report of what gets sent to and from your projector.

dcchan2 commented 7 years ago

Red consistently loads 128 entries and fills the rest with 0. Green and Blue tables seem to be untouched.

On Thu, Feb 23, 2017 at 10:47 PM, Arve Hjønnevåg notifications@github.com wrote:

No it loads red, then green then blue. If you run a python shell you can load them individually. You said the green and blue don't work though, so I expect they don't work because the read already failed. It is odd that it would not report an error though.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/arvehj/jvcprojectortools/issues/7#issuecomment-282196501, or mute the thread https://github.com/notifications/unsubscribe-auth/AYx6SZbGrIA-Uz-mBWSZUhM29vpHRMCFks5rflLkgaJpZM4MJiMz .

arvehj commented 7 years ago

Can you include a trace from the tracing enabled jvc_gamma script?

dcchan2 commented 7 years ago

How do I enable the trace?

On Thu, Feb 23, 2017 at 11:00 PM, Arve Hjønnevåg notifications@github.com wrote:

Can you include a trace from the tracing enabled jvc_gamma script?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/arvehj/jvcprojectortools/issues/7#issuecomment-282197995, or mute the thread https://github.com/notifications/unsubscribe-auth/AYx6SRIQ2HdCa9M-YUW_KQvitdJFCQ_4ks5rflXJgaJpZM4MJiMz .

arvehj commented 7 years ago

I enabled it in the test branch, You can either download it, or make the same change locally: 1362b9b9ee4c3f6ace7c69c1505451a1c86a82e6.

dcchan2 commented 7 years ago

Trace.txt

arvehj commented 7 years ago

The projector claims it received all three gamma tables. I added a change to read back each table if you want to try that: 367caf1d55af94423d5ac6c05eecd6c595a88bc6. You can also try a delay between each one in case the projector needs time to process it (my projector does not responds until long after I sent the table) 60431bf632a01673cdd6fe8b71e2d2b8f68e20db.

dcchan2 commented 7 years ago

I'll try it tomorrow. It's midnight here. I was surprised to see the script finish in 2 seconds ( maybe even less).

dcchan2 commented 7 years ago

Hi, Just tried these and both versions work perfectly, thank you very much! Did you make any other changes? It's strange that adding read-back will make loading work. The old 10-second time-out shouldn't be an issue as uploading the gamma table takes less than 2 seconds. BTW, I actually don't have much interest in HDR, since the 2014 models did not have the required luminance. I'm more interested in finding ways to fine-tune the gamma, and hope this tool can help with that. This is the only model year that had no way for the user to access the 12-pt gamma. Thanks again.

arvehj commented 7 years ago

My theory is that your projector acknowledges that it received the gamma table before it has finished processing it. It seems like it then aborts processing the red gamma table if you send the green and blue table, and also don't process them at all. I don't remember exactly how long it takes to load a gamma table on my projector but I think it is a lot longer than two seconds.

Do you see a longer delay reading back the gamma table with 367caf1d55af94423d5ac6c05eecd6c595a88bc6 than you do if you wait a litttle before you let the read happen with 60431bf632a01673cdd6fe8b71e2d2b8f68e20db? If so then the read command probably waits for the previous write to complete processing.

arvehj commented 7 years ago

While I have not added direct support for 2014 model year projectors, the wip branch now lets you ignore some errors and adds the read back to verify which seemed to fix your problem. Please report if you are able to load gamma curves with this version.

udoewich commented 5 years ago

@arvehj,

I have a 2014 model as well and had to apply the Gamma Correction change as mentioned in your second post to make it work with the master branch.

Any idea how multiple model years could be supported?

I'm new to Python so don't know what's possible or not. Would having multiple versions of "jvc_command.py", one for each model year be possible? Perhaps via "importlib"?

arvehj commented 5 years ago

The different model years are similar enough that duplicating the code in jvc_command.py for each model is probably not worth it. The code is not structured in a way that lets you easily support multiple models at the same time. The easiest way would be to add a configuration step and run the tool again. jvc_command.py could then read the configuration file and define the types used by the configured model year. since I only have one jvc projector this is not high on my todo list though.

udoewich commented 5 years ago

Yes, thankfully they kept the protocol the same and only added (or removed) table entries between the years. I've only briefly looked over all commands and added the entries that were missing (see the diff below).

I'll give it some thought and will experiment to figure out what the best approach might be. It's a learning experience. ;)

diff --git a/jvc_command.py b/jvc_command.py
index 2ecf11a..1879073 100644
--- a/jvc_command.py
+++ b/jvc_command.py
@@ -25,6 +25,9 @@ class BinaryData():

 class Model(ReadOnly, Enum):
     """Projector model code"""
+    DLA_X500R_XC5880R_RS49 = b'ILAFPJ -- XHK1'
+    DLA_RS4910 = b'ILAFPJ -- XHK2'
+    DLA_X700R_XC7880R_RS57_X900R_RS6710 = b'ILAFPJ -- XHK3'
     DLA_X550R_X5000_XC5890R_RS400 = b'ILAFPJ -- XHP1'
     DLA_XC6890 = b'ILAFPJ -- XHP2'
     DLA_X750R_X7000_XC7890R_RS500_X950R_X9000_RS600_PX1 = b'ILAFPJ -- XHP3'
@@ -135,12 +138,14 @@ class PictureMode(Enum):
     Animation = b'02'
     Natural = b'03'
     THX = b'06'
+    FourK_50_60P = b'0B'
     User1 = b'0C'
     User2 = b'0D'
     User3 = b'0E'
     User4 = b'0F'
     User5 = b'10'
     User6 = b'11'
+    Photo = b'12'

 class ClearBlack(Enum):
     """Clear Black Setting"""
@@ -166,6 +171,8 @@ class ColorProfile(Enum):
     Anime2 = b'07'
     Video = b'08'
     xvColor = b'09'
+    Adobe = b'0A'
+    Stage = b'0B'
     Cinema3D = b'0C'
     THX = b'0D'
     Custom1 = b'0E'
@@ -176,7 +183,9 @@ class ColorProfile(Enum):
     Film3 = b'13'
     Video3D = b'14'
     Animation3D = b'15'
+    Photo3D = b'16'
     Film3D = b'1E'
+    Stage3D = b'1F'
     THX3D = b'20'
     Reference = b'21'
     Custom6 = b'22'
@@ -184,8 +193,13 @@ class ColorProfile(Enum):
 class ColorTemperature(Enum):
     """Color Temperature Setting"""
     Temp5500K = b'0'
+    Temp6000K = b'1'
     Temp6500K = b'2'
+    Temp7000K = b'3'
     Temp7500K = b'4'
+    Temp8000K = b'5'
+    Temp8500K = b'6'
+    Temp9000K = b'7'
     Temp9300K = b'8'
     HighBright = b'9'
     Custom1 = b'A'
@@ -198,8 +212,13 @@ class ColorTemperature(Enum):
 class ColorTemperatureCorrection(Enum):
     """Color Temperature Correction Setting"""
     Temp5500K = b'0'
+    Temp6000K = b'1'
     Temp6500K = b'2'
+    Temp7000K = b'3'
     Temp7500K = b'4'
+    Temp8000K = b'5'
+    Temp8500K = b'6'
+    Temp9000K = b'7'
     Temp9300K = b'8'
     HighBright = b'9'
     Xenon1 = b'D'
@@ -221,28 +240,30 @@ class GammaTable(Enum):

 class GammaCorrection(Enum):
     """Gamma Correction Setting"""
-    Normal = b'00'
-    GammaA = b'01'
-    GammaB = b'02'
-    GammaC = b'03'
-    Import = b'04'
-    Gamma1_8 = b'05'
-    Gamma1_9 = b'06'
-    Gamma2_0 = b'07'
-    Gamma2_1 = b'08'
-    Gamma2_2 = b'09'
-    Gamma2_3 = b'0A'
-    Gamma2_4 = b'0B'
-    Gamma2_5 = b'0C'
-    Gamma2_6 = b'0D'
-    Film1 = b'0E'
-    Film2 = b'0F'
+    Normal = b'0'
+    GammaA = b'1'
+    GammaB = b'2'
+    GammaC = b'3'
+    Import = b'4'
+    Gamma1_8 = b'5'
+    Gamma1_9 = b'6'
+    Gamma2_0 = b'7'
+    Gamma2_1 = b'8'
+    Gamma2_2 = b'9'
+    Gamma2_3 = b'A'
+    Gamma2_4 = b'B'
+    Gamma2_5 = b'C'
+    Gamma2_6 = b'D'
+    Film1 = b'E'
+    Film2 = b'F'
     GammaD = b'14'

 class ColorManagement(Enum):
     """Color Management Setting"""
     Off = b'0'
     On = b'1'
+    Custom2 = b'2'
+    Custom3 = b'3'

 class ClearMotionDrive(Enum):
     """Clear Motion Drive Setting"""
@@ -300,6 +321,8 @@ class SourceData(ReadOnly, str):
     """Input Info Source Information"""
     def __new__(cls, value):
         return {
+            b'00': '480i',
+            b'01': '576i',
             b'02': '480p',
             b'03': '576p',
             b'04': '720p50',
@@ -313,6 +336,7 @@ class SourceData(ReadOnly, str):
             b'0C': '720p 3D',
             b'0D': '1080i 3D',
             b'0E': '1080p 3D',
+            b'0F': '4K',
             b'10': '4K(4096)60',
             b'11': '4K(4096)50',
             b'12': '4K(4096)30',