Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Raspberry Pi: Pi Camera Board not working
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
AchilleTalon
Guru
Guru


Joined: 11 Apr 2004
Posts: 368
Location: Montreal, Quebec, Canada

PostPosted: Tue Sep 02, 2014 11:00 pm    Post subject: Raspberry Pi: Pi Camera Board not working Reply with quote

I am trying to make working the Raspberry Pi Camera board without success.

My Gentoo/Linux kernel is 3.12.26, my version of media-libs/raspberrypi-userland is pre20140117. I have the following in my /boot/config.txt:
Code:

gpu_mem=128
start_file=start_x.elf
fixup_file=fixup_x.dat


My firmware files in /boot are recently extracted from Github (last Friday if I remember correctly).

Here is the message I am getting while trying the following:
Code:
localhost ~ # raspistill -o file.jpg
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


Obviously there isn't any firmware updates unless the Github stuff is outdated. How can I get more information on what is going on? Any hints?

TIA.
_________________
Achille Talon Hop!
Back to top
View user's profile Send private message
chithanh
Developer
Developer


Joined: 05 Aug 2006
Posts: 2152
Location: Berlin, Germany

PostPosted: Wed Sep 03, 2014 1:50 am    Post subject: Reply with quote

I think the raspberrypi-userland is too old. Unfortunately, my Pi started to run very unstable this summer, so I cannot create a properly tested update to the package.
Back to top
View user's profile Send private message
AchilleTalon
Guru
Guru


Joined: 11 Apr 2004
Posts: 368
Location: Montreal, Quebec, Canada

PostPosted: Wed Sep 03, 2014 4:03 pm    Post subject: Reply with quote

I compiled the code from Github and it is working now. So, yes, the problem is the raspberry-userland code is outdated. Will take a look at the ebuild file and see if I can package a new version.
_________________
Achille Talon Hop!
Back to top
View user's profile Send private message
AchilleTalon
Guru
Guru


Joined: 11 Apr 2004
Posts: 368
Location: Montreal, Quebec, Canada

PostPosted: Wed Sep 03, 2014 9:43 pm    Post subject: Reply with quote

So, the solution is only to make a new tarball from the Github, copy the ebuild with another name, ebuild ... manifest, put the tarball on the distribution servers and that's it.
_________________
Achille Talon Hop!
Back to top
View user's profile Send private message
chithanh
Developer
Developer


Joined: 05 Aug 2006
Posts: 2152
Location: Berlin, Germany

PostPosted: Wed Sep 03, 2014 10:33 pm    Post subject: Reply with quote

I made a new snapshot, raspberrypi-userland-0_pre20140830 which you can test.

It is in package.mask for now because I cannot test it myself.
Back to top
View user's profile Send private message
AchilleTalon
Guru
Guru


Joined: 11 Apr 2004
Posts: 368
Location: Montreal, Quebec, Canada

PostPosted: Wed Sep 03, 2014 11:08 pm    Post subject: Reply with quote

Wait, I found something. When building using the script buildme provided with the source code, everything works fine. When building with the ebuild script I get the original error.

There is then something with the ebuild steps that makes it fail. I am using cross compilation for speed. I will try to rebuild locally and let you know the outcome.

NOTE: I did build with the ebuild script locally and it doesn't work neither. So, my conclusion is there is something with the steps in the ebuild script which cause the problem. I haven't gone further in the investigation. If time permit tomorrow I will look at it.
_________________
Achille Talon Hop!
Back to top
View user's profile Send private message
AchilleTalon
Guru
Guru


Joined: 11 Apr 2004
Posts: 368
Location: Montreal, Quebec, Canada

PostPosted: Thu Sep 04, 2014 3:54 pm    Post subject: Reply with quote

What I discovered so far. Doing everything in the ebuild script doesn't work. Replacing the cmake-util commands by the plain cmake commands doesn't work neither. Using the ebuild to up to the prepare phase and then running the buildme script works. I then decided to modify the ebuild script to separate steps in order to identify where it fails exactly.

Here is my script:
Code:
(...)
src_configure() {
    # toolchain file not needed, but build fails if it is not specified
    #local mycmakeargs="-DCMAKE_BUILD_TYPE=Release ./"
    #cmake-utils_src_configure
    mkdir -p build/raspberry/release
    cd build/raspberry/release
    cmake -DCMAKE_BUILD_TYPE=Release ../../..
}

src_compile() {
    cd build/raspberry/release
    emake
}

src_install() {
    #local mycmakeargs="DESTDIR=/var/tmp/mycamera"
    #cmake-utils_src_install
    cd build/raspberry/release
    emake install DESTDIR=/var/tmp/mycamera
    doenvd "${FILESDIR}"/04${PN}

    # enable dynamic switching of the GL implementation
    dodir /usr/lib/opengl
    dosym ../../../opt/vc /usr/lib/opengl/${PN}

    # tell eselect opengl that we do not have libGL
    touch "${ED}"/opt/vc/.gles-only
}


If I use ebuild up to the prepare step, then run in the $S directory the following steps from the buildme script:
Code:
mkdir -p build/raspberry/release
chown -R portage:portage build
cd build/raspberry/release
cmake -DCMAKE_BUILD_TYPE=Release ../../..


Then create the file .configured in /var/tmp/portage/media-libs/raspberrypi-userland-0_pre20140903 to prevent the next step to run the configure part of the ebuild.

Code:
ebuild raspberrypi-userland-0_pre20140903.ebuild install
export PATH=$PATH:/var/tmp/mycamera/opt/vc/bin
export LD_LIBRARY_PATH=/var/tmp/mycamera/opt/vc/lib


Then, raspistill works correctly.

So, obviously something is not done properly in the configure phase. I tried with:
Code:
local mycmakeargs="DESTDIR=/var/tmp/mycamera"
cmake-utils_src_install


In the ebuild script and it doesn't work. The configure phase completes without errors. However the installed executable doesn't work and produce the error reported originally.

My knowledge of cmake is almost inexistent, so, if anyone can provide some kind of guidance it will be appreciated.
_________________
Achille Talon Hop!
Back to top
View user's profile Send private message
chithanh
Developer
Developer


Joined: 05 Aug 2006
Posts: 2152
Location: Berlin, Germany

PostPosted: Wed Oct 21, 2015 9:10 am    Post subject: Reply with quote

So I managed to get my Raspberry Pi to work more or less stable again, by downclocking and upvolting a bit.

I investigated the issue and though I have no camera, I get the same error:
Code:
# /opt/vc/bin/raspistill -o file.jpg
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: Camera is not enabled in this build. Try running "sudo raspi-config" and ensure that "camera" has been enabled
Googling a bit turned up this issue in a different camera application for the Raspberry Pi and it contained the right pointer. Namely, the executable needs to link to libmmal_vc_client.so in order to use the camera.

When forcing the library to be loaded, there is still an error but that appears to be normal if you run it without a camera attached.
Code:
# LD_PRELOAD=/opt/vc/lib/libmmal_vc_client.so /opt/vc/bin/raspistill -o file.jpg
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
This means it is either an --as-needed issue, or the build scripts need to be modified in order to link to libmmal_vc_client explicitly.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum