1

I'm trying to run uv4l inside a Docker container. This is a short description of the u4vl project:

cross-platform, user space drivers for real or virtual video input and output devices (with absolutely no external difference from kernel drivers), and other pluggable back-ends or front-ends.

So inside the docker container, u4vl will try to register a user space driver. In my case exposing the Raspberry Pi camera as /dev/video0.

When I run the command:

uv4l --auto-video_nr --driver raspicam --width 1080 --height 720 --encoding mjpeg --server-option '--port=9000'

I get a message saying <notice> [core] Registering device node /dev/video0, but when I try to do ls /dev there is no /dev/video0 device.

I run the container in privileged mode using the --privileged flag in the docker run command.

Is there anything else I need to do inside the container in order to "allow" it to create a user space driver and new device?

I'm by no means a Linux expert, so forgive me if my terminology/understanding is a bit off.

Jonas Follesø
  • 6,441
  • 7
  • 41
  • 54

2 Answers2

1

Are you running this command inside or outside the container? Running the container in --privileged mode just exposes the host device nodes inside the container, you can't new ones inside. If you run the command outside, then run the container with the flag, you should be able to see the new device node.

yelsayed
  • 5,236
  • 3
  • 27
  • 38
  • Right. I run the command inside the container - not outside (as I was hoping to create the device from the container, as the driver is user space and container is privileged). Creating the device outside the container and exposing it either through `--volume` or `--privileged` is something I've done for serial ports before. So there is no ways to give the container enough privileges to actually create the device (even if it's only visible inside the container itself)? – Jonas Follesø Dec 13 '16 at 11:50
  • 1
    Not that I know of. Keep in mind that Docker isn't meant for this, it's not an emulation or a virtual operating system, it's just acting as a virtual file system environment for most cases. Creating devices is something your host should be doing. – yelsayed Dec 13 '16 at 18:12
  • In this case we're using Docker as a distribution mechanism for the app layer of an embedded system which exposes the Pi camera as a IP camera using uv4l. Docker is convenient as we can package and deploy the whole application as one, so figured this might be a possible solution given the `--privileged` flag, but for now I'll just have to run the uv4l part on the host. – Jonas Follesø Dec 14 '16 at 15:06
1

I'm just working on it and I get it working with a Richo Thesa by running

docker run -it --device=/dev/bus/usb/`lsusb | grep Ricoh|awk {'print $2'}`/`lsusb | grep Ricoh|awk {'print $4'}|sed 's/:$//'` -p 8080:8080 --cap-add=ALL --privileged -v /lib/modules:/lib/modules -v=/dev:/dev -e UV4L_PARAMETERS="-k -f --sched-rr --mem-lock --driver uvc --device-id 05ca:2711 --auto-video_nr" daniego/rover-uv4l

Probably you need just to map the device. I will work on the raspicam next month, but you can probably find a way to get it working by having a look on my work https://github.com/daniego/rover-uv4l and https://hub.docker.com/r/daniego/rover-uv4l/