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

Android app crashes when opening HDR videos on graphene OS #15362

Open
1 of 3 tasks
MaKraMc opened this issue Jan 15, 2025 · 4 comments
Open
1 of 3 tasks

Android app crashes when opening HDR videos on graphene OS #15362

MaKraMc opened this issue Jan 15, 2025 · 4 comments

Comments

@MaKraMc
Copy link
Contributor

MaKraMc commented Jan 15, 2025

The bug

When trying to watch HDR videos recorded on an iPhone (tested with other HDR .mov vodeos as well) on an Android device with graphene OS installed, the App crashes.

This has been happening since release 1.122.0 wich introduced support for HDR videos.
SDR Videos work fine, I've only observed HDR videos that lead to a crash.

On my Samsung Tablet and iPhone, the HDR Videos play fine, it seems to only affect Graphene OS (wich is pretty near stock). I will try to test this on a stock android device once I get my hands on one.

The OS that Immich Server is running on

Debian 11

Version of Immich Server

v1.124.2

Version of Immich Mobile App

v1.124.2

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

#
# WARNING: Make sure to use the docker-compose.yml of the current release:
#
# /~https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml
#
# The compose file on main may not be compatible with the latest release.
#

name: immich

services:
  immich-server:
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    # extends:
    #   file: hwaccel.transcoding.yml
    #   service: cpu # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding
    volumes:
      # Do not edit the next line. If you want to change the media storage location on your system, edit the value of UPLOAD_LOCATION in the .env file
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - stack.env
    ports:
      - 2283:2283
    depends_on:
      - redis
      - database
    restart: always
    healthcheck:
      disable: false

  immich-machine-learning:
    container_name: immich_machine_learning
    # For hardware acceleration, add one of -[armnn, cuda, openvino] to the image tag.
    # Example tag: ${IMMICH_VERSION:-release}-cuda
    image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
    # extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/ml-hardware-acceleration
    #   file: hwaccel.ml.yml
    #   service: cpu # set to one of [armnn, cuda, openvino, openvino-wsl] for accelerated inference - use the `-wsl` version for WSL2 where applicable
    volumes:
      - model-cache:/cache
    env_file:
      - stack.env
    restart: always
    healthcheck:
      disable: false

  redis:
    container_name: immich_redis
    image: docker.io/redis:6.2-alpine@sha256:2d1463258f2764328496376f5d965f20c6a67f66ea2b06dc42af351f75248792
    healthcheck:
      test: redis-cli ping || exit 1
    restart: always

  database:
    container_name: immich_postgres
    image: docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
      POSTGRES_INITDB_ARGS: '--data-checksums'
    volumes:
      # Do not edit the next line. If you want to change the database storage location on your system, edit the value of DB_DATA_LOCATION in the .env file
      - ${DB_DATA_LOCATION}:/var/lib/postgresql/data
    healthcheck:
      test: pg_isready --dbname='${DB_DATABASE_NAME}' --username='${DB_USERNAME}' || exit 1; Chksum="$$(psql --dbname='${DB_DATABASE_NAME}' --username='${DB_USERNAME}' --tuples-only --no-align --command='SELECT COALESCE(SUM(checksum_failures), 0) FROM pg_stat_database')"; echo "checksum failure count is $$Chksum"; [ "$$Chksum" = '0' ] || exit 1
      interval: 5m
      start_interval: 30s
      start_period: 5m
    command: ["postgres", "-c", "shared_preload_libraries=vectors.so", "-c", 'search_path="$$user", public, vectors', "-c", "logging_collector=on", "-c", "max_wal_size=2GB", "-c", "shared_buffers=512MB", "-c", "wal_compression=on"]
    restart: always

volumes:
  model-cache:

Your .env content

UPLOAD_LOCATION=/zpool02/docker/immich/library
DB_DATA_LOCATION=/zpool02/docker/immich/postgres
IMMICH_VERSION=release
DB_PASSWORD=...
DB_USERNAME=immich
DB_DATABASE_NAME=immich

Reproduction steps

  1. Install immich >= 122.0 on a device running graphene OS.
  2. Upload HDR video (Like a standard iPhone recording)
  3. View video in app on graphene OS.
  4. Crash

Relevant log output

type: crash
osVersion: google/cheetah/cheetah:15/AP4A.250105.002/2025010700:user/release-keys
flags: dev options enabled
package: app.alextran.immich:175, targetSdk 35
process: app.alextran.immich
processUptime: 6662 + 348 ms
installer: com.looker.droidify

java.lang.ClassCastException: w0.c cannot be cast to java.lang.Error
	at k5.b.b0(Unknown Source:35)
	at k0.i0.C1(Unknown Source:2)
	at k0.i0.c0(Unknown Source:0)
	at k0.g0.b(Unknown Source:4)
	at g0.n$c.a(Unknown Source:17)
	at g0.n.h(Unknown Source:16)
	at g0.n.a(Unknown Source:0)
	at g0.m.run(Unknown Source:6)
	at g0.n.f(Unknown Source:67)
	at k0.i0.f2(Unknown Source:422)
	at k0.i0.n1(Unknown Source:192)
	at k0.i0.s1(Unknown Source:0)
	at k0.i0.m0(Unknown Source:0)
	at k0.Y.run(Unknown Source:4)
	at android.os.Handler.handleCallback(Handler.java:991)
	at android.os.Handler.dispatchMessage(Handler.java:102)
	at android.os.Looper.loopOnce(Looper.java:232)
	at android.os.Looper.loop(Looper.java:317)
	at android.app.ActivityThread.main(ActivityThread.java:8826)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:591)
	at com.android.internal.os.ExecInit.main(ExecInit.java:50)
	at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
	at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:369)

Additional information

FFProbe of an affected video (downloaded from immich server)

  built with Apple clang version 16.0.0 (clang-1600.0.26.4)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/7.1_4 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags='-Wl,-ld_classic' --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libaribb24 --enable-libbluray --enable-libdav1d --enable-libharfbuzz --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox --enable-audiotoolbox
  libavutil      59. 39.100 / 59. 39.100
  libavcodec     61. 19.100 / 61. 19.100
  libavformat    61.  7.100 / 61.  7.100
  libavdevice    61.  3.100 / 61.  3.100
  libavfilter    10.  4.100 / 10.  4.100
  libswscale      8.  3.100 /  8.  3.100
  libswresample   5.  3.100 /  5.  3.100
  libpostproc    58.  3.100 / 58.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Downloads/IMG_0119.MOV':
  Metadata:
    major_brand     : qt  
    minor_version   : 0
    compatible_brands: qt  
    creation_time   : 2024-08-05T06:34:06.000000Z
    com.apple.quicktime.location.accuracy.horizontal: 5.264832
    com.apple.quicktime.location.ISO6709: +47.4116+011.0114+2124.287/
    com.apple.quicktime.make: Apple
    com.apple.quicktime.model: iPhone 15
    com.apple.quicktime.software: 17.6
    com.apple.quicktime.creationdate: 2024-08-05T08:34:05+0200
  Duration: 00:00:13.41, start: 0.000000, bitrate: 55744 kb/s
  Stream #0:0[0x1](und): Video: hevc (Main 10) (hvc1 / 0x31637668), yuv420p10le(tv, bt2020nc/bt2020/arib-std-b67), 3840x2160, 55448 kb/s, 59.94 fps, 59.94 tbr, 600 tbn (default)
      Metadata:
        creation_time   : 2024-08-05T06:34:06.000000Z
        handler_name    : Core Media Video
        vendor_id       : [0][0][0][0]
        encoder         : HEVC
      Side data:
        DOVI configuration record: version: 1.0, profile: 8, level: 10, rpu flag: 1, el flag: 0, bl flag: 1, compatibility id: 4, compression: 0
        Ambient Viewing Environment, ambient_illuminance=314.000000, ambient_light_x=0.312700, ambient_light_y=0.329000
  Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 191 kb/s (default)
      Metadata:
        creation_time   : 2024-08-05T06:34:06.000000Z
        handler_name    : Core Media Audio
        vendor_id       : [0][0][0][0]
  Stream #0:2[0x3](und): Data: none (mebx / 0x7862656D), 0 kb/s (default)
      Metadata:
        creation_time   : 2024-08-05T06:34:06.000000Z
        handler_name    : Core Media Metadata
  Stream #0:3[0x4](und): Data: none (mebx / 0x7862656D), 0 kb/s (default)
      Metadata:
        creation_time   : 2024-08-05T06:34:06.000000Z
        handler_name    : Core Media Metadata
  Stream #0:4[0x5](und): Data: none (mebx / 0x7862656D), 72 kb/s (default)
      Metadata:
        creation_time   : 2024-08-05T06:34:06.000000Z
        handler_name    : Core Media Metadata
Unsupported codec with id 0 for input stream 2
Unsupported codec with id 0 for input stream 3
Unsupported codec with id 0 for input stream 4

Android crash report:

type: crash
osVersion: google/cheetah/cheetah:15/AP4A.250105.002/2025010700:user/release-keys
flags: dev options enabled
package: app.alextran.immich:175, targetSdk 35
process: app.alextran.immich
processUptime: 6662 + 348 ms
installer: com.looker.droidify

java.lang.ClassCastException: w0.c cannot be cast to java.lang.Error
	at k5.b.b0(Unknown Source:35)
	at k0.i0.C1(Unknown Source:2)
	at k0.i0.c0(Unknown Source:0)
	at k0.g0.b(Unknown Source:4)
	at g0.n$c.a(Unknown Source:17)
	at g0.n.h(Unknown Source:16)
	at g0.n.a(Unknown Source:0)
	at g0.m.run(Unknown Source:6)
	at g0.n.f(Unknown Source:67)
	at k0.i0.f2(Unknown Source:422)
	at k0.i0.n1(Unknown Source:192)
	at k0.i0.s1(Unknown Source:0)
	at k0.i0.m0(Unknown Source:0)
	at k0.Y.run(Unknown Source:4)
	at android.os.Handler.handleCallback(Handler.java:991)
	at android.os.Handler.dispatchMessage(Handler.java:102)
	at android.os.Looper.loopOnce(Looper.java:232)
	at android.os.Looper.loop(Looper.java:317)
	at android.app.ActivityThread.main(ActivityThread.java:8826)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:591)
	at com.android.internal.os.ExecInit.main(ExecInit.java:50)
	at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
	at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:369)
@alextran1502
Copy link
Contributor

Hello, can you please try this APK? It is built from main and I believe it fixes the crash issue. Please let me know how it goes

https://drive.google.com/file/d/1esfRUb8BbouLnyTPZupthsYfzYCySkR2/view?usp=sharing

@MaKraMc
Copy link
Contributor Author

MaKraMc commented Jan 15, 2025

Hi Alex, thanks for looking into this personally so quickly (Huge fan :D)
With your apk, the app does indeed not immidiatly crash when opening a video, it just displays the thumbnail and a spinner after tapping on a video (Seems to be buffering indefinitely). So this looks promising, the Video just does not play.

@alextran1502
Copy link
Contributor

yeah we will need to figure out why it doesn't play. Can you send a sample video, please?

@MaKraMc
Copy link
Contributor Author

MaKraMc commented Jan 15, 2025

Sure. Just try this short clip I shot on my iPhone with pretty default settings.

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

No branches or pull requests

2 participants