pinephone
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
pinephone [2020/06/23 15:29] – [Current State] mark | pinephone [2020/07/15 10:10] – [Camera] mark | ||
---|---|---|---|
Line 57: | Line 57: | ||
- | ==== Kernel ==== | + | ===== Kernel |
The kernel currently used is: | The kernel currently used is: | ||
Line 88: | Line 88: | ||
- | ==== Crust ==== | + | ===== Crust ===== |
The Pinephone uses CRUST to do the power management. | The Pinephone uses CRUST to do the power management. | ||
Line 96: | Line 96: | ||
- | ==== Current State ==== | + | ===== Current State ===== |
The following is not working: | The following is not working: | ||
Line 108: | Line 108: | ||
- | === Vibration motor === | + | ==== Vibration motor ==== |
From https:// | From https:// | ||
Line 143: | Line 143: | ||
- | === Camera === | + | ==== Camera |
- | The camera is a OV6540 and is connected via the sun6i csi interface. | + | The camera is a OV6540 and is connected via the sun6i csi interface. |
- | The PostmarketOS kernel (Pulled in APKBUILD from https:// | ||
- | When this is compared | + | So First we need to enable |
+ | < | ||
+ | CONFIG_V4L2_FLASH_LED_CLASS=m | ||
+ | CONFIG_LEDS_CLASS_FLASH=m | ||
+ | CONFIG_LEDS_BRIGHTNESS_HW_CHANGED=y | ||
+ | CONFIG_LEDS_SGM3140=m | ||
+ | </ | ||
- | The first is that CONFIG_VIDEO_DEV is build into the kernel, | + | Then compile up the kernel |
- | The following is also set on the pmos: | + | Copy these over the PinePhone and install them into the running kernel: |
< | < | ||
- | CONFIG_STAGING_MEDIA=y | + | sudo insmod led-class-flash.ko |
- | CONFIG_VIDEO_SUNXI=y | + | sudo insmod v4l2-flash-led-class.ko |
- | CONFIG_VIDEO_SUNXI_CEDRUS=y | + | sudo insmod leds-sgm3140.ko |
</ | </ | ||
- | None of these are set on the ut kernel. | + | You should now have the /dev/media1 device. |
- | CONFIG_MEDIA_SUPPORT is also set to a module on ut, it exists, but does not load(does not fail to load). May be a dummy module? | + | Next, UT does not have media-ctl, we could use the apt version, however that one is too old. Instead I used: https:// |
- | Interestingly, | + | Download this package and copy just the media-ctl over to the PinePhone. Then setup the media device: |
- | Strangely, if we extract config.gz from the phone, its different to the one used in the kernel!!!! | + | < |
+ | sudo ./media-ctl -d /dev/media1 --set-v4l2 '" | ||
+ | </ | ||
+ | Now we need to check that it all works | ||
+ | |||
+ | Ok, by using fswebcam, we can install this from apt (Note this may be unsafe and could brick the PinePhone......) | ||
+ | |||
+ | < | ||
+ | sudo mount /dev/loop0 / -o remount,rw | ||
+ | sudo apt-get install fswebcam | ||
+ | sudo mount /dev/loop0 / -o remount,ro | ||
+ | </ | ||
+ | |||
+ | And now we are ready to capture: | ||
+ | |||
+ | < | ||
+ | fswebcam --device /dev/video1 --resolution 1280x720 | ||
+ | </ | ||
+ | |||
+ | Using gstreamer, the orientation is wrong. | ||
+ | |||
+ | V4l2Src should implement GstVideoOrientation see https:// | ||
+ | |||
+ | |||
+ | GstVideoOrientation | ||
+ | |||
+ | See | ||
+ | |||
+ | https:// | ||
+ | |||
+ | this is implemented in | ||
+ | |||
+ | https:// | ||
+ | |||
+ | |||
+ | For gst-droid (used on android), https:// | ||
+ | |||
+ | For droidcamsrc: | ||
+ | |||
+ | |||
+ | https:// | ||
+ | |||
+ | |||
+ | So does not look like v4l handles angle | ||
+ | |||
+ | |||
+ | |||
+ | ==== PinePhone Camera ==== | ||
+ | |||
+ | I have created a special version of the Camera app for the Pinephone, this is not the correct solution to the problem, but works for now. | ||
+ | |||
+ | The following script also needs to be run once to setup the media control and video input. It assumes the the non-standard version of media-ctl is available along with the kernel modules (see above). | ||
+ | |||
+ | < | ||
+ | #!/bin/bash | ||
+ | |||
+ | sudo insmod led-class-flash.ko | ||
+ | sudo insmod v4l2-flash-led-class.ko | ||
+ | sudo insmod leds-sgm3140.ko | ||
+ | |||
+ | sudo ./media-ctl -d /dev/media1 --set-v4l2 '" | ||
+ | |||
+ | sudo v4l2-ctl --set-ctrl horizontal_flip=1 --device=/ | ||
+ | sudo v4l2-ctl --set-ctrl vertical_flip=1 --device=/ | ||
+ | </ | ||
- | The actual config file is a lot closer to the pmos one. And nothing seems to suggest a major difference. | ||
+ | The Custom version of the camera can be found here: {{ :: | ||
+ | And the src is: https:// | ||
- | === Cross Compile === | + | ===== Cross Compile |
https:// | https:// |
pinephone.txt · Last modified: 2020/07/21 12:02 by mark