[Replicant] QR code scanning working, but slow preview

Wolfgang Wiedmeyer wreg at wiedmeyer.de
Wed Jan 4 22:49:54 UTC 2017


happy new year to you all!

In the last days, I was finally able to fix QR code scanning (or barcode
scanning in general) on the Replicant side[1]. Out of different apps
with scanners that I tested, ZXing works. The scanner view in the
Bitcoin Wallet app and in the Rumble app don't work because they rely on
some unsupported OpenGL features. But these apps are still usable
because the scanned codes can be pasted from the ZXing app. Some
barcodes, that are not only black on white and have more colors
incorporated, might not work because of the simplified conversion. I
expect this to not be a bigger issue.

The bigger issue is the slow preview. The camera preview is already slow
but it's bearable. The barcode scanner app (ZXing) preview is annoyingly
slow. First, I thought this is because of my conversion in the
background, but I disabled data forwarding to the app at some point and
the preview was almost not noticeable faster. The conversion is also
pretty fast: 15ms per frame on the Galaxy S3.

My guess is that there is a general regression in the software rendering
of SurfaceViews in SurfaceFlinger compared to previous Android
versions. It's a lot faster on Replicant 4.2. I removed some of the
large preview resolutions[2], but this helps only a little. There was a
large refactoring of SurfaceFlinger after Android 4.2, so it's not easy
to figure out the changes that might cause this.
Some time ago, I tried to do profiling of llvmpipe which was basically a
profiling of SurfaceFlinger because llvmpipe gets loaded by
SurfaceFlinger. I did this with callgrind and only got garbage output
although I tried to set the needed build flags. I could try this again
with the Android software renderer. I also could go through some of the
tools Google offers for Android. However, most of them seem to be toys
for app developers, but I could be wrong. dumpsys SurfaceFlinger also
provides some useful output.
If anyone can help debugging this or has an idea how this issue could be
debugged, then I would be very thankful.

Best regards,

[1]  https://code.fossencdi.org/frameworks_base.git/commit/?h=replicant-6.0&id=a57394a0be5e601c447a07786487bd4c34b0d899

[2]  https://code.fossencdi.org/device_samsung_smdk4412-common.git/commit/?h=replicant-6.0&id=058a1cf3e508f85edc50e6914de2a171ad1a9731

Website: https://fossencdi.org
OpenPGP: 0F30 D1A0 2F73 F70A 6FEE  048E 5816 A24C 1075 7FC4
Key download: https://wiedmeyer.de/keys/ww.asc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/replicant/attachments/20170104/ddaacffa/attachment.asc>

More information about the Replicant mailing list