xerpi / vita-udcd-uvc

PSVita UDCD USB Video Class plugin
468 stars 23 forks source link

Latency with raspberry pi #40

Closed Pollinopops closed 4 years ago

Pollinopops commented 4 years ago

Hello,

Thank you for your incredible work. But I have a problem with it. I managed to make it work whitout issues on a windows computer with OBS. The latency was very low and the games were playable.

Unfortunately, when I try using my raspberry pi 3b, there is a very noticeable lag which make the streaming feature unusable. This is what happens when I run the following command

$ mpv tv:// --tv-device=/dev/video0 --tv-width=864 --tv-height=488 --tv-fps=30

Playing: tv:// [tv] Selected driver: v4l2 [tv] name: Video 4 Linux 2 input [tv] your device driver does not support VIDIOC_G_STD ioctl, VIDIOC_G_PARM was used instead. [tv] Selected device: PSVita [tv] Capabilities: video capture read/write streaming [tv] supported norms: [tv] inputs: 0 = Input 1; [tv] Current input: 0 [tv] Current format: NV12 libv4l2: error set_fmt gave us a different result then try_fmt! [tv] tv.c: norm_from_string(pal): Bogus norm parameter, setting default. [tv] ioctl enum norm failed: Inappropriate ioctl for device [tv] Error: Cannot set norm! [tv] Selected input hasn't got a tuner! [tv] ioctl set mute failed: Invalid argument [tv] ioctl query control failed: Invalid argument [tv] ioctl query control failed: Invalid argument [tv] ioctl query control failed: Invalid argument [tv] ioctl query control failed: Invalid argument (+) Video --vid=1 (rawvideo) [vo/sdl] Using opengles2 Using conversion filter. VO: [sdl] 864x488 yuv420p [osd/libass] PlayResX undefined, setting to 960 libv4l2: error dequeuing buf: Invalid argument [tv] VIDIOC_DQBUF failed: Invalid argument libv4l2: error dequeuing buf: Invalid argument [tv] VIDIOC_DQBUF failed: Invalid argument libv4l2: error dequeuing buf: Invalid argument [tv] VIDIOC_DQBUF failed: Invalid argument libv4l2: error dequeuing buf: Invalid argument [tv] VIDIOC_DQBUF failed: Invalid argument libv4l2: error dequeuing buf: Invalid argument [tv] VIDIOC_DQBUF failed: Invalid argument libv4l2: error dequeuing buf: Invalid argument [tv] VIDIOC_DQBUF failed: Invalid argument [tv] ioctl set mute failed: Invalid argument [tv] 4165 frames successfully processed, -1720 frames dropped. Exiting... (Quit)

Thank you for your help !

xerpi commented 4 years ago

Hi, have you tried with other programs such as vlc, mplayer or mpv?

Pollinopops commented 4 years ago

Yes, I tried with Mplayer but it couldn't open the stream. I can post the error message when I get back home later this week. It said something like bad usage of memory process aborted.

Regarding VLC, I am only able to see the stream in Ascii art in my terminal via SSH. I don't know how to tell it to use the hdmi out.

It seams like the command to change the resolution and frame rate in MPV is ignored.

xerpi commented 4 years ago

This could be useful: https://github.com/xerpi/vita-udcd-uvc/issues/24

Pollinopops commented 4 years ago

I managed to make it work without any latency by compiling a hardware accelerated MPV in Raspbian Buster. I used the following guide on my raspberry pi 3b and it worked perfectly. https://www.raspberrypi.org/forums/viewtopic.php?t=245574

Using the following command I get no latancy :

mpv av://v4l2:/dev/video0 --profile=low-latency --untimed --fs

maskmark commented 4 years ago

u need a openmax encoding installed manually.or simply google vitadock image.