GloDroidCommunity / raspberry-pi

Android 14 for the Raspberry PI 4 series based on the GloDroid project
Apache License 2.0
28 stars 5 forks source link

HwcDisplayConfigs: switch headless display to 30Hz #15

Closed mikegapinski closed 1 year ago

mikegapinski commented 1 year ago

When headless display mode is used in drm_hwcomposer we use scrcpy(with software encoder or v4l2 hardware one) or other capture methods to interact with the device

The Pi can't keep up with 60Hz encoding for higher resolutions and even in 1024x768 switching to 30Hz significantly reduces the CPU load when VirtualDisplay is utilized for capture.

With this patch the board is able to play video on virtual displays smoothly without putting too much load on the CPU.

I used to "control the framerate" of my capture software by ignoring frames and not sending them to the encoder, this also worked but the resources were already wasted before since the frames they were already composed without being consumed

mikegapinski commented 1 year ago

Marked as draft until I verify the patch on mainline drm_hwcomposer

rsglobal commented 1 year ago

Looks good.

mikegapinski commented 1 year ago

@rsglobal Rebased the patch. It's ready to merge.

BTW: configuration/common//patches- feel redundant now after GlodroidCommunity showed up. Right now we have to add patches that add a patch to glodroid/configuration instead of placing them in patches-aosp. I don't have a nice solution for this in my head yet but I need to figure something out for Tesla Android where my platform patches will be shared between boards.

Good to see mainline drm_hwcomposer on RPI4, it works well, kudos!

rsglobal commented 1 year ago

Was the audio HAL commit added by accident?

mikegapinski commented 1 year ago

Was the audio HAL commit added by accident?

good catch, removed it from this branch