Skip to content
This repository was archived by the owner on May 6, 2021. It is now read-only.

Commit a65ec1f

Browse files
committed
Merge branch 'master' of https://github.com/tvdzwan/hyperion
Conflicts: CrossCompileHowto.txt
2 parents 79e9dd6 + 987624f commit a65ec1f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+4086
-1754
lines changed

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/*.user
2-
/build
3-
/build-x86
2+
/build*
43
.DS_Store
54

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "dependencies/external/protobuf"]
2+
path = dependencies/external/protobuf
3+
url = https://github.com/tvdzwan/protobuf.git

CMakeLists.txt

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,27 @@ option(ENABLE_DISPMANX "Enable the RPi dispmanx grabber" ON)
1111
message(STATUS "ENABLE_DISPMANX = " ${ENABLE_DISPMANX})
1212

1313
option(ENABLE_SPIDEV "Enable the SPIDEV device" ON)
14-
message(STATUS "ENABLE_SPIDEV = " ${ENABLE_SPIDEV})
14+
message(STATUS "ENABLE_SPIDEV = " ${ENABLE_SPIDEV})
15+
16+
option(ENABLE_WS2812BPWM "Enable the WS2812b-PWM device" OFF)
17+
message(STATUS "ENABLE_WS2812BPWM = " ${ENABLE_WS2812BPWM})
1518

1619
option(ENABLE_V4L2 "Enable the V4L2 grabber" ON)
1720
message(STATUS "ENABLE_V4L2 = " ${ENABLE_V4L2})
1821

22+
option(ENABLE_X11 "Enable the X11 grabber" OFF)
23+
message(STATUS "ENABLE_X11 = " ${ENABLE_X11})
24+
1925
option(ENABLE_TINKERFORGE "Enable the TINKERFORGE device" ON)
2026
message(STATUS "ENABLE_TINKERFORGE = " ${ENABLE_TINKERFORGE})
2127

28+
option(ENABLE_PROTOBUF "Enable PROTOBUF server" ON)
29+
message(STATUS "ENABLE_PROTOBUF = " ${ENABLE_PROTOBUF})
30+
31+
if(ENABLE_V4L2 AND NOT ENABLE_PROTOBUF)
32+
message(FATAL_ERROR "V4L2 grabber requires PROTOBUF. Disable V4L2 or enable PROTOBUF")
33+
endif(ENABLE_V4L2 AND NOT ENABLE_PROTOBUF)
34+
2235
# Createt the configuration file
2336
# configure a header file to pass some of the CMake settings
2437
# to the source code
@@ -44,8 +57,8 @@ include_directories(${CMAKE_SOURCE_DIR}/include)
4457
# Prefer static linking over dynamic
4558
#set(CMAKE_FIND_LIBRARY_SUFFIXES ".a;.so")
4659

47-
#set(CMAKE_BUILD_TYPE "Debug")
48-
set(CMAKE_BUILD_TYPE "Release")
60+
set(CMAKE_BUILD_TYPE "Debug")
61+
#set(CMAKE_BUILD_TYPE "Release")
4962

5063
# enable C++11
5164
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -Wall")
@@ -54,13 +67,6 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -Wall")
5467
# Configure the use of QT4
5568
find_package(Qt4 COMPONENTS QtCore QtGui QtNetwork REQUIRED QUIET)
5669

57-
# add protocol buffers (make sure to find the static version)
58-
set(CMAKE_FIND_LIBRARY_SUFFIXES_OLD ${CMAKE_FIND_LIBRARY_SUFFIXES})
59-
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
60-
find_package(Protobuf REQUIRED)
61-
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_OLD})
62-
set(CMAKE_FIND_LIBRARY_SUFFIXES_OLD)
63-
6470
#add libusb and pthreads
6571
find_package(libusb-1.0 REQUIRED)
6672
find_package(Threads REQUIRED)

CompileHowto.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Install the required tools and dependencies
22
sudo apt-get update
3-
sudo apt-get install git cmake build-essential libprotobuf-dev libQt4-dev libusb-1.0-0-dev protobuf-compiler python-dev
3+
sudo apt-get install git cmake build-essential libQt4-dev libusb-1.0-0-dev python-dev
44

55
# RPI ONLY: when you build on the rapberry pi and inlcude the dispmanx grabber (which is the default)
66
# you also need the firmware including headers installed. This downloads the firmware from the raspberrypi github
@@ -11,7 +11,7 @@ sudo cp -R "$FIRMWARE_DIR/hardfp/opt/*" /opt
1111

1212
# create hyperion directory and checkout the code from github
1313
export HYPERION_DIR="hyperion"
14-
git clone https://github.com/tvdzwan/hyperion.git "$HYPERION_DIR"
14+
git clone --recursive https://github.com/tvdzwan/hyperion.git "$HYPERION_DIR"
1515

1616
# create and enter the build directory
1717
mkdir "$HYPERION_DIR/build"
@@ -20,7 +20,7 @@ cd "$HYPERION_DIR/build"
2020
# run cmake to generate make files on the rsapberry pi
2121
cmake ..
2222
# or if you are not compiling on the raspberry pi and need to disable the Dispmanx grabber and support for spi devices
23-
cmake -DENABLE_DISPMANX=OFF -DENABLE_SPIDEV=OFF ..
23+
cmake -DENABLE_DISPMANX=OFF -DENABLE_SPIDEV=OFF -DENABLE_X11=ON ..
2424

2525
# run make to build Hyperion
2626
make

CrossCompileHowto.txt

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,43 @@
11
ON RASPBERRY
22
--------------
3-
sudo apt-get install libprotobuf-dev libQt4-dev libusb-1.0-0-dev python-dev rsync
3+
sudo apt-get install libQt4-dev libusb-1.0-0-dev python-dev rsync
44

55
ON HOST
66
---------
77
export RASPI=192.168.1.17
88
export RASCROSS_DIR="$HOME/raspberrypi"
99
export HYPERION_DIR="$HOME/hyperion"
1010

11+
# install required packages
12+
sudo apt-get install git rsync cmake build-essential libQt4-dev libusb-1.0-0-dev python-dev
1113
sudo apt-get install git rsync cmake ia32-libs protobuf-compiler
14+
1215
# On newer version of Ubuntu (and maybe other distros) the ia32-libs is not available, the following
1316
# install solved this for me (TODO: verify what is really required)
1417
sudo apt-get install libc6:i386 libgcc1:i386 gcc-4.6-base:i386 libstdc++5:i386 libstdc++6:i386
1518

19+
# create the rootfs by copying it from an rpi running for example raspbmc
1620
mkdir -p "$RASCROSS_DIR/rootfs"
17-
git clone git://github.com/raspberrypi/tools.git "$RASCROSS_DIR/tools"
21+
rsync -rl --delete-after --safe-links pi@$RASPI:/{lib,usr} "$RASCROSS_DIR/rootfs"
1822

23+
# get the raspberry pi firmware and add it to the rootfs
1924
git clone https://github.com/raspberrypi/firmware.git "$RASCROSS_DIR/firmware"
20-
ln -s "$RASCROSS_DIR/firmware/opt" "$RASCROSS_DIR/rootfs/opt"
25+
ln -s "$RASCROSS_DIR/firmware/hardfp/opt" "$RASCROSS_DIR/rootfs/opt"
2126

22-
rsync -rl --delete-after --safe-links pi@$RASPI:/{lib,usr} "$RASCROSS_DIR/rootfs"
27+
# get the compile tools
28+
git clone git://github.com/raspberrypi/tools.git "$RASCROSS_DIR/tools"
2329

24-
git clone https://github.com/tvdzwan/hyperion.git "$HYPERION_DIR"
25-
mkdir "$HYPERION_DIR/build"
26-
cmake -DCMAKE_TOOLCHAIN_FILE="$HYPERION_DIR/Toolchain-RaspberryPi.cmake" --build "$HYPERION_DIR/build" "$HYPERION_DIR"
30+
# get the Hyperion sources
31+
git clone --recursive https://github.com/tvdzwan/hyperion.git "$HYPERION_DIR"
2732

33+
# do a native build (to build the protobuf compiler for the native platform)
34+
mkdir "$HYPERION_DIR/build"
35+
cmake -DENABLE_DISPMANX=OFF --build "$HYPERION_DIR/build" "$HYPERION_DIR"
2836

37+
# do the rpi build
38+
# specify the protoc export file to import the protobuf compiler from the native build
39+
mkdir "$HYPERION_DIR/build-rpi"
40+
cmake -DCMAKE_TOOLCHAIN_FILE="$HYPERION_DIR/Toolchain-RaspberryPi.cmake" -DIMPORT_PROTOC=$HYPERION_DIR/build/protoc_export.cmake --build "$HYPERION_DIR/build-rpi" "$HYPERION_DIR"
2941

3042
------------------------------------------------------------------------------
3143
These instructions are based on the guide given by:

HyperionConfig.h.in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,11 @@
99
// Define to enable the spi-device
1010
#cmakedefine ENABLE_SPIDEV
1111

12+
// Define to enable the ws2812b-pwm-device
13+
#cmakedefine ENABLE_WS2812BPWM
14+
1215
// Define to enable the spi-device
1316
#cmakedefine ENABLE_TINKERFORGE
17+
18+
// Define to enable PROTOBUF server
19+
#cmakedefine ENABLE_PROTOBUF

Toolchain-RaspberryPi.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ SET(CMAKE_SYSTEM_NAME Linux)
44
SET(CMAKE_SYSTEM_VERSION 1)
55

66
# specify the cross compiler
7-
SET(CMAKE_C_COMPILER ${RASPCROSS_DIR}/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc)
8-
SET(CMAKE_CXX_COMPILER ${RASPCROSS_DIR}/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++)
7+
SET(CMAKE_C_COMPILER ${RASPCROSS_DIR}/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-gcc)
8+
SET(CMAKE_CXX_COMPILER ${RASPCROSS_DIR}/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++)
99

1010
# where is the target environment
1111
SET(CMAKE_FIND_ROOT_PATH ${RASPCROSS_DIR}/rootfs)

cmake/Findlibusb-1.0.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ else (LIBUSB_1_LIBRARIES AND LIBUSB_1_INCLUDE_DIRS)
8787
message(STATUS " - Libraries: ${LIBUSB_1_LIBRARIES}")
8888
endif (NOT libusb_1_FIND_QUIETLY)
8989
else (LIBUSB_1_FOUND)
90+
unset(LIBUSB_1_LIBRARY CACHE)
9091
if (libusb_1_FIND_REQUIRED)
9192
message(FATAL_ERROR "Could not find libusb")
9293
endif (libusb_1_FIND_REQUIRED)

cmake/qt4/Qt4ConfigDependentSettings.cmake

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,16 @@ if(Q_WS_X11)
270270

271271
endif()
272272

273+
if(Q_WS_QWS)
274+
set(CMAKE_THREAD_PREFER_PTHREADS 1)
275+
find_package(Threads)
276+
if(CMAKE_USE_PTHREADS_INIT)
277+
set(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${CMAKE_THREAD_LIBS_INIT})
278+
endif()
279+
280+
set (QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${CMAKE_DL_LIBS})
281+
282+
endif()
273283

274284
if(Q_WS_WIN)
275285
set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} imm32 winmm)

config/hyperion.config.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@
8080
{
8181
"type" : "none",
8282
"time_ms" : 200,
83-
"updateFrequency" : 20.0000
83+
"updateFrequency" : 20.0000,
84+
"updateDelay" : 0
8485
}
8586
},
8687

0 commit comments

Comments
 (0)