[Replicant] QR code scanning working, but slow preview
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. 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, 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.
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...
Size: 818 bytes
Desc: not available
More information about the Replicant