Crash on 2. image record when shoot RAW and have series mode on - General Discussion and Assistance - CHDK Forum  

Crash on 2. image record when shoot RAW and have series mode on

  • 7 Replies
  • 5618 Views
Crash on 2. image record when shoot RAW and have series mode on
« on: 27 / January / 2011, 08:08:27 »
Advertisements
I get random crash with this code i notice in DNG when i press and hold shoot button so a series of RAW is shoot.

savetime of RAW is between 1.470 sec and 1.780 sec in DNG and 1.260 sec and 1.429 sec in CRW.

when shoot not RAW, then 2-3 fps are record /sec.so the camera is fast in generel


char *hook_raw_image_addr()   //ASM1989  DONE FOR IXUS 1000
{
   if (*((int*)0x34D0) != 0)    //  34C4 + C  ->   FF885154  ->FF885180   (ixus 1000)
      return (char*)(0x46000000);   // at FFB8ECF4  pointed at aSsimgprocbuf_c DCB "SsImgProcBuf.c",0
   else
      return (char*) 0x4132CD20;   // found at[search CRAW BUF]
}

char *hook_alt_raw_image_addr()
{
   // Appears to be two raw buffers (this returns inactive buffer)
   // Addresses below found in table at FFB9922C, ref at FF88883C
   // used in _sub_FF888630__SsImgProcBuf.c__0
   // checks [0x36a0 + 0xc] --> defines which buffer is active

   if (*((int*)0x34D0) == 0)
      return (char*) 0x46000000;
   else
      return (char*) 0x4132CD20;
}

but when i change code to default so hook_alt_raw_image_addr
return same address as hook_raw_image_addr

i get always crash on 2. shoot .happen in DNG and crw mode when the camera show busy(do darkframe subtraction) i think.
.I try several places of the rawhook.but always same.
it seem happen during RAW save, because i try out a sleep here, but not help.Raw Buffer cached on or off too not help

when i use a slower SD card, save time need around 2.5 sec and Camera never crash when camera show busy.I verify that often, with same result.

also camera never crash, when not busy is show (i guess no darkframe subtraction then)

void __attribute__((naked,noinline)) capt_seq_hook_raw_here()
{
 asm volatile("STMFD   SP!, {R0-R12,LR}\n");

    raw_save_stage = RAWDATA_AVAILABLE;
    core_rawdata_available();
    while (raw_save_stage != RAWDATA_SAVED){
   _SleepTask(10);
    }
+    _SleepTask(1000);

 asm volatile("LDMFD   SP!, {R0-R12,PC}\n");
}

romlog show this when crash

ASSERT!! FsIoNotify.c Line 457
Occured Time  2011:01:27 11:24:20
Task ID: 17236003
Task name: SpyTask
SP: 0x0038B958
StackDump:
0x00000000
0xFF8723B8
0x000001C9
0x00000000
0x00000003
0x00000101
0x001B85BC
0x00000000
0x19980218
0x19980218
0x0038B9C4
0xFF8724DC
0x00000101
0x00000001
0x001B85BC
0x00000003
0x00000000
0xFF838050
0x001A6A64
0x001B85CC
0x00000316
0x001B85A8
0x19980218
0x0018B4C4
0x19980218
0x0038B9C8
0x0017FBBB
0x0018B4B4
0x001A6A3C
0x000000B1
0x4132CD20
0x4132CD20
0x00000000
0x00000000
0x00000000
0x00000000
0xFF816DB0
0xFF8128B0
0x00000014
0xFF83B5B8
0x00000000
0x01312D00
0x001B7834
0x001B6824
0x00000000
0x000000B1
0x19980218
0x00172E03
0x00372BB8
0x19980218
0x19980218
0xFF816B74
0x19980218
0x19980218
0x00000808
ShootConDump:
01 02 07 08 09 09 0a 09 0f 0f
CameraConDump:
07 0a 02 0d 09 01 0f 0f 0f 0f
00009710: SS:LoadTest:10

00009720: SS:PreCapt

00009750: UI:DisplayPhysicalScreenCBR

00009750: UI:Re ScreenUnLock

00009750: UI:ScreenUnLock

00009770: UI:ShootState:0x2

