SX60HS Porting - page 71 - DryOS Development - CHDK Forum supplierdeeply

SX60HS Porting

  • 915 Replies
  • 347883 Views
Re: SX60HS Porting
« Reply #700 on: 05 / March / 2017, 15:29:19 »
Advertisements
Is it possible to access raw (or close to raw) sensor values 'on the fly', perhaps with half shoot pressed? or are we restricted to looking at uyvy as displayed on the LCD?
 

*

Offline reyalp

  • ******
  • 14079
Re: SX60HS Porting
« Reply #701 on: 05 / March / 2017, 16:14:47 »
Is it possible to access raw (or close to raw) sensor values 'on the fly', perhaps with half shoot pressed? or are we restricted to looking at uyvy as displayed on the LCD?
It's possible that some more "raw" version of the live view data exists but I don't recall anyone finding it. It would not be raw like we get from stills, since live view undoubtedly doesn't read out full resolution sensor data. My gut feeling is that the hardware probably produces the live view YUV output without ever exposing it in a different format.
Don't forget what the H stands for.

*

Offline srsa_4c

  • ******
  • 4451
Re: SX60HS Porting
« Reply #702 on: 05 / March / 2017, 20:22:41 »
Is it possible to access raw (or close to raw) sensor values 'on the fly', perhaps with half shoot pressed?
If related stuff from ML ever gets ported, then yes. But not currently.
Stuff that's missing: EDMAC related research, hooking live view related fw code, being able to allocate larger amounts of RAM (not from the Canon heap).
'On the fly' would still not be possible, one would have to buffer raw data in RAM and then process it. There are special hardware units in the DIGIC hardware to do stuff like retrieving raw histogram, debayering raw data to yuv, fixing bad pixels, correcting lens vignetting, correcting lens distortions, etc. The firmware always uses those instead of the ARM CPU.

Re: SX60HS Porting
« Reply #703 on: 10 / March / 2017, 22:40:08 »
Yes Edmac is very interesting. Installed it. I think I need to research registers for digic 6


Re: SX60HS Porting
« Reply #704 on: 12 / March / 2017, 14:54:04 »
While looking at EDMAC stuff using the edmac module, thinking it would be so nice if I could do this from chdkptp with rmem. But rmem of c0f04000 for example causes a crash...we'd need something to read shared memory the way edmac does it. Possibly this already exists? @reyalp

*

Offline reyalp

  • ******
  • 14079
Re: SX60HS Porting
« Reply #705 on: 12 / March / 2017, 16:02:08 »
While looking at EDMAC stuff using the edmac module, thinking it would be so nice if I could do this from chdkptp with rmem. But rmem of c0f04000 for example causes a crash...we'd need something to read shared memory the way edmac does it. Possibly this already exists? @reyalp
rmem uses the send_data function the standard firmware uses to transfer a buffer. It has been previously noted this often doesn't work on MMIO and other special address ranges, presumably because the underlying function uses DMA (single word or small transfers may be OK).

It would be possible (and useful) to add a "buffered" version of rmem that copies chunks to a temporary buffer instead.

You should be able to use Lua peek to read anything that readable with a normal load instruction, but that may not be your problem.  On GX7 peeking 0xc0f04000 crashes without a romlog.
Don't forget what the H stands for.

*

Offline Ant

  • *****
  • 509
Re: SX60HS Porting
« Reply #706 on: 12 / March / 2017, 16:11:43 »
But rmem of c0f04000 for example causes a crash... @reyalp
But you can read EDMAC register values from shadow memory. On M3 it begins from 0x01040000.

Re: SX60HS Porting
« Reply #707 on: 12 / March / 2017, 18:04:20 »
Quote
But you can read EDMAC register values from shadow memory. On M3 it begins from 0x01040000.
Thanks! this works quite well.
Tested with camera recording 1080p video.

Result from my version of EDMAC:
Code: [Select]
Connection : write=0x80000000 read=0xff
Base: c0f04300 Address    :  353fb00
State      :        4
Size A     :        0 (0 x 0)
Size B     :  1670500 (1280 x 359)
Size N     :        0 (0 x 0)
off1a      :        0
off1b      :        0
off2a      :        0
off2b      :        0
off3       :        0
off40      :        0

Results from multiple rmem's

Code: [Select]

con 1> rmem -i32 0x01044300 32
0x01044300 128
0x01044300: 0x00000004 0x20008000 0x033e2b00 0x00000000
0x01044310: 0x01670500 0x00000000 0x00000000 0x00000000
0x01044320: 0x00000000 0x00000000 0x00000000 0x00000000

con 1> rmem -i32 0x01044300 32
0x01044300 128
0x01044300: 0x00000004 0x20008000 0x0353fb00 0x00000000
0x01044310: 0x01670500 0x00000000 0x00000000 0x00000000
0x01044320: 0x00000000 0x00000000 0x00000000 0x00000000
0x01044330: 0x00000000 0x00000000 0x00000000 0x00000000

 con 1> rmem -i32 0x01044300 32
0x01044300 128
0x01044300: 0x00000001 0x20008000 0x03491300 0x00000000
0x01044310: 0x01670500 0x00000000 0x00000000 0x00000000
0x01044320: 0x00000000 0x00000000 0x00000000 0x00000000
0x01044330: 0x00000000 0x00000000 0x00000000 0x00000000

Now if I understand correctly this is a DMA transfer of units 1280 bytes performed 360 times to address 0x03491300 or 0x0353fb00 or 0x033e2b00
which seems consistent for a 16:9 video which would be 640:360 on the LCD.

However I do not recognize the addresses:
 0x03491300 0x0353fb00 0x033e2b00

Edit: but dumping one of the above addresses with rmem to a file reveals a digic6 uyvy image (live view)

« Last Edit: 12 / March / 2017, 18:15:20 by 62ndidiot »


Re: SX60HS Porting
« Reply #708 on: 12 / March / 2017, 22:21:15 »
Probably I should post the above and this on the EDMAC thread which is a few replies above.  @ant
1. Where are the raw sensor Dma entries?.  I'd expect to find a series of entries to convert it, lens corrections, uYvY conversion etc. Where to look?
2. Shadow memory: what's the address for c0f5xxxxx? Just extended from 0x0104xxxx? is there shadow memory for the 0xD0xxxxxx range which  Xtensa may reference. How would one figure that out?
« Last Edit: 13 / March / 2017, 14:02:10 by 62ndidiot »

*

Offline Ant

  • *****
  • 509
Re: SX60HS Porting
« Reply #709 on: 13 / March / 2017, 14:26:57 »
Sorry, but I did not dig deeper.
You better should ask your qestion to author of this topic
I don't know about shadow memory for Xtensa core.
« Last Edit: 13 / March / 2017, 14:33:28 by Ant »

 

Related Topics