RK3576: DP Alt Mode display management (auto-switch + manual cycle)#2678
RK3576: DP Alt Mode display management (auto-switch + manual cycle)#2678pgratz1 wants to merge 1 commit into
Conversation
|
Tested on ANBERNIC RG Vita Pro with VITURE Pro XR glasses (combined with #2676). Plugging in the glasses via USB-C automatically moves workspace 1 to the glasses and powers off the internal DSI-1 panel. Unplugging restores the internal display and EmulationStation restarts at the correct resolution. |
|
Updated based on reviewer feedback. This revision makes What changed:
Why
The correct approach for normal DRM hotplug events is a udev rule (as used by Audio note: DP audio over the USB-C connection is not yet handled. The VITURE glasses expose only HID and CDC serial interfaces over USB — no USB Audio Class. DP audio would require adding ASoC DAI component registration to |
d755366 to
6789c74
Compare
|
Tested on ANBERNIC RG Vita Pro with VITURE Pro XR glasses:
|
fcd6a3b to
567e941
Compare
567e941 to
d01957b
Compare
|
Any update on this? I'm looking to improve dual screen support when external monitors are hotplugged (no pr yet, just a plan so far), seems like this branch contains many helpful changes. Specifically: Another example is |
| wlr-randr 2>/dev/null | awk '/^(DSI|eDP|LVDS)-/ { print $1 }' | ||
| } | ||
|
|
||
| # Returns the PipeWire sink for DP audio (hdmi-audio-codec on 27e40000.dp). |
There was a problem hiding this comment.
Not very platform agnostic that 27e40000.dp ...
There was a problem hiding this comment.
That's fair, this weekend I'll have some more time to play with this and maybe make this a bit less RG Vita Pro specific....
There was a problem hiding this comment.
OK so this particular code was part of a rabbit hole I went down trying to get audio working via the DP device. I actually never got it working so I'm rolling back that change. I'm testing the roll back but it should be clean since it was working before (TF if I know why I can't get the sound working on the glasses I have though... works great from my phone).
8aec0c6 to
a099c94
Compare
|
@xzn Still active, just got bogged down with work, just rebased on the current next head and removed the code Loki666 didn't like. A few notes that might be useful for your dual-screen work: On dp_monitor's approach: The core mechanism is a sway IPC subscription ( On On |
|
@loki666 Are you all happy with the approach I'm taking here or do you have any advice on how I should rework it? I'm thinking about doing a hotkey to switch output from device to DP to both in a round robin. I don't have any other devices so I don't have anything to compare against, so let me know what you think and what you'd like to see to get this merged. |
|
Changes looks ok... (need testing for regression) Question : what's the issue currently? I thought we already had some mechanism to switch output to external display. (Or is currently only covering HDMI) |
|
So the main issue this is trying to solve is that with the current next head, while the kernel is recognizing that there is a DP inserted, and it is powering the display, Sway isn't putting ES on that screen (also doesn't work on insertion of HDMI). With this patch when you insert DP (or HDMI) it will move ES to the DP or HDMI and power down the local screen. I'm thinking of augmenting this to allow round robin between DP/HDMI or device screen or both via hotkey combo (any suggestions which? Claude says L1+BNT_South is not used, maybe that?) BTW, just saw that L1+BNT_BACK is supposed to do something like switch screens but on the vita pro it doesn't do anything in ES. |
|
Just did a little testing with the next head. With that if you boot with HDMI plugged in it does go there but inserting it after boot does not work w/o my patch. Booting with DP does not work on stock though. Brings up the display sideways on the device. |
|
Ok thanks. This is indeed something we'll probably want to pull. We are currently in feature freeze for upcoming monthly release. But I guess next week we can merge this. Could you force push this in one single commit. |
|
OK sure, let me test my round robin thing and if that works I'll do it as a single commit. |
Adds dp_monitor, a daemon that subscribes to sway IPC output events and automatically powers the device's internal display off when a DP Alt Mode display is connected, and back on when it disconnects. Using sway IPC rather than udev avoids the race condition where wlr-randr/swaymsg require sway to have already processed the new output before they can act on it. Wires dp_monitor into 111-sway-init so it launches automatically on any sway device that has DP or HDMI hardware connectors. Also adds dp_output_cycle, a script that manually cycles display output mode (external-only → internal-only → both → repeat) on L1+Select, replacing the broken screen_switch binding on the same hotkey. dp_output_cycle coordinates with dp_monitor via a lock file so the two never fight over output state. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
a099c94 to
efd9f9f
Compare
Summary
Userspace changes to manage display output when an external display is connected via USB-C DP Alt Mode on RK3576 devices.
Depends on: #2680 (kernel patches for DP Alt Mode support)
Changes
dp_monitor
wlr-randr/swaymsgrequire sway to have already processed the new output before they can act on it111-sway-initon any sway device with DP or HDMI hardware connectors — not RK3576-specificdp_output_cycle (new)
screen_switchbinding on the same hotkeydp_monitorcannot react mid-transitionsway config (111-sway-init)
for_window [app_id="emulationstation"] move output DP-1so ES opens on the external display when first connectedTest plan
make docker-RK3576wlr-randroutput reflects enabled/disabled state correctly after each cycle step🤖 Generated with Claude Code