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

halium-7.1: Disable cameraserver & mediaserver #9

Merged
merged 3 commits into from
May 4, 2023

Conversation

fredldotme
Copy link

@fredldotme fredldotme commented May 3, 2023

Halium-based ports either use droidmedia or camera_service in libhybris for camera needs.
Android's default cameraserver actively interferes with camera functionality provided by either of them,
while hosting an unnecessary Binder interface no one is using.
In addition to that it also takes over the socket for the camera trust agent which
we don't want.

Last but not least, since this racy behavior causes trouble, cameraserver's removal
also fixes the Xperia X's infamous "green half" screen in the viewfinder.

To round it up also disable mediaserver as it is an unnecessary Binder service for Halium.
Also, it might act as a fallback for providing camera functionality depending
on the device's hardening configuration, which would spawn yet another conflicting
cameraserver in disguise, replacing the trust agent socket underneath our feet.

fredldotme added 2 commits May 3, 2023 03:23
Halium-based ports either use droidmedia or camera_service in libhybris for camera needs.
This service actively interferes with camera functionality provided by either of them,
while hosting an unnecessary Binder interface no one is using.
In addition to that it also takes over the socket for the camera trust agent which
we don't want.

Last but not least, since this racy behavior causes trouble, cameraserver's removal
also fixes the Xperia X's infamous "green half" screen in the viewfinder.
mediaserver is an unnecessary Binder service for Halium.
Also, it might act as a fallback for providing camera functionality depending
on the device's hardening configuration, which would spawn yet another conflicting
cameraserver in disguise, replacing the trust agent socket underneath our feet.
…CameraService

libcameraservice has multiple consumers, each instantiating their own TrustAgentRegistry and
tripping over each other's trust socket on the same path.

Don't instantiate the TrustAgentRegistry unconditionally. Instead, just do so for the actual
CameraService.
@fredldotme
Copy link
Author

fredldotme commented May 3, 2023

The actual fix for Halium 7.1 not having a stable trust-agent connection depending on a race condition during boot is in eb287ea. I just noticed that the other two reflect 1:! the only other open PR here: #5

Let me know how to proceed with the service disablement changes but the mentioned commit eb287ea is critical in getting camera permissions to work properly.

@peat-psuwit
Copy link

Hmm if both Android's mediaservice and cameraservice are disabled, then there's no reason that CameraService might be instantiated twice, right? Or am I missing something?

Also, could you please test if the disablement of mediaservice affects HW video decoding in browser? My feeling is that it shouldn't (because we have this commit), but just in case.

@fredldotme
Copy link
Author

Hmm if both Android's mediaservice and cameraservice are disabled, then there's no reason that CameraService might be instantiated twice, right? Or am I missing something?

Also, could you please test if the disablement of mediaservice affects HW video decoding in browser? My feeling is that it shouldn't (because we have this commit), but just in case.

With gpu-compositing enabled in QtWebEngine and mediaservice disabled everything works as expected, including H264 decoding.

@peat-psuwit peat-psuwit merged commit 036aad8 into halium-7.1 May 4, 2023
@Flohack74 Flohack74 deleted the halium-7.1-nomediaservices branch May 6, 2023 09:54
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.

2 participants