TurquoiseBlue
Posts: 4
Joined: Wed Dec 13, 2017 3:05 am

Raspiraw broken by new userland / firmware version

Wed Aug 01, 2018 2:12 am

raspiraw works with the older version of Raspberry Pi userland / firmware, but not the new one.

That is, it works with:

Code: Select all

Raspberry Pi Firmware: eeaaf5e2b5aee29f31e989c0dddd186fb68b2144
Raspberry Pi Userland: 2448644657e5fbfd82299416d218396ee1115ece
However, it does not work with the master commit code in https://github.com/raspberrypi/firmware or https://github.com/raspberrypi/userland/

I believe this is caused by an incorrect buffer size. I ran the same executable on both stock Raspbian as well as the newest userland/firmware. Several things differ:
  • the data buffer with raspbian is 3280*2464*5/4 = 10102400, which is correct for 10-bit data (every 5th byte contains the low bit information)
  • the data buffer with newest code is 3280*2464 = 8081920, which is too small for 10-bit data (the images still include the 5th byte, but the data is truncated)
  • the minimum number of buffers with raspbian is 4, but with the newest code is 6
  • if the software crashes while running raspiraw with the newer code, then a restart is required to reconnect to the camera
As a result, if I take the same raspiraw executable and run it on both stock Raspbian and new code, I get differing results. With the stock, everything runs as expected. With the new code, it will run for a few seconds before crashing and showing an assert in vcdbg log assert.

Steps to Replicate:
Upgrade Raspbian to use newest firmware and userland, compile raspiraw, and then run it. The returned images only be 8081920 bytes long rather than 10102400 bytes, and the software will crash frequently.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5557
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Raspiraw broken by new userland / firmware version

Wed Aug 01, 2018 6:55 am

I'm aware, but also on holiday until Monday.

It's not buffer number that is the issue. That was increased as part of a change that was believed to sort the issue of a double buffer swap dropping/duplicating frames.

There have also been updates to the isp component to relax the alignment requirements, but those should all be transparent if the app sets the alignment itself (raspiraw does).
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5557
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Raspiraw broken by new userland / firmware version

Tue Aug 07, 2018 10:33 am

Cause found. I'd got the code correct in one branch of an if/else, but not the other.
I've got a fix, so it should be in the next rpi-update release.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

bprats99
Posts: 30
Joined: Thu Apr 04, 2013 4:54 am
Location: Southern California USA

Re: Raspiraw broken by new userland / firmware version

Sun Aug 12, 2018 5:27 pm

After upgrading my astronomy camera on Friday August 10 Raspberry Pi 3b and PiCam V2 from 4-14-27 V7+ #1100 to 4-14-61 V7+ # 1133 Raspistill gives MMAL error messages. Apt-get update/upgrade cycles and Repowering / Rebooting the Pi a number of times got the camera running but I see some differences: The PNG mode output files have increased in size to 11.5 megabytes; DRC HIGH gives a solid GREEN file When I first executed Raspistill with the new upgrade the PNG output file was over 17 megabytes in size then each succeeding files was smaller dropping to 11.5megabytes average. Raspistill stability seems rocky as camera operation has never been a problem before the upgrade however Chrontab successfully executed my Raspistill job all night without error.

Is there a reason for the PiCam V2 normal with lens removed to be hypersensitive to Red ?

Thanks for the wonderful software .....

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5557
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Raspiraw broken by new userland / firmware version

Sun Aug 12, 2018 7:19 pm

bprats99 wrote:
Sun Aug 12, 2018 5:27 pm
After upgrading my astronomy camera on Friday August 10 Raspberry Pi 3b and PiCam V2 from 4-14-27 V7+ #1100 to 4-14-61 V7+ # 1133 Raspistill gives MMAL error messages. Apt-get update/upgrade cycles and Repowering / Rebooting the Pi a number of times got the camera running but I see some differences: The PNG mode output files have increased in size to 11.5 megabytes; DRC HIGH gives a solid GREEN file When I first executed Raspistill with the new upgrade the PNG output file was over 17 megabytes in size then each succeeding files was smaller dropping to 11.5megabytes average. Raspistill stability seems rocky as camera operation has never been a problem before the upgrade however Chrontab successfully executed my Raspistill job all night without error.

Is there a reason for the PiCam V2 normal with lens removed to be hypersensitive to Red ?

Thanks for the wonderful software .....
How is this at all linked to raspiraw? That has no PNG mode, nor DRC, as they are all functions of the firmware driven pipeline.
Please start a new thread with details of what you're doing (full command lines please), and we can take it from there.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

Return to “Camera board”

Who is online

Users browsing this forum: Biologist and 5 guests