inspirit / PS3EYEDriver

PS3EYE Camera Driver for OSX and Windows

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

image glitch

gaborpapp opened this issue · comments

I experience image glitch in 640x480@60fps on slower OS X computers, especially when something cpu intensive processing is going on. Maybe it is usb packet corruption, which is not handled properly.

I know this is a pretty old issue (understatement), but if you were seeing frame corruption in the SDL sample app, this was caused by missing thread synchronization in the app. It's possible the openframeworks/cinder sample apps also have the same issue, but I've not been able to test.

The SDL issue is solved here: #21

Just installed and built on Windows 7, using all the download versions listed in the readme. I'm seeing glitches sometimes every few seconds with the SDL sample app.

I think this is indeed improper handling of usb packets when PTS or FID changes and last_packet_type is INTER_PACKET. Changing ps3eye.cpp line 769 fixes the issue for me:

        /* If PTS or FID has changed, start a new frame. */
        if (this_pts != last_pts || this_fid != last_fid) {
            if (last_packet_type == INTER_PACKET)
            {
                frame_add(LAST_PACKET, NULL, 0);
            }

Change to:

        /* If PTS or FID has changed, start a new frame. */
        if (this_pts != last_pts || this_fid != last_fid) {
            if (last_packet_type == INTER_PACKET)
            {
                frame_add(DISCARD_PACKET, NULL, 0);
            }

And the glitched frames are dropped!

commented

Is this fixed by #27 then?

we should ask the author @gaborpapp