Table of contents
1.
Introduction
2.
What is Raspberry Pi and How Does it Work?
3.
What is Cinder?
4.
Cinder with Raspberry Pi 3
4.1.
Prerequisites
4.1.1.
Installing CMake
4.2.
Dependencies for Cinder
5.
Building the Cinder
5.1.
Fetching and Building the Cinder
5.2.
Clang
6.
Building and Running BasicApp
6.1.
Building
6.2.
Running
6.3.
Exiting
7.
Troubleshooting
7.1.
Audio–Starting the pulsedeamon
7.2.
Audio–No Output Using a 3.5mm headphone jack
8.
Frequently Asked Questions
8.1.
What are the requirements for Cinder-Raspberry Pi 3 Platform?
8.2.
What are the constraints kept in mind while building Cinder?
8.3.
How do you use clang while building a Cinder?
8.4.
How to exit the BasicApp of Cinder-Raspberry Pi 3?
9.
Conclusion
Last Updated: Mar 27, 2024
Medium

Cinder-Raspberry Pi 3 Platform

Author Rashi
0 upvote
Career growth poll
Do you think IIT Guwahati certified course can help you in your career?

Introduction

Six years ago, a single-board computer hit the market, changing the game for tinkerers and do-it-yourselfers. The Raspberry Pi is a big dream for all kinds of projects—gaming consoles, home streaming, VPN servers, and more—but gathering your supplies and learning the basics is the first step. 

Cinder-Raspberry Pi 3 Platform

In this article, we will learn about Cinder with Raspberry Pi 3 platform with a brief introduction to Raspberry Pi and Cinder.

What is Raspberry Pi and How Does it Work?

The Raspberry Pi is a miniature computer the size of a deck of cards. It employs a system on a chip (Opens in a new window), which integrates the CPU and GPU into a single integrated circuit, with the RAM, USB ports, and other components soldered onto the board for a complete package.

What is Raspberry Pi and How Does it Work?

The Raspberry Pi device resembles a motherboard, with mounted chips and ports exposed. Still, it contains all of the components required to connect the input, output, and storage devices and begin computing.

What is Cinder?

Cinder is an OpenStack Block Storage service. It provides virtual management of block storage devices. It offers end users with a self-service API to request and utilize those resources without requiring any understanding of where their storage is deployed or what type of device is being used.

Cinder with Raspberry Pi 3

Prerequisites

  • Raspbian Jessie or later
     
  • CMake 3.0+
     

Installing CMake

sudo apt-get install cmake

Dependencies for Cinder

Run the below command to get Cinder Raspberry Pi 3 with its dependencies.

sudo apt-get install libxcursor-dev \
libgles2-mesa-dev \
zlib1g-dev \
libfontconfig1-dev \
libmpg123-dev \
libsndfile1 \
libsndfile1-dev \
libpulse-dev \
libasound2-dev \
libcurl4-gnutls-dev \
libgstreamer1.0-dev \
libgstreamer-plugins-bad1.0-dev \
libgstreamer-plugins-base1.0-dev \
gstreamer1.0-libav \
gstreamer1.0-alsa \
gstreamer1.0-pulseaudio \
gstreamer1.0-plugins-bad \
libboost-filesystem-dev

Building the Cinder

Fetching and Building the Cinder

git clone --recursive https://github.com/cinder/Cinder.git
cd Cinder
mkdir build && cd build
cmake .. -DCINDER_TARGET_GL=es2-rpi
make -j 3


Due to GCC memory requirements, attempting to build Cinder with more than three jobs, specified with the -j 3 parameter, will almost certainly result in a hard crash. For example, when compiling a 5 MB C file with 65337 functions to assemble, GCC consumes over 700 MB of RAM. Files with fewer functions (32769 and 16385) take a fraction of the time. A workaround is to divide the file into multiple C files and compile each separately.

Check out most important Git Interview Questions here.

Clang

Clang is a front-end compiler that converts programming languages like C++, C, Objective C++, and Objective C into machine code. Compared to GCC, Clang reduces single-thread compilation time by 5% to 10%. As a result, Clang provides more benefits for large-scale project development.

Cinder can be used with the Raspbian Jessie version of Clang (v3.5.0). Install it with apt-get:

sudo apt-get install clang


When prompted by this command, type /usr/bin/clang++ to make Clang the default compiler:

sudo update-alternatives --config c++

Building and Running BasicApp

Building

cd samples/BasicApp/proj/cmake
mkdir build && cd build
cmake .. -DCINDER_TARGET_GL=es2-rpi
make

Running

Starting from samples/BasicApp/proj/cmake/build:

./Debug/BasicApp

Exiting

To exit the BasicApp, press the Esc key. Cinder, which is for Linux on the Raspberry Pi 3, is currently having Esc hardcoded to exit an application.

Troubleshooting

Audio–Starting the pulsedeamon

Raspbian ships with PulseAudio installed. However, it would be best if you started the pulsedeamon before you can utilize audio in your application. Do that by running the following:

pulseaudio -D

Audio–No Output Using a 3.5mm headphone jack

Try the following. It will force output to the 3.5mm jack (more information here):

sudo amixer cset numid=3 1

Frequently Asked Questions

What are the requirements for Cinder-Raspberry Pi 3 Platform?

Raspbian Jessie or a later version and CMake 3.0+ is required for Cinder-Raspberry Pi 3 Platform.

What are the constraints kept in mind while building Cinder?

Due to GCC memory requirements, attempting to build Cinder with more than three jobs, specified with the -j 3 parameter, will almost certainly result in a hard crash.

How do you use clang while building a Cinder?

Cinder can be used with the Raspbian Jessie version of Clang (v3.5.0). Install it with apt-get: sudo apt-get install clang.

How to exit the BasicApp of Cinder-Raspberry Pi 3?

To exit the BasicApp, press the Esc key. Cinder for Linux on the Raspberry Pi 3 currently have Esc hardcoded to exit an application.

Conclusion

In this article, we have learned about Cinder with the Raspberry Pi 3 platform with a brief introduction to Raspberry Pi and Cinder.

You can refer to our guided paths on Coding Ninjas Studio to learn more about DSA, Competitive Programming, JavaScript, System Design, etc. Enrol in our courses and refer to the mock test and problems available. Take a look at the interview experiences and interview bundle for placement preparations.

Happy Learning!

Live masterclass