Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Very laggy on Android mobile app when scrolling on default photos view #12674

Open
1 of 3 tasks
maltokyo opened this issue Sep 14, 2024 · 34 comments
Open
1 of 3 tasks

Very laggy on Android mobile app when scrolling on default photos view #12674

maltokyo opened this issue Sep 14, 2024 · 34 comments

Comments

@maltokyo
Copy link

The bug

When scrolling on Google photos, the scrolling is extremely smooth even when scrolling too fast for full thumbnails to load. On Immich this is very laggy. Granted I have 100k photos, so not sure if that's the issue but it should still work. Attached a screen recording of me scrolling at a constant speed, and the laggy scrolling is clearly visible.

Link to video
https://youtube.com/shorts/D0theLCMa4s?si=ZsPg36C8EhGr6ktO

The OS that Immich Server is running on

android 14

Version of Immich Server

v1.115

Version of Immich Mobile App

v1.114

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

Stock standard docker compose. With Intel HW acceleration on.

Your .env content

Standard env

Reproduction steps

  1. Scroll on photos screen through many photos at medium pace (constant pace)
  2. Observe lagging
    ...

Relevant log output

No response

Additional information

No response

@bo0tzz
Copy link
Member

bo0tzz commented Sep 14, 2024

What device are you using? Try enabling "prefer remote images" in the advanced settings.

@Cookie-Monster-Coder
Copy link

What device are you using? Try enabling "prefer remote images" in the advanced settings.

This does not work.

Related issue:
#11113

@maltokyo
Copy link
Author

maltokyo commented Sep 14, 2024 via email

@maltokyo
Copy link
Author

maltokyo commented Sep 14, 2024 via email

@alextran1502
Copy link
Contributor

@maltokyo how many albums do you have? Did you start scrolling right away when you first open the app?

The stuttering is due to the albums sync mechanism compete with the UI thread, after the albums sync finished, it will be smoother.

Regardless, we have plan to optimize this process for a better user experience

@maltokyo
Copy link
Author

Thank you for the replies. Yes I used a script to make albums from about 1000 folders. So, many albums. But immich has been installed for weeks. So I thought it maybe has had enough time to scroll correctly. Thanks for the news on optimizing this.

@alextran1502
Copy link
Contributor

@maltokyo the sync here check for the diff with the server, adding and removing assets on the mobile...etc, basically expensive operations that can be taxing for the client, and it runs when opening the app and after some certain actions.

@maltokyo
Copy link
Author

maltokyo commented Sep 14, 2024 via email

@alextran1502
Copy link
Contributor

@maltokyo maybe a better wording from is the operation of figuring out what to sync is taxing and competing with UI thread

@maltokyo
Copy link
Author

@alextran1502 ok, is there anything I can do to get more data on this on my side, in order to find out what is causing the issue? Some way to get logs (and which ones?) from mobile or server, please let me know. Any way I can assist, I'm willing to of course.

@alextran1502
Copy link
Contributor

@maltokyo thanks for the offer, we already known the bottle neck and have plans to word toward improving it in the near future

@maltokyo
Copy link
Author

Understood. Thanks a lot. Apart from this, everything is absolutely amazing.

@Mitmischer
Copy link

Mitmischer commented Oct 6, 2024

I'd also like to help debug this issue. For me the experience is even worse - the app takes a long time to load and becomes completely frozen for multiple seconds sometimes, most often directly after starting while synchronization takes place. Having "remove images preferred" activated at this point doesn't help, but it helps later during normal use. Maybe it's also my device but it should be that out-of-date and slow yet (Snapdragon 845, no SD card). I have ~23000 photos and 1500 videos totaling 32 GB.

Thanks for the hard work, for the rest I can only agree - Immich is amazing!

Probably related: #11113

@sbillaudelle
Copy link

I experience the same issue. So far, I had attributed this to the age of my phone, but I just upgraded and still suffer from a laggy UI.

~ 20 seconds after opening the app, it becomes very fluid and responsive, corroborating the statement that this is connected to the synchronization.

Please let me know if you need more data.

@orywig
Copy link

orywig commented Oct 13, 2024

I experience the same thing on iOS. Did not have this issue until I imported a Google Takeout which added a ton of albums. Which, I only have 133 albums, which doesn’t sound like a ton.

@alextran1502
Copy link
Contributor

@orywig yeah the album sync is causing the competition with the UI thread at the moment. The looping over albums and each assets to calculate which one need to be add/delete/update is quite taxing, so we are working towards a fix

@orywig
Copy link

orywig commented Oct 13, 2024

Thanks, @alextran1502! I should have mentioned I saw your comments above about there being a plan for this. I just wanted to note that it’s a iOS thing as well as Android. Thanks for all you do! Love the project!

@orywig
Copy link

orywig commented Oct 29, 2024

Until the team can resolve this issue, has anyone here found a temporary resolution or workaround? The lag while the albums are syncing is quite impactful to the user experience; especially when remote and this is happening across the internet. I can't think of anything besides just cleaning up and removing any unnecessary albums to shorten the sync time.

@Cookie-Monster-Coder
Copy link

I don't believe the full cause of this issue is albums syncing. I open up the app, wait 5 mins on the startup position, just taping the screen every so often so the phone doesn't go to sleep, after the 5 mins are up I start scrolling and it still crashes.

@alextran1502
Copy link
Contributor

@Cookie-Monster-Coder hmmm, what is your phone model? If you go to App Settings > Advanced > toggle Prefer Remote Image, does it help?

@maltokyo
Copy link
Author

maltokyo commented Oct 29, 2024 via email

@ratti
Copy link

ratti commented Oct 29, 2024

Same issue here, also Pixel 8 Pro. Had it in Android 14, have it in 15. I have approx. 120.000 images in daily folder on external folders, also used that script to create albums from folders.

I noticed this: When I scroll down, the app is stuttering. Let's accept that for now and scroll BACK again. Also stuttering.

Using mobile browser instead, or on desktop computer, all is fine.

The App is excluded in DNS66 adblocker VPN.

No new photos were added for some days.

@maltokyo
Copy link
Author

maltokyo commented Oct 29, 2024 via email

@Cookie-Monster-Coder
Copy link

@Cookie-Monster-Coder hmmm, what is your phone model? If you go to App Settings > Advanced > toggle Prefer Remote Image, does it help?

Samsung 22+

Enabling Remote Images does NOT help.

@alextran1502
Copy link
Contributor

alextran1502 commented Oct 29, 2024

Hmm, this is very odd; I tested my 80_000 assets library on a Pixel 8 and Galaxy 23 and cannot cause it to crash or stutter after the assets and album are synced. There is some janking when the bucket is loaded in. I wonder if there is some specific photo that the app cannot read and cause the crash 🤔

@maltokyo
Copy link
Author

maltokyo commented Oct 29, 2024 via email

@alextran1502
Copy link
Contributor

@maltokyo Yep, that will do it for your case. Until the new album sync is implemented, it is not pretty for 1000s albums at the moment

@maltokyo
Copy link
Author

maltokyo commented Oct 29, 2024 via email

@alextran1502
Copy link
Contributor

@maltokyo The current album sync process is running on the main thread due to its complexity and causing the UI to stutter

@maltokyo
Copy link
Author

maltokyo commented Oct 29, 2024 via email

@ratti
Copy link

ratti commented Oct 29, 2024

I can confirm I have 3022 albums. My external folder is just a rsync from my Mac, and there the photos are organized by a schema
{$year} / {$year_$month_$day___Some_Nice_Description}

Edit: …and I have two external folders, because I use an app on my phone to rsync ~/DCIM/Camera to the server for backup purposes. Those second folder is not sorted into albums.

Later, I move the photos to my Mac, clean them up, and then they get rsync'd to the „real“ folder and end up in real albums.

@ldandersen
Copy link

I have a library of 50000+ photos (with only a few albums and basically a pretty stock Immich server installation), and can confirm that for me the app has become borderline unusable on iOS. Web interface works like a champ on both mobile and desktop.

Disabling sync does seem to mitigate the problem, which seems to point (as some above have speculated) to the issue being the sync process blocking the main thread--for seemingly up to 10-20 seconds at a time on a library as large as mine. If this is true, it's definitely not a sustainable way to approach the sync process.

Anyway, pretty bummed because this is the first real issue I've had with what is otherwise an absolutely stellar project!

@alextran1502
Copy link
Contributor

@ldandersen If you have a few albums then the app should be smooth after the hashing progress is done (check for the spinner icon on the Photos page)

@ratti
Copy link

ratti commented Nov 7, 2024

Just to add feedback: Me, huge collection, many albums, doesn't use sync.

I am syncing the photos from my smartphone with a different app to a different place, then I tag & sort & fix them manually on my computer, then I rsync the fine result to my webserver, and that folder then is mounted into immich as an external dir.

So, I neither upload manually via app/web, nor I use syncing in the app. Just a mounted folder that's changing ~once a month.

(and: I totally agree this project is shocking great!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants