nioyco
Posts: 7
Joined: Wed Feb 27, 2013 1:23 am

Camera Module (Board) on Gentoo

Mon Jul 15, 2013 11:20 pm

Hey,

Anyone know the way to enable the new Camera Module on Gentoo linux?
The tools seems to be pre-installed for Raspian

Thanx

nioyco
Posts: 7
Joined: Wed Feb 27, 2013 1:23 am

Re: Camera Module (Board) on Gentoo

Mon Jul 15, 2013 11:58 pm

Next step : I'm downloading last kernel (linux.git) and i will try genkernel with menuconfig option to see if the camera module option exist in and check the modules. Maybe i can activate it ;)

ZappeL
Posts: 1
Joined: Sat Jul 20, 2013 12:11 am

Re: Camera Module (Board) on Gentoo

Sat Jul 20, 2013 12:32 am

Hey,
i'm stucking at the same point, got my cam-module a couple of days ago, but i can't get it working..

i'm using kernel 3.10.1 (rpi-3.10.y branch from: https://github.com/raspberrypi/linux). Anytime i try to start the device i got the following message:

Code: Select all

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've checked everything twice (with the raspian image it works fine). I tested it also with the "_x.*" firmware files, but the error is still there. I think it's caused by a missing kernel module, but i dont know which one, maybe someone has a hint for us.

Regards

Batolemaeus
Posts: 1
Joined: Thu Aug 01, 2013 3:11 pm

Re: Camera Module (Board) on Gentoo

Thu Aug 01, 2013 3:25 pm

It's not (strictly) as kernel issue.

If you do a ldd on /opt/vc/bin/raspistill, you will notice that there's something missing:

Code: Select all

libmmal_core.so => /opt/vc/lib/libmmal_core.so (0xb6f59000)
        libmmal_util.so => /opt/vc/lib/libmmal_util.so (0xb6f43000)
        libvcos.so => /opt/vc/lib/libvcos.so (0xb6f31000)
        libbcm_host.so => /opt/vc/lib/libbcm_host.so (0xb6f17000)
        libpthread.so.0 => /lib/libpthread.so.0 (0xb6ef7000)
        libc.so.6 => /lib/libc.so.6 (0xb6dc3000)
        libgcc_s.so.1 => /usr/lib/gcc/armv6j-hardfloat-linux-gnueabi/4.6.3/libgcc_s.so.1 (0xb6db0000)
        libdl.so.2 => /lib/libdl.so.2 (0xb6da5000)
        librt.so.1 => /lib/librt.so.1 (0xb6d96000)
        libvchiq_arm.so => /opt/vc/lib/libvchiq_arm.so (0xb6d87000)
        /lib/ld-linux-armhf.so.3 (0xb6f6f000)
Compare this to the output of the binary from the github repo:

Code: Select all

        libmmal_core.so => /opt/vc/lib/libmmal_core.so (0xb6ecf000)
        libmmal_util.so => /opt/vc/lib/libmmal_util.so (0xb6eb9000)
        libmmal_vc_client.so => /opt/vc/lib/libmmal_vc_client.so (0xb6ea6000)
        libvcos.so => /opt/vc/lib/libvcos.so (0xb6e94000)
        libbcm_host.so => /opt/vc/lib/libbcm_host.so (0xb6e7a000)
        libpthread.so.0 => /lib/libpthread.so.0 (0xb6e5a000)
        libdl.so.2 => /lib/libdl.so.2 (0xb6e4f000)
        librt.so.1 => /lib/librt.so.1 (0xb6e40000)
        libvchiq_arm.so => /opt/vc/lib/libvchiq_arm.so (0xb6e32000)
        libc.so.6 => /lib/libc.so.6 (0xb6cfe000)
        libgcc_s.so.1 => /usr/lib/gcc/armv6j-hardfloat-linux-gnueabi/4.6.3/libgcc_s.so.1 (0xb6cea000)
        /lib/ld-linux-armhf.so.3 (0xb6ee5000)

What is happening? Well, the --as-needed flag is being passed to the linker as a default option since ~2010. It is supposed to strip all unneeded libraries..but in this case, it strips one too many.

You can override this behavior. In /etc/portage/env, create a file. Let's call it raspberrypi-userland. Put the following into the file:

Code: Select all

LDFLAGS="-Wl,-O1"
Then, in /etc/portage/package.env:

Code: Select all

media-libs/raspberrypi-userland raspberrypi-userland
Then re-emerge raspberrypi-userland, and raspistill should work.

brendlefly62
Posts: 3
Joined: Sat May 03, 2014 4:29 pm

Re: Camera Module (Board) on Gentoo

Sat May 03, 2014 4:56 pm

I've tried all the steps above to ensure the --as-needed was corrected, but I still get an error trying to use the raspistill or raspivid. Can someone advise? is this a toolchain issue? (I noticed above was with gcc-4.6.3, whereas I'm on gcc-4.7.3 and glibc-2.17 -- Also, If I use a raspbian image to boot the same system, the camera works fine -- but I notice raspbian and the github source for userland are expecting to compile with arm-linux-gnueabihf- rather than the compiler I have [armv6j-hardfloat-linux-gnueabi-])

Code: Select all

# raspistill -o image.jpg
raspistill: symbol lookup error: /opt/vc/lib/libGLESv2.so: undefined symbol: client_tls

### other maybe-relevant background info
# uname -a
Linux Raspberry06 3.12.17-raspberrypi+ #2 PREEMPT Sat Apr 26 09:00:40 EDT 2014 armv6l BCM2708 GNU/Linux

# gcc-config -l
 [1] armv6j-hardfloat-linux-gnueabi-4.7.3 *

# eix glibc
[I] sys-libs/glibc
     Available versions:  (2.2) ~2.9_p20081201-r3^s 2.10.1-r1^s 2.11.3^s ~*2.12.1-r3^s 2.12.2^s ~2.13-r2^s 2.13-r4^s ~*2.14^s ~2.14.1-r2^s 2.14.1-r3^s ~*2.15-r1^s 2.15-r2^s 2.15-r3^s{tbz2} 2.16.0^s 2.17^s{tbz2} ~2.18-r1^s{tbz2} ~2.19^s **9999^s
       {debug gd hardened multilib nscd profile selinux suid systemtap vanilla CROSSCOMPILE_OPTS="headers-only"}
     Installed versions:  2.17(2.2)^s{tbz2}(18:22:41 04/20/14)(-debug -gd -hardened -multilib -nscd -profile -selinux -suid -systemtap -vanilla CROSSCOMPILE_OPTS="-headers-only")
     Homepage:            http://www.gnu.org/software/libc/libc.html
     Description:         GNU libc6 (also called glibc2) C library

User avatar
DougieLawson
Posts: 34139
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: Camera Module (Board) on Gentoo

Sun May 04, 2014 4:05 pm

Pull the source from https://github.com/raspberrypi/userland and there's a buildme script that should build everything and install it all in the right places.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3Bs*3, 3B+

Any DMs sent on Twitter will be answered next month.

brendlefly62
Posts: 3
Joined: Sat May 03, 2014 4:29 pm

Re: Camera Module (Board) on Gentoo

Sun May 04, 2014 9:40 pm

Thanks, DougieLawson. I did that, but the buildme script fails ... that's why I submitted the question. :?

User avatar
DougieLawson
Posts: 34139
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: Camera Module (Board) on Gentoo

Mon May 05, 2014 9:13 am

What exciting messages did you get from that buildme failure?
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3Bs*3, 3B+

Any DMs sent on Twitter will be answered next month.

brendlefly62
Posts: 3
Joined: Sat May 03, 2014 4:29 pm

Re: Camera Module (Board) on Gentoo

Thu May 08, 2014 1:08 am

Um, well, you know - I just re-ran it, and this time it successfully completed and installed. I can also capture images and video. :D However, I still get errors trying to run raspistill or raspivid:

raspistill -- note that the first fails completely; the second reports errors but captures an image.

Code: Select all

# raspistill -o image8.jpg
raspistill: symbol lookup error: /opt/vc/lib/libGLESv2.so: undefined symbol: client_tls
# LD_LIBRARY_PATH=/opt/vc/lib raspistill -o image8.jpg
mmal: mmal_vc_port_parameter_set: failed to set port parameter 64:0:ENOSYS
mmal: Function not implemented
mmal: mmal_vc_port_parameter_set: failed to set port parameter 64:0:ENOSYS
mmal: Out of memory
mmal: Unable to set shutter speed
I tried to correct the first problem above by adding /opt/vc/bin to /etc/ld.so.conf.d/06-raspberrypi-userland.conf and running 'ldconfig' -- but it still behaves as above.
raspivid -- captures 10s of video...

Code: Select all

# raspivid -t 10000 -h 480 -w 640 -hf -o video4.h264
mmal: mmal_vc_port_parameter_set: failed to set port parameter 64:0:ENOSYS
mmal: Function not implemented
mmal: mmal_vc_port_parameter_set: failed to set port parameter 48:2:ENOSYS
mmal: failed to set INLINE HEADER FLAG parameters

hpux735
Posts: 11
Joined: Mon Mar 26, 2012 3:38 am
Contact: Website

Re: Camera Module (Board) on Gentoo

Sat Nov 15, 2014 6:11 am

Woot!

Thanks Batolemaeus, the package use file changes worked perfectly.

User avatar
Gavinmc42
Posts: 2132
Joined: Wed Aug 28, 2013 3:31 am

Re: Camera Module (Board) on Gentoo

Fri Apr 20, 2018 12:51 pm

Wonder if the camera can be got going on the Aarch64 version.
https://community.arm.com/graphics/b/bl ... te-library

Running 32bit on 64 bit
https://github.com/sakaki-/gentoo-on-rp ... too-System

Grab images from VC4 via 32bit, work on them with 64bit and NEON.
So many new things to try now that 64bit Gentoo is here.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

Return to “Gentoo”