Avoid saving (jpg,raw) buffers - General Discussion and Assistance - CHDK Forum supplierdeeply

Avoid saving (jpg,raw) buffers

  • 8 Replies
  • 1984 Views
*

Offline c10ud

  • ***
  • 245
Avoid saving (jpg,raw) buffers
« on: 10 / February / 2011, 06:04:16 »
Advertisements
I was wondering if there was some simple method for making the camera skip the save-to-sdcard the raw/jpeg buffer part.

This way we could (optionally) save the chdk-raw-dng directly and skip further writings to sdcard.

I started looking into the captseq task for interesting jumps but no luck so far (G12 100c dump for reference). WrCacheMgr.c also got my attention but i was looking for a simple solution, i don't feel like overriding yet-another-task is the way to go. I was hoping for something like buffer_ready_to_be_saved flag somewhere (or a jump in captseq?) we could overwrite at our own pleasure and skip destroying even more our sdcard.

Has anyone ever looked into this? Anyone with a nicer disassembled code than mine willing to take a look at this parts? Ideas? Thoughts?


Greets

Re: Avoid saving (jpg,raw) buffers
« Reply #1 on: 10 / February / 2011, 09:20:07 »
Has anyone ever looked into this?

Maybe EWAVR has but we do not hear from him very often these days.

After saving the RAW buffer, if you write COLOR_BLACK to all locations the JPG file is tiny (and WHITE !).

*

Offline c10ud

  • ***
  • 245
Re: Avoid saving (jpg,raw) buffers
« Reply #2 on: 12 / February / 2011, 10:23:10 »
Has anyone ever looked into this?

Maybe EWAVR has but we do not hear from him very often these days.

After saving the RAW buffer, if you write COLOR_BLACK to all locations the JPG file is tiny (and WHITE !).
interesting info, thanks :)
however i was looking for a way to programmaticaly inhibit saving on request (something like a write-lock killswitch..however, this could be an interesting path..?).. as soon as exams will allow me to take a better look, i'll see if i can find something in the firm! :D

*

Offline c10ud

  • ***
  • 245
Re: Avoid saving (jpg,raw) buffers
« Reply #3 on: 13 / February / 2011, 13:43:05 »
quick (and bad) update:

forcing freeclusters to 0 -> no luck so far
locking sd card -> no luck so far
injecting somecode in wrcachemanager -> no luck so far (because of ROM?)


*

Offline reyalp

  • ******
  • 11902
Re: Avoid saving (jpg,raw) buffers
« Reply #4 on: 13 / February / 2011, 15:53:45 »
I would suggest finding the task that does the writing and simply skipping that step.

An alternative would be to hook the file system drivers and ignore writes to files matching certain patterns...

Quote
injecting somecode in wrcachemanager -> no luck so far (because of ROM?)
???
Don't forget what the H stands for.

*

Offline c10ud

  • ***
  • 245
Re: Avoid saving (jpg,raw) buffers
« Reply #5 on: 14 / February / 2011, 14:36:04 »
I would suggest finding the task that does the writing and simply skipping that step.

An alternative would be to hook the file system drivers and ignore writes to files matching certain patterns...

Quote
injecting somecode in wrcachemanager -> no luck so far (because of ROM?)
???
mm i didn't identify a task yet, i think wrmanager is what is doing the write, but i had an hard time tracing all the subs that lead to it (my ida skills suck, i'll probably give a better look after exams)

about "injecting" code: i thought on making that wrmanager routine return soon after it was called, but i guess addresses from 0xff81xxxx on are mapped to rom, since poke wasn't working as expected (my bad, didn't study dryos that much :s)

*

Offline reyalp

  • ******
  • 11902
Re: Avoid saving (jpg,raw) buffers
« Reply #6 on: 14 / February / 2011, 16:43:04 »
about "injecting" code: i thought on making that wrmanager routine return soon after it was called, but i guess addresses from 0xff81xxxx on are mapped to rom, since poke wasn't working as expected (my bad, didn't study dryos that much :s)
All of the canon executable code is in ROM, except for a very small amount related to the exception handlers. You cannot simply replace existing code. Some function pointers do live in RAM, which might be useful.

As a first step, I would suggest making an effort to understand how CHDK currently modifies the firmware.
Don't forget what the H stands for.

*

Offline c10ud

  • ***
  • 245
Re: Avoid saving (jpg,raw) buffers
« Reply #7 on: 18 / February / 2011, 16:52:20 »
>I would suggest finding the task that does the writing and simply skipping that step.
nice idea!

 just found out task_FileScheduleTask. If i tell the camera to load a simple while-1-sleep-task instead of that, the SD remains untouched.

However the camera seems to be expecting some sort of feedback from the task since the "i'm saving please wait" light continues to flash (and if you shoot too much, it crashes).

In the next days i'll see if instead of just killing the task i can make it do its job and when asked just skip the writing (but not the "i'm done, go ahead caller" part)


Re: Avoid saving (jpg,raw) buffers
« Reply #8 on: 20 / February / 2011, 06:29:32 »
>However the camera seems to be expecting some sort of feedback from the task since the "i'm saving >please wait" light continues to flash (and if you shoot too much, it crashes).

If you get the crash, you can try this code, that do not try create the folders on second shoot.but you need look  that camera create on series shoot no new dir when the day change during you press shoot button

Ixus 1000 work ok with code change written below perfect

http://chdk.setepontos.com/index.php?topic=6057.msg60490#msg60490
Ixus 1000 HS

 

Related Topics