sceUsbCamSetupStill error and go!cam info

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
User avatar
jean
Posts: 489
Joined: Sat Jan 05, 2008 2:44 am

sceUsbCamSetupStill error and go!cam info

Post by jean »

error 80243905. I'm trying to mess up with code from the chottoCam post here on ps2dev. Simply changing "preview" video framerate to 60

Code: Select all

videoparam.framerate = PSP_USBCAM_FRAMERATE_60_FPS;
and replacing copy to framebuffer with a nicer

Code: Select all

		m = 0;
		n = 0;
		for &#40;i = 0; i < 272; i++&#41;
		&#123;
			memcpy&#40;&vram&#91;n&#93;,&framebuffer&#91;m&#93;,1920&#41;;
			m += 480;
			n += 512;
		&#125;
leads to the said 80243905 error code from sceUsbCamSetupStill(&stillparam); when trying to take a still (r-button press).

Anyway...i was taking a look at pspusbcam.h; the functions exported by usbcam module resemble those of any mobile phone's camera. I argue that this is not an application library, but something exported directly by camera hardware. So the question is: is it possible to obtain raw (uncompressed) data from go!cam?
adrahil
Posts: 274
Joined: Thu Mar 16, 2006 1:55 am

Post by adrahil »

The error code is because of the way you setup your stillparam. Can you paste it here?
User avatar
jean
Posts: 489
Joined: Sat Jan 05, 2008 2:44 am

Post by jean »

...as i said the example is exactly the same you can find here(http://forums.ps2dev.org/viewtopic.php?t=7074&start=0) except for the changes i pointed out. Doesn't seem to be a simple param formatting issue....maybe i'm an idiot and i caused memory corruption with my frame copy code, but i can't see any problem in that simple snippet; and video goes nicely until i try to stop it and take a still....
moonlight
Posts: 567
Joined: Wed Oct 26, 2005 7:46 pm

Post by moonlight »

Which is the size of the image you try to get? Maybe if it is too high, you should decrease the video frame rate (or the size of the image to keep the frame rate)
User avatar
jean
Posts: 489
Joined: Sat Jan 05, 2008 2:44 am

Post by jean »

Code: Select all

	videoparam.size = sizeof&#40;videoparam&#41;;
	videoparam.resolution = PSP_USBCAM_RESOLUTION_480_272;
	videoparam.framerate = PSP_USBCAM_FRAMERATE_60_FPS;
	videoparam.wb = PSP_USBCAM_WB_AUTO;
	videoparam.saturation = 120;
	videoparam.brightness = 129;
	videoparam.contrast = 64;
	videoparam.sharpness = 0;
	videoparam.effectmode = PSP_USBCAM_EFFECTMODE_NORMAL;
	videoparam.framesize = MAX_VIDEO_FRAME_SIZE;
	videoparam.evlevel = PSP_USBCAM_EVLEVEL_0_0;	
this works for video until i stop it to take a still...i was wandering if it's a timing issue (i.e. when i'm stopping video there's still data to get before getting done) and then i'm trying inserting pauses...too bad, i would like to acquire as much data as possible as fast as i can...

Code: Select all

	stillparam.size = sizeof&#40;stillparam&#41;;
	stillparam.resolution = PSP_USBCAM_RESOLUTION_1024_768;
	stillparam.jpegsize = MAX_STILL_IMAGE_SIZE;
	stillparam.delay = PSP_USBCAM_NODELAY;
	stillparam.complevel = 1;
	stillparam.reverseflags = PSP_USBCAM_MIRROR;
this works only if i set

Code: Select all

videoparam.framerate = PSP_USBCAM_FRAMERATE_15_FPS;
Which is the size of the image you try to get? Maybe if it is too high, you should decrease the video frame rate (or the size of the image to keep the frame rate)
...uhm...ok, but i thought the two things were unconnected... i mean: i have to stop video to take a still; does one thing influence the other?

No news on the "how to get raw data" side?
adrahil
Posts: 274
Joined: Thu Mar 16, 2006 1:55 am

Post by adrahil »

I looked at the usbcam.prx and it seems that the still resolution and video are linked. That is if you set a still image resolution higher than 1024x768, you have to decrease the video framerate to 15 FPS. Ask Sony why, but it seems like they're have been taking some design shortcuts recently :)

As for the RAW, well, we would need to get a camera firmware first...
User avatar
jean
Posts: 489
Joined: Sat Jan 05, 2008 2:44 am

Post by jean »

ok, many thanks for investigating....it seems that i'll have to find some workarounds...
Post Reply