Add custom configuration for pinephone pro camera.

This commit is contained in:
2023-01-19 10:48:22 +13:00
parent 44a39a9544
commit be32f35315

View File

@ -202,3 +202,29 @@ EOF
Done! You now have a custom app in the launcher to control your remote device access 😎
** Custom camera application
The pinephone pro generally uses the [[https://gitlab.com/postmarketOS/megapixels][megapixels]] application for users interacting with the front and rear cameras.
This works out of the box on the original pinephone, however for the pinephone pro a custom build of megapixels is required:
Run the code block below to clone, compile and install the custom megapixels build:
#+NAME: Compile and install custom megapixels
#+begin_src tmate
git clone https://github.com/kgmt0/megapixels -b linux-megi-6.1 && cd megapixels && wget http://deb.debian.org/debian/pool/main/m/megapixels/megapixels_1.6.0-1.debian.tar.xz && tar -xvf megapixels_1.6.0-1.debian.tar.xz && sudo apt build-dep . && dpkg-buildpackage -b -rfakeroot -us -uc && cd .. && sudo dpkg -i megapixels_1.6.0-1_arm64.deb
#+end_src
Once the custom megapixels build is installed and the phone has been rebooted the megapixels app will launch successfully and take photos, however these will be washed out with a green color.
To fix this we can update the script the megapixels app uses to postprocess images that are taken, refer [[https://forum.pine64.org/showthread.php?tid=17711&pid=115439#pid115439][here]]. Run the block below to address this:
#+NAME: Update post processing script
#+begin_src tmate
sudo cp /usr/share/megapixels/postprocess.sh /usr/share/megapixels/postprocess.sh.bak
sudo sed -i 's/$DCRAW +M -H 4 -o 1 -q 3 -T "$@" "$MAIN_PICTURE.dng"/$DCRAW +M -H 4 -o 1 -q 3 -n 300 -a -m 0 -g 2.4 12.92 -b 1.0 -T "$@" "$MAIN_PICTURE.dng"./' /usr/share/megapixels/postprocess.sh
#+end_src