sailfishos-sony-tama / main

Documentation, releases, and issues
MIT License
38 stars 7 forks source link

Camera issues #46

Closed ApostolosB closed 3 years ago

ApostolosB commented 4 years ago

As the title suggests. To rep:

Open the camera Use two fingers to zoom. Camera becomes unresponsive and the option to close the app or wait appears.

MartinX3 commented 4 years ago

Depending on the source of the problem it may not be fixable now, since any further camera updates continue with the 4.14 kernel of SODP (which is used here)

ApostolosB commented 4 years ago

@MartinX3 No problem. Hopefully the new kernel will be stable enough in the near future so we can update it. The camera isn't good (quality, speed) at the moment.

MartinX3 commented 4 years ago

Depends on @rinigus :) I don't know what is needed on the sailfish side to adapt the 4.14/10.0 sodp :)

I would say after the release of OEMv3 it is stable enough for AOSP to act as a daily driver

rinigus commented 4 years ago

There are two issues. One of them is related to memory management problem which gets exposed by camera as in #30. With this problem I will ask for feedback at Sony AOSP channels, just have to prepare documented case which shows strange results when following kernel memory counters.

Second, is the camera support itself. As mentioned by @MartinX3, it requires newer kernel and drivers. I have hopes to use 4.14 on AOSP9 base. That will not require major porting effort for the new base. But, its surely not targeted by AOSP developers and I don't know if its possible.

If we need to shift to new AOSP base, it will take time. As mentioned earlier, I would first stabilize on AOSP9 and target issues on that. So, I'd prefer not to deal with new base right now.

MartinX3 commented 4 years ago

AOSP9 and 4.14 (and 10 and 9.0) can work Buuut is not official supported. So help by sodp is sadly limited in that case.

rinigus commented 4 years ago

Exactly. Well, in our case, support is mainly due to curiosity and wish to overcome technical challenges by the participants. But let's wait till 4.14 / AOSP10 normalizes and gets to the stable state. Then we can test and look how it works for us

ApostolosB commented 4 years ago

The technical stuff its up to people that know what they are doing. I want the best possible supported solution (in terms of features supported on the phone) and i am willing to help with testing. Sadly this is all i can do.

rinigus commented 4 years ago

@ApostolosB : try to use AdvancedCamera from openrepos. But yes, camera is not in the best shape right now.

ApostolosB commented 4 years ago

Oh yeah forgot to mention my advanced camera experience. Advanced camera fucked up things and i think i had to restart the phone. After i started it i couldn't even use the main camera app.

I used Adv Cam. from the store. I'll start playing with openrepos once we have an "official" release.

rinigus commented 4 years ago

Yes, right now, thread lightly when working with camera.

ApostolosB commented 4 years ago

Interestingly this behavior is only present in the camera mode. In the video mode it works ok(ish). Slow but works.

pagism commented 4 years ago

Same behaviour here with camera as Apostolos described. What I noticed is that camera app is somehow slow to start, slow to focus and default controls do not work as expected.

Installing Advance Camera make things worse actually.

rinigus commented 4 years ago

As mentioned above, we can start looking closer into the camera after kernel update to 4.14. Right now, its close to what AOSP9 camera does and, as a result, we should not expect anything better in SFOS. As Linux 4.14 promises much better camera, I am planning to look into it when that's ready for daily use. Until that, its mainly survival on current camera

MartinX3 commented 4 years ago

Daily use -> at the moment it is stable But there are cosmetic issues in the bootanimation and vidc video playing is not perfect

rinigus commented 4 years ago

I guess I will wait till the next round of binaries and stabilized as much as possible without glitches. We have few other things to fix as well, so better prioritize the time

ApostolosB commented 4 years ago

The worst thing about the camera now is the focus performance. If stars align and it focuses right i get an OK pic. But that doesn't happen often. And its more obvious in an app like Codereader where you need the camera to focus on the barcode.

MartinX3 commented 4 years ago

@rinigus please add https://github.com/sonyxperiadev/kernel/pull/1921 as a workaround on 4.9 :)

