2 of 9
2
[Tutorial] PS3 Eye Working on Linux
Posted: 10 February 2009 04:47 PM   [ Ignore ]   [ # 16 ]
Rank
Joined  2008-12-31
Total Posts:  37
New Member
Seth (cerupcat) - 10 February 2009 04:20 PM

I can’t get this fully working with vw_kubel version or kaswy.

I have a built in web camera on my laptop. Using kaswy’s method, when I got to test with the webcam application, it loads my built in camera.

On vw_kuble’s method, when I got to vlc I can get audio from the ps3 mic to play, but I can’t see any video. You said to set the device to v4l2, but I don’t see an option of where to put that in VLC. I also don’t have “media” in VLC. (Open VLC, then go to Media > Open Capture Device). I do have File -> Open Capture device. I don’t know where to change it to v4l though.

Also kaswy, you say it’ll run at 640x480@100, but we know it can’t do that resolution at that fps. Is that a typo?

Any help would be appreciated.

Ok, lets see.. I am going to assume that your built in camera is picked up as /dev/video0. That is what Kaswy’s app looks for (I think). So if there is a way to disable that in the bios, that may work..

For VLC.. You must have a different version or something. Mine is VLC 0.9.4 on Ubuntu kernel 2.6.29-rc2. What distro and kernel version are you running? Custom kernel or stock?

Try the File > Open Capture Device. It will open a settings window. At the top, look for “Capture Mode”. You should be able to set this to Video for Linux 2. If not, your kernel probably doesn’t have it built in (maybe try to update the kernel?). This is also where you put in the /dev/video0 (probably /dev/video1 in your case), and /dev/audio1. Don’t bother with the advanced options in VLC (resolution and framerate), they will just crash VLC because of how the driver sets those.

I’m not sure if that is the problem or not, but it should give you a good start.

Profile
 
 
Posted: 10 February 2009 04:55 PM   [ Ignore ]   [ # 17 ]
Avatar
RankRankRankRankRankRank
Joined  2007-04-08
Total Posts:  2539
Dedicated

I’m using ubuntu 8.10 with stock everything. I installed vlc using apt-get. So not sure about versions. It’ll now bring up an image in VLC but it’s a frozen image and kinda of distorted.

I can now see it working in the webcam viewer from kaswy.

I’m not sure how to change resolution/fps though now.

I don’t quite understand where to put this (from kaswy’s website):

“So to setup the driver to one of these video modes, you must pass it as param to the module driver at load time:
modprobe gspca_ov534 videomode=10
and if you want change the actual mode you must unload the driver and load it again with the new mode as
parameter like that:
modprobe -r gspca_ov534;modprobe gspca_ov534 videomode=12”

Also, the camera now shows up in tbeta, but unfortunately the picture is all black and doesn’t seem to load compltely. Does anyone else have it working with kawsy’s driver and tbeta?

 Signature 

MTmini, MTbiggie, & Audiotouch creator & Community Core Vision Co-founder

Follow on:
My Blog | Facebook | Twitter | Youtube

Profile
 
 
Posted: 10 February 2009 05:54 PM   [ Ignore ]   [ # 18 ]
RankRank
Joined  2008-12-10
Total Posts:  209
Member

I haven’t gotten a chance to try out the driver myself yet - Ubuntu is a bit ‘hairy’ in that you need to use sudo (super-user do) for most administrative actions.

so, pop open a command line and throw at it:

sudo modprobe -r gspca_ov534

will ask for your pass, then remove the module, then:

sudo modprobe gspca_ov534 videomode=XX

where XX is the mode you’re looking for (see kaswy’s previous post for modes), again prompt for password, and the driver should load with the desired resolution/framerate.

I do know the ‘original’ gspca_ov534 driver was not compatible with tbeta from my testing - i may have been missing a library or two however (i didn’t have ucview for example).

 Signature 

22” LLP-LCD ftw
TUIO Smoke (Windows / Linux) - http://projects.edencomputing.com/projects/tuiosmoke

Profile
 
 
Posted: 10 February 2009 08:09 PM   [ Ignore ]   [ # 19 ]
Rank
Joined  2008-12-31
Total Posts:  37
New Member

Those commands get put in a terminal (Applications -> Accessories -> Terminal). You will need to use sudo, as cicada said. The “modprobe” program loads and unloads kernel drivers from the command line. Use the ‘modprobe -r’ to unload a driver, then the ‘videomode=**’ changes the res and fps set by the driver while loading it back.

The Eye does not seem to work in tbeta. I don’t know exactly what it is, but the problem is something with unicap (error is “unicap: error starting capture"). I’ve yet to figure out a solution, as the error message gives no useful information (to me anyway).

Also, if you get it working at any res: does it freeze at all with Kaswy’s app? If so, how long before the freeze, and what do you have plugged into other usb ports? I am trying to figure this out on my computer. My guess is that my Logitech wireless mouse is taking up just enough USB bandwidth to freeze the camera, but I would like some confirmation.

[edit on the freezing] Its not my mouse, disconnected that and still froze… luvcview says “Unable to dequeue buffer: Input/output error Error grabbing Cleanup done. Exiting ...”. Maybe a little more to go on, but google isn’t turning up much yet…

Profile
 
 
Posted: 10 February 2009 08:18 PM   [ Ignore ]   [ # 20 ]
Avatar
RankRankRankRankRankRank
Joined  2007-04-08
Total Posts:  2539
Dedicated

If I do unload “sudo modprobe -r gspca_ov534” it’ll say “Operation not permitted”
And if I try to load “sudo modprobe gspca_ov534 videmode=00” it’ll say “unkown symbol in module, or unkown paramter (see dmseg)”

So I’m not sure what’s going on. I originally installed gscpa with your method vw_kubel and then installed kaswy’s over it. Or at least I thought I did since the camera loads in his webcam viewer. I can run it at 640 x 480 @ 60fps table and haven’t freezed once. On windows I can’t even run it at 30fps without freezing.

So yeah, I can’t change resolutions or fps right now for some reason.

 Signature 

MTmini, MTbiggie, & Audiotouch creator & Community Core Vision Co-founder

Follow on:
My Blog | Facebook | Twitter | Youtube

Profile
 
 
Posted: 10 February 2009 08:27 PM   [ Ignore ]   [ # 21 ]
Rank
Joined  2008-12-31
Total Posts:  37
New Member

An explanation on that: the -r option tells modprobe to remove the module listed. It is reading the ‘videomode’ part of your command as a module that you are trying to remove.

So try this:

sudo modprobe -r gspca_ov534

That will remove the module.

Now to load it:

sudo modprobe gspca_ov534 videomode=XX

Replace XX with the mode you want (it is a two number sequence, the ones listed by Kaswy). This tells the module what video mode you want it to have. The ‘sudo’ part is necessary in both commands, that should fix your first error. A note about the install, Kaswy’s gspca driver is simply a modified version of what my guide installs. Following the guide will download and install the latest version, but it is more generic and full of unneeded stuff. Downloading Kaswy’s gspca has only what is necessary for the camera, and adds the videomode function. So more or less, you just installed the same driver over itself (some changes though). Nothing wrong with it, just explaining what happened there.

Your driver install looks to be fine. Try the modprobe this way and see if that does it.

Profile
 
 
Posted: 10 February 2009 08:32 PM   [ Ignore ]   [ # 22 ]
Avatar
RankRankRankRankRankRank
Joined  2007-04-08
Total Posts:  2539
Dedicated

Sorry yeah, that’s what I’m doing.

The reloading after unload doesn’t work for me. I get the error above “Fatal: Error inserting gspca_ov534”.... “unkown symbol in module, or unkown paramter (see dmseg)”

 Signature 

MTmini, MTbiggie, & Audiotouch creator & Community Core Vision Co-founder

Follow on:
My Blog | Facebook | Twitter | Youtube

Profile
 
 
Posted: 10 February 2009 08:48 PM   [ Ignore ]   [ # 23 ]
RankRank
Joined  2008-12-10
Total Posts:  209
Member

Check the file /etc/modules and see if there’s a line entry for the gspca_ov534 module with bad parameters - I had an issue similar to what you’re describing because I typoed a parameter, and it was saved to this file.

 Signature 

22” LLP-LCD ftw
TUIO Smoke (Windows / Linux) - http://projects.edencomputing.com/projects/tuiosmoke

Profile
 
 
Posted: 10 February 2009 08:52 PM   [ Ignore ]   [ # 24 ]
Rank
Joined  2008-12-31
Total Posts:  37
New Member

Hmm, I’m thinking that Kaswy’s driver didn’t install correctly, and it is trying to load the normal driver without videomode support.

So.. You will need to uninstall the one you installed with my guide (guess I need to remove that other one, or make a big note about it). Do you still have the gspca folder created while installing the drivers? If so, open a terminal, ‘cd’ to that directory, and type ‘sudo make uninstall’.

If that is successful, re-download Kaswy’s driver, and install it as normal.

I might look into creating some .deb files for the driver. Never tried it before though, so…

[edit] Try cicada’s suggestion first. I didn’t run into this problem, so I’ve never had to fix it. If that doesn’t work, you will want to just uninstall the module and start over.

Profile
 
 
Posted: 10 February 2009 08:56 PM   [ Ignore ]   [ # 25 ]
Avatar
RankRankRankRankRankRank
Joined  2007-04-08
Total Posts:  2539
Dedicated

All I have in etc/modules file is:

fuse
lp
sbp2

Any of you guys on IRC? Feel bad taking up all this space in this topic.

[edit] ok I’ll try that ^^

[edit] Ok trying to reinstall with just kawsy drive and im getting an error now lol.

When I run make or sudo make on kawsy’s I get

file not found: /lib/modules/2.6.27-9.generic/build/include/linux/netdevice.h at scripts/make_config_compat.pl line 15
make[1]
: ***[config-compat.h] Error 2
make[1]
Leave directory /'home/user/gsapca-ps3eyeMT/v4l'
make: *** [all] Error 2

Ok, looks like im on 8.04 not 8.1 ubuntu. Maybe that’s the issue. I’m going to try upgrading possibly.

 Signature 

MTmini, MTbiggie, & Audiotouch creator & Community Core Vision Co-founder

Follow on:
My Blog | Facebook | Twitter | Youtube

Profile
 
 
Posted: 10 February 2009 10:50 PM   [ Ignore ]   [ # 26 ]
Avatar
RankRankRankRankRankRank
Joined  2007-04-08
Total Posts:  2539
Dedicated

Ok, I just upgraded from 8.04 to 8.10 and now have kernel 2.6.27-11-generic

Just as before, I can’t make kawsy’s package.

When I run make, I get:

make -/home/cerup/Desktop/gspca-ps3eyeMT/v4l 
make[1]
Entering directory `/home/cerup/Desktop/gspca-ps3eyeMT/v4l'
perl scripts/make_config_compat.pl /lib/modules/2.6.27-9-generic/build ./.myconfig ./config-compat.h
File not found: /lib/modules/2.6.27-9-generic/build/include/linux/netdevice.h at scripts/make_config_compat.pl line 15.
make[1]: *** [config-compat.h] Error 2
make[1]: Leaving directory 
`/home/cerup/Desktop/gspca-ps3eyeMT/v4l'
make: *** [all] Error 2

 Signature 

MTmini, MTbiggie, & Audiotouch creator & Community Core Vision Co-founder

Follow on:
My Blog | Facebook | Twitter | Youtube

Profile
 
 
Posted: 11 February 2009 03:49 AM   [ Ignore ]   [ # 27 ]
Avatar
RankRankRank
Joined  2008-06-16
Total Posts:  330
Sr. Member

Hello, I just did that as well.
You need to edit the file “.version” and change the build version to 11.

I managed to get the original gspca_ov534 and kaswy’s patched version to work fine with reacTIVision.
(use the CVS version if you want to give it a try)

Here are my observations:
* the original gspca_ov534 (compiled from the source repository) delivers a very good image quality and a default video format of 640x480@30fps
* kaswy’s patched version adds the possibility of changing the video formats using the “videomode” module parameters
* although kawsy’s test application reports FPS rates closer to what the video format states, with reacTIVision I just get exactly half that frame rate
I am not sure what is the cause for that difference, but for the moment I trust the reacTIVision values, since they are constant
* the image with kawsy’s version is upside-down
* the image quality with kawsy’s version is not very good, probably the video modes use heavy compression or maybe some default settings are to high

And many thanks to kaswy and the gspca_ov534 developers,
it is really exciting to see such a cheap camera performing that well on Linux!
hope that helps,
Martin.K

 Signature 

TUIO community site: http://www.tuio.org
reacTIVision framework: http://reactivision.sf.net
TUIO & reacTIVision CVS: http://sf.net/projects/reactivision
reacTIVision forum: http://sf.net/apps/phpbb/reactivision

Profile
 
 
Posted: 11 February 2009 03:20 PM   [ Ignore ]   [ # 28 ]
Rank
Joined  2008-12-31
Total Posts:  37
New Member

Seth, that was what I mentioned last night. Martin is correct, you need to edit the .version file in the gspca source to match your kernel release (’uname -r’ in a terminal to see what it is).

Got to be a more streamlined way to do this, just have to find it…

And.. I got some more insight from the ubuntu forums about the freezing issue. Not sure why it only affects me, but someone suggested changing the buffer timeout in the driver. The DPC latency looks very good for my computer, only a few spikes about ~300us when closing a program or when the camera image freezes.

[edit] YES!!!! Finally! I figured out the freezing issue, and a solution!!! In the driver file ‘ov534.c’, the function CTRL_TIMEOUT is defined as 500. Changing it to 2000 drastically lowers the number of “select timeout” errors. I think that raising it a little higher than that might fix the problem completely. This seems to cause a drop in FPS by about 5-10 however, so it may not be an ideal solution in all cases. But I’ll take a smooth video over high FPS, so it works for me..

[edit 2] Set the timeout to 5000, this doesn’t seem to work as well. I am just going to keep playing with it and see what works. However, the freezes are few and farther between, so that is progress…

Profile
 
 
Posted: 12 February 2009 04:53 PM   [ Ignore ]   [ # 29 ]
Avatar
Rank
Joined  2008-12-02
Total Posts:  31
New Member
Martin Kaltenbrunner - 11 February 2009 03:49 AM

Hello, I just did that as well.
You need to edit the file “.version” and change the build version to 11.

I managed to get the original gspca_ov534 and kaswy’s patched version to work fine with reacTIVision.
(use the CVS version if you want to give it a try)

Here are my observations:
* the original gspca_ov534 (compiled from the source repository) delivers a very good image quality and a default video format of 640x480@30fps
* kaswy’s patched version adds the possibility of changing the video formats using the “videomode” module parameters
* although kawsy’s test application reports FPS rates closer to what the video format states, with reacTIVision I just get exactly half that frame rate
I am not sure what is the cause for that difference, but for the moment I trust the reacTIVision values, since they are constant
* the image with kawsy’s version is upside-down
* the image quality with kawsy’s version is not very good, probably the video modes use heavy compression or maybe some default settings are to high

And many thanks to kaswy and the gspca_ov534 developers,
it is really exciting to see such a cheap camera performing that well on Linux!
hope that helps,
Martin.K

You’re right,
There was an error in my code,sorry....your framerate count is the right count, I corrected (V0.2), and now I show the right values.
So the real modes are:
00: 640x480@15
01: 640x480@30
02: 640x480@40
03: 640x480@50
04: 640x480@60
10: 320x240@30
11: 320x240@40
12: 320x240@50
13: 320x240@60
14: 320x240@75 (test)

We can’t, for now, have higher framerate. Windows Alexp driver use the raw transfer mode for the video of the cam, that is the fastest way.
I don’t know how to do that under Linux. I continue working on that and help is welcome.
For my MT i use the 320x240@50 with touchlib and it work well.

Thanks everybody for comments, and do not hesitate to tell me if there are other bugs.

Here the new files V0.2

 Signature 

My Setup :http://kaswy.free.fr

Profile
 
 
Posted: 13 February 2009 06:57 AM   [ Ignore ]   [ # 30 ]
Avatar
RankRankRank
Joined  2008-06-16
Total Posts:  330
Sr. Member

Hello, thanks a lot for the updates!
The code now compiles fine and the new frame rates are correct, 640x480@60fps is pretty nice already,
achieving the possible maximum would be great actually. How much would that be for VGA and QVGA?

The other issues still are there, the image is still upside down and the image quality is still quite strange due to possible compression or exaggerated default image settings.
So let’s hope you’ll find something about the RAW image mode you mention.

thanks again,
Martin.K

 Signature 

TUIO community site: http://www.tuio.org
reacTIVision framework: http://reactivision.sf.net
TUIO & reacTIVision CVS: http://sf.net/projects/reactivision
reacTIVision forum: http://sf.net/apps/phpbb/reactivision

Profile
 
 
   
2 of 9
2
 
‹‹ Why 5?      Binoculars idea for camera ››