00009770: UI:ClearEventComp

00009770: UI:DisplayPhysicalScreenCBR

00009770: UI:DisplayPhysicalScreenCBR

00010430: UI:ShootSeqToUI:0x2006:adr:0x45,Para:69

00010430: UI:ShtCon_SetPreCapt

00010430: UI:DSIC:62,0

00010440: UI:ScreenLock

00010490: UI:ScreenUnLock

00010510: UI:_ResetShootingMode

00010520: UI:_EntryPrepareShoot

00010520: UI:ShootState:0x7

00010520: UI:DisplayPhysicalScreenCBR

00011640: UI:Button:0x000009A3:PressSwTwo

00011640: UI:ShootState:0x8

00011650: UI:ShootState:0x9

00011650: UI:ShtCon_ContiShootPicture

00011650: UI:DSIC:14,0

00011650: UI:_MuteOn

00011650: UI:DSIC:43,0

00011650: UI:DispSwCon_MuteOnPhysicalScreen

00011650: UI:MuteOnPhysicalScreen

00011650: SS:Shoot

00011650: UI:DSIC:63,0

00011660: UI:ScreenLock

00011670: SS:   Raw[1]

00011670: SS:   Raw[1]

00011670: UI:ScreenUnLock

00011690: UI:ScreenLock

00011690: UI:ScreenUnLock

00011720: UI:DisplayPhysicalScreenCBR

00011720: UI:DisplayPhysicalScreenCBR

00011820: UI:ShootSeqToUI:0x2022:adr:0,Para:0

00011830: UI:DSIC:64,0

00014560: UI:DSIC:45,0

00014560: UI:DispSwCon_MuteOffPhysicalScreen

00014560: UI:MuteOffPhysicalScreen

00015150: UI:ShootSeqToUI:0x2007:adr:0x196,Para:406

00015150: SS:   Raw[1]

00015150: SS:   Raw[1]

00015160: UI:ShootState:0x9

00015160: UI:ShtCon_ContiShootPicture

00015160: UI:DSIC:14,0

00015160: SS:Shoot

00015160: UI:DSIC:63,0

00015170: UI:ScreenLock

00015170: SS:   Raw[2]

00015170: SS:   Raw[2]

00015170: UI:ScreenUnLock

00015180: UI:ScreenLock

00015180: UI:ScreenUnLock

00015190: UI:DisplayPhysicalScreenCBR

00015190: UI:ShootSeqToUI:0x2001:adr:0,Para:0

00015190: UI:Sht_CancelStrobeChargeTimer

00015190: UI:DSIC:4c,0

00015190: UI:ShootSeqToUI:0x2008:adr:0x196,Para:406

00015200: UI:_MuteOff

00015200: UI:DSIC:44,0

00015200: UI:ScreenLock

00015200: UI:ScreenUnLock

00015200: UI:ShootState:0xA

00015200: UI:ShtCon_StartReview

00015210: UI:_EntryActionReview

00015210: SS:StartRev

00015210: UI:LogicalEvent:0x311f:adr:0,Para:0

00015220: UI:DisplayPhysicalScreenCBR

00015220: UI:DisplayPhysicalScreenCBR

00015220: UI:ShootState:0x9

00015300: UI:DSIC:47,0

00015300: UI:DSIC:46,0

00015300: SS:   Raw[1]

00015300: SS:   Raw[1]

00015310: UI:ShootSeqToUI:0x201e:adr:0x196,Para:406

00015310: UI:ShootSeqToUI:0x2029:adr:0x196,Para:406

00015310: UI:comp

00015310: SS:NextAvail(3),ReviewAvail(5)

00015330: UI:ShootSeqToUI:0x2022:adr:0,Para:0

00015330: UI:DSIC:64,0

    
Ixus 1000 HS

*

Offline reyalp

  • ******
  • 14082
Re: Crash on 2. image record when shoot RAW and have series mode on
« Reply #1 on: 27 / January / 2011, 12:19:07 »
This is unsurprising, using alt raw buffer should be considered highly experimental. Would be interesting to know if sx30 or g12 experience the same problem. Of course there's been so much trial and error code in your port other causes would be unsurprising too....

