Skip to content

Update CameraService.cpp #1

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

Open
wants to merge 1 commit into
base: twelve-L
Choose a base branch
from

Conversation

abhishekfire08
Copy link

libcameraservice: Add support for miui camera mode

  • devices like ginkgo and some xiaomi sdm660 use miui camera mode in camera
    hal to activate certain functions in camera hal, these are enabled when
    vendor.camera.miui.apk is set to 1 based on sys.camera.miui.apk value

  • if this prop is set by default gcam crashes, so we must do it dynamically

  • xiaomi does this in stock libcameraservice but unfortunately we don't
    have stock android 12 to use prebuilt lib

@abhishekfire08
Copy link
Author

libcameraservice: Add support for miui camera mode

  • devices like ginkgo and some xiaomi sdm660 use miui camera mode in camera
    hal to activate certain functions in camera hal, these are enabled when
    vendor.camera.miui.apk is set to 1 based on sys.camera.miui.apk value

  • if this prop is set by default gcam crashes, so we must do it dynamically

  • xiaomi does this in stock libcameraservice but unfortunately we don't
    have stock android 12 to use prebuilt lib

techyminati pushed a commit that referenced this pull request Mar 14, 2023
Do not hold lock when IPC call is expected from HAL.

C2SurfaceSyncObj is shared lock between framework and HAL. HAL process
can have only one thread to handle IPC from HAL to framework.
Therefore Holding C2SurfaceSyncObj from HAL during IPC call could
trigger deadlock. The exact scenario is as follows.

Thread #1:(HAL -> framework IPC) HIDL call onInputBuffersReleased()
            calls to feedInputBufferIfAvailable(). Since this is using
            HAL IPC thread, this will block Thread #3. This is waiting
            for mOuput mutex which is held by Thread #2.
Thread #2:(framework) discardBuffer() holds mOutput mutex which blocks
            Thread #1. But this is waiting for C2SurfaceSyncObj which is
            held by Thread #3.
Thread #3:(HAL) Dtor of C2BufferQueueBlockPoolData is holding
            C2SurfaceSyncObj, therefore this will block #2. This thread
            is waiting for HIDL IPC thread to be free in order for
            'igbp->cancel()', but HIDL IPC thread is already occupied by
            Thread #1.

Bug: 246707566
Test: atest android.media.decoder.cts.AdaptivePlaybackTest
Test: atest android.media.decoder.cts.DecoderTest
Change-Id: I6a9540d3b4d03806cd40bb4f89a234a6b77758a9
Merged-In: I6a9540d3b4d03806cd40bb4f89a234a6b77758a9
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

Successfully merging this pull request may close these issues.

1 participant