pinephone
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
pinephone [2020/07/01 10:06] – [Current State] mark | pinephone [2020/07/21 12:02] (current) – mark | ||
---|---|---|---|
Line 56: | Line 56: | ||
+ | ===== Changelog ===== | ||
- | ==== Kernel ==== | + | There is no official changelog, |
+ | |||
+ | https:// | ||
+ | |||
+ | |||
+ | ===== Kernel | ||
The kernel currently used is: | The kernel currently used is: | ||
Line 88: | Line 94: | ||
- | ==== Crust ==== | + | ===== Crust ===== |
The Pinephone uses CRUST to do the power management. | The Pinephone uses CRUST to do the power management. | ||
Line 96: | Line 102: | ||
- | ==== Current State ==== | + | ===== Current State ===== |
The following is not working: | The following is not working: | ||
Line 108: | Line 114: | ||
- | === Vibration motor === | + | ==== Vibration motor ==== |
From https:// | From https:// | ||
Line 143: | Line 149: | ||
- | === 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 | ||
- | The actual config file is a lot closer to the pmos one. And nothing seems to suggest a major difference. | + | Ok, by using fswebcam, we can install this from apt (Note this may be unsafe and could brick the PinePhone......) |
- | OPPS wrong kernel branch!!!!! try again.... | + | < |
+ | sudo mount /dev/loop0 / -o remount, | ||
+ | sudo apt-get install fswebcam | ||
+ | sudo mount /dev/loop0 / -o remount, | ||
+ | </ | ||
+ | And now we are ready to capture: | ||
+ | < | ||
+ | fswebcam --device /dev/video1 --resolution 1280x720 | ||
+ | </ | ||
- | ok, after some help, it looks like the device tree is not complete. The Flash LED driver is not available so the DTS fails. | + | Using gstreamer, the orientation |
- | To enable | + | V4l2Src should implement GstVideoOrientation see https:// |
- | < | + | |
- | CONFIG_V4L2_FLASH_LED_CLASS=m | + | GstVideoOrientation |
- | CONFIG_LEDS_CLASS_FLASH=m | + | |
- | CONFIG_LEDS_BRIGHTNESS_HW_CHANGED=y | + | See |
- | CONFIG_LEDS_SGM3140=m | + | |
- | </code> | + | 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 led-class-flash.ko | ||
sudo insmod v4l2-flash-led-class.ko | sudo insmod v4l2-flash-led-class.ko | ||
- | |||
sudo insmod leds-sgm3140.ko | sudo insmod leds-sgm3140.ko | ||
- | sudo insmod | + | 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=/ | ||
</ | </ | ||
- | === Cross Compile === | + | The Custom version of the camera can be found here: {{ :: |
+ | |||
+ | And the src is: https:// | ||
+ | |||
+ | ===== Cross Compile | ||
https:// | https:// |
pinephone.txt · Last modified: 2020/07/21 12:02 by mark