I would guess that your added sleep completely eliminates the advantage of using the alternate raw buffer, so you might as well just use the normal one all the time. Or figure out a way to know exactly when things are ready to continue.
Quote
savetime of RAW is between 1.470 sec and 1.780 sec in DNG and 1.260 sec and 1.429 sec in CRW.

when shoot not RAW, then 2-3 fps are record /sec.so the camera is fast in generel
What else do you expect ? raw is a lot of data.

Crashing on the faster card rather than the slow one seem slightly odd.

Quote
but when i change code to default so hook_alt_raw_image_addr
return same address as hook_raw_image_addr

i get always crash on 2. shoot .happen in DNG and crw mode when the camera show busy(do darkframe subtraction) i think.
.I try several places of the rawhook.but always same.
Are you saying that you always get the crash *after* you change the code ???

CRW shouldn't use alt raw at all.
Don't forget what the H stands for.

Re: Crash on 2. image record when shoot RAW and have series mode on
« Reply #2 on: 27 / January / 2011, 13:53:48 »
>This is unsurprising, using alt raw buffer should be considered highly experimental. Would be interesting to >know if sx30 or g12 experience the same problem. Of course there's been so much trial and error code in >your port other causes would be unsurprising too....

I mean i get the crash always when i use not the altraw buffer(altraw return then same address as raw).with altraw other address it happen not so often.

maybe the problem happen better on Ixus 300 HS, because it can faster shoot.other canon camera can only do 1 - 1.5 fps.

my fast card store 12 mb/sec and slow card store 6 mb/sec.so there is need a card that transfer at least 12 megabyte i think.

here too help a sleep command i find now out.I need add it before.

So it seem the canon Firmware do some action on a file and chdk want do a action too and it crash.
but i have no idea what can be problem, because the raw are all store in seperate folder.

ASSERT!! FsIoNotify.c Line 457

is btw same as other users report they get on bootcrash.
maybe its same problem.and SX20 user also report crash on shooting.

seem i need try a old build what happen then

>Are you saying that you always get the crash *after* you change the code Huh?

I use original Code from trunk1050

with that code it now work always.so chdk should wait.

void __attribute__((naked,noinline)) capt_seq_hook_raw_here()
{
 asm volatile("STMFD   SP!, {R0-R12,LR}\n");

     _SleepTask(1000);
    raw_save_stage = RAWDATA_AVAILABLE;
    core_rawdata_available();
    while (raw_save_stage != RAWDATA_SAVED){
   _SleepTask(10);
    }


 asm volatile("LDMFD   SP!, {R0-R12,PC}\n");
}

EDIT:

I see in raw.c source, that there is always a dir dcim try to create.i try to deactivate that and look what happen then.


//         mkdir("A/DCIM");
#if defined(CAM_DATE_FOLDER_NAMING)
        if (conf.raw_in_dir)
            get_target_dir_name(dir);
        else
            sprintf(dir, RAW_TARGET_DIRECTORY, 100);
#else
        sprintf(dir, RAW_TARGET_DIRECTORY, (conf.raw_in_dir)?get_target_dir_num():100);
#endif
//       mkdir(dir);

and it work.

first i remove only 1 A/DCIM dir create, but this not help.


it seem when canon firmware do fsionotify no mkdir command is allowed even if the commands do nothing.
I dont understand wy this is need here, directories are create on boot
« Last Edit: 27 / January / 2011, 14:14:29 by Bernd R »
Ixus 1000 HS

Re: Crash on 2. image record when shoot RAW and have series mode on
« Reply #3 on: 28 / January / 2011, 00:33:25 »
seems to be the same with my post (http://chdk.setepontos.com/index.php?topic=6052.0)

I dont understand wy this is need here, directories are create on boot

yes, dirs can be created on boot, but you can boot today at 23:59:59 and start shooting at 00:00:01 tomorrow, and if conf.raw_in_dir is set, there will be "path not found" error :-), or even if user removes the dirs via file browser.



Re: Crash on 2. image record when shoot RAW and have series mode on
« Reply #4 on: 28 / January / 2011, 06:29:34 »
I test now, if this is maybe a stack problem, but when i do this line (i guess 0x2000 in old was stack size)

 _CreateTask("SpyTask", 0x19, 0x4000, core_spytask, 0);

problem is still in.

Can you tell how fast your SD Card can write(you can see this on benchmark) ?
Does the change i write you and other help too on that problem ?

>yes, dirs can be created on boot, but you can boot today at 23:59:59 and start shooting at 00:00:01 >tomorrow, and if conf.raw_in_dir is set, there will be "path not found" error :-), or even if user removes >the dirs via file browser.

ah you are right, i have test, the IX 1000 create really a new folder in daily folder mode, when i switch on the Camera at 23:59 and press on 23:59:52 shoot half and then on 00:00:04 shoot full.

But when i begin a continues shoot at 23:59:55 and end on 00:00:14 then all files are store in old folder and no new folder is create.

maybe you can test this on your camera too, when you change the time in Canon menu to 23:59 with daily folder, it can easy test.

So its possible that this 2 mkdir are only call on first shoot.chdk support a flag for that because of save only first raw feature

state_shooting_progress = SHOOTING_PROGRESS_PROCESSING;

when shooting_Progress_processing is set, then no mkdir is call
« Last Edit: 28 / January / 2011, 06:32:59 by Bernd R »
Ixus 1000 HS

Re: Crash on 2. image record when shoot RAW and have series mode on
« Reply #5 on: 28 / January / 2011, 08:20:11 »
Hi
I test with  4GB class4 card, 4400-5000 kbps write speed

for now I have no card reader with me, so can not test the changes, will do this later in the evening.


Re: Crash on 2. image record when shoot RAW and have series mode on
« Reply #6 on: 30 / January / 2011, 14:12:04 »
>for now I have no card reader with me, so can not test the changes, will do this later in the evening.

Have you or other test it ?

I have now change code of raw.c so only on 1. shoot the dirs are try to create, this help on IX1000 and no crashes happen.

int raw_savefile() {

......


    // got here second time in a row. Skip second RAW saving.
    if (conf.raw_save_first_only && state_shooting_progress == SHOOTING_PROGRESS_PROCESSING) {
        return 0;
    }

-    state_shooting_progress = SHOOTING_PROGRESS_PROCESSING;

    if (conf.save_raw
        && (!(shooting_get_prop(PROPCASE_RESOLUTION)==5))
        && (!((movie_status > 1) && conf.save_raw_in_video))
        && (!((m==MODE_SPORTS) && conf.save_raw_in_sports))
        && (!((m==MODE_AUTO) && conf.save_raw_in_auto))
        && (!(conf.edge_overlay_enable && conf.save_raw_in_edgeoverlay))
        && (!((shooting_get_drive_mode()==1) && conf.save_raw_in_burst && !(m==MODE_SPORTS)))
        && (!((shooting_get_drive_mode()>=2) && conf.save_raw_in_timer))
        && (!((shooting_get_prop(PROPCASE_BRACKET_MODE)==1) && conf.save_raw_in_ev_bracketing)) )
    {
        int timer; char txt[30];

        started();

        t.actime = t.modtime = time(NULL);

-        mkdir("A/DCIM");
#if defined(CAM_DATE_FOLDER_NAMING)
        if (conf.raw_in_dir)
            get_target_dir_name(dir);
        else
            sprintf(dir, RAW_TARGET_DIRECTORY, 100);
#else
        sprintf(dir, RAW_TARGET_DIRECTORY, (conf.raw_in_dir)?get_target_dir_num():100);
#endif
+if (state_shooting_progress != SHOOTING_PROGRESS_PROCESSING)
+{
 +       mkdir("A/DCIM");
 +       mkdir(dir);
+}
+        state_shooting_progress = SHOOTING_PROGRESS_PROCESSING;
-        mkdir(dir);
Ixus 1000 HS

Re: Crash on 2. image record when shoot RAW and have series mode on
« Reply #7 on: 31 / January / 2011, 03:39:51 »
back online now )
tested, seems to work as you described.

about this:
mkdir("A/DCIM");
mkdir(dir);

as I can see, mkdir is recursive, so there is no need to call it twice (needs testing)

regards, michael
« Last Edit: 31 / January / 2011, 03:47:45 by micklesh »


 

Related Topics