pinephone
                Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| pinephone [2020/06/24 12:29] – [Current State] mark | pinephone [2025/05/09 05:29] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| 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 | + | 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, | ||
| + | sudo apt-get install fswebcam | ||
| + | sudo mount /dev/loop0 / -o remount, | ||
| + | </ | ||
| + | |||
| + | And now we are ready to capture: | ||
| + | |||
| + | < | ||
| + | fswebcam --device /dev/video1 --resolution 1280x720 | ||
| + | </ | ||
| + | |||
| + | Using gstreamer, the orientation | ||
| + | |||
| + | 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 | ||
| + | |||
| + | 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). | ||
| + | |||
| + | < | ||
| + | # | ||
| + | |||
| + | 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=/ | ||
| + | </ | ||
| - | OPPS wrong kernel branch!!!!! try again.... | ||
| + | The Custom version of the camera can be found here: {{ :: | ||
| + | And the src is: https:// | ||
| - | === Cross Compile === | + | ===== Cross Compile | 
| https:// | https:// | ||
pinephone.1593001794.txt.gz · Last modified: 2025/05/09 05:28 (external edit)
                
                