Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: [Raspberry Pi] OpenCV Fails to retrieve an image from the camera #15

Open
Max4programing opened this issue Aug 29, 2024 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@Max4programing
Copy link

Max4programing commented Aug 29, 2024

Provide a brief description of the issue

**PS5 camera doesn't work with this firmware **

I was trying to get this loader and firmware to work on a raspberry pi which is based on linux (it works and uploads the firmware without issue). It shows on the UVC logs as camera device and the logs look fine. But in testing all it did was show a black screen on webcam testers. I tried changing the exposure and the frame per second of the camera with no luck. I decide to use opencv since it worked in this tutorial. After setting a basic script to open a window and display the camera view I got an timeout error.

Here is the code

import cv2

cap = cv2.VideoCapture("/dev/video0")

cap.set(cv2.CAP_PROP_FRAME_WIDTH, 1920)
cap.set(cv2.CAP_PROP_FRAME_HEIGHT, 1080)

cap.set(cv2.CAP_PROP_FPS, 15)

while True:
  ret, frame = cap.read()
  if not ret:
    print("Failed to capture image")
    break
  
  cv2.imshow("Video", frame)
  if cv2.waitKey(1) & 0xFF == ord("q"):
      break
cap.release()
cv2.destroyAllWindows()

Operating System version

Linux (Default)

Which camera model was this for?

PlayStation 5

Relevant log output

[ WARN:[email protected]] global cap_v4l.cpp:1136 tryIoctl VIDEOIO(V4L2:/dev/video0): select() timeout.
@Max4programing Max4programing added the bug Something isn't working label Aug 29, 2024
@raleighlittles raleighlittles changed the title [Bug]: OpenCV Fails to retrieve an image from the camera [Bug]: [Raspberry Pi] OpenCV Fails to retrieve an image from the camera Aug 29, 2024
@raleighlittles
Copy link
Owner

@Max4programing Huh, I'm not able to reproduce the issue you're seeing, instead I get the "Failed to capture image" message.

image

This might either be an issue with the code snippet or something wrong with the UVC firmware (which I didn't make). Can you try changing the frame rate to see if that fixes it? There should be other frame rates you can use in the 1080p mode (check the README)

@Max4programing
Copy link
Author

Max4programing commented Sep 1, 2024

This should be the correct Log Output

[ WARN:[email protected]] global cap_v4l.cpp:1136 tryIoctl VIDEOIO(V4L2:/dev/video0): select() timeout.

Failed to capture image

The Source of the Problem

When looking through the Dmesg Logs more in depth I found that

[Sun Sep 1 17:42:00 2024] usb 2-1: New USB device found, idVendor=05a9, idProduct=058c, bcdDevice= 1.00
[Sun Sep 1 17:42:00 2024] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[Sun Sep 1 17:42:00 2024] usb 2-1: Product: USB Camera-OV580
[Sun Sep 1 17:42:00 2024] usb 2-1: Manufacturer: Omnivision Technologies, Inc.
[Sun Sep 1 17:42:00 2024] usb 2-1: Found UVC 1.00 device USB Camera-OV580 (05a9:058c)
[Sun Sep 1 17:42:00 2024] usbcore: registered new interface driver uvcvideo
[Sun Sep 1 17:42:01 2024] i2c-bcm2835 fe205000.i2c: i2c transfer timed out
[Sun Sep 1 17:42:01 2024] edt_ft5x06 10-0038: Unable to fetch data, error: -110

This error repeats filling the log and never stops until I reboot.

@raleighlittles
Copy link
Owner

@Max4programing I didn't see those errors unfortunately, I think those are specific to the Raspberry Pi. The I2C module that it's talking about is for the Raspberry Pi specifically, it isn't on a standard linux system. And the edt_ft5x06 module is for the touchscreen display, which again obviously won't be present on a regular linux system..

I'll try to see if i I can borrow a Raspberry Pi to reproduce this issue though.

@Max4programing
Copy link
Author

Update

Dmesg Log after removing touch screen

w1_master_driver w1_bus_master1: Attaching one wire slave 00.880000000000 crc 4e
w1_master_driver w1_bus_master1: Family 0 for 00.880000000000.4e is not registered.
uvcvideo 2-1:1.1: Failed to resubmit video URB (-1).

Log of guvcveiw

V4L2_CORE: Could not grab image (select timeout): Resource temporarily unavailable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants