Thanks, guys! I've got to hurry to get as much done on ops-for-linux - it may not get finished for a month or 2. I have 3 of the camcorders and am going to be sending them out to my sisters and parents with the hope of putting together a family video Christmas card (if everyone cooperates! :D ). I want to ship them out this week, so it's either get it working over the weekend or I have to wait a while.
That will leave me plenty of time to try to incorporate the downloading from PV2TOOLS into avidownload. Some of it is a little hard to understand for me, 'cause I've been away from this for so long. I'll get it in there someday!
BTW - I did the permanent unlock thing on my CVS red model 410 digital camera. As a result, I don't know if the unlocking code for it I put into avidownload is working or not. Does anyone out there have a locked (but with known key!) model they like to try the unlock on. The rest of avidownload still works - I'd just like to verify the unlock portion on the digital camera.
Thanks again! :D
SaturnNiGHTS- 11-02-2007
...so you have avidownload downloading both pictures and video? as in the camera unlocker works?
anewguy- 11-04-2007
...so you have avidownload downloading both pictures and video? as in the camera unlocker works?
Haven't got downloads working from the camera yet (as you know, that's a "little" complicated. However, I do have the unlocking code in place. I permanently unlocked my camera in PV2TOOLS in Windows, so I can't actually -*test*-('") the unlocking to be sure it is working. I would love to forward the mess :D I have so far to anyone who's camera is locked but for which they have they challenge/response stored in the key file. I let the unlocking go ahead and just look at the same file as the camcorders, so it will be .saturnkeys in the users home folder.
Anyone want to -*test*-('") just the unlocking of a camera? :D
EDIT: I didn't "break" the movie downloads so all that avidownload did still works - just want to -*test*-('") digital camera unlocking now.
EDIT EDIT: I THOUGHT I had permanently unlocked the digital camera model 410, but when I went back to try the Windows PV2TOOLS tonight, I did unlock and it matched a key, so I guessed it mus need it. So, I go back to Linux, run my mess as dwecombo this time with the key included in the .saturnkeys file, and I got this:
ave@dave-desktop:~/avidownload/src$ ./dwecombo
INFO: Closing any opened devices...
INFO: Open devices closed.
INFO: Scanning USB bus 0 ...
INFO: USB device with VID: 0x03f0, PID: 0x7604 on bus 0
INFO: USB device with VID: 0x050d, PID: 0x705c on bus 0
INFO: USB device with VID: 0x05e3, PID: 0x0608 on bus 0
INFO: Scanning USB bus 1 ...
INFO: USB device with VID: 0x0dca, PID: 0x0027 on bus 1
INFO: Device found: SMaL BAD VID: 0x0DCA, PID: 0x0027
INFO: Device is a camera
INFO: Device successfully opened.
INFO: Loading .saturnkeys from home directory...
INFO: Requesting challenge from camera
INFO: Received challenge from camera
key to challengeigicam
key: Challenge matches digicam
INFO: Sending response
INFO: Succeeded at unlocking camera.
INFO: Downloading media to /home/dave/saturn_vids/2007.11.04_01.30.28AM/
INFO: Download from camera.....
NOTE: At camera_Download: folder: /home/dave/saturn_vids/2007.11.04_01.30.28AM/
INFO: Closing any opened devices...
INFO: Open devices closed.
dave@dave-desktop:
Then I went back in and added newlines to the log info lines so I didn't get the line write-overs as shown above. Now the damn thing gives me this:
dave@dave-desktop:~/avidownload/src$ ./dwecombo
INFO: Closing any opened devices...
INFO: Open devices closed.
INFO: Scanning USB bus 0 ...
INFO: USB device with VID: 0x03f0, PID: 0x7604 on bus 0
INFO: USB device with VID: 0x050d, PID: 0x705c on bus 0
INFO: USB device with VID: 0x05e3, PID: 0x0608 on bus 0
INFO: Scanning USB bus 1 ...
INFO: USB device with VID: 0x0dca, PID: 0x0027 on bus 1
INFO: Device found: SMaL BAD VID: 0x0DCA, PID: 0x0027
INFO: Device is a camera
INFO: Device successfully opened.
INFO: Loading .saturnkeys from home directory...
INFO: Requesting challenge from camera
INFO: No challenge received.
dave@dave-desktop:~/avidownload/src$
I've tried cycling the power on the camera, etc., but same result. This error comes when the write of the command requesting the challenge fails. Beats me - I'll keep trying.
EDIT-EDIT-EDIT: If I just rerun the program several times, each time I get different status codes back from the write and read of the challenge keys from the camera. Sometimes the write status is ok, other times not. Sometimes the read status is ok, other times not. I'm not sure WHAT'S going on at this point. I suspect maybe my camera isn't behaving well like a nice little camera should! :D
anewguy- 11-04-2007
Okay, I got tired of editing the last post (I suppose it looks pretty stupid as well :D ). So, I have found a pattern to the status keys reported by repeated runs of the program.
1st run - both keys 0
2nd run- write key 31, read key -110
3rd run - write key -110, read key 141
4th run - write key -110, read key 77
5th run - write key -110, read key 141
the pattern of 2nd, 3rd, 4th, 5th repeats.
Anyone got any ideas? I've looked at maushammers pages for the command set for the camera, and I must say it's a little hard working out just what the heck is going on. Is there an updated command list?
Thanks!:D
Dave
anewguy- 11-05-2007
The 64 byte limit is a problem with the camcorder, not with Linux per se - most revs of the camcorder mistakenly report to the OS that they only allow 64 bytes of data in a command. In Windows, we tell the OS to ignore the device and overfeed it. Linux does "the right thing" and stops the programmer from stupidly overflowing the device.
The limitation doesn't apply to the pv2, which uses a different USB mechanism for it's commands - bulk transfers. As you observed, you can send any size file/command through a bulk transfer, and the OS+device take care of the buffering issues. This should apply equally to Linux and Windows.
My CVS model 410 digital camera shows with a maximum packet size of 64 also. Does this mean that the bulk download will be restricted since Linux is tight on packet sizes?
BillW- 11-05-2007
I'm not entirely sure if that applies to bulk commands, but the point is moot - the fact that the pv2 uses USB 1.0 restricts the transfer rate a lot more than the 64 byte buffer would. Transferring data on Windows or Linux from a pv2 is a slow operation.
anewguy- 11-05-2007
Yikes! It will be slow! BTW - I've looked through the USB specs and I still can't tell if the packet size also applies to bulk transfers.
I know from reading some other pages on the web that you at one time found directory and file manipulation commands in the pv2, but no apparent way to access them from USB. So, if I am following things correctly, to actually download a picture in avidownload I will need to include your code that builds a directory structure of the raw directory, then proceed to walk it (again using your code :D ) in order to find each file and request a bulk download, correct?
Thanks again! :D :D
Dave
SaturnNiGHTS- 11-05-2007
Yikes! It will be slow! BTW - I've looked through the USB specs and I still can't tell if the packet size also applies to bulk transfers.
I know from reading some other pages on the web that you at one time found directory and file manipulation commands in the pv2, but no apparent way to access them from USB. So, if I am following things correctly, to actually download a picture in avidownload I will need to include your code that builds a directory structure of the raw directory, then proceed to walk it (again using your code :D ) in order to find each file and request a bulk download, correct?
Thanks again! :D :D
Dave
yep, that is correct. if you like, i can upload somewhere a copy of my "mediadownload" source. it's not really working by any means, but it should help in the pursuit.
BillW- 11-05-2007
I will need to include your code that builds a directory structure of the raw directory, then proceed to walk it (again using your code :D ) in order to find each file and request a bulk download, correct?
SN beat me to the punch, but yes, this is the only way to do it AFAIK. Even the flatfoto2 drivers do the exact same thing.
anewguy- 11-06-2007
Just a little update - have the version of avidownload I'm working unlocking the camera and getting the count of pictures - I just haven't figured out what's wrong yet that they don't actually download (my simple little traces in the execution says they completed when in fact nothing happened).
So, yes I can unlock a camera, and I can get the picture count.
Not great, but getting there! :D
dave@dave-desktop:~/avidownload/src$ ./dwecombo
INFO: Closing any opened devices...
INFO: Open devices closed.
INFO: Scanning USB bus 0 ...
INFO: USB device with VID: 0x03f0, PID: 0x7604 on bus 0
INFO: USB device with VID: 0x050d, PID: 0x705c on bus 0
INFO: USB device with VID: 0x05e3, PID: 0x0608 on bus 0
INFO: Scanning USB bus 1 ...
INFO: Scanning USB bus 2 ...
INFO: USB device with VID: 0x0dca, PID: 0x0027 on bus 2
INFO: Device found: SMaL BAD VID: 0x0DCA, PID: 0x0027
INFO: Device is a camera
INFO: Device successfully opened.
INFO: Loading .saturnkeys from home directory...
INFO: Requesting challenge from camera
INFO: No challenge received.
INFO: Will assume camera is permanently unlocked for now....
INFO: ...if this is not the case expect the downloads to fail.
INFO: Downloading media to /home/dave/pv2_pics/2007.11.06_01.47.46AM/
INFO: Download from camera.....
INFO: Checking directory location..
INFO: Checking picture count..
INFO: Found 3 pictures
ERROR: Failed at downloading IMG_0016.RAW
ERROR: Trouble downloading picture IMG_0016.RAW
ERROR: Failed at downloading IMG_0017.RAW
ERROR: Trouble downloading picture IMG_0017.RAW
ERROR: Failed at downloading IMG_0018.RAW
ERROR: Trouble downloading picture IMG_0018.RAW
Warning: No files were retrieved.
INFO: Downloads completed.
INFO: Closing any opened devices...
INFO: Open devices closed.
dave@dave-desktop:~/avidownload/src$
anewguy- 11-06-2007
SUCCESS!! Unlocked, downloaded 2 pictures in raw format.
Things I still need to do:
- pass the foldername into the picture download routine so that it will put the pictures in user home folder sub "pv2_pics" with subfolder by date/time as per avidownload.
Nothing is broke per se, but I was wondering if someone can tell me where I can find information on the dcraw2jpg function? I have taken the code from pv2fetch and incorporated it into avidownload, and this is the only function I could not find, so I commented out the statement.
Thanks! :D
anewguy- 11-06-2007
...so you have avidownload downloading both pictures and video? as in the camera unlocker works?
Yep..!! Still need to put in the code to direct the pictures to be saved in another folder, but it opens, unlocks and downloads from both the CVS camcorders and the CVS red model 410 digital camera (firmware 6600).
It may not be real pretty, but it does work. Made it easy by just incorporating chunks of pv2fetch.
Dave :D
SaturnNiGHTS- 11-06-2007
Nothing is broke per se, but I was wondering if someone can tell me where I can find information on the dcraw2jpg function? I have taken the code from pv2fetch and incorporated it into avidownload, and this is the only function I could not find, so I commented out the statement.
i understand it's your own build, but with the original setup of avidownload, i wanted to be as small as possible and to have as little dependencies for a build environment as possible .
just make sure you can disable the jpg output via a command switch. i use them in raws all the time and clean them up in gimp.
and you'd be looking for libkdcraw-dev.
EDIT: and i hope it's as neatly delimited and formatted as mine. --grins--
anewguy- 11-06-2007
Nothing is broke per se, but I was wondering if someone can tell me where I can find information on the dcraw2jpg function? I have taken the code from pv2fetch and incorporated it into avidownload, and this is the only function I could not find, so I commented out the statement.
i understand it's your own build, but with the original setup of avidownload, i wanted to be as small as possible and to have as little dependencies for a build environment as possible .
just make sure you can disable the jpg output via a command switch. i use them in raws all the time and clean them up in gimp.
and you'd be looking for libkdcraw-dev.
EDIT: and i hope it's as neatly delimited and formatted as mine. --grins--
Yeah, I kept it at just under 38k for the exe, so that's not too bad. This whole thing is really just your avidownload and pv2fetch kind of melded together - nothing original. I did find I still need to get the switches for either deleting the images or formating the thing when it's done with the camera (the stuff for the camcorder still works great!). I think I'll leave out the jpeg conversion and just leave it at raws. Currently it compiles just using what I THINK (ouch, that hurts, and I'm usually wrong :D ) are the standard libraries and libusb - I compile it just like avidownload -> cc -o xxxx *.c -lusb .
I don't have the rate of transfer (kbytes per second) in there, but the truth of the matter is I don't think too many actual users would care - they just want to see progress and have it finish. I would think it would be a neat thing to have in during development to see how fast it is going!
The movies download pretty fast, and the pictures download fast as well.
I can send a copy to you if you'd like. Let me know if you'd like the source as well - just be aware my C coding isn't very good so you'll get some laughs out of what little pieces I did put in. :D
It is very pretty code. :D :D :D
EDIT: formatting works fine
dave@dave-desktop:~/avidownload/src$ ./dwecombo -f
NOTICE: Will format device after download!
INFO: Closing any opened devices...
INFO: Open devices closed.
INFO: Scanning USB bus 0 ...
INFO: USB device with VID: 0x03f0, PID: 0x7604 on bus 0
INFO: USB device with VID: 0x050d, PID: 0x705c on bus 0
INFO: USB device with VID: 0x05e3, PID: 0x0608 on bus 0
INFO: Scanning USB bus 1 ...
INFO: Scanning USB bus 2 ...
INFO: Scanning USB bus 3 ...
INFO: USB device with VID: 0x0dca, PID: 0x0027 on bus 3
INFO: Device found: SMaL BAD VID: 0x0DCA, PID: 0x0027
INFO: Device is a camera
INFO: Device successfully opened.
INFO: Loading .saturnkeys from home directory...
INFO: Requesting challenge from camera
INFO: No challenge received.
INFO: Will assume camera is permanently unlocked for now....
INFO: ...if this is not the case expect the downloads to fail.
INFO: Downloading media to /home/dave/pv2_pics/2007.11.06_03.20.33PM/
INFO: Download from camera.....
INFO: Checking directory location..
INFO: Checking picture count..
INFO: Found 3 pictures
INFO: Succeeded at downloading IMG_0021.RAW
INFO: Wrote IMG_0021(0002).RAW
INFO: Succeeded at downloading IMG_0022.RAW
INFO: Wrote IMG_0022(0002).RAW
INFO: Succeeded at downloading IMG_0023.RAW
INFO: Wrote IMG_0023(0002).RAW
INFO: All pictures downloaded successfuly
INFO: Downloads completed.
INFO: Attempting camera format...
INFO: format write okay
INFO: format read status okay
INFO: Camera format successful.
INFO: Resetting PV2...
dave@dave-desktop:~/avidownload/src$
Now I still need to get the foldername passed to the download from camera routines so it will save the images in a user home "/pv2_pics" folder. I'm so dang rusty at all of this I'm having a hard time with something that simple!! :D Everything I have done to this has mainly been just merging code!
anewguy- 11-06-2007
Okay, I fixed the pointer problem so now the camera pictures are saved to a user home "pv2_pics/xxxxxxx" folder where the xxxxxxx is the date/time stamp as per avidownload of videos. I now have a tool I can use for both my camcorders and my m410 digital camera.
I have a question about the digital camera, specifically anyone who has dealt with the programming for these. The first execution of the program always fails somewhere along the line with a failure to change directory. Every 1st time. Run it a 2nd time and everything works great. Is there some sort of timing issue with the camera whereby it takes 2 attempts to get this to work (like if it is first powered on or reset, does it require some command even before the key challenges?)??
Thanks again! :D
Dave
SaturnNights - if you want a copy of the stuff with the change made for the foldername for pictures, let me know. This is mostly avidownload, with the download pictures stuff from pv2fetch. I think both are open source?
Forumer™ is Voted #1 Free Forum Hosting provider
Build your own community today with the largest message board hosting company.