Dual displays - usb-c and HDMI on rock960ab with android 9.0

Building on Dual Display Framebuffer Settings, I was trying to get a usb-c touch screen and an hdmi monitor running today with android 9.0. I was encouraged when I booted with both plugged in and both displays were getting signal. I could see the Android home screen on both. Also encouraging, the android DisplayManager returns 2 displays “Built-In” and “HDMI”.

However when you use the Presentation API to draw content, it doesn’t behave as expected:

Draw on “Built-In” display: draws on both screens, nav bar buttons still visible and tappable. Ok, good
Draw on “HDMI” display: draws on just USB-C screen, HDMI screen unaffected. Draws on full screen on top of nav bar buttons. Tapping where they were does nothing.

Ok, not too bad for the first try. So I modified /vendor/build.prop as follows:

vendor.hwc.device.primary=DP # I'm not sure, is this correct value for usb-c video? 

The behavior gets a little weird. Launcher doesn’t mirror to USB-C screen, only shows on HDMI screen. When I open the test app, it is mirrored on both screens. And the Presentation behavior is reversed, content drawn on both “Built in” and “HDMI” displays shows up only on HDMI screen.

I don’t think the “DP” value I put in build.prop is correct, but I also think there’s an issue where the android HWC can’t tell the 2 screens apart. It just thinks there’s 1 screen and it’s “HDMI” regardless of how it’s actually connected.

I was working with this in the past. For my build.prop settings I had the following:

 # default primary display

You may try loading Google Slides APK and testing the presentation view that way to ensure you are doing it correctly. Or, use some other Presentation test app.

Could you post your application code?

Yes, thanks for your initial post! On Android 9, sys.hwc has changed to vendor.hwc. Otherwise I was following your lead.

I was testing with the APISamples android app, developed by google. Presentation api activity. The code to list displays is pretty simple:


Then you can take the Display that gets returned from that and:

    val presentation = BCPresentationDialog(this, display)

BCPresentationDialog is just an instance of the Presentation class that shows some content.