WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Issue with rpi-vc and camera  (Read 9582 times)

Offline goetzmoritz

  • Newbie
  • *
  • Posts: 3
Issue with rpi-vc and camera
« on: March 07, 2016, 01:43:48 AM »
Hi there,

I'm trying to get my pi camera to run.
I installed a v7 piCore image on my just unpacked class 10 sd-card (8 gig).
After burning image to the sd card I added
Code: [Select]
gpu_mem=128
start_file=start_x.elf
fixup_file=fixup_x.dat
to boot/config.txt

After that:
Code: [Select]
tce-load -wi rpi-vc.tcz
and than:
Code: [Select]
chmod 777 /dev/vchiq
finally:
Code: [Select]
filetool.sh -b
reboot

When I try to activate the camera, I get this:


Code: [Select]
tc@box:~$ raspistill -t 5000
mmal: mmal_vc_component_create: failed to create component 'vc.ril.camera' (1:ENOMEM)
mmal: mmal_component_create_core: could not create component 'vc.ril.camera' (1)
mmal: Failed to create camera component
mmal: main: Failed to create camera component
mmal: Camera is not detected. Please check carefully the camera module is installed correctly


To verify that it's not my hardware I did not touch anything, changed the sd-card to working raspbian and took an image whiched worked well.

I'm using rpi1-B with standard camera module and I'm connected to the pi via ssh.
I also tried the -n option in case it's a preview-issue.

Any suggestions? Thanks!!!!


Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: Issue with rpi-vc and camera
« Reply #1 on: March 07, 2016, 07:47:55 AM »
Hi goetzmoritz
Quote
gpu_mem=128
start_file=start_x.elf
fixup_file=fixup_x.dat
According to this:
https://www.raspberrypi.org/forums/viewtopic.php?f=43&t=39996&sid=762c27cb9ea1a3d6b3a6ccbe1e8ec5dc&start=25
the syntax is:
Code: [Select]
start_file=start_x.elf
start_fixup=fixup_x.dat
That was from Apr 11, 2013 4:42 am so maybe that has changed.

Quote
and than:
Code: newbielink:javascript:void(0); [nonactive]
chmod 777 /dev/vchiq

finally:
Code: newbielink:javascript:void(0); [nonactive]
filetool.sh -breboot
The  /dev  directory gets rebuilt from scratch after every boot. You should probably add the  chmod  line to your
bootlocal.sh  file.

Quote
mmal: mmal_vc_component_create: failed to create component 'vc.ril.camera' (1:ENOMEM)
Thise site suggests possible cable problems for that error:
http://elinux.org/Rpi_Camera_Module#Camera_not_working_at_all

Offline goetzmoritz

  • Newbie
  • *
  • Posts: 3
Re: Issue with rpi-vc and camera
« Reply #2 on: March 08, 2016, 12:25:27 AM »
Quote
According to this:
https://www.raspberrypi.org/forums/viewtopic.php?f=43&t=39996&sid=762c27cb9ea1a3d6b3a6ccbe1e8ec5dc&start=25
the syntax is:
Code: [Select]

start_file=start_x.elf
start_fixup=fixup_x.dat

That was from Apr 11, 2013 4:42 am so maybe that has changed.

I tried it but it didn't help. When I look at the startup of my working raspbian it only showes me the gpu_mem=128 line but start_file and fixup are missing there.

Quote
The  /dev  directory gets rebuilt from scratch after every boot. You should probably add the  chmod  line to your
bootlocal.sh  file.

good hint. I forgot about that.

Quote
Thise site suggests possible cable problems for that error:
http://elinux.org/Rpi_Camera_Module#Camera_not_working_at_all

Unfortunately no, as I mentioned above the camera is working when I insert a sd-card with raspbian so a hardware-issue is not possible. Also I changed the raspberry, sd card (burned the image to a brand new one) and the camera and it didn't help.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: Issue with rpi-vc and camera
« Reply #3 on: March 08, 2016, 08:53:17 AM »
Hi goetzmoritz
Quote
I tried it but it didn't help. When I look at the startup of my working raspbian it only showes me the gpu_mem=128 line but start_file and fixup are missing there.
Try removing  start_file  and  fixup  and check for or add this to config.txt:
Code: [Select]
start_x=1As per:
http://elinux.org/RPiconfig#Camera

Offline gavinmc42

  • Sr. Member
  • ****
  • Posts: 301
Re: Issue with rpi-vc and camera
« Reply #4 on: March 12, 2016, 04:00:28 AM »
Using the 7.1beta1
Just tested this on Pi3, camera not working
Same SDcard works on old Pi B.
Putting "start_x=1" in config.txt works, must be related to new 4.1.18?

Seem to remember something on the Raspberry forums about different GPIO/I2C pin are used on Pi 3.
Lots of activity in Raspberry Pi userland re vc last few days.
So probably rpi-vc.tcz will need be to be updated.

Offline gavinmc42

  • Sr. Member
  • ****
  • Posts: 301
Re: Issue with rpi-vc and camera
« Reply #5 on: March 13, 2016, 06:15:37 AM »
 Hi Goetzmoritz

Just tried the camera on a Pi 3 with latest Raspbian with updates and 4.1.19 kernel.
Bit low on power as it was running from a PC USB port, 3's do need lots of power.
Got the little 4 color square on the monitor that indicates low voltage.
Had that same message until I used raspi-config to enable the camera.

mmal: mmal_vc_component_create: failed to create component 'vc.ril.camera' (1:ENOMEM)
mmal: mmal_component_create_core: could not create component 'vc.ril.camera' (1)
mmal: Failed to create camera component
mmal: main: Failed to create camera component
mmal: Camera is not enabled in this build. Try running "sudo raspi-config" and ensure that "camera" has been enabled


Camera now working, have not tested everything but "sudo raspistill -d" works.
Just tested same Raspbian SDcard on old B with same camera, still works.
I test with Raspbian as well to find out if camera is not working or software faulty.
At the moment I think rpi-vc.tcz and/or kernel needs an upgrade in piCore for Pi 3's.

Sometimes the connector is not in perfectly.
Also had one a bit dirty, it worked after a clean, take care about  static.

I assume the camera chip needs to be setup via the i2c commands first before image can be taken.
Some sort of IO expander is used on Pi3, GPIO/I2C messed up, fixed in Raspbian not yet in piCore?
Think Bela is working on it for next  release.

Sure wish we had a schematic for 2  and 3.
U20 is a i2c multiplexer or I/O expander, tiny 16 pin part on the 3.
Rumour is, it has something to do with the WiFi chip and maybe the LEDs.

There is also supposed to be some control for the switch mode power chip that is on the 2 and 3.
Probably a reason Raspberry Org don't want people to know how this bit works;)
Magic smoke and mirrors stuff.
Somebody will figure it out and get us water cooled 1.5GHz Pi3's :P

Gavin

Offline gavinmc42

  • Sr. Member
  • ****
  • Posts: 301
Re: Issue with rpi-vc and camera
« Reply #6 on: March 13, 2016, 07:05:48 AM »
Only a few makers of i2c chips.
Ti no luck with matching package shape.
NXP has a PCA6404 in a  XQFN16 that looks about right.
Address 0x43 would match the rumored one if Addr input is tied high.

All this probably relevant to WiFi/Bluetooth chip, SW power and LEDs.
If controlled by the VPU/GPU,  going to be harder for mere mortals to figure out.

Or maybe the PCAL6408A?
Topside marking don't match?
MCP23S09? nope 3x3mm

Someone been here
https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=138280&p=922287&hilit=GPIO+expander#p922287

Offline gavinmc42

  • Sr. Member
  • ****
  • Posts: 301
Re: Issue with rpi-vc and camera
« Reply #7 on: March 15, 2016, 04:46:55 AM »
Confirmed Pi 2 and camera also  not working with piCore 4.1.19 with rpi-vc.tcz.
But does on Raspbian, still need better power supply just in case it's that.

Tends to confirm a change in the way 2 and 3's talk to the camera.
In Raspbian the bin files are in /opt/vc/... piCore puts the rpi-vc.tcz files elsewhere - /usr/local...
Swap the files in Raspbian into a new rpi-vc.tcz?

Had not tried  camera on a Pi 2 before, got so many old A and B's still to use up.
Need it to work for WiFi Pi 3 robots. Pi 3 going to be interesting for OpenCV.



Offline mosimo

  • Newbie
  • *
  • Posts: 6
Re: Issue with rpi-vc and camera
« Reply #8 on: March 16, 2016, 10:14:37 AM »
Also having the same errors with an R-Pi2 and camera board. Tested on 7 Final, beta1 and beta2.

Brand new install. Only changes are:

config.txt has:
Code: [Select]
start_x=1
gpu_mem=128
start_file=start_x.elf
start_fixup=fixup_x.dat

bootlocal.sh has: (Then backed up)
Code: [Select]
chmod 777 /dev/vchiq

Installed rpi-vc using:
tce-load -wi rpi-vc

vcgencmd get_camera:
Code: [Select]
supported=1, detected=0

vcgencmd get_mem arm:
Code: [Select]
arm=880M

vcgencmd get_mem gpu:
Code: [Select]
gpu=128M

