Eos 400d ( Rebel XTI ) - page 178 - DSLR Hack development - CHDK Forum

Eos 400d ( Rebel XTI )

  • 1871 Replies
  • 842510 Views
Re: Eos 400d ( Rebel XTI )
« Reply #1770 on: 20 / June / 2013, 03:29:45 »
Advertisements
Sounds like a race condition ?!?... Perhaps a semaphore can solve it.
Either our own semaphore, or we find a semaphore for the display and rely on it.

That makes sense: all my test code seems to add is some delay to the execution of display_overlay; perhaps that delay is enough to fix a race condition [it also serves to wake up our message queue, by the way; but then removing display_overlay should not fix the issue].

In the past, we used the semaphore at VramInstance_address, but that was when we refreshed the display asynchronously; as soon as Sergei found out about the TransferScreen method, we stopped using that semaphore: if I am not mistaken, TransferScreen is already protected by that semaphore (and thus display_overlay is also protected).

*

Offline 0xAF

  • ***
  • 220
    • 0xAF
Re: Eos 400d ( Rebel XTI )
« Reply #1771 on: 20 / June / 2013, 04:09:16 »
Just some thoughts:

1.
Is it possible that in some race condition case get_current_cmode() returns something not reliable (i.e. > CMODES_MAX) ?
then this line in display_overlay() will make troubles:
Code: [Select]
bmp_printf(vram_address, FONT(FONT_SMALL, COLOR_BLACK, COLOR_GRAY),  16,  96, "%s", cmodes_config.names[current_cmode]);
note the cmodes_config.names[]

2.
I would try to wrap the display_overlay() with semaphore just in case...
i'm not sure if this will help, but the "timestamp()" call actually calls clock_gettime() with "0" as first param, which should mean CLOCK_REALTIME.
If this VxWorks function is truly posix, it probably reads the RTC of the camera, which should be separate module with SPI/I2C (or similar) interface, hence communication over the BUS is needed. It is possible (depending of the implementation of clock_gettime ) that if this routine is called too fast the BUS is busy and if it does not check the BUS, bad things may happen. Though I believe VxWorks should have considered this.
Anyway, try wrapping the display_overlay() with our semaphore and see if it helps ?
« Last Edit: 20 / June / 2013, 04:11:24 by 0xAF »
// AF

Re: Eos 400d ( Rebel XTI )
« Reply #1772 on: 24 / June / 2013, 16:54:18 »
Hi,
first of all thanks for all your work for this magic sw.
I got a lot of problems with the latest version, the camera locked a lot of time and was forced to do a battery pull each time there was a lock. Moreover the camera locked when I mounted the flash Nissin, it has been impossible to shot with the flash.
I reinstall an old version of last year, suitable for my needs.

Re: Eos 400d ( Rebel XTI )
« Reply #1773 on: 26 / June / 2013, 02:18:09 »
Well, I just returned from a 4 day trip with a full 2GB card, and guess what? The camera did not lock, not even once! And all I changed was these two lines at the end of display_overlay:

Code: [Select]
void display_overlay(uint8_t *vram_address) {
    char buffer[LP_MAX_WORD];

    if (FLAG_GUI_MODE == GUIMODE_OLC && AE_IS_CREATIVE(DPData.ae)) {
        int current_cmode = get_current_cmode();

        if (status.msm_active)
            bmp_printf(vram_address, FONT(FONT_SMALL, COLOR_BLACK, COLOR_GRAY),  35,  96, "[***]");
        else if (status.cmode_active && current_cmode != CMODE_NONE)
            bmp_printf(vram_address, FONT(FONT_SMALL, COLOR_BLACK, COLOR_GRAY),  16,  96, "%s", cmodes_config.names[current_cmode]);

        if (status.fexp && DPData.tv_val != TV_VAL_BULB)
            bmp_printf(vram_address, FONT(FONT_SMALL, COLOR_BLACK, COLOR_GRAY), 138,  32, "#");

        if (settings.autoiso_enable && (DPData.ae != AE_MODE_M || DPData.tv_val != TV_VAL_BULB))
            bmp_printf(vram_address, FONT(FONT_SMALL, COLOR_BLACK, COLOR_GRAY), 237,  14, "%s", AUTOISO_AUTO);

        if (DPData.wb == WB_MODE_COLORTEMP)
            bmp_printf(vram_address, FONT(FONT_SMALL, COLOR_BLACK, COLOR_GRAY),  50, 138, "%d", DPData.color_temp);

        if (DPData.ae_bkt) {
            ec_print(buffer, DPData.ae_bkt);
            bmp_printf(vram_address, FONT(FONT_SMALL, COLOR_BLACK, COLOR_GRAY), 224,  96, "%s", buffer);
        }

#ifdef RELEASE
        bmp_printf(vram_address, FONT(FONT_SMALL, COLOR_BLACK, COLOR_BLUE), 148, 0, LP_WORD(L_P_400PLUS));
#else
        bmp_printf(vram_address, FONT(FONT_SMALL, COLOR_BLACK, COLOR_RED ),  20, 0, LP_WORD(L_A_WARNING));
#endif

        if (*display_message) {
            if(timestamp() < message_timeout)
                bmp_printf(vram_address, FONT(FONT_SMALL, COLOR_WHITE, COLOR_BLACK),  16, 228, display_message);
            else
                *display_message = '\0';
        }

        if (!FLAG_DISPLAY_ON)
                enqueue_action(beep);
    }
}

