Porting a camera sx530hs - page 12 - DryOS Development - CHDK Forum

Porting a camera sx530hs

  • 300 Replies
  • 153492 Views
*

Offline blackhole

  • *****
  • 946
  • A590IS 101b
    • Planetary astrophotography
Re: Porting a camera sx530hs
« Reply #110 on: 14 / April / 2016, 18:00:24 »
Advertisements
Quote
In the meantime, can you check those playback features I asked about (zooming into images, playing videos)?
Zooming into images works good,playback videos does not work.
Sorry for waiting.
« Last Edit: 14 / April / 2016, 18:02:44 by blackhole »

*

Offline srsa_4c

  • ******
  • 4451
Re: Porting a camera sx530hs
« Reply #111 on: 14 / April / 2016, 18:16:02 »
Zooming into images works good,playback videos does not work.
I think this is appropriate here ->  :blink:
Now I wonder which layer of the card-IO could be the problem...?

Do you see any speed difference on a 'bad' card (with and without CHDK) when using the Canon interface to scroll between photos (using thumbnail view)?

If the camera can retouch images in playback mode (resize, add effect etc.), does that work? If it seems to, does it actually write the resulting image to card?

*

Offline blackhole

  • *****
  • 946
  • A590IS 101b
    • Planetary astrophotography
Re: Porting a camera sx530hs
« Reply #112 on: 14 / April / 2016, 18:40:55 »
Quote
I think this is appropriate here ->  :blink:
Now I wonder which layer of the card-IO could be the problem...?

Do you see any speed difference on a 'bad' card (with and without CHDK) when using the Canon interface to scroll between photos (using thumbnail view)?

If the camera can retouch images in playback mode (resize, add effect etc.), does that work? If it seems to, does it actually write the resulting image to card?
There is no difference in speed. Images can be edited but the result can not be saved on the card.

*

Offline reyalp

  • ******
  • 14128
Re: Porting a camera sx530hs
« Reply #113 on: 14 / April / 2016, 21:16:16 »
If you haven't already, with a "bad" card, try

=call_event_proc('Driver.Create')
=call_event_proc('SetSDPwrPort',0)
=call_event_proc('SetSDPwrPort',1)


edit
related thread https://chdk.setepontos.com/index.php?topic=5563.10

edit 2:
oops, forgot no lua.
« Last Edit: 15 / April / 2016, 21:29:52 by reyalp »
Don't forget what the H stands for.

*

Offline srsa_4c

  • ******
  • 4451
Re: Porting a camera sx530hs
« Reply #114 on: 15 / April / 2016, 17:52:43 »
=call_event_proc('Driver.Create')
=call_event_proc('SetSDPwrPort',0)
=call_event_proc('SetSDPwrPort',1)
This will have to be done in core (Lua can't load on a bad card). I have also done experiments (logging activity) on the firmware's ReadSDCard and WriteSDCard functions (it's easy because these are accessed by pointers, stored in RAM). I'll post details later.

Side note, unrelated to this cam: we could set up extensive logging (raw hook, filewrite hooks and WriteSDCard) to find out when things happen during/after shooting...

*

Offline srsa_4c

  • ******
  • 4451
Re: Porting a camera sx530hs
« Reply #115 on: 15 / April / 2016, 20:40:58 »
@blackhole
Here's some messy debug code. It will try to log CHDK Open() calls and the 2 low level firmware SD card functions.
You'll need to rebuild stubs_entry.S, so make sure you have your PRIMARY.BIN in platform/sx530hs/sub/100c .
I'm using 2 unused (unused if HDMI is not connected) areas in RAM to log some binary data:
0x749310, size: 0x7100
0x788790, size: 0x7100
Please get those 2 buffers into files using reyalp's command. (1 bad and 1 good case)
You don't have to hurry, do it when you have time.

edit:
attachment modified slightly
« Last Edit: 16 / April / 2016, 09:10:14 by srsa_4c »

*

Offline reyalp

  • ******
  • 14128
Re: Porting a camera sx530hs
« Reply #116 on: 15 / April / 2016, 21:46:52 »
This will have to be done in core (Lua can't load on a bad card).
Oops, didn't think of that  :-[

For sx530hs 100c, we can use

!con:call_function(0xFF21DE30,0)

to turn off, 1 to turn on. In my previous testing, turning off and attempting to access the SD card worked after some delay, so it's possible this causes the firmware to reset it's disk subsystem.

It's notable that SetSDPwrPort is significantly more complicated in sx530 compared to older cams like D10, so if the startup power down thing is needed, just poking one MMIO may not be enough.

NB: you can use call_function with functions looked up in main.bin.dump too, so for example you should be able to switch to rec by looking up switch_mod_usb. Remember to set the thumb bit.
Don't forget what the H stands for.

*

Offline blackhole

  • *****
  • 946
  • A590IS 101b
    • Planetary astrophotography
Re: Porting a camera sx530hs
« Reply #117 on: 16 / April / 2016, 05:08:38 »
The next few days I can not do anything, I do not have a camera and a computer. The only thing I have is a smartphone.
I'll be back soon.

*

Offline blackhole

  • *****
  • 946
  • A590IS 101b
    • Planetary astrophotography
Re: Porting a camera sx530hs
« Reply #118 on: 17 / April / 2016, 16:45:53 »
Quote
Here's some messy debug code. It will try to log CHDK Open() calls and the 2 low level firmware SD card functions.
You'll need to rebuild stubs_entry.S, so make sure you have your PRIMARY.BIN in platform/sx530hs/sub/100c .
I'm using 2 unused (unused if HDMI is not connected) areas in RAM to log some binary data:
0x749310, size: 0x7100
0x788790, size: 0x7100
Please get those 2 buffers into files using reyalp's command. (1 bad and 1 good case)
You don't have to hurry, do it when you have time.
Hi guys!
Here are the files:
https://drive.google.com/open?id=0B2NRqqO9AOURTU9YWVlrSlk3V28

*

Offline srsa_4c

  • ******
  • 4451
Re: Porting a camera sx530hs
« Reply #119 on: 17 / April / 2016, 18:39:58 »
Here are the files:
Thanks.
It's not what I expected.
Even on a bad card, Open() returns a valid file descriptor and ReadSDCard is also called a lot - can not distinguish the good and bad case by looking at the logs.
There's one difference: in the 'bad' case, WriteSDCard is not called at all.

New strategy is needed...

Until then, try reyalp's recent suggestion:

For sx530hs 100c, we can use

!con:call_function(0xFF21DE30,0)

to turn off, 1 to turn on.

 

Related Topics


SimplePortal © 2008-2014, SimplePortal