As I noted on another thread
http://chdk.setepontos.com/index.php/topic,2686.0.html, limited webcam operation is now possible.
I did a quick hack with patched Lua and gphoto2 on Ubuntu on my a570is. As is, the setup shoots an image approximately every 10 seconds and moves it out of the camera to the PC via USB (PTP).
The scripts (lua and bash) and a help text are attached. Read the help file, Ubuntu needs some configuring to make it ignore the camera so that gphoto2 can use it directly.
The way I did it Lua needs access to four new Canon firmware functions. It's pretty easy to crash the camera using them, so this all needs a lot of polishing before we can think of adding it to the trunk. That's one reason I haven't spend time prepared a patch for this.
Additions required for a570is 1.00e are:
platform/a570/sub/100e/stubs_entry_2.S:
NHSTUB(PB2Rec, 0xffc119b8)
NHSTUB(Rec2PB, 0xffc119f8)
NHSTUB(ForceQuitPTPMode, 0xffd8e158)
NHSTUB(RefreshUSBMode, 0xffd8df5c)
include/lolevel.h:
extern void _PB2Rec(void);
extern void _Rec2PB(void);
extern void _ForceQuitPTPMode(void);
extern void _RefreshUSBMode(void);
platform/generic/wrappers.c:
void PB2Rec(void)
{
_PB2Rec();
}
void Rec2PB(void)
{
_Rec2PB();
}
void ForceQuitPTPMode(void)
{
_ForceQuitPTPMode();
}
void RefreshUSBMode(void)
{
_RefreshUSBMode();
}
include/platform.h:
void PB2Rec(void);
void Rec2PB(void);
void ForceQuitPTPMode(void);
void RefreshUSBMode(void);
core/luascript.c:
static int luaCB_PB2Rec( lua_State* L )
{
PB2Rec();
return 0;
}
static int luaCB_Rec2PB( lua_State* L )
{
Rec2PB();
return 0;
}
static int luaCB_ForceQuitPTPMode( lua_State* L )
{
ForceQuitPTPMode();
return 0;
}
static int luaCB_RefreshUSBMode( lua_State* L )
{
RefreshUSBMode();
return 0;
}
core/luascript.c function register_lua_funcs()
FUNC(PB2Rec);
FUNC(Rec2PB);
FUNC(ForceQuitPTPMode);
FUNC(RefreshUSBMode);
(after those modifications CHDK will of course not build for any other firmware due to missing stubs/dummy wrappers).
I wanted to signal things from the PC by uploading a file after the PC script is done transferring, but sadly upload didn't work at all. Has anyone ever managed to upload files via USB to an a570is on any OS?