1

How do you enable the camera module in Ubuntu 16.04 running on a Raspberry Pi 3?

This is similar to my earlier question, except where that was for the Raspberry Pi 2, this is for the 3.

I ran through the same procedure I documented there, but even though all steps ran successfully, and the command vcgencmd get_camera reports:

supported=1 detected=1

attempting to run raspistill --nopreview --output image.jpg results in the error:

mmal: mmal_component_create_core: could not find component 'vc.camera_info'
mmal: Failed to create camera_info component
mmal: mmal_component_create_core: could not find component 'vc.ril.camera'
mmal: Failed to create camera component
mmal: main: Failed to create camera component
mmal: Failed to run camera app. Please check for firmware updates

I re-ran sudo rpi-udpate, re-checked by settings in /boot/config.txt but everything looks right. I had previously gotten the camera working under Raspbian on the Pi3, and I haven't changed any wiring since replacing the SD card with an image of Ubuntu 16, so the I'm certain it's a software issue. What's different with Ubuntu? What can I do to diagnose and fix this problem?

$ lsmod
Module                  Size  Used by
bnep                   10340  2
hci_uart               17943  1
btbcm                   5929  1 hci_uart
bluetooth             326105  22 bnep,btbcm,hci_uart
binfmt_misc             6388  1
snd_usb_audio         118608  0
snd_hwdep               5727  1 snd_usb_audio
snd_usbmidi_lib        19801  1 snd_usb_audio
snd_rawmidi            18516  1 snd_usbmidi_lib
evdev                  11396  0
snd_seq_device          3621  1 snd_rawmidi
brcmfmac              186339  0
brcmutil                5661  1 brcmfmac
cdc_acm                17370  0
cfg80211              427855  1 brcmfmac
rfkill                 16037  6 cfg80211,bluetooth
bcm2835_gpiomem         3040  0
bcm2835_wdt             3225  0
uio_pdrv_genirq         3164  0
uio                     8000  1 uio_pdrv_genirq
snd_bcm2835            20447  0
snd_pcm                75762  2 snd_bcm2835,snd_usb_audio
snd_timer              19288  1 snd_pcm
snd                    51908  8 snd_bcm2835,snd_usb_audio,snd_hwdep,snd_timer,snd_pcm,snd_rawmidi,snd_usbmidi_lib,snd_seq_device
ipv6                  347530  24

$ cat /boot/config.txt | grep -v '^#' | grep '.'
hdmi_force_hotplug=1
hdmi_drive=2
start_x=1
gpu_mem=256

$ uname -a
Linux localhost 4.4.23-v7+ #913 SMP Tue Oct 4 14:16:19 BST 2016 armv7l armv7l armv7l GNU/Linux

After I enabled start_debug=1 in my /boot/config.txt, now sudo vcdbg log assert shows:

002702.229: assert( source ) failed; ../../../../../middleware/confzilla/cp_front_fdt.c::cp_front_fdt_load_builtin line 115 rev c844c61
vcdbg_ctx_get_dump_stack: dump_stack failed
----------------
003569.708: assert( card not initialised ) failed; ../../../../../filesystem/media/sdcard/sdcard.c::sdhost_close line 1045 rev c844c61
vcdbg_ctx_get_dump_stack: dump_stack failed
----------------

Edit: I'm not entirely sure what happened, but now it's working. In case anyone else runs into this, here's what I did.

I tried downgrading my firmware to a version from Oct 2015. That failed and caused by Pi to show the Rainbow Screen of Death. However, I was able to use rpi-update from my laptop to revert the firmware on the SD card, to get it to boot again.

Another issue I was having was insanely long boot times when unplugged from ethernet. I fixed this by editing /etc/network/interfaces and changing eth0's entry from auto to manual. I also fixed a problem with eth0 being renamed to enx*, which might have been confusing network startup.

I was also seeing a boot up error from the "Load System Module" service. Looking at the log showed it was trying to load kernel module bcm2808_rng which didn't exist. Researching this error found that this module is for the Raspberry Pi 2, and has been removed and replaced with the module bcm2835_rng. Modifying the file '/etc/modules-load.d/rpi2.conf' and replacing the old module name with the new one fixed that error.

The docs for installing raspistill on Ubuntu had me cloning and building the https://github.com/raspberrypi/userland.git repo. I was previously doing this from inside /tmp. I changed this to ~, incase the build was saving important files in /tmp which were then being lost after reboot.

After a few reboots, I again tested raspistill, and it worked. I'm not sure if any of those changes were fixes, or if I just scared away some gremlins, but I've rebooted a few times and raspistill is now working reliably.

I re-ran the shell commands I posted earlier, so see what's changed, and everything was the same except for the lsmod output. It shows the exact same kernel modules, but where the evdev module was listed as being used by 0 other modules, it nows shows it's being used by 2 other modules, although it doesn't list those module's names.

1
  • The error you were getting indicates the firmware wasn't camera enabled so my guess would be something went wrong with the initial rpi-update attempt (though I couldn't say what). Anyway, glad to hear it's working again - I must give the camera a whirl under Ubuntu sometime
    – Dave Jones
    Commented Oct 12, 2016 at 21:20

1 Answer 1

1

I got exactly the same problem as you did, also by painfully executed your steps for the RPi2 found here.

I did not go through your boot problems as I only downgraded (using rpi-update) from 840a496a84e9e76ee3aef42918eecac06bd7f610 to 667cfabe63bc663383559ef88317e86f9bd41e45 (14 days older). The sha hashes/versions can be found here.

After the upgrade (and a reboot) raspistill -o cam.jpg all of a sudden worked.

I also tried to upgrade do the latest firmware version (840a496a84e9e76ee3aef42918eecac06bd7f610) again, and - surprise - everything still works.

Besides that, I only enabled boot logging as suggested by you, but I did not change anything otherwise. (I also didn't had bcm2835_rng in my /etc/modules-load.d/rpi2.conf; ethernet was connected all the time).

So the solution seems to be:

  • Follow @Cerin's steps for the RPi 2
  • Try to run raspistill -o cam.jpg, if it fails, downgrade by using for example sudo rpi-update 667cfabe63bc663383559ef88317e86f9bd41e45
  • Reboot and try raspistill -o cam.jpg, again.

So now that I got raspistill working, gstreamer still refuses to run, but that's not subject of this thread...

$ gst-launch-1.0 rpicamsrc bitrate=1000000 \ ! 'video/x-h264,width=640,height=480' \ ! h264parse \ ! queue \ ! rtph264pay config-interval=1 pt=96 \ ! gdppay \ ! udpsink host=10.0.0.92 port=5600 Setting pipeline to PAUSED ... mmal: mmal_component_create_core: could not find component 'vc.ril.camera' ERROR: Pipeline doesn't want to pause. ERROR: from element /GstPipeline:pipeline0/GstRpiCamSrc:rpicamsrc0: GStreamer error: state change failed and some element failed to post a proper error message with the reason for the failure. Additional debug info: gstbasesrc.c(3354): gst_base_src_start (): /GstPipeline:pipeline0/GstRpiCamSrc:rpicamsrc0: Failed to start Setting pipeline to NULL ... Freeing pipeline ...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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