From 0bcd7c0363d8e86cefda851048631d16c9f7f088 Mon Sep 17 00:00:00 2001 From: popoviciri Date: Thu, 15 Aug 2019 12:57:21 +0200 Subject: [PATCH 1/3] patch for python-picamera library to add the new greyworld AWB mode until this PR gets merged: https://github.com/waveform80/picamera/pull/576 --- .../0001-enable-awb-greyworld-mode.patch | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 package/python-picamera/0001-enable-awb-greyworld-mode.patch diff --git a/package/python-picamera/0001-enable-awb-greyworld-mode.patch b/package/python-picamera/0001-enable-awb-greyworld-mode.patch new file mode 100644 index 0000000000..ad99666236 --- /dev/null +++ b/package/python-picamera/0001-enable-awb-greyworld-mode.patch @@ -0,0 +1,27 @@ +diff --git a/picamera/camera.py b/picamera/camera.py +index 36b1202..a7da186 100644 +--- a/picamera/camera.py ++++ b/picamera/camera.py +@@ -274,6 +274,7 @@ class PiCamera(object): + 'incandescent': mmal.MMAL_PARAM_AWBMODE_INCANDESCENT, + 'flash': mmal.MMAL_PARAM_AWBMODE_FLASH, + 'horizon': mmal.MMAL_PARAM_AWBMODE_HORIZON, ++ 'greyworld': mmal.MMAL_PARAM_AWBMODE_GREYWORLD, + } + + IMAGE_EFFECTS = { +diff --git a/picamera/mmal.py b/picamera/mmal.py +index 81b059f..82b2b5f 100644 +--- a/picamera/mmal.py ++++ b/picamera/mmal.py +@@ -692,7 +692,8 @@ MMAL_PARAM_AWBMODE_T = ct.c_uint32 # enum + MMAL_PARAM_AWBMODE_INCANDESCENT, + MMAL_PARAM_AWBMODE_FLASH, + MMAL_PARAM_AWBMODE_HORIZON, +-) = range(10) ++ MMAL_PARAM_AWBMODE_GREYWORLD, ++) = range(11) + MMAL_PARAM_AWBMODE_MAX = 0x7fffffff + + class MMAL_PARAMETER_AWBMODE_T(ct.Structure): + From 73ba459c357baa34ca3c5d3df435281148f63a63 Mon Sep 17 00:00:00 2001 From: popoviciri Date: Thu, 15 Aug 2019 13:01:58 +0200 Subject: [PATCH 2/3] update v4l-utils to 1.16.6 I had the feeling the update included the extra enum in v4l2; it did not! but is a good update nonetheless --- package/libv4l/libv4l.hash | 2 +- package/libv4l/libv4l.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package/libv4l/libv4l.hash b/package/libv4l/libv4l.hash index 231a471b9e..425c33f369 100644 --- a/package/libv4l/libv4l.hash +++ b/package/libv4l/libv4l.hash @@ -1,6 +1,6 @@ # Locally calculated after checking signature # https://linuxtv.org/downloads/v4l-utils/v4l-utils-1.16.3.tar.bz2.asc -sha256 7c5c0d49c130cf65d384f28e9f3a53c5f7d17bf18740c48c40810e0fbbed5b54 v4l-utils-1.16.3.tar.bz2 +sha256 f9dac1878e3d5636eab7f56bb209fdfc66b94ee8a2aae54dcb4282fe63a678ae v4l-utils-1.16.6.tar.bz2 # Locally calculated sha256 391e4da1c54a422a78d83be7bf84b2dfb8bacdd8ad256fa4374e128655584a8a COPYING sha256 5a7f623a50e384aaf6d2ced068339ddf93d0a50d3a0ecbe86f125b07804ecc78 COPYING.libv4l diff --git a/package/libv4l/libv4l.mk b/package/libv4l/libv4l.mk index fe1ffbcf5d..b31d1a4c41 100644 --- a/package/libv4l/libv4l.mk +++ b/package/libv4l/libv4l.mk @@ -4,7 +4,7 @@ # ################################################################################ -LIBV4L_VERSION = 1.16.3 +LIBV4L_VERSION = 1.16.6 LIBV4L_SOURCE = v4l-utils-$(LIBV4L_VERSION).tar.bz2 LIBV4L_SITE = https://linuxtv.org/downloads/v4l-utils LIBV4L_INSTALL_STAGING = YES From 99d1e2534b170d0789d937403156ab0007822f74 Mon Sep 17 00:00:00 2001 From: popoviciri Date: Thu, 15 Aug 2019 21:41:21 +0200 Subject: [PATCH 3/3] patch motion with mmal updates for greyworld AWB mode motion could use a full upgrade of the mmal lib. Tried the last userland files but got stuck at some point. Compiling error I couldn't fix. Will be waiting for someone capable of doing this. --- .../motion/0001-enable-awb-greyworld.patch | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 package/motion/0001-enable-awb-greyworld.patch diff --git a/package/motion/0001-enable-awb-greyworld.patch b/package/motion/0001-enable-awb-greyworld.patch new file mode 100644 index 0000000000..1fcb219f69 --- /dev/null +++ b/package/motion/0001-enable-awb-greyworld.patch @@ -0,0 +1,35 @@ +diff --git a/raspicam/RaspiCamControl.c b/raspicam/RaspiCamControl.c +index 073d657..ad0e405 100644 +--- a/raspicam/RaspiCamControl.c ++++ b/raspicam/RaspiCamControl.c +@@ -73,7 +73,8 @@ static XREF_T awb_map[] = + {"fluorescent", MMAL_PARAM_AWBMODE_FLUORESCENT}, + {"incandescent", MMAL_PARAM_AWBMODE_INCANDESCENT}, + {"flash", MMAL_PARAM_AWBMODE_FLASH}, +- {"horizon", MMAL_PARAM_AWBMODE_HORIZON} ++ {"horizon", MMAL_PARAM_AWBMODE_HORIZON}, ++ {"greyworld", MMAL_PARAM_AWBMODE_GREYWORLD} + }; + + static const int awb_map_size = sizeof(awb_map) / sizeof(awb_map[0]); +@@ -1196,6 +1197,7 @@ int raspicamcontrol_set_exposure_mode(MMAL_COMPONENT_T *camera, MMAL_PARAM_EXPOS + * - MMAL_PARAM_AWBMODE_INCANDESCENT, + * - MMAL_PARAM_AWBMODE_FLASH, + * - MMAL_PARAM_AWBMODE_HORIZON, ++ * - MMAL_PARAM_AWBMODE_GREYWORLD, + * @return 0 if successful, non-zero if any parameters out of range + */ + int raspicamcontrol_set_awb_mode(MMAL_COMPONENT_T *camera, MMAL_PARAM_AWBMODE_T awb_mode) +diff --git a/raspicam/RaspiCamControl.h b/raspicam/RaspiCamControl.h +index f4c189a..e7a847f 100644 +--- a/raspicam/RaspiCamControl.h ++++ b/raspicam/RaspiCamControl.h +@@ -57,6 +57,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + MMAL_PARAM_AWBMODE_INCANDESCENT, + MMAL_PARAM_AWBMODE_FLASH, + MMAL_PARAM_AWBMODE_HORIZON, ++ MMAL_PARAM_AWBMODE_GREYWORLD, + * + * Image FX + MMAL_PARAM_IMAGEFX_NONE, +