Camera not working

I built the balena-cam project in a docker container on my Fin device, but cannot get the camera to be recognized. In fact, if I run the vgencmd (I forget what it is now), I get a response saying

supported=0, detected=0

My Fin is a 1.1, my camera is the official pi cam v2.1, which works fine in my RPi4
My balenaOS is v2.46, running local containers.

My USB camera works fine if I plug that in, no changes, no permissions.

Do I need to give the container specific access to the onboard devices?

I’ve tried pluggin the camera into CAM1, flipped the switch under the CM3 module, and copied over the dt blob file to the /boot folder…same, no access and not listed as supported.

Any thoughts/ideas?

what kind of camera is it? a pi cam? do you have any way to rule out it is working outside of balenaCam?

Hi @webtop, if you ssh into the hostOS is there a /dev/vchiq device there?

Indeed there is:
crw------- 1 root root 244, 0 Dec 23 09:11 /dev/vchiq

I’ll install the raspian desktop when I finish work today, and test it. The camera itself is fine, but just not sure if this is a hardware or a software issue.

Ok, finally got back to this. With raspbian installed, I see /dev/video10, /dev/video11, and /dev/video12 but neither are actually accessible. When loading balenaCam, I see no video devices at all, and the container continuously restarts until I plug in a USB webcam.

Is there another way I can test the camera hardware?

As I see that you mentioned you have a Pi4 as well, is it possible to deploy balenaCam to that device, to test if the project is working for you there? If that works successfully, then we can start to investigate whether there are hardware issues with your Fin that require a replacement, or, if there are changes need to the Project to better support the Fin, which we could of course handle via GitHub repo updates. Let us know the results of the Pi4 test, if you can, thanks!

Sure thing, I’ll get that deployed this evening and update the ticket.

Thx

@webtop one other thing to make sure to check is that your container has privileged flag set on it as in https://github.com/balenalabs/balena-cam/blob/master/docker-compose.yml#L5 . I assume if you are deploying the balena-cam repo without changes, it will already have it, but just have to check. Its also necessary to BALENA_HOST_CONFIG_start_x = 1 and BALENA_HOST_CONFIG_gpu_mem=192 set on your device via the dashboard to ensure the container is enabled correctly. So just double checking those too :slight_smile:

@shaunmulligan Most of my work with this is done offline, in dev mode. Can the BALENA_HOST_CONFIG items be added as env vars in the docket file, or the docker-compose file?

unfortunately not easily, we want to enable it to be set via the CLI, but its not possible today. The two ways are :
1.) if the device is connected to the dashboard, you can set them on there and they will apply on device (should work while in local dev mode)
2.) you can change them on /resin-boot/config.txt but this can only be done before first boot, since after first boot these values are written to a DB in the supervisor and that becomes the source of truth for them. So in your case this method wouldn’t be great as you would probably have to reprovision the device.

I have also created a publicly viewable issue to track this here: https://github.com/balena-io/balena-cli/issues/1701

@shaunmulligan Thanks. Yeah I’m not fussed about having to reprovision the device as this is all experimental research for an upcoming project, so the fin I’m using right now is purely a dev board.

Thx

cool, then in that case what you would do (assuming you are using macOS), unzip the original image you downloaded, double click on the .img and this should automount the resin-boot, navigate into it and open config.txt with a file edit and add these two lines to the very bottom of the file:

start_x=1
gpu_mem=192

then eject resin-boot and flash the modified .img onto the fin.

I decided the best way was to deploy from the cloud, and after adding the environment variables, all was well with the world…well, my little world.

Thanks @shaunmulligan @dtischler and @mbalamat

Now to get sound added!!!

Nice to hear that you manged to make this work : )
Let us know how it goes with sound.