Hi,
first of all thanks for all your work for this magic sw.
I got a lot of problems with the latest version, the camera locked a lot of time and was forced to do a battery pull each time there was a lock. Moreover the camera locked when I mounted the flash Nissin, it has been impossible to shot with the flash.
I reinstall an old version of last year, suitable for my needs.

We are working on this problem, sorry for the inconvenience.


*

Offline 0xAF

  • ***
  • 220
    • 0xAF
Re: Eos 400d ( Rebel XTI )
« Reply #1774 on: 26 / June / 2013, 03:40:18 »
Well, I just returned from a 4 day trip with a full 2GB card, and guess what? The camera did not lock, not even once! And all I changed was these two lines at the end of display_overlay:

Code: [Select]
...
        if (!FLAG_DISPLAY_ON)
                enqueue_action(beep);
...

enqueue_action() is calling TryPostMessageQueue() only.
IMO TryPostMessageQueue() should not be a blocking function, which means this 2 lines adds only few ns (or ms) delay to the display_overlay() routine.
Can you try it with SleepTask(10) for example.
// AF

*

Offline Sergei

  • ***
  • 114
Re: Eos 400d ( Rebel XTI )
« Reply #1775 on: 26 / June / 2013, 12:46:35 »
Eduperez, try to declare display_message as static variable in display.c.
Code: [Select]
static char display_message[LP_MAX_WORD];

Re: Eos 400d ( Rebel XTI )
« Reply #1776 on: 30 / June / 2013, 17:41:24 »
Hi,
first of all thanks for all your work for this magic sw.
I got a lot of problems with the latest version, the camera locked a lot of time and was forced to do a battery pull each time there was a lock.
...
I reinstall an old version of last year, suitable for my needs.

Same here... (400D incl. BG-E3) 

Many thanks for your great work!  :)

Re: Eos 400d ( Rebel XTI )
« Reply #1777 on: 30 / June / 2013, 19:00:25 »
I have finally changed display_overlay to this:
Code: [Select]
void display_overlay(uint8_t *vram_address) {
char buffer[LP_MAX_WORD];

if (FLAG_GUI_MODE == GUIMODE_OLC && AE_IS_CREATIVE(DPData.ae)) {
if (FLAG_DISPLAY_ON) {
int current_cmode = get_current_cmode();

if (status.msm_active)
bmp_printf(vram_address, FONT(FONT_SMALL, COLOR_BLACK, COLOR_GRAY),  35,  96, "[***]");
else if (status.cmode_active && current_cmode != CMODE_NONE)
bmp_printf(vram_address, FONT(FONT_SMALL, COLOR_BLACK, COLOR_GRAY),  16,  96, "%s", cmodes_config.names[current_cmode]);

if (status.fexp && DPData.tv_val != TV_VAL_BULB)
bmp_printf(vram_address, FONT(FONT_SMALL, COLOR_BLACK, COLOR_GRAY), 138,  32, "#");

if (settings.autoiso_enable && (DPData.ae != AE_MODE_M || DPData.tv_val != TV_VAL_BULB))
bmp_printf(vram_address, FONT(FONT_SMALL, COLOR_BLACK, COLOR_GRAY), 237,  14, "%s", AUTOISO_AUTO);

if (DPData.wb == WB_MODE_COLORTEMP)
bmp_printf(vram_address, FONT(FONT_SMALL, COLOR_BLACK, COLOR_GRAY),  50, 138, "%d", DPData.color_temp);

if (DPData.ae_bkt) {
ec_print(buffer, DPData.ae_bkt);
bmp_printf(vram_address, FONT(FONT_SMALL, COLOR_BLACK, COLOR_GRAY), 224,  96, "%s", buffer);
}

#ifdef RELEASE
bmp_printf(vram_address, FONT(FONT_SMALL, COLOR_BLACK, COLOR_BLUE), 148, 0, LP_WORD(L_P_400PLUS));
#else
bmp_printf(vram_address, FONT(FONT_SMALL, COLOR_BLACK, COLOR_RED ),  20, 0, LP_WORD(L_A_WARNING));
#endif

if (*display_message) {
if(timestamp() < message_timeout)
bmp_printf(vram_address, FONT(FONT_SMALL, COLOR_WHITE, COLOR_BLACK),  16, 228, display_message);
else
*display_message = '\0';
}
} else {
SleepTask(OVERLAY_DELAY);
}
}
}

And this seems to be working properly; so I have just released it as 20130414-03.

Many thanks for your help!


Re: Eos 400d ( Rebel XTI )
« Reply #1778 on: 10 / July / 2013, 16:47:03 »
It has been reported to me that version 20130414-03 still produces camera lock-ups; and unfortunately, I do not have much time right now to spend on this. I have just released 20130414-04, that disables all the overlay information, until I can find some time and come back to this issue.
« Last Edit: 30 / July / 2013, 07:05:00 by eduperez »

Re: Eos 400d ( Rebel XTI )
« Reply #1779 on: 05 / September / 2013, 10:56:08 »
Hi,

most likely you've already heard about this: http://haxit.blogspot.ch/2013/08/hacking-transcend-wifi-sd-cards.html

He managed to hack a wifi sd-card that is based on a linux system. So I thought that maybe by using a Sd2CF Adapter card this would offer a whole bunch of possibilities by accessing the linux system on the sd wifi from 400plus. I've ordered a Transcend wifi to see if the already existing 400plus is working with it

Regards
F.

 

Related Topics