CHDK PTP interface - page 21 - General Discussion and Assistance - CHDK Forum

CHDK PTP interface

  • 1244 Replies
  • 525367 Views
Re: CHDK PTP interface
« Reply #200 on: 01 / July / 2010, 15:03:22 »
Advertisements
Quote
Try "mode 1" command for switching camera to record mode.

The command seems to have no effect.  (I don't get any output on the terminal and the camera doesn't do anything).  Here's what my terminal looks like:

<conn> mode 1
<conn> lua shoot()

Re: CHDK PTP interface
« Reply #201 on: 01 / July / 2010, 16:26:15 »
I feel that the unresponsiveness of the camera is due to windows interfering as described here (taken from page 11):

Quote
I noticed that if I plugged in the USB cable after the CHDK had started on the camera that 4 out of 5 times the camera would switch to "disk" mode (for lack of a better term) and not accept commands and not come out of it until I opened the battery compartment.

I am running linux in a windows virtual box that, so when I plug in the USB cable the camera first talks to windows before I can capture it into the linux machine.  Could the communications with windows be the problem here?

Re: CHDK PTP interface
« Reply #202 on: 01 / July / 2010, 21:36:37 »
So where would one start porting the patches to an A560?

*

Offline c10ud

  • ***
  • 245
Re: CHDK PTP interface
« Reply #203 on: 04 / July / 2010, 09:55:58 »
so, i was experimenting a bit with the viewfinder image lurking ewavr's code in order to make the yuv-to-rgb conversion OS agnostic.

Code: [Select]
    char* liveb = NULL; 
    unsigned char* buf1= NULL;
    int WIDTH = 720;
    int HEIGHT = 480;
    int BUFWIDTH = 720;
    long int SIZE = (BUFWIDTH*HEIGHT*6)/4;
    liveb = ptp_chdk_get_memory(ADDRESS, SIZE, &params, &params.deviceinfo);
    if (liveb == NULL)
        return NULL;
    buf1=(unsigned char*)liveb;
    unsigned char* nastybuf =(unsigned char*) malloc (sizeof(unsigned char*)*SIZE);
    if (nastybuf == NULL)
        return NULL;
    memcpy(nastybuf, liveb, SIZE);
    int* col = (int*)nastybuf;
    int x = 0; int y = 0;
    for (y=0; y<HEIGHT; y++) {
    for (x=0; x<BUFWIDTH; x+=4, buf1+=6) {
        if ( x < WIDTH) {
            *col++=get_pixel_yuv(buf1[1],  buf1[0], buf1[2]);
            *col++=get_pixel_yuv(buf1[3],  buf1[0], buf1[2]);
            *col++=get_pixel_yuv(buf1[4],  buf1[0], buf1[2]);
            *col++=get_pixel_yuv(buf1[5],  buf1[0], buf1[2]);
        }
    }
    }   
    free(liveb);
    return nastybuf;
the current code returns a nice uchar* with raw rgb data. using the Qt toolkit i can magically convert this to whatever image format i want with two simple lines
Code: [Select]
    QImage img(nastybuf, WIDTH, HEIGHT, QImage::Format_RGB32);

    img.save("converted_image.bmp");
however a cool thing would have been returning "complete" image data instead of raw rgb without involving the use of a complete toolkit in orderd to be fast and more platform-independant as possible (i see ewavr uses Windows' GDI+ for converting the image data in his chdkde tool). I was thinking on linking some c library like libjpeg, what do you think? Is there a simpler solution in your opinion?

greets


*

Offline c10ud

  • ***
  • 245
Re: CHDK PTP interface
« Reply #204 on: 05 / July / 2010, 04:35:26 »

Re: CHDK PTP interface
« Reply #205 on: 06 / July / 2010, 20:01:16 »
jmgummes -- you need to send the following lua command to force the camera back into shooting mode. Until then no commands will respond.


lua post_levent_to_ui("PressRecButton")


then, things like
lua shoot()

should operate correctly.. Can you read python? If so you'll find the wedding photobooth code helpful as an example of crudely controlling the camera in this manner.

Re: CHDK PTP interface
« Reply #206 on: 09 / July / 2010, 01:04:45 »
I'm very new to this and don't understand what to do to get my a720 recognised by Win XP? I have latest chdk build and libusb for windows installed and CHDKCAM too. I cannot get my a720 to become available to the PC at all now, where at least it used to be seen by the Canon pc transfer app before. Of course CHDKCAM cant see it either.

I really would like to use it for an animation trigger via usb. Thanks for any advice (btw, I love chdk!), keeps me from buying a 550D ;)

*

Offline fe50

  • ******
  • 3152
  • IXUS50 & 860, SX10 Star WARs-Star RAWs
    • fe50
Re: CHDK PTP interface
« Reply #207 on: 09 / July / 2010, 01:28:47 »
Hello & welcome, 3pointedit !

I'm very new to this and don't understand what to do to get my a720 recognised by Win XP? I have latest chdk build and libusb for windows installed and CHDKCAM too. I cannot get my a720 to become available to the PC at all now, where at least it used to be seen by the Canon pc transfer app before.
The PTP stuff is not integrated in the standard CHDK builds from the Autobuild server; there are compiled binaries (i.e. "ready-to-use") for some cameras...

--> http://chdk.wikia.com/wiki/User:Fe50#PTP_stuff


Re: CHDK PTP interface
« Reply #208 on: 09 / July / 2010, 06:47:34 »
I have downloded and applied the CHDK-a720-100c-0.9.9.zip, which contained a .bin and PS.FI2 files. I added these to my SD card and CHDK booted ok but my PC still cant see the camera. Is there something about Libusb I should be doing? I installed it from the win32 build site at sourceforge, but couldnt get the latest build to install. I tried a slightly earlier Vers. It seemed to give me all the right install windows during the wizard.

I assume that it sees the camera ok, should I be registering the device somehow?

*

Offline fudgey

  • *****
  • 1705
  • a570is
Re: CHDK PTP interface
« Reply #209 on: 09 / July / 2010, 12:14:40 »
I may be wrong, but my best guess is you need to disable CHDK USB remote shutter feature from CHDK settings for PTP to work.

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal