Skip to content

Commit

Permalink
Merge pull request #66 from hao-yao/main
Browse files Browse the repository at this point in the history
Engineer release on 2023-08-07
  • Loading branch information
hao-yao authored Aug 10, 2023
2 parents 884b81a + 9c8b13e commit 0fbfca6
Show file tree
Hide file tree
Showing 341 changed files with 76,819 additions and 2,273 deletions.
115 changes: 31 additions & 84 deletions .github/workflows/build-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,97 +8,44 @@ on:
pull_request:

jobs:
build-ipu6ep-on-ubuntu-2204:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v2

- name: Build for ipu6ep
run: |
echo "APT::Get::Always-Include-Phased-Updates True;" | sudo tee -a /etc/apt/apt.conf
sudo apt-get update -q -q
sudo apt-get install git cmake libexpat-dev automake libtool libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libunwind-dev --yes
git clone https://github.com/intel/ipu6-camera-bins -b main --depth 1
sudo cp -rv ipu6-camera-bins/ipu6ep/include/* /usr/include/
sudo cp -rv ipu6-camera-bins/ipu6ep/lib/* /usr/lib/
rm -fr ipu6-camera-bins
mkdir -p ./build/out/install/usr && cd ./build/
cmake -DCMAKE_BUILD_TYPE=Release \
-DIPU_VER=ipu6ep \
-DENABLE_VIRTUAL_IPU_PIPE=OFF \
-DUSE_PG_LITE_PIPE=ON \
-DUSE_STATIC_GRAPH=OFF \
-DCMAKE_INSTALL_PREFIX=/usr ..
make
sudo make install
build-ipu6-on-ubuntu-2204:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v2

- name: Build for ipu6
run: |
echo "APT::Get::Always-Include-Phased-Updates True;" | sudo tee -a /etc/apt/apt.conf
sudo apt-get update -q -q
sudo apt-get install git cmake libexpat-dev automake libtool libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libunwind-dev --yes
git clone https://github.com/intel/ipu6-camera-bins -b main --depth 1
sudo cp -rv ipu6-camera-bins/ipu6/include/* /usr/include/
sudo cp -rv ipu6-camera-bins/ipu6/lib/* /usr/lib/
rm -fr ipu6-camera-bins
mkdir -p ./build/out/install/usr && cd ./build/
cmake -DCMAKE_BUILD_TYPE=Release \
-DIPU_VER=ipu6 \
-DENABLE_VIRTUAL_IPU_PIPE=OFF \
-DUSE_PG_LITE_PIPE=ON \
-DUSE_STATIC_GRAPH=OFF \
-DCMAKE_INSTALL_PREFIX=/usr ..
make
sudo make install
build-ipu6ep-on-ubuntu-2004:
runs-on: ubuntu-20.04

runs-on: ubuntu-latest
container: ubuntu:22.04
steps:
- uses: actions/checkout@v2

- name: Build for ipu6ep
- uses: actions/checkout@v3
- name: Build on Ubuntu 22.04
run: |
sudo apt-get update -q -q
sudo apt-get install git cmake libexpat-dev automake libtool libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev --yes
echo 'APT::Get::Always-Include-Phased-Updates True;' | tee -a /etc/apt/apt.conf
echo 'Acquire::http::User-Agent-Non-Interactive "true";' | tee -a /etc/apt/apt.conf
apt-get update -q
echo "" | apt-get install git build-essential cmake libexpat-dev automake libtool libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libunwind-dev --yes
git clone https://github.com/intel/ipu6-camera-bins -b main --depth 1
sudo cp -rv ipu6-camera-bins/ipu6ep/include/* /usr/include/
sudo cp -rv ipu6-camera-bins/ipu6ep/lib/* /usr/lib/
cp -rv ipu6-camera-bins/include/* /usr/include/
cp -rv ipu6-camera-bins/lib/* /usr/lib/
rm -fr ipu6-camera-bins
mkdir -p ./build/out/install/usr && cd ./build/
cmake -DCMAKE_BUILD_TYPE=Release \
-DIPU_VER=ipu6ep \
-DENABLE_VIRTUAL_IPU_PIPE=OFF \
-DUSE_PG_LITE_PIPE=ON \
-DUSE_STATIC_GRAPH=OFF \
-DCMAKE_INSTALL_PREFIX=/usr ..
make
sudo make install
git clone https://github.com/intel/icamerasrc.git -b icamerasrc_slim_api ../icamerasrc --depth 1
./build.sh -s ${PWD}/.. -i ${PWD}/out --board ipu_tgl ipu_adl ipu_mtl
cp -rv ./out/install/include/* /usr/include
cp -rv ./out/install/lib/* /usr/lib
cp -rv ./out/install/share/* /usr/share
build-ipu6-on-ubuntu-2004:
runs-on: ubuntu-20.04

runs-on: ubuntu-latest
container: ubuntu:20.04
steps:
- uses: actions/checkout@v2

- name: Build for ipu6
- uses: actions/checkout@v3
- name: Build on Ubuntu 20.04
run: |
sudo apt-get update -q -q
sudo apt-get install git cmake libexpat-dev automake libtool libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev --yes
echo 'Acquire::http::User-Agent-Non-Interactive "true";' | tee -a /etc/apt/apt.conf
apt-get update -q
export TZ=Asia/Shanghai
echo "" | apt-get install -qy tzdata
echo "" | apt-get install git build-essential cmake libexpat-dev automake libtool libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libdrm-dev --yes
git clone https://github.com/intel/ipu6-camera-bins -b main --depth 1
sudo cp -rv ipu6-camera-bins/ipu6/include/* /usr/include/
sudo cp -rv ipu6-camera-bins/ipu6/lib/* /usr/lib/
cp -rv ipu6-camera-bins/include/* /usr/include/
cp -rv ipu6-camera-bins/lib/* /usr/lib/
rm -fr ipu6-camera-bins
mkdir -p ./build/out/install/usr && cd ./build/
cmake -DCMAKE_BUILD_TYPE=Release \
-DIPU_VER=ipu6 \
-DENABLE_VIRTUAL_IPU_PIPE=OFF \
-DUSE_PG_LITE_PIPE=ON \
-DUSE_STATIC_GRAPH=OFF \
-DCMAKE_INSTALL_PREFIX=/usr ..
make
sudo make install
git clone https://github.com/intel/icamerasrc.git -b icamerasrc_slim_api ../icamerasrc --depth 1
./build.sh -s ${PWD}/.. -i ${PWD}/out --board ipu_tgl ipu_adl ipu_mtl
cp -rv ./out/install/include/* /usr/include
cp -rv ./out/install/lib/* /usr/lib
cp -rv ./out/install/share/* /usr/share
72 changes: 24 additions & 48 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (C) 2017-2022 Intel Corporation
# Copyright (C) 2017-2023 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -253,6 +253,13 @@ else()
endif()

add_library(camhal_static STATIC ${LIBCAMHAL_SRCS})

if (NOT CAL_BUILD AND (NOT "${CMAKE_INSTALL_SUB_PATH}" STREQUAL ""))
set(CMAKE_SKIP_RPATH TRUE)
set_target_properties(camhal PROPERTIES LINK_FLAGS
"-Wl,-rpath,/usr/lib/${CMAKE_INSTALL_SUB_PATH}")
add_compile_definitions(SUB_CONFIG_PATH="${CMAKE_INSTALL_SUB_PATH}")
endif()
set_target_properties(camhal_static PROPERTIES OUTPUT_NAME "camhal")

#---------------------------- Link settings ----------------------------
Expand Down Expand Up @@ -375,68 +382,37 @@ endif() #ENABLE_SANDBOXING
#--------------------------- Install settings ---------------------------
if (NOT CAL_BUILD)
# Install headers
install(DIRECTORY include/ DESTINATION include/libcamhal)
if (SUPPORT_LIVE_TUNING)
install(FILES modules/livetune/LiveTuning.h DESTINATION include/libcamhal/api)
endif() #SUPPORT_LIVE_TUNING
if ("${CMAKE_INSTALL_SUB_PATH}" STREQUAL "")
install(DIRECTORY include/ DESTINATION include/libcamhal)
if (SUPPORT_LIVE_TUNING)
install(FILES modules/livetune/LiveTuning.h DESTINATION include/libcamhal/api)
endif() #SUPPORT_LIVE_TUNING
endif()

# Install configure files
# By default ipu4 is used
if("${IPU_VER}" STREQUAL "ipu6")
if("${PRODUCTION_NAME}" STREQUAL "Andrews")
message("Install TGL Andrews configure files")
install(DIRECTORY config/ubuntu/tgl/ DESTINATION share/defaults/etc/camera)
else()
message("Install TGL IPU6 configure files")
install(DIRECTORY config/linux/ipu6/ DESTINATION share/defaults/etc/camera)
endif()
elseif("${IPU_VER}" STREQUAL "ipu6ep")
if("${PRODUCTION_NAME}" STREQUAL "ccg_platform")
message("Install ADL Platform configure files")
install(DIRECTORY config/ubuntu/adl/ DESTINATION share/defaults/etc/camera)
elseif("${PRODUCTION_NAME}" STREQUAL "Tributo")
message("Install ADL Tributo configure files")
install(DIRECTORY config/ubuntu/adl/ DESTINATION share/defaults/etc/camera)
else()
message("Install ADL IPU6EP configure files")
install(DIRECTORY config/linux/ipu6ep/ DESTINATION share/defaults/etc/camera)
endif()
elseif("${IPU_VER}" STREQUAL "ipu6epmtl")
if("${PRODUCTION_NAME}" STREQUAL "mtl-ubuntu")
message("Install MTL ubuntu configure files")
install(DIRECTORY config/ubuntu/mtl/ DESTINATION share/defaults/etc/camera)
elseif("${PRODUCTION_NAME}" STREQUAL "mtl-iotg")
message("Install MTL iotg configure files")
install(DIRECTORY config/linux/ipu6ep/ DESTINATION share/defaults/etc/camera)
else()
message("Install MTL configure files")
install(DIRECTORY config/linux/ipu6ep/ DESTINATION share/defaults/etc/camera)
endif()
elseif("${IPU_VER}" STREQUAL "ipu6sepla")
if("${PRODUCTION_NAME}" STREQUAL "penguin_peak")
message("Install JSL penguin peak configure files")
install(DIRECTORY config/ubuntu/jsl/ DESTINATION share/defaults/etc/camera)
endif()
# Install configure files, by default ipu4 is used
if(("${IPU_VER}" STREQUAL "") OR ("${IPU_VER}" STREQUAL "ipu4"))
message("Install camera configure files for ipu4")
install(DIRECTORY config/linux/ipu4/ DESTINATION share/defaults/etc/camera/${CMAKE_INSTALL_SUB_PATH})
else()
message("Install APL IPU4 configure files")
install(DIRECTORY config/linux/ipu4/ DESTINATION share/defaults/etc/camera)
message("Install camera configure files for" ${IPU_VER})
install(DIRECTORY config/linux/${IPU_VER}/ DESTINATION share/defaults/etc/camera/${CMAKE_INSTALL_SUB_PATH})
endif()

# Install libraries
if (${CMAKE_VERSION} VERSION_LESS 3.11)
install(TARGETS camhal camhal_static
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib/${CMAKE_INSTALL_SUB_PATH}
ARCHIVE DESTINATION lib/${CMAKE_INSTALL_SUB_PATH}
)
else()
install(TARGETS camhal camhal_static)
install(TARGETS camhal camhal_static DESTINATION lib/${CMAKE_INSTALL_SUB_PATH})
endif()

# Install package config file
configure_file(${PROJECT_SOURCE_DIR}/cmake/libcamhal.pc.cmakein
${PROJECT_SOURCE_DIR}/libcamhal.pc @ONLY)
install(FILES libcamhal.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
DESTINATION ${CMAKE_INSTALL_LIBDIR}/${CMAKE_INSTALL_SUB_PATH}/pkgconfig)

endif() #NOT CAL_BUILD

Expand Down
123 changes: 22 additions & 101 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# ipu6-camera-hal

This repository supports MIPI cameras through the IPU6 on Intel Tiger Lake and
Alder Lake platforms. There are 4 repositories that provide the complete setup:
This repository supports MIPI cameras through the IPU6 on Intel Tiger Lake, Alder Lake, Raptor Lake and Meteor Lake platforms.
There are 4 repositories that provide the complete setup:

- https://github.com/intel/ipu6-drivers - kernel drivers for the IPU and sensors
- https://github.com/intel/ipu6-camera-bins - IPU firmware and proprietary image processing libraries
Expand All @@ -13,108 +13,29 @@ Alder Lake platforms. There are 4 repositories that provide the complete setup:

## Build instructions:
- Dependencies: ipu6-camera-bins
- Dependencies: libexpat-dev automake libtool libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
- For cameras supporting privacy mode (ov01a1s, ov02c10, ov2740), add a dummy image for it:
```shell
cd config/linux/ipu6ep
ffmpeg -i <input_file> -pix_fmt nv12 privacy_image_<sensor_name>-uf_<width>_<height>.yuv
```
- Build and install:

1. Set IPU6 version and product name for build
- For Tiger Lake, set:
```shell
IPU6_VER=ipu6
```

- For Alder Lake, set:
```shell
IPU6_VER=ipu6ep
```

2. Then continue:
```shell
cd ipu6-camera-hal
mkdir -p ./build/out/install/usr && cd ./build/
cmake -DCMAKE_BUILD_TYPE=Release \
-DIPU_VER=${IPU6_VER} \
-DENABLE_VIRTUAL_IPU_PIPE=OFF \
-DUSE_PG_LITE_PIPE=ON \
-DUSE_STATIC_GRAPH=OFF \
-DCMAKE_INSTALL_PREFIX=/usr ..
# if don't want install to /usr, use -DCMAKE_INSTALL_PREFIX=./out/install/usr, export PKG_CONFIG_PATH="$workdir/build/out/install/usr/lib/pkgconfig"
Please follow https://github.com/intel/ipu6-camera-bins README to install.

make -j`nproc`
sudo make install
```

3. Move user space driver for different platforms **(if you build for either ipu6-only or ipu6ep-only support, skip this step)**:
```shell
mkdir /usr/lib/${IPU6_VER}
mkdir /usr/share/defaults/etc/${IPU6_VER}
- Dependencies: libexpat-dev automake libtool libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev

mv /usr/lib/libtbd.so.0.0.0 /usr/lib/${IPU6_VER}/libtbd.so.0.0.0
mv /usr/lib/libSkyCamAIC.so /usr/lib/${IPU6_VER}/libSkyCamAIC.so
mv /usr/lib/libSkyCamAICKBL.so /usr/lib/${IPU6_VER}/libSkyCamAICKBL.so
mv /usr/lib/libStatsConverter.so /usr/lib/${IPU6_VER}/libStatsConverter.so
mv /usr/lib/libbroxton_ia_pal.so /usr/lib/${IPU6_VER}/libbroxton_ia_pal.so
mv /usr/lib/libia_aec.so /usr/lib/${IPU6_VER}/libia_aec.so
mv /usr/lib/libia_aic.so /usr/lib/${IPU6_VER}/libia_aic.so
mv /usr/lib/libia_aic_engine.so /usr/lib/${IPU6_VER}/libia_aic_engine.so
mv /usr/lib/libia_aic_myriad.so /usr/lib/${IPU6_VER}/libia_aic_myriad.so
mv /usr/lib/libia_aiq.so /usr/lib/${IPU6_VER}/libia_aiq.so
mv /usr/lib/libia_aiq_file_debug.so /usr/lib/${IPU6_VER}/libia_aiq_file_debug.so
mv /usr/lib/libia_aiqb_parser.so /usr/lib/${IPU6_VER}/libia_aiqb_parser.so
mv /usr/lib/libia_bcomp.so /usr/lib/${IPU6_VER}/libia_bcomp.so
mv /usr/lib/libia_cca.so /usr/lib/${IPU6_VER}/libia_cca.so
mv /usr/lib/libia_cca_file_debug.so /usr/lib/${IPU6_VER}/libia_cca_file_debug.so
mv /usr/lib/libia_ccat.so /usr/lib/${IPU6_VER}/libia_ccat.so
mv /usr/lib/libia_cmc_parser.so /usr/lib/${IPU6_VER}/libia_cmc_parser.so
mv /usr/lib/libia_coordinate.so /usr/lib/${IPU6_VER}/libia_coordinate.so
mv /usr/lib/libia_dpc.so /usr/lib/${IPU6_VER}/libia_dpc.so
mv /usr/lib/libia_dvs.so /usr/lib/${IPU6_VER}/libia_dvs.so
mv /usr/lib/libia_dvs_file_debug.so /usr/lib/${IPU6_VER}/libia_dvs_file_debug.so
mv /usr/lib/libia_emd_decoder.so /usr/lib/${IPU6_VER}/libia_emd_decoder.so
mv /usr/lib/libia_exc.so /usr/lib/${IPU6_VER}/libia_exc.so
mv /usr/lib/libia_intrinsics.so /usr/lib/${IPU6_VER}/libia_intrinsics.so
mv /usr/lib/libia_isp_bxt.so /usr/lib/${IPU6_VER}/libia_isp_bxt.so
mv /usr/lib/libia_isp_bxt_file_debug.so /usr/lib/${IPU6_VER}/libia_isp_bxt_file_debug.so
mv /usr/lib/libia_lard.so /usr/lib/${IPU6_VER}/libia_lard.so
mv /usr/lib/libia_log.so /usr/lib/${IPU6_VER}/libia_log.so
mv /usr/lib/libia_ltm.so /usr/lib/${IPU6_VER}/libia_ltm.so
mv /usr/lib/libia_ltm_file_debug.so /usr/lib/${IPU6_VER}/libia_ltm_file_debug.so
mv /usr/lib/libia_me_corner.so /usr/lib/${IPU6_VER}/libia_me_corner.so
mv /usr/lib/libia_mkn.so /usr/lib/${IPU6_VER}/libia_mkn.so
mv /usr/lib/libia_nvm.so /usr/lib/${IPU6_VER}/libia_nvm.so
mv /usr/lib/libia_ob.so /usr/lib/${IPU6_VER}/libia_ob.so
mv /usr/lib/libia_pd.so /usr/lib/${IPU6_VER}/libia_pd.so
mv /usr/lib/libia_view.so /usr/lib/${IPU6_VER}/libia_view.so
mv /usr/lib/libpvl_blink_detection.so /usr/lib/${IPU6_VER}/libpvl_blink_detection.so
mv /usr/lib/libpvl_eye_detection.so /usr/lib/${IPU6_VER}/libpvl_eye_detection.so
mv /usr/lib/libpvl_face_detection.so /usr/lib/${IPU6_VER}/libpvl_face_detection.so
mv /usr/lib/libpvl_face_recognition.so /usr/lib/${IPU6_VER}/libpvl_face_recognition.so
mv /usr/lib/libpvl_mouth_detection.so /usr/lib/${IPU6_VER}/libpvl_mouth_detection.so
mv /usr/lib/libpvl_object_tracking.so /usr/lib/${IPU6_VER}/libpvl_object_tracking.so
mv /usr/lib/libpvl_smile_detection.so /usr/lib/${IPU6_VER}/libpvl_smile_detection.so
mv /usr/lib/libcisu.so.0.0.0 /usr/lib/${IPU6_VER}/libcisu.so.0.0.0
mv /usr/lib/libcisu_os_plugin.so.1.0.0 /usr/lib/${IPU6_VER}/libcisu_os_plugin.so.1.0.0
mv /usr/lib/libgcss.so.0.0.0 /usr/lib/${IPU6_VER}/libgcss.so.0.0.0
mv /usr/lib/libia_camera.so.0.0.0 /usr/lib/${IPU6_VER}/libia_camera.so.0.0.0
mv /usr/lib/libia_cipf.so.0.0.0 /usr/lib/${IPU6_VER}/libia_cipf.so.0.0.0
mv /usr/lib/libcamhal.so /usr/lib/${IPU6_VER}/libcamhal.so
mv /usr/share/defaults/etc/camera /usr/share/defaults/etc/${IPU6_VER}/
- Build and install:
Recommend to build together with icamerasrc and using `build.sh` in this repo.
1. Put ipu6-camera-hal, icameasrc and build.sh parallel as below:
```

4. Copy ipu6-camera-hal/config/linux/rules.d/*.rules to /lib/udev/rules.d/:
```shell
cp ../config/linux/rules.d/*.rules /lib/udev/rules.d/
cp build.sh .. && cd ..
# work
# ├── build.sh
# ├── icamerasrc
# ├── ipu6-camera-hal
# └── out
```

5. Reboot to make udev rules take effect.
2. In `work` folder, run `./build.sh`. Output binaries will be in `out/install`. (RPM build is not implemented yet)

3. Install contents in `out/install` to your `/usr`:
```sh
sudo cp -r ./out/install/include/* /usr/include
sudo cp -r ./out/install/lib/* /usr/lib
sudo cp -r ./out/install/share/* /usr/share
```

## Tagged for removal:
The folder icamerasrc contains a gst plugin. This has been moved to https://github.com/intel/icamerasrc and will eventually be removed.
For more building details please reference the `build.sh`.
Loading

0 comments on commit 0fbfca6

Please sign in to comment.