immich-app / immich

High performance self-hosted photo and video management solution.
https://immich.app
GNU Affero General Public License v3.0
38.99k stars 1.84k forks source link

Android App Crashes when sliding on a video. #10439

Open carloslockward opened 2 weeks ago

carloslockward commented 2 weeks ago

The bug

Video: https://github.com/immich-app/immich/assets/24941719/1e3bb88f-ecb0-4a1c-91b5-f0084ccc586e

As you can see in the video, Immich crashes as soon as you slide on a video.

The OS that Immich Server is running on

unraid 6.12.9

Version of Immich Server

1.106.4

Version of Immich Mobile App

1.106.3 build.143

Platform with the issue

Your docker-compose.yml content

N/A

Your .env content

N/A

Reproduction steps

1. Enter app
2. Tap on a video
3. Slide right or left

Relevant log output

No response

Additional information

No relevant logs are produced on the server. Just websocket connect and then disconnect when the crash happens.

alextran1502 commented 2 weeks ago

Hello, what is your phone model?

alextran1502 commented 2 weeks ago

Also any logs can you grab from the mobile app?

carloslockward commented 2 weeks ago

@alextran1502 Is a Samsung S22+. Nothing relevant seems to be happening in the logs.

I set the log level to FINEST, cleared the logs and then reproduced the issue. Here are the logs produced:

2024-06-17 14:44:15.540878 | FINE     | socket_io_client:engine.Socket | flushing 1 packets in socket |
2024-06-17 14:44:15.539720 | FINE     | socket_io_client:engine.Socket | socket receive: type "ping", data "null" |
2024-06-17 14:43:51.747926 | INFO     | AssetNotifier        | Load assets: 1430ms |
2024-06-17 14:43:51.747902 | INFO     | AlbumService         | Syncing completed. Changes: false |
2024-06-17 14:43:51.747890 | FINE     | SyncService          | 0 assets to delete, 0 to update |
2024-06-17 14:43:51.747869 | FINE     | SyncService          | Syncing all local albums almost done. Collected 0 asset candidates to delete |
2024-06-17 14:43:51.747782 | FINE     | SyncService          | Local album Camera has not changed. Skipping sync. |
2024-06-17 14:43:51.709082 | INFO     | AlbumService         | 'Recents' is not selected, keeping only selected albums |
2024-06-17 14:43:51.708979 | INFO     | AlbumService         | Found 54 device albums |
2024-06-17 14:43:50.910340 | INFO     | AlbumService         | Syncing completed. Changes: false |
2024-06-17 14:43:50.910330 | FINE     | SyncService          | 0 assets to delete, 0 to update |
2024-06-17 14:43:50.910317 | FINE     | SyncService          | Syncing all local albums almost done. Collected 0 asset candidates to delete |
2024-06-17 14:43:50.910243 | FINE     | SyncService          | Local album Camera has not changed. Skipping sync. |
2024-06-17 14:43:50.713579 | FINE     | socket_io_client:engine.Socket | socket receive: type "message", data "2["on_new_release",{"isAvailable":false,"checkedAt":"2024-06-17T17:41:56.209Z","serverVersion":{"major":1,"minor":106,"patch":4},"releaseVersion":{"major":1,"minor":106,"patch":4}}]" |
2024-06-17 14:43:50.653247 | FINE     | socket_io_client:engine.Socket | socket receive: type "message", data "2["on_server_version",{"options":{},"loose":false,"includePrerelease":false,"raw":"1.106.4","major":1,"minor":106,"patch":4,"prerelease":[],"build":[],"version":"1.106.4"}]" |
2024-06-17 14:43:50.644386 | FINE     | socket_io_client:engine.Socket | socket receive: type "message", data "0{"sid":"KzrTxYgt647ZBWafAABZ"}" |
2024-06-17 14:43:50.606617 | INFO     | AlbumService         | 'Recents' is not selected, keeping only selected albums |
2024-06-17 14:43:50.596675 | INFO     | AlbumService         | Found 54 device albums |
2024-06-17 14:43:50.548669 | FINE     | socket_io_client:engine.Socket | flushing 1 packets in socket |
2024-06-17 14:43:50.548657 | FINE     | socket_io:parser.Encoder | encoded {type: 0, data: null, nsp: /} as 0 |
2024-06-17 14:43:50.548623 | FINE     | socket_io:parser.Encoder | encoding packet {type: 0, data: null, nsp: /} |
2024-06-17 14:43:50.548614 | FINE     | socket_io_client:Manager | writing packet {type: 0, data: null, nsp: /} |
2024-06-17 14:43:50.548599 | FINE     | socket_io_client:Socket | transport is open - connecting |
2024-06-17 14:43:50.548498 | FINE     | socket_io_client:Manager | cleanup |
2024-06-17 14:43:50.548490 | FINE     | socket_io_client:Manager | open |
2024-06-17 14:43:50.548478 | FINE     | socket_io_client:engine.Socket | socket open |
2024-06-17 14:43:50.548412 | FINE     | socket_io_client:engine.Socket | socket receive: type "open", data "{"sid":"oXtyEqtojXDT0yDnAABY","upgrades":[],"pingInterval":25000,"pingTimeout":20000,"maxPayload":1000000}" |
2024-06-17 14:43:50.293210 | FINE     | socket_io_client:Manager | readyState opening |
2024-06-17 14:43:50.293083 | FINE     | socket_io_client:Manager | connect attempt will timeout after 20000 |
2024-06-17 14:43:50.292884 | FINE     | socket_io_client:engine.Socket | setting transport websocket |
2024-06-17 14:43:50.291578 | FINE     | socket_io_client:engine.Socket | creating transport "websocket" |
2024-06-17 14:43:50.291366 | FINE     | socket_io_client:Manager | opening REDACTED |
2024-06-17 14:43:50.291284 | FINE     | socket_io_client:Manager | readyState closed |
2024-06-17 14:43:50.291104 | FINE     | socket_io_client     | ignoring socket cache for REDACTED |
2024-06-17 14:43:49.415561 | INFO     | ApiService           | Pinging server with response code 200 |
alextran1502 commented 2 weeks ago

Thank you, does it crash on every video or just that one specific video?

desmond206x commented 2 weeks ago

Also happens on my Pixel 7 Android 14.

Only happens while switching from one video to another for me. But every time.

https://github.com/immich-app/immich/assets/833191/fe6ccfbd-786b-4dba-9b45-05641e46ff3d

carloslockward commented 2 weeks ago

@alextran1502 I can confirm it only happens when swipping from video to video. I also noticed that this only happens if the videos are on device, if the videos are only on the Immich server it seems it doesnt happen.

kt368 commented 2 weeks ago

I see same bug, Pixel 7* Android 14. When I sliding from one vide file to another (both files are in my phone locally) Immich app is crashing. App version 1.106.4, Server version 1.106.4. Server run in docker at Centos stream 9.

RealJohnGalt commented 1 week ago

In logcat are you seeing a crash, or is it being lmkd killed? If you're scrolling past a large number of photos/videos prior you're probably running into high memory usage in the android app and it's getting killed swiping like this.

This has been a known issue for me on multiple devices as long as I can remember. Here I can easily hit 6.5-7G app memory usage before it gets killed. As a workaround I only use the app for backups and the website for browsing on android.

desmond206x commented 1 week ago

If you're scrolling past a large number of photos/videos prior you're probably running into high memory usage in the android app and it's getting killed swiping like this.

No. I can open the app, open the first video of two in a row and after swiping to the second video the app crashes immediately.

RealJohnGalt commented 1 week ago

If you're scrolling past a large number of photos/videos prior you're probably running into high memory usage in the android app and it's getting killed swiping like this.

No. I can open the app, open the first video of two in a row and after swiping to the second video the app crashes immediately.

I'd still check logcat to see if you get a crash trace or if it is killed. It is very inefficient, so killings occur easily and often.

desmond206x commented 1 week ago

Any progress on this? It is really annoying to use the app with this bug

alextran1502 commented 1 week ago

There is not. I couldn't reproduce this issue yet on Android phone Samsung S23

alextran1502 commented 1 week ago

Can you guys go into the app settings > advanced > toggle preferences remote image and see if it fixes the issue?

Also, do you guys access your instance over reverse proxy or local IP? Can it be reproduced on local IP?

kt368 commented 6 days ago

I tried change to "Prefer remote image", but the error still appears.

On Sun, Jun 30, 2024, 13:49 Alex @.***> wrote:

Can you guys go into the app settings > advanced > toggle preferences remote image and see if it fixes the issue?

— Reply to this email directly, view it on GitHub https://github.com/immich-app/immich/issues/10439#issuecomment-2198753233, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB4CKW3AUVHCHHSFYDKMH2DZKBVMXAVCNFSM6AAAAABJOQCHAWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJYG42TGMRTGM . You are receiving this because you commented.Message ID: @.***>

desmond206x commented 6 days ago

Yeah, same for me. Still chrashing. Maybe it has something to do with the type of the video? Codec, HDR, ... something like this?

alextran1502 commented 6 days ago

Do you guys have default encoding options? Can you post your encoding settings if you modified them?

kt368 commented 6 days ago

My encoding options have been changed from the default. Here they are: Constant rate factor (-crf) 31 PRESET (-preset) slow AUDIO CODEC aac ACCEPTED AUDIO CODECS AAC MP3 OPUS VIDEO CODEC vp9 ACCEPTED VIDEO CODECS H.264 VP9 TARGET RESOLUTION 720p MAX BITRATE 0 THREADS 0 TRANSCODE POLICY Only videos not in an accepted format TONE-MAPPING Hable TWO-PASS ENCODING Yes Hardware Acceleration disabled Other options default I think this error is not related to video encoding because the error occurs even with the video files which have not yet been converted on the server.

Also here is the properties of one of the source video files: Codec: MPEG AAC Audio (mp4a) Language: English Type: Audio Channels: Stereo Sample rate: 48000 Hz Bits per sample: 32 Stream 1 Codec: MPEG-H Part2/HEVC (H.265) (hvc1) Language: English Type: Video Video resolution: 3840x2160 Buffer dimensions: 3840x2160 Frame rate: 59.695780 Decoded format: Orientation: Left bottom Color primaries: ITU-R BT.709 Color transfer function: ITU-R BT.709 Color space: ITU-R BT.709 Range Chroma location: Left

-- Best Regards Hryhorii

вс, 30 июн. 2024 г. в 23:37, Alex @.***>:

Do you guys have default encoding options? Can you post your encoding settings if you modified them?

— Reply to this email directly, view it on GitHub https://github.com/immich-app/immich/issues/10439#issuecomment-2199351413, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB4CKWZKT7SINLQIAPPWTNLZKD2JPAVCNFSM6AAAAABJOQCHAWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJZGM2TCNBRGM . You are receiving this because you commented.Message ID: @.***>

RaulGw4 commented 6 days ago

I also have this issue. I use the default encoding options.

I am running the latest version of Immich both on my server and the phone.

I got a Nothing Phone 2 with Android 14

https://github.com/immich-app/immich/assets/116492323/f8bbb978-e7d9-4955-ae9f-094497dcba64

RaulGw4 commented 6 days ago

There is not. I couldn't reproduce this issue yet on Android phone Samsung S23

Call me on discord, I will give you access to my phone to view what logs you need. raul_gw4

RealJohnGalt commented 5 days ago

Do you guys have default encoding options? Can you post your encoding settings if you modified them?

I do not use encoding at all. My videos are 80-130mbps h265. I use a reverse proxy but I can recreate on direct local IP also. Here on swiping on videos app memory usage goes crazy and it eventually gets killed (doesn't actually crash). Similar to the memory usage issue from scrolling down photo view in some cases (though that issue seems to be tied to waiting for thumbnails to load, was mostly solved by moving my thumbnails to a nvme).

alextran1502 commented 5 days ago

I wonder if this is related to your video recording settings. Can you share it so that I can reproduce it?

carloslockward commented 5 days ago

@RealJohnGalt I also use a reverse proxy and I get the issue. I think the reverse proxy is unrelated.

@alextran1502

To recap:

RaulGw4 commented 5 days ago

I wonder if this is related to your video recording settings. Can you share it so that I can reproduce it?

Quite interesting.

I have recorded 2 videos with my phone.

When i swipe between them in the immich app it crashes. But if i delete the files from my phone and use the cloud video it works without issues.

RaulGw4 commented 5 days ago

Update

I have installed the latest version of the android app on my phone (1.107.1). I have recorded 2 new videos and it doesn't seem to happen to those anymore.

BUT! The old ones still are the same. I have used the exact same phone, app, settings to record.

https://github.com/immich-app/immich/assets/116492323/c6262f23-c244-4267-91ce-53f06eba4aa3

carloslockward commented 4 days ago

Update

I have installed the latest version of the android app on my phone (1.107.1). I have recorded 2 new videos and it doesn't seem to happen to those anymore.

BUT! The old ones still are the same. I have used the exact same phone, app, settings to record.

screen.mp4

@RaulGw4 I think the video might be too short to reproduce the issue! Try recording a longer video maybe 20 seconds at least?

RaulGw4 commented 4 days ago

Update

I have installed the latest version of the android app on my phone (1.107.1). I have recorded 2 new videos and it doesn't seem to happen to those anymore.

BUT! The old ones still are the same. I have used the exact same phone, app, settings to record.

screen.mp4

@RaulGw4 I think the video might be too short to reproduce the issue! Try recording a longer video maybe 20 seconds at least?

You are right.

I have recorded 2 new videos that are 20 seconds long and it is happening.

desmond206x commented 4 days ago

I copied two videos from the WhatsApp video folder to my camera folder which syncs with immich. The videos are on my device and on remote and I can switch between without problems.

So it seems like it really has something to do with the video encoding or something like this.

carloslockward commented 4 days ago

I copied two videos from the WhatsApp video folder to my camera folder which syncs with immich. The videos are on my device and on remote and I can switch between without problems.

So it seems like it really has something to do with the video encoding or something like this.

Whatsapp videos are compressed heavily.

Perhaps is not the video encoding but its size. Which would explain why very short videos also don't have the issue.