-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
After upgrade to the latest firmware, images from Pi Noir V2 now purple on Pi Zero W #1167
Comments
As per https://www.raspberrypi.org/forums/viewtopic.php?f=43&t=241633, the AWB algorithm was updated a month ago. |
Thanks a lot! So I just ran it now (night time here) with my IR light, the results are now B&W, rather than purple :) I'll run it again tomorrow daytime, but it looks like that fixed it! Thanks a lot! |
That's a workaround rather than the fix. I've reported it to the guys who wrote the new algorithm. It's a curious one, and I suspect that even the old algorithm is giving up on it, but it then drops back to the simpler greyworld scheme which is likely to give you more sane mono pictures. |
Gotcha thanks a lot. During daytime, the images now look like the non-purple version above again with the workaround. |
Had the same problem on Pi Zero + Buster + MotionEye. Running the suggested workaround fixes the problem, but seems to need running after every reboot, but after stopping the camera that MotionEye has auto started at reboot. |
@Pi-DD I created a systemd service that runs it for me:
|
Thank you! |
See: raspberrypi/firmware#1167 firmware: arm_loader: Support CLOCK_EMMC2 from GET_CLOCK_RATE See: raspberrypi/firmware#1179 firmware: arm_loader: Force word alignment for the DTB See: raspberrypi/firmware#1175 firmware: clock_2711: don't set reserved values for KA in PLL KAIP registers firmware: Assorted minor fixes for tvservice -o
Latest rpi-update firmware has a potential fix to the new AWB scheme. Can you test it? |
@anfractuosity can you report output of |
Sure:
|
@anfractuosity, could you provide some more details please?
|
Sure, github didn't like me attaching the files (15MB each), but I've added a link below instead: https://www.anfractuosity.com/files/hack.jpg - taken after the 'sudo vcdbg set awb_mode 0' trick Both images were taken with --raw. Hope that helps. Both images where taken minutes after each other. It's from daytime, under typical British weather ;) (rain and cloud). It's not IR illuminated at the moment. |
Thank you for the images. We think we have identified why this may be happening - summary is that the algorithm searches along the colour temperature curve measured for the standard camera and is (correctly) restricted from moving too far off from there. We will need to discuss how to fix this correctly for the NoIR case. Until then, could you please run with the |
I am having the same issue. I assume doing |
Have realised that commands just changes the way white balance is calculated. Must be something else going wrong with my setup! (running that command does remove the pink glow though). Only just got the PI camera, so had nothing to compare it against |
|
just adding my 2 cents..
|
@2sec - thanks for that - I wondered what had happened when, following kernel updates yesterday I got the “purple image problem” on Stretch remote device (that had not had it before) and which then froze when I tried to fix it. Fortunately I can get to it and restart it and then add the system service suggested above to force the old AWB algorithm. |
@anfractuosity - I would appreciate some guidance on implementing your systemd service. I had not needed it up until the latest Stretch updates over the weekend have introduced the "purple haze" problem. Not having done anything like that before I have tried to read up on this and make it work, but am obviously missing something! I have placed the file in /etc/systemd/system as other material seemed to guide me and have enabled it. Jul 15 19:54:46 DDhomepi5 systemd[1]: [/etc/systemd/system/AWB.service:11] Executable path is not absolute, ignoring: vcdb ~ ` Inexperience showing through here, but help much appreciated. Thanks |
@popcornmix - thank you, I can see you are trying to help, but with my (rather limited!) level of skill and knowledge I have no idea what to do about what you are pointing me to! |
@popcornmix I just tried the latest firmware Jul 15 2019 17:36:28 And attached two pictures taken just now under IR light:
@Pi-DD Try this instead maybe, although the version I listed did work for me:
sudo systemctl enable AWB |
@anfractuosity - many thanks for that, perfect! Worked first time. No idea why the original did not, but now working perfectly from boot to use the old algorithm. |
A new firmware has been released (use To use this new awb mode, you will need to update the raspicam binaries with a patch - see here Until this is fully merged you will have to build the binaries manually. Once you have done that, run |
no problem, my tower melted down from the upgrade, so did I, I found a way to fix it, my apologies-
…________________________________
From: Phil Elwell <[email protected]>
Sent: Sunday, November 24, 2019 1:04 PM
To: raspberrypi/firmware <[email protected]>
Cc: Jessica Woods <[email protected]>; Comment <[email protected]>
Subject: Re: [raspberrypi/firmware] After upgrade to the latest firmware, images from Pi Noir V2 now purple on Pi Zero W (#1167)
@JessicaWoods03<https://github.com/JessicaWoods03> Abuse will not be tolerated. Your message has deleted. Further offences will result in blocking.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#1167?email_source=notifications&email_token=ALSSROGDOYAPNY3YGNB5NALQVLT7JA5CNFSM4H4M3WR2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFAU3NI#issuecomment-557927861>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ALSSROA5DR2B3D7CWXQKTOTQVLT7JANCNFSM4H4M3WRQ>.
|
So I did the fix- and it fixed- but somehow all of these are temp fixes- I did the awb_mode- IDK if its another upgrade messup- for 2020? Anyone else's camera took a crap this year? Need some help on this- |
I have a Pi 3B+ I had a hard time finding software support for the pi4- so I went with my old pi- |
@JessicaWoods03, could you post a detailed explanation of your problem to the Raspberry Pi camera forums please? You can find it at https://www.raspberrypi.org/forums/viewforum.php?f=43. As far as we know, there are no known issues with awb_mode=greyworld on Pi4 and this githhub issues will remain closed. |
Has any recent kernel update removed the ability to run the vcdbg “fix” to go back to the old AWB version? I ask because everything indicates that my AWB.service runs successfully, but I am now getting the purple effect again. |
Yeah mine too- I am rerunning the vcdbg "fix" once before last year and it fixed it- and it went back to purple- Just this year recently with the latest updates- |
You should not be using the vcdbg command to fix this, we introduced a new AWB mode parameter, greyworld, that should fix it correctly. For example, raspistill --awb greyworld -o fred.fpg The MMAL parameter is MMAL_PARAM_AWBMODE_GREYWORLD. |
Note, this should only be necessary for the NoIR camera. |
James - in my case the problem is that I don’t feel competent to install Motion from a tar file and the setup I am using needs the latest level of Motion (4.3.0) that supports “greyworld” to pass the the parameter to the camera. It’s not yet available as a deb file. But just to be entirely clear - am I correct that the “fix” no longer works since grey world was introduced? |
Quick look at the code and I cannot see any immediate reason why it would not work, would need to spend longer trying to figure it out and don't have time right now, especially since the vcdbg was very much a nasty hack for testing purposes whilst we implemented the correct fix, so should not be relied upon. |
James your awesome!! Thanks for helping us out :) |
@JessicaWoods03, could you please post a log captured with:
After running and stopping your camera application please? As @JamesH65 mentioned, this bit of code has not been touched in a while, so I am also a bit surprised that it has now broken. |
Yeah I can...give me a second...its a bit of a mess right now- I unplugged it...just called it a loss. This was a new issue I am sure no one expected to deal with- |
Thanks a lot. I used my Pi after 1year and found everything was pink. At first, Thought my cam had got some hardware issues. This answer solved my issue. |
FYI I've merged a further firmware change for those who can't update their userspace apps. Once it is released, if you add |
kernel: Reduce noise from rpi poe hat fan See: raspberrypi/linux#3493 kernel: ARM: dts: bcm271x: Use a53 pmu, drop RPI364 See: raspberrypi/linux#3508 firmware: isp component: rtos_common_mem: Fix smallalloc test in mem_handle_acquire_if_valid firmware: platform: 2711: Make chicken-bit pip size vary with pmic quantum firmware: USB device boot for CM4 firmware: arm_loader: Add SET_LAUNCH_VPU1 mailbox message firmware: il: camera: Add config.txt param awb_auto_is_greyworld for NoIR camera See: #1167 firmware: arm_loader: Provisional support for high peris firmware: arm_loader: Only add margins to cmdline if non-zero firmware: clock: Support clock_measure_pll on pi0-3 firmware: platform: Back to CLOCK_PLL_CHAN_CPER for emmc on pi0-3
kernel: Reduce noise from rpi poe hat fan See: raspberrypi/linux#3493 kernel: ARM: dts: bcm271x: Use a53 pmu, drop RPI364 See: raspberrypi/linux#3508 firmware: isp component: rtos_common_mem: Fix smallalloc test in mem_handle_acquire_if_valid firmware: platform: 2711: Make chicken-bit pip size vary with pmic quantum firmware: USB device boot for CM4 firmware: arm_loader: Add SET_LAUNCH_VPU1 mailbox message firmware: il: camera: Add config.txt param awb_auto_is_greyworld for NoIR camera See: raspberrypi/firmware#1167 firmware: arm_loader: Provisional support for high peris firmware: arm_loader: Only add margins to cmdline if non-zero firmware: clock: Support clock_measure_pll on pi0-3 firmware: platform: Back to CLOCK_PLL_CHAN_CPER for emmc on pi0-3
Is the auto white balance greyworld preset supposed to work with the v4l2 module as well? I've tried setting it in qv4l2 but I still get purple images. |
Yes it should be available through V4L2 as long as you have updated the firmware appropriately. |
I've flashed a new SD card with the latest version of raspian but I still get purple images from my noir camera when using V4L2, even though I've set the white balance to greyworld. Images from raspistill look correct with the greyworld awb though. I'm using qv4l2 as my capture application. qv4l2 and |
Is there a logical fix in chronological order on how to fix the purple camera issue on Noir? There is rag tag information everywhere but ... Thanks |
If you're really stuck, then add |
My pics turned pink just yesterday. Im currently iterating over awb_gains(red, blue) in steps of range 0.05 in python to find out what works best. Every awb_mode setting is horribly pink. Is the greyworld setting accessible via the python api? Also running Pi4 noir v2 |
Pi4 8Gb, HQ camera setup as NO-IR, RaspiOS 32 bit, kernel 5.4.49-v7l+,
I was seeing a pink cast via However, if I run So maybe there is an issue with awb_auto_is_greyworld? Log if useful:
|
Thanks @6by9 for this option. For people who use Motion, I have not found an other way to specify greyworld mode directly in Motion. |
The camera used in our setup is the NoIR cam which has the issue of having a strong pink tint in images taking with daylight. The camera firmware has a special white balance mode "greyworld" to compensate for this. However, this mode is not yet available through the picamera library. Therefore, following a suggestion from this SO comment: raspberrypi/firmware#1167 (comment) we're adding the new white balance mode to the camera. Furthermore, also change the camera's resolution to a format that makes use of the entire sensor (scaled down to 25%). Also play with the brightness and contrast parameters to get the best image possible.
With the latest firmware in buster, the results under similar lighting conditions:
With the firmware in stretch, the results under similar lighting conditions:
I've tried using the same version of raspivid as in stretch, on buster, but still got purple results, which leads me to think this is a firmware issue.
I've also looked at images from during the day and at night time, all are now purple. Whereas the results from Stretch were markedly different.
Cheers
The text was updated successfully, but these errors were encountered: