Multiple displays detection

Post Reply
Mirec
Posts: 12
Joined: Sun Sep 14, 2025 5:30 am

Multiple displays detection

Post by Mirec »

I want to ask if it is possible to set it up or advise what needs to be done in my virtualcockpit project. As I have already mentioned, I have an rpi4B, two displays and an extended desktop to 2048x768. The first display is 1024x567 touch (used for Android Auto) and the second display is 1024x768 no touch (the cockpit.html app is running). I have already set one thing on the rpi in boot, but I need advice on how to add the hudiy app settings so that if I have both displays connected and I turn on the rpi+displays power, everything is ok and everything runs as it should. But I need logic, I unlock the car, the rpi power is turned on and display 1, display 2 is still without power, if I turn on the ignition key, the second cockpit display starts and the problem is that then the entire android auto and cockpit music display is scattered. If you can set something in hudiy like in rpi boot fw that both hdmi still appear as connected or fixed setting and display layout regardless of whether a display is connected or not.
hudiy
Site Admin
Posts: 440
Joined: Mon Jul 14, 2025 7:42 pm

Re: Multiple displays detection

Post by hudiy »

In Raspberry Pi OS Bookworm, window positioning is managed by labwc, while display detection and configuration are handled by kanshi.

The kanshi's README describes an option for creating custom profiles - this might be helpful in your case.

https://gitlab.freedesktop.org/emersion/kanshi
https://labwc.github.io/

Kanshi is started in Raspberry Pi OS Bookworm via /etc/xdg/labwc/autostart
Mirec
Posts: 12
Joined: Sun Sep 14, 2025 5:30 am

Re: Multiple displays detection

Post by Mirec »

Sorry to bother you so much but I can't get around this and set it up properly. I updated hudiy to v1.2 everything is ok but I can't set the display layout. In version 1.0 I had everything set up nicely, even android auto on one display on the other nicely via the server port12345 my app cockpit.html immediately ran the api media and navi as I wanted and even via port 5050 I had a functional gpio on rpi. but after the update everything just messed up the display layout. in kanshi I set the displays like this: profile default {
output HDMI-A-1 enable mode 1024x576@59.966999 position 0,0 transform normal
output HDMI-A-2 enable mode 1024x768@75.028999 position 1024,0 transform normal
}
this ensured that they did not change for me, but I noticed that in the update there was a change in the run.sh file, version 1.0 was asking for QT_QPA_PLATFORM=xcb and the new version 1.2 is now running purely on wayland and refers to the new run_startup.sh and that is a bug that I still can't solve. All the parameters in Kanshi are ok, even when I install wlr-randr, the displays are set nicely, I still have everything set in main_configuration, and the parameters in the dashboard and overlays are set, but the Android Auto still only runs on one display, and when I run cockpit.html, it actually cancels Android Auto and runs the cockpit, and the second screen still only has the desktop wallpaper.
hudiy
Site Admin
Posts: 440
Joined: Mon Jul 14, 2025 7:42 pm

Re: Multiple displays detection

Post by hudiy »

Mirec wrote: Thu Sep 25, 2025 7:15 pm Sorry to bother you so much but I can't get around this and set it up properly. I updated hudiy to v1.2 everything is ok but I can't set the display layout. In version 1.0 I had everything set up nicely, even android auto on one display on the other nicely via the server port12345 my app cockpit.html immediately ran the api media and navi as I wanted and even via port 5050 I had a functional gpio on rpi. but after the update everything just messed up the display layout. in kanshi I set the displays like this: profile default {
output HDMI-A-1 enable mode 1024x576@59.966999 position 0,0 transform normal
output HDMI-A-2 enable mode 1024x768@75.028999 position 1024,0 transform normal
}
this ensured that they did not change for me, but I noticed that in the update there was a change in the run.sh file, version 1.0 was asking for QT_QPA_PLATFORM=xcb and the new version 1.2 is now running purely on wayland and refers to the new run_startup.sh and that is a bug that I still can't solve. All the parameters in Kanshi are ok, even when I install wlr-randr, the displays are set nicely, I still have everything set in main_configuration, and the parameters in the dashboard and overlays are set, but the Android Auto still only runs on one display, and when I run cockpit.html, it actually cancels Android Auto and runs the cockpit, and the second screen still only has the desktop wallpaper.
Could you please post main_configuration.json and overlays.json files? Also please post screenshot from screen configuration tool (Start -> Preferences -> Screen Configuration).

Please have a look at splitWithProjections parameter (https://github.com/wiboma/hudiy/blob/ma ... pplication). According to the description of your setup it should be set to true.

You can still use the QT_QPA_PLATFORM=xcb if you do not plan using DRM renderer.
Mirec
Posts: 12
Joined: Sun Sep 14, 2025 5:30 am

Re: Multiple displays detection

Post by Mirec »

I am sending files and photos because I can send a maximum of 3 attachments, so if needed I will send more photos later.
Attachments
virtualcocpit alfa.rar
(3.67 MiB) Downloaded 82 times
owerlais.rar
(432 Bytes) Downloaded 73 times
main_configurations.rar
(1.4 KiB) Downloaded 74 times
Mirec
Posts: 12
Joined: Sun Sep 14, 2025 5:30 am

Re: Multiple displays detection

Post by Mirec »

the xcb works if I add it to run.sh but it is slower than drm. and since drm is already in version 1.2 I would like to start snim.ked so in the worst case downgrade to version 1.0
hudiy
Site Admin
Posts: 440
Joined: Mon Jul 14, 2025 7:42 pm

Re: Multiple displays detection

Post by hudiy »

Configuration looks good. Could you please post the screenshot how the window looks when you run Hudiy with and without xcb?
Mirec
Posts: 12
Joined: Sun Sep 14, 2025 5:30 am

Re: Multiple displays detection

Post by Mirec »

So in one photo there is a launch of hudiy where I added the line export QT_QPA_PLATFORM=xcb to the hudiy_run.sh file, and then the displays are nicely arranged on the bottom app android auto and the top my app cockpit.html, in this case I can determine where I have something to display, the second photo is the original launch of hudiy_run.sh version 1.2 and there the problem arises that no matter how hard I try to load the display, hudiy still asks for a screen with a higher resolution and does not take the second screen into account at all because as you can see in the photo, I always have only the rpi area on one and hudiy android auto is displayed on the other. Even if I change the order of the screens in the settings (Start -> Preferences -> Screen configuration). so hudiy is displayed where I want it, but after restarting it is displayed again on the larger one and the whole setting is broken.Even if I put that line in run sh so that it appears according to the old version, I can't set the display exactly where Android Auto should appear versus touch. With the old version 1.0, I had everything set up nicely and functionally, so I hope you can advise how to set it up on the new version 1.2. According to what I've read, Wayland is faster and less processor-hungry, so the whole thing should be faster, so I would be happy if it could be run under Wayland and not use the old version under XCB.
Attachments
virtualcocpit alfa.rar
(2.76 MiB) Downloaded 81 times
hudiy
Site Admin
Posts: 440
Joined: Mon Jul 14, 2025 7:42 pm

Re: Multiple displays detection

Post by hudiy »

Looks like for some reason labwc ignores requested window size in full wayland mode. You can try forcing it in $HOME/.config/labwc/rc.xml using window rules and actions like:

Code: Select all

<?xml version="1.0"?>
<openbox_config xmlns="http://openbox.org/3.4/rc">
  <windowRules>
    <windowRule identifier="hudiy" matchOnce="true" serverDecoration="no">
      <action name="MoveTo" x="0" y="0" />
      <action name="ResizeTo" width="2048" height="768" />
    </windowRule>

    <windowRule identifier="splash" matchOnce="true" serverDecoration="no">
      <action name="MoveTo" x="0" y="0" />
      <action name="ResizeTo" width="2048" height="768" />
    </windowRule>
  </windowRules>
</openbox_config>
https://labwc.github.io/labwc-config.5.html
https://labwc.github.io/labwc-actions.5.html
Post Reply