1

I'm having trouble using the UV4L raspidisp device driver from linux-projects. This is supposed to provide a V4L2 compliant device that provides the output from the Raspberry Pi's HDMI output at /dev/videoX.

Unfortunately, I cannot get it to work. While the installation instruction on the page skips to mention that uv4l-raspicam is not optional even if I don't have a camera attached and also don't intend to do so, I can't get a frame capture using the V4L2 interface.

I also tried some configuration of the driver by issuing

uv4l --driver raspidisp --display 0 --framerate 5 --resolution 3

I am using this bellbind/capture.c for testing. It compiles with

gcc capture.c -ljpeg -o capture

So, as opposed to the suggested compile statement you just skip -std=c99. This code works flawlessly with a UVC webcam, but not with UV4L raspidisp. I get an Operation not permitted error, even when I run the software with sudo.

What am I missing here? Has anyone already worked with UV4L raspidisp?

1

The raspicam driver is optional. That said, you are missing --auto-video_nr in your command line to create the /dev/video0 node expected by your program:

sudo killall uv4l (in case some other instances are running, e.g. raspicam - however, this is optional, as multiple instances can run simultaneously)

uv4l --driver raspidisp --display 0 --framerate 5 --resolution 3 --auto-video_nr

The capture.c program does not support the YUV420P format provided by the driver. It asks for YUYV instead and does not check the answer from the driver which returns YUV420P, as said. So it ends up with producing a result.jpg showing some garbage from the display. The program should be fixed to handle YUV420P.

  • I also had the raspidisp-extras to get a video device on reboot. Those seem to do nothing unless raspicam is also installed. Now I removed both an with the command you posted here it works like a charm. I know the program needs adaption but that is something I can handle. I can see that the device returns a "YU12" image in the V4L2 terminology. A device that I could not open even it was present, was something I have struggled with for quite a bit. Thank you! – kwasmich Nov 11 '17 at 9:22
  • 1
    You are right in saying there is a problem with the raspidisp-extras package (which should automatically load the raspidisp driver at boot). I checked the systemd .service file in it and noticed there is a typo: "raspicam" instead of "raspidisp". I sent an email to linux-projects.org and asked them to fix the problem. They ack.'ed and I can see the fix online, Try to update the packages. – cacachu Nov 11 '17 at 12:52
  • I tried the updated package on a fresh raspbian stretch. Now the device appears as /dev/video1 but it does not work as expected. I get the error Software caused connection abort when calling VIDIOC_QUERYBUF. But it works if I remove --mem-lock from uv4l_raspidisp.service. – kwasmich Nov 12 '17 at 20:49
  • weird. I have no problems on my side with the installed .service. – cacachu Nov 12 '17 at 21:14
  • Mystery solved. I set the memory split to 128 on a Raspberry Pi Model A (256 MB RAM in total). Obviously the remaining free memory is not enough. I get random errors like the above, sudden termination of the SSH session and kernel panics, stating "Out of memory and no killable processes...". But works fine without --mem-lock. – kwasmich Nov 13 '17 at 19:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.