GrapheneOS Camera QR Code Stress Test
Acknowledgements
The plain text transcription of William Shakespeare's "Hamlet" was taken from https://gist.github.com/provpup/2fc41686eab7400b796b
Equipment
qrencode
version 4.1.1 Kentaro Fukuchi: https://packages.gentoo.org/packages/media-gfx/qrencode
- Google Pixel 1, used as device to display the QR Codes
- Google Pixel 4, running GrapheneOS Build RQ3A.211001.001.2021100606, with
GrapheneOS Camera, version 1.0 (alpha build).
- 150-watt equivalent LED full spectrum lamp.
Process
QR codes were generated with the use of head -c [count] hamlet.txt | qrencode -o hamlet[count].png
, with [count]
indicating the number of kilobytes that would be used for each test. Counts used were at 50B, 1000B, 2000B, 2800B, 2900B, 2950B, and 2970B to generate the QR codes.
Due to the limitations of the QR Encoding program, the test was stopped with a maximum QR code size of 2970B. Choosing 2971B as a size resulted in qrencode returning the error Input data too large
.
Scanning was done by transferring the images to an old Google Pixel 1 running Simple Gallery. The Pixel 1 is an outdated phone at the time of writing, but is in good physical condition. A single layer tempered glass screen protector remains installed on the phone.
Tests were performed with the QR displaying device placed flat on a table screen-side up, first in night conditions with all lights extinguished except for four 24" LED monitors set upright, between 2 feet and 4 feet away from the displayed phone. The scanning phone was then used to scan the QR codes being held first in the same orientation as the displayed phone, then upside-down, then to the left, then to the right. Each test, the contents were checked against the original script for correctness. The process started on the 50B code, then was repeated through each successive image. The phone scanning the QR codes was held with one hand with the user seated and the arm held at near-full extension horizontally to give a realistic simulation of day to day use.
After the initial test in a dark environment, a single overhead light consisting of a 150-watt equivalent full spectrum LED lamp was switched on approximately 6 feet above the test unit, and the test repeated.
If the phone did not read the QR code and display a result within 4 seconds of attempting to read the QR code, or displayed an incorrect result, the unit was considered to have failed the test. The timer was started after placing the QR code in the highlighted box shown by the camera app, and the edges of the QR code roughly aligned to the horizontal and vertical sections of the box.
Outcomes
All tests passed successfully.
Conclusions
The new QR Scanning code utility on GrapheneOS Camera works at scanning black and white QR codes against a gray background in both night and daytime conditions with the phone held in any reasonable orientation. The QR Code Scanning functionality in GrapheneOS Camera performs fully as it is intended to perform.