HDMI power and alternative remote inputs ( was Re: G7 X porting thread)

  • 38 Replies
  • 6299 Views
Advertisements
Hi,
Is there any possibility to enable the HDMI output in recording mode on a G7X?
I would not need any HDMI stream, but just the +5V on Pin 19.

Reason for that is that i want to use USB Remote using the +5V from HDMI Pin 19.

Background: USB Remote is used in a Underwater housing together with reed contact(inside) and solenoid(outside). There is almost no space in the housing to place additional batteries.
I had this setup already with my S100 + unterwater housing working. Now after changing to G7X it looks like the HDMI Transceiver is not enabled in recording mode (no +5V on Pin 19)

G7X - CHDK 100d

*

Offline reyalp

  • ******
  • 11514
Re: Re: G7 X porting thread
« Reply #1 on: 06 / June / 2018, 13:47:13 »
Hi,
Is there any possibility to enable the HDMI output in recording mode on a G7X?
I would not need any HDMI stream, but just the +5V on Pin 19.

Reason for that is that i want to use USB Remote using the +5V from HDMI Pin 19.

Background: USB Remote is used in a Underwater housing together with reed contact(inside) and solenoid(outside). There is almost no space in the housing to place additional batteries.
I had this setup already with my S100 + unterwater housing working. Now after changing to G7X it looks like the HDMI Transceiver is not enabled in recording mode (no +5V on Pin 19)
That's a clever trick. Unfortunately, I'm not aware of any way to power up the HDMI port. If it's possible, reverse engineering would be required to find it.

One possible alternative might be using the battery temperature ADC (see this thread for background https://chdk.setepontos.com/index.php?topic=10385.0). I'm imagining thin wire or flex cable taped to the battery, masking the thermistor pin, connecting to the switch through the external power port.

The advantage of this is that the reed switch would just need to switch to ground or open circuit (or open circuit and the original terminal), not +5v.

If this seems like it might work for you, I can come up with a build that supports remote via the battery terminal, just let me know which firmware you have.

There might also be status bits related to the HDMI or SD video out that could be used. I'll have look at this a bit later.
Don't forget what the H stands for.

*

Offline srsa_4c

  • ******
  • 3695
Re: Re: G7 X porting thread
« Reply #2 on: 06 / June / 2018, 15:31:58 »
There is an event procedure named ChangePowerState which is HDMI-related. Perhaps worth a try.

Re: Re: G7 X porting thread
« Reply #3 on: 06 / June / 2018, 15:53:56 »
Hi,
Is there any possibility to enable the HDMI output in recording mode on a G7X?
I would not need any HDMI stream, but just the +5V on Pin 19.

Reason for that is that i want to use USB Remote using the +5V from HDMI Pin 19.

Background: USB Remote is used in a Underwater housing together with reed contact(inside) and solenoid(outside). There is almost no space in the housing to place additional batteries.
I had this setup already with my S100 + unterwater housing working. Now after changing to G7X it looks like the HDMI Transceiver is not enabled in recording mode (no +5V on Pin 19)
That's a clever trick. Unfortunately, I'm not aware of any way to power up the HDMI port. If it's possible, reverse engineering would be required to find it.

One possible alternative might be using the battery temperature ADC (see this thread for background https://chdk.setepontos.com/index.php?topic=10385.0). I'm imagining thin wire or flex cable taped to the battery, masking the thermistor pin, connecting to the switch through the external power port.

The advantage of this is that the reed switch would just need to switch to ground or open circuit (or open circuit and the original terminal), not +5v.

If this seems like it might work for you, I can come up with a build that supports remote via the battery terminal, just let me know which firmware you have.

There might also be status bits related to the HDMI or SD video out that could be used. I'll have look at this a bit later.

Thank you very much, also a nice possibility, but this has the disadvantage of having (thin) cables coming out of the camera and they have to be attached/removed for charging and normal usage (not underwater) of the camera.

There is an event procedure named ChangePowerState which is HDMI-related. Perhaps worth a try.

It would be great if the transceiver could be powered using this function. How to call this function?

G7X - CHDK 100d


*

Offline reyalp

  • ******
  • 11514
Re: Re: G7 X porting thread
« Reply #4 on: 06 / June / 2018, 16:40:21 »
Thank you very much, also a nice possibility, but this has the disadvantage of having (thin) cables coming out of the camera and they have to be attached/removed for charging and normal usage (not underwater) of the camera.
Yes, it's not ideal. You could perhaps make it self contained on the battery.  FWIW, here's another somewhat related thread, where a user wanted to use the remote with a waterproof cam, and put everything in the battery compartment https://chdk.setepontos.com/index.php?topic=11058.0
Quote
There is an event procedure named ChangePowerState which is HDMI-related. Perhaps worth a try.

It would be great if the transceiver could be powered using this function. How to call this function?
See http://chdk.wikia.com/wiki/Event_Procedure and http://chdk.wikia.com/wiki/Lua/Lua_Reference/Native_Function_Calls for general information.

In brief: You need set "Enable native function calls" in the CHDK menu, and then call the function from script using either call the function by name with call_event_proc or by address using call_func_ptr

Names and addresses of known functions can be found in the source using the funcs_by_*.csv files under https://app.assembla.com/spaces/chdk/subversion/source/HEAD/trunk/platform/g7x/sub

If you call by name, you may have to call additional functions before hand to ensure the one you call is registered. Normally, call_event_proc returns -1 if an eventproc isn't registered. Note the _FW at the end of many names should be omitted when using call_event_proc.

If calling by address, you need to use the right address for your specific firmware.

For experimenting with stuff like this, I generally use chdkptp (https://app.assembla.com/spaces/chdkptp/wiki) so I can try things interactively rather than have to write a script, copy to the card etc with every variation.

The actual usage/behavior of any specific function needs to be determined by reverse engineering or experiment. From the disassembly, it looks like ChangePowerState takes a single argument, either 1 or 0. So you could try

call_func_ptr(0xfc0c3339,1)

and check whether power is present. (The address happens to be the same for this particular function on all known g7x firmwares)
Don't forget what the H stands for.

Re: Re: G7 X porting thread
« Reply #5 on: 07 / June / 2018, 02:42:07 »
thank you very much for your detailed explanation.
I will try it and report back the result.
G7X - CHDK 100d

*

Offline reyalp

  • ******
  • 11514
Re: Re: G7 X porting thread
« Reply #6 on: 07 / June / 2018, 02:52:24 »
I didn't have anything handy to check output, but I verified that calling
call_func_ptr(0xfc0c3339,1)
doesn't seem hurt anything.

Also, maybe a typo but comments above mentioned pin 19 as the HDMI +5v. From the diagrams on the internet (e.g. https://en.wikipedia.org/wiki/HDMI), it seems like this should be pin 18.

Another possible option is the analog video out detection: https://chdk.setepontos.com/index.php?topic=13448.msg137330#msg137330
I started a new thread, since it isn't g7x specific and would require some CHDK changes.
Don't forget what the H stands for.

Re: Re: G7 X porting thread
« Reply #7 on: 07 / June / 2018, 04:05:00 »
yes you are right. +5V is pin 18.
pin 19 is the hot plug detect, which is maybe also a candidate to use instead of USB power detection.
G7X - CHDK 100d


Re: Re: G7 X porting thread
« Reply #8 on: 07 / June / 2018, 12:30:54 »
i just tried call_func_ptr(0xfc0c3339,1)/call_func_ptr(0xfc0c3339,0) but unfortuantely the pin 19 didnt go to +5V
And yes, it is Pin 19, because on Micro HDMI there is a slighly different layout.
I have also verified that in play mode 5V are there.
G7X - CHDK 100d

Re: Re: G7 X porting thread
« Reply #9 on: 07 / June / 2018, 13:36:56 »
But after analyzing the disassembly i found that ChangePowerState is also called from 2 different functions:
0xfc0c3388 and 0xfc0c33be. And it turned out that 0xfc0c3388 is turning on the power and 0xfc0c33be turning it off.

so with call_func_ptr(0xfc0c3389) i can now turn on the 5V HDMI power.

i will continue to investigate if we can also use HDMI Hotplug detect Pin (Pin 1)
maybe also HDMI live view is possible now, but i cannot test it, i have no cable :-(

thank you for your great support.

« Last Edit: 07 / June / 2018, 13:41:32 by hugoboss00 »
G7X - CHDK 100d