sonyxperiadev / bug_tracker

Empty repository that is used as a bugtracker for Open Devices project
52 stars 13 forks source link

[ALL] Camera dark and green because of clang issue #469

Closed stefanhh0 closed 4 years ago

stefanhh0 commented 5 years ago

Platform: Yoshino Device: Lilac Kernel version: 4.9.189-g5701b92270bf Android version: android-10.0.0_r1 Software binaries version: SW_binaries_for_Xperia_Android_9.0_2.3.2_v9_yoshino.zip Version baseband: 1308-8921_47.1.A.16.20 Build: aosp_g8441-userdebug 10 QP1A.190711.019 eng.stefan.20190923.205535

Description Right after boot aosp camera app works. However when trying to open it a second time, a message comes like "can't connect to camera". Opening it a 3rd time the camera one can only see something dark greenish on the display. Taking then a photo the photo results in a completely black picture.

This only happens when the kernel was compiled using clang. When it is being compiled with GCC aosp camera just works fine.

Symptoms

How to reproduce

Additional context The dmesg and logcat do not include the picture taking but the "can't connect" event and when the display shows dark green contents. logcat.log dmesg.log

MarijnS95 commented 5 years ago

The dark-green display also happens on Discovery (Nile) and Suzu (Loire). I vaguely remember it happening on Mermaid (Ganges) as well, but didn't seem to happen again as of late. I'll have to check how it behaves with a camera app. The green image (iirc also without proper AF) always seems to happen in the wifi DPP setup (scanning a QR-code).

There is most likely a change to the Android 10 camera3 interface, or something like that. I'll check CAF Android 10 branches for any relevant changes and see whether this is easily fixable.

Haxk20 commented 5 years ago

@MarijnS95 the green bug isnt happening on Mermaid anymore.

MarijnS95 commented 5 years ago

@Haxk20 "Anymore"? Do you have any idea what caused it to magically disappear?

Haxk20 commented 5 years ago

@MarijnS95 Sorry. Bad wording. I never had it on my phone but i knew that other people had this issue on different sony phones. I myself never had it.

ix5 commented 5 years ago

I'm pretty sure this happens when building the kernel with clang. On GCC it's fine.

MarijnS95 commented 5 years ago

@ix5 Thanks for reminding! That might actually be the case, as we've seen before.

I can do a quick test on discovery.

MarijnS95 commented 5 years ago

Yep confirmed, this is a clang issue. Thanks again @ix5!

Most likely a data structure with different packing on this compiler.

Ray-Alfy commented 4 years ago

I used GCC (coz it's AOSP build system used gcc as default)

Ray-Alfy commented 4 years ago

oh, no it's used prebuit kernel from folder pioneer

chris42 commented 4 years ago

oh, no it's used prebuit kernel from folder pioneer

EDIT: Info below will only work for AOSP 9. If you are trying to compile AOSP 10, please see this comment

The prebuilt kernel have the same issue, you need to build them by yourself. Set BUILD_KERNEL := true in kernel/sony/msm-4.9/common-kernel/KernelConfig.mk and then use make installclean before build

Ray-Alfy commented 4 years ago

oh, no it's used prebuit kernel from folder pioneer

The prebuilt kernel have the same issue, you need to build them by yourself. Set BUILD_KERNEL := true in kernel/sony/msm-4.9/common-kernel/KernelConfig.mk and then use make installclean before build

I will try it and answer in a couple of hours

MarijnS95 commented 4 years ago

Set BUILD_KERNEL := true in kernel/sony/msm-4.9/common-kernel/KernelConfig.mk

Inline kernel building doesn't work anymore in Android 10.

Instead you need to cd into kernel/sony/msm-4.9/common-kernel, edit build-kernels-gcc.sh to only build the platform and device of your choice, and run ./build-kernels-gcc.sh. Be sure to check the logging file that's printed to the screen.

chris42 commented 4 years ago

Inline kernel building doesn't work anymore in Android 10.

Instead you need to cd into kernel/sony/msm-4.9/common-kernel, edit build-kernels-gcc.sh to only build the platform and device of your choice, and run ./build-kernels-gcc.sh. Be sure to check the logging file that's printed to the screen.

Yup, sorry, messed up the issues: We should be clear here. The Info was for @Ray-Alfy Issue #493 . He seems to be building AOSP 9. In this issue thread it was talked about AOSP 10, which has the same problem, however solution of rebuilding kernel is more complicated as @MarijnS95 states.

Ray-Alfy commented 4 years ago

Set BUILD_KERNEL := true in kernel/sony/msm-4.9/common-kernel/KernelConfig.mk and then use make installclean before build

Thanks a lot for the answer, it really helps! I think the development team should rebuild the kernel prebuild. For Nile-Pioneer, the request can be closed.

jerpelea commented 4 years ago

all precompiled kernels are compiled with GCC for now

stefanhh0 commented 4 years ago

Platform: Yoshino Device: Lilac Kernel version: 4.14.176-gf0356fa3bcac:

Android version: android-10.0.0_r36 Software binaries version: SW_binaries_for_Xperia_Android_10.0.7.1_r1_v6_yoshino.img Version baseband: 1307-7511_47.2.A.11.228 Build: aosp_g8441-userdebug 10 QQ2A.200501.001.B3 eng.stefan.20200510.170705

The clang problem is only on k4.9, thus to avoid it don't use clang but gcc when compiling k4.9. Or just use simply the gcc prebuilt 4.9 kernels.

Verified that it is fixed on k4.14 which uses clang as compiler.