Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4824

Graphics, sound and multimedia • Re: DRM application occupies both HDMI ports

$
0
0
So, I've used udev and sysfs to identify when OUT1 is connected. I will leave a hint here so that future users can deal with it. Note: in my kernel I have debugfs.

Udev rule:

Code:

SUBSYSTEM=="drm", ACTION=="change", ENV{DEVLINKS}=="/dev/dri/by-path/platform-gpu-card", RUN+="/usr/bin/kvmd-udev-restart-pass %k %E{CONNECTOR}"
The script:

Code:

set -eEset -xcard="$1"conn_id="$2"test -n "$card"test -n "$conn_id"card_n="${card/card/}"test -n "$card_n"port=$(grep "^connector\[$conn_id\]:" "/sys/kernel/debug/dri/$card_n/state" | awk '{print $2}')test -n "$port"if [ "$port" = "HDMI-A-1" ]; thenif systemctl is-enabled -q kvmd-pass; thenstatus=$(head -n 1 "/sys/class/drm/$card-$port/status")if [ "$status" = "connected" ]; thensystemctl restart kvmd-pass || truefififi

Statistics: Posted by mdevaev — Mon Mar 11, 2024 5:14 pm



Viewing all articles
Browse latest Browse all 4824

Trending Articles