(We have a similar one for 4.14, too, until it gets fixed in an OEM binary blob update https://github.com/sonyxperiadev/kernel/pull/2118)

rinigus commented 4 years ago

@MartinX3: Do you know if the workaround will be merged?

MartinX3 commented 4 years ago

@rinigus good idea! I redirected it to the team :D

MartinX3 commented 4 years ago

Aaaand merged! https://github.com/sonyxperiadev/kernel/pull/1921 <3

This will workaround focus problems as far as it is able to.

rinigus commented 4 years ago

Will test it as soon as our build servers (OBS) will work again. They are today on strike, it seems.

ApostolosB commented 4 years ago

One more thing i notice with the front camera is a red hue on the image you see on the screen when it starts. It sorts itself out after a bit. But i think i remember thins also when i was playing with aosp.

BTW features like burst mode/continuous shooting, choosing resolutions are things that need to be done in the SFOS camera and not on the aosp side right???

rinigus commented 4 years ago

BTW features like burst mode/continuous shooting, choosing resolutions are things that need to be done in the SFOS camera and not on the aosp side right???

it has to be supported by AOSP first - not sure burst mode it. as for reso choosing, that should work already

ApostolosB commented 4 years ago

Another word of warning. Video with the main camera (4k in something like 15 FPS -not good) seems to mess something up and you end up with a black screen. Restart required.

MartinX3 commented 4 years ago

Yes. The camera driver is from April 2019 Kernel 4.14 has the one from November 2019. The experience will be better with it. The problems are already known or fixed. :) @rinigus

ApostolosB commented 4 years ago

@MartinX3 OK. I have no idea what is fixed or not. I just wanted to warn people. As for the way forward (aosp9 4.14 kerner or aosp10 or whatever) and when we move, its up to rinigus. I have no idea about stuff like that or the benefits, drawbacks and work needed for each.

rinigus commented 4 years ago

As far as I understand, benefits are great in terms of camera. Sounds like we will have to use next AOSP base for it to work. There is an outside chance to scrape through with AOSP9 and kernel 4.14, but its surely will be just lucky if true as few other things were changed with 4.14.

As its a new base, a new port will be required. Right now, AOSP9 is the newest we have as a base for SFOS ports. I expect that work on AOSP10 will start and we could realistically work on adjusting our port in the middle of next year.

As for fix mentioned by @MartinX3 before for kernel 4.9, I haven't had a chance to check it, as OBS servers are not working properly. Admins will have to look into it, hence the delay.

I am going to rename the issue into more general "Camera issues", so readers could see the problems.

pagism commented 4 years ago

in previous release the camera had several issues, back then when i tried to use the Advanced Camera app, i had to reboot the phone and uninstall the app. This afternoon, rather accidentally i thought there was a new release of tge app and install it again. Surprisingly, it does not crash the phone and performs a lot better better than the default camera app.

ApostolosB commented 4 years ago

Knowing the situation with the camera i am king of afraid to do anything related to it :rofl:

But yeah the latest release -of the OS- is infinitely more stable than the previous one.

MartinX3 commented 4 years ago

@rinigus the 4.14 kernel for tama is nice. I use it daily and it comes with a better camera. :)

But IDLE drain is now at ~1%/h due to a sleep bug in the RPMh.

rinigus commented 4 years ago

@MartinX3: great to hear! As far as I remember, 4.14 would require AOSP10 base, which SFOS is not supporting yet (would have to check the latest status, but I think so). Not sure when I will approach it. Camera is important, so we should switch to 4.14 eventually.

Meanwhile, @MartinX3, make sure it all works perfectly on AOSP :)

What is RPMh? https://android.googlesource.com/kernel/msm/+/android-7.1.0_r0.2/Documentation/arm/msm/rpm.txt ?

MartinX3 commented 4 years ago

@rinigus Aaand here is 4.14 for 9.0 https://github.com/sonyxperiadev/local_manifests/tree/android-9.0.0_r46a

Here I restored the buildability https://github.com/MartinX3-AndroidDevelopment-OmniROM/vendor-qcom-opensource-interfaces/commits/MartinX3/omnirom-9.0_twrp-10.0

I needed it to compile twrp 9.0 with the 4.14 kernel, because the twrp 9.0 isn't buildable in 10 ROMs

Yeah, RPMh is the successor of RPM which got used on older SoCs If I remember correctly it's used since the Snapdragon 845 Here a description https://lwn.net/Articles/748981/

Have fun making experiments :D

rinigus commented 4 years ago

@MartinX3, interesting. I will surely have to test it. Although, TWRP does not use camera blobs and is not a thorough test of AOSP9/4.14 hybrid. But interesting anyway!

ApostolosB commented 4 years ago

Has the AOSP10 move need to be initiated by Jolla themselves or is something the port community can handle?

rinigus commented 4 years ago

@ApostolosB - AOSP10 can be done by community. But the last few years, we had Jolla's lead through SFOS X program which ensured that we had a reference port. This year it is not there yet, as far as I can see. I keep an eye on what's happening on the porters channel, maybe should ask around.

pagism commented 4 years ago

there is no recent roadmap updates from jolla lately, maybe they wait for the community to make a move first? i have the feeling they struggle with resources

rinigus commented 4 years ago

I asked on sfos-porters channel if someone is working on aosp10 - no reply so far

ApostolosB commented 4 years ago

The new forum is open. (https://forum.sailfishos.org/) Maybe we can have a topic there also.

Thaodan commented 4 years ago

@ApostolosB I put some work hybris-10 see my github profile. Still very early.

Thaodan commented 4 years ago

@rinigus I have a hybris patched kernel for kumano, you just have to add the hybris changes to the tama defconfigs.

rinigus commented 4 years ago

Does that kernel work? But you are on AOSP10, right?

Thaodan commented 4 years ago

It does (tested by booting android with it).

rinigus commented 4 years ago

I tested AOSP10 on Apollo (PixelExperience July 14, 2020 build, same day Sony binaries). Camera was tested with the included simple app and is still rather poor. Flash and image acquisition are not in sync. Without flash images could be better, but I am not 100% sure. Will have to test it further and check details.

Hopefully, the flash-image acquisition sync issue will be fixed at some time.

PS: Haven't checked with pure AOSP10 build as I got some strange reboots with it. Could be due to the switch from SFOS to AOSP (we have userdata in LVM, AOSP in ext2) and fastboot -w was failing on my PC. Have to look into it further when I get time and, if reproducible, report upstream.

rinigus commented 4 years ago

There could be somewhat better ability to focus. And it seems to be more stable than on SFOS. On SFOS, sometimes camera crashes and you have to reboot to get it back. Not sure it was an issue for AOSP9. On AOSP10, no camera crashes experienced so far.

pagism commented 4 years ago

I think I've experienced camera crash with the latest SFOS 3.3 update, before that camera crash was more frequent. tbh i do not use camera much mainly because camera experience with SFOS is in general bad. Pity we cannot make use of hw potential.

-- Sent from my Jolla

MartinX3 commented 4 years ago

The A10 camera is much better than the A9 one and far more stable. The 2 big issues left are a properly calibrated focus and the gcam support as far as I know. I don't know how much low light handling can get improved.

pagism commented 4 years ago

I hope it is, the current one (A9) seems to be like stuck in high iso. No comparison with stock camera performance in low light either.

-- Sent from my Jolla

rinigus commented 4 years ago

@MartinX3: OK, maybe I would say it more than it is not worse in AOSP10 than in AOSP9. I guess I was expecting larger improvement as the room for improvement is significant. As mentioned above, it is better in focusing already and improved stability (but here I compared SFOS vs AOSP, could be SFOS induced). We still have out of sync flashlight (https://github.com/sonyxperiadev/bug_tracker/issues/406).

Just made a video and ghosting has reduced (even hard to detect) on lower light conditions. AOSP9 is rather poor with huge ghosting when you move the camera.

Better focus calibration would be great as it is one of the major issues. As for low light, let's get normal light working first... GCam requires some kind of raw images access, right?

@pagism: well, not too bad in SFOS in general. On Onyx it was similar to Android. Here as well (to AOSP), just stock is way better

MartinX3 commented 4 years ago

Camx kills the entire camera access until a restsrt because of a bug in the camera budget system

About raw images, i am not sure if they are not correct or my smartphone apps just dont properly open the dng files

ApostolosB commented 4 years ago

While stability is important (having to reboot after using the camera is no fun) focus is also a big thing. Leaving photography outside it makes it suuuper difficult scan barcodes etc if it doesn't work right. A more "practical" issue.