raspistill -o test.jpg:
Code: [Select]
mmal: mmal_vc_component_create: failed to create component 'vc.ril.camera' (1:ENOMEM)
mmal: mmal_component_create_core: could not create component 'vc.ril.camera' (1)
mmal: Failed to create camera component
mmal: main: Failed to create camera component
mmal: Camera is not enabled in this build. Try running "sudo raspi-config" and ensure that "camera" has been enabled

The camera LED flashes for a brief moment the first time after boot when you do anything with the camera like raspistill, raspivid, vcgencmd get_camera. But it will only do it once until you reboot.
I've had the camera working in the past. Only just come back to this project and can't find my old SD card with a working version on.

[edit]
Just tested a fresh raspbian install, enabled camera and ran raspistill -o test.jpg and it worked fine. So it's not my camera.
[/edit]
« Last Edit: March 16, 2016, 10:17:54 AM by mosimo »

Offline gavinmc42

  • Sr. Member
  • ****
  • Posts: 301
Re: Issue with rpi-vc and camera
« Reply #9 on: March 16, 2016, 06:48:10 PM »
supported=1, detected=0

I think it needs i2c comms to detect a camera chip.
The rpi-vc.tcz is old and not Pi2/3 compatible?

If you know how to do it, you could grab these files and make a new rpi-vc.tcz
https://github.com/raspberrypi/firmware/tree/master/opt/vc

Offline mosimo

  • Newbie
  • *
  • Posts: 6
Re: Issue with rpi-vc and camera
« Reply #10 on: March 17, 2016, 01:50:50 AM »
Ok, I got the camera working again. I had to edit the config.txt file and change the Enable peripheral buses dtparam line

From:
dtparam=i2c=on,spi=on,i2s=on,i2c_vc=on

To:
dtparam=i2c=on,spi=on,i2s=on,i2c_vc=off

Doing this vcgencmd get_camera now shows as detected=1 and raspivid and raspistill work fine.

Offline gavinmc42

  • Sr. Member
  • ****
  • Posts: 301
Re: Issue with rpi-vc and camera
« Reply #11 on: March 18, 2016, 04:32:12 AM »
Hi mosimo,

Well done, nice detective work.
It works on my Pi2's and 3's, need to turn i2c_vc=off.

dtparam=i2c=on,spi=on,i2s=on,i2c_vc=off

Now to get WiFi going.

Gavin

Offline joeysr20det

  • Newbie
  • *
  • Posts: 9
Re: Issue with rpi-vc and camera
« Reply #12 on: August 29, 2016, 09:31:08 AM »
I'm running into the same issue with Picore 7.07 on my Raspberry Pi Zero. I've set my config.txt file the same as listed about:

start_x=1
gpu_mem=128
start_file=start_x.elf
start_fixup=fixup_x.dat

as well as the bit about:

...i2c_vc=off

I've updated the permissions on /dev/vchiq, added the rpi-vc module, backed up and rebooted.

When I run vcgencmd get_camera i get:

supported=0 detected=0

I've verified my camera works on Arch Linux, Raspian, and a few others. Any suggestions on what I might try. This is the very last piece to me being able to use Tiny Core on my pi instead of Arch Linux... and I really want to use TC. TC freaking rocks!

Thanks for any input and Thank you very much for the RPI build of TC!
Tiny core rocks!

Offline joeysr20det

  • Newbie
  • *
  • Posts: 9
Re: Issue with rpi-vc and camera
« Reply #13 on: August 29, 2016, 09:47:48 AM »
Also to note, this is a cheaper Ebay camera:

http://www.ebay.com/itm/Night-Vision-IR-Surveillance-Camera-2-Pcs-3W-Infrared-Light-For-Raspberry-Pi-/262351644157?hash=item3d156065fd:g:RuEAAOSwoudW9Il5

Says it has a Omnivision 5647 sensor on it. Not sure if the rpi-vc package only knows how to talk to a certain set of cameras or if they are all fairly standard... Just thought I'd mention this just in case.
Tiny core rocks!

Offline joeysr20det

  • Newbie
  • *
  • Posts: 9
Re: Issue with rpi-vc and camera
« Reply #14 on: August 29, 2016, 01:36:16 PM »
Went a ahead and took a stab at compiling userland myself. Got the compile-essentials package, git, cmake and a few others. I was able to clone the userland and compile it following a tutorial I found:

http://www.stuffaboutcode.com/2013/08/compile-raspberry-pi-userland-raspivid.html

I then used the squashfs to build a new tcz, generated a new md5 and copied both to the tce/optional dir on the 2nd partition. Looks like my compiled module loads without issue but a called to:

vcgencmd get_camera

is still yielding

supported=0 detected=0 :(

I think I'm about tapped out on ideas.

Thanks in advance to anyone that can help. It would be much appreciated!
Tiny core rocks!