New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Daemon mode causes stuttering when two monitors are connected #19
Comments
Hi @m45t3r, thanks for the feedback. Indeed, I came across the problem as well. Few weeks ago, I tried the deamon mode on two different computers, but I couldn't reproduce that stuttering. After an investigation:
Inconvenience:
The juice is worth the squeeze and I can't keep using xrandr after getting such a stuttering. prev=0; i=0
while true; do
for edid in /sys/class/drm/*/edid; do
[ -n "$(cat "$edid")" ] && i=$((i+1))
done
[ "$i" -eq 1 ] && [ "$i" != "$prev" ] && "${XRANDR}" --auto
prev="$i"; i=0
sleep 2
done |
Signed-off-by: Thomas Venriès <thomas.venries@gmail.com>
Looks good, however I am getting the following warning though:
And btw, there is another interesting file in this directory:
In fact, this seems to be a good choice for detecting connect/disconnect monitors, since my eDP entry is enabled and HDMI were disabled in the above case. |
Warning message, but does it work ? Try to replace this: [ -n "$(cat "$edid")" ] && i=$((i+1)) With this: [ -n "$(<"$edid")" ] && i=$((i+1)) It avoids both forking a subshell and executing the |
In Arch Linux,
Btw, even changing the line I as suggested: [ -n "$(<"$edid")" ] && i=$((i+1)) I get the same error. However, this seems to work though: # Daemon mode
if $aFlag ; then
prev=0; i=0
while true; do
for status in /sys/class/drm/*/status; do
[ "$(<"$status")" = "connected" ] && i=$((i+1))
done
if [ "$i" -eq 1 ] && [ "$i" != "$prev" ]; then
"${XRANDR}" --auto --dpi "${dpi}"
fi
prev="$i"; i=0
sleep 2
done
fi BTW, |
Sold ! |
Signed-off-by: Thomas Venriès <thomas.venries@gmail.com>
Thanks @Ventto. |
Firstly, great project.
mons
is exactly what I needed to manage multiple monitors usingi3wm
.To the issue I am having: running
mons
in daemon mode with two monitors cause a small stuttering each dozen of seconds, that is quite noticiable when watching a video. The issue seems to bexrandr
itself, that causes this stuttering when two monitors are enabled, however if only one monitor is connected there is no problem. To easily reproduce the problem, you can run in a terminal;With two monitor connected, open a video in YouTube for example. The frame rate is completely choppy. Of course,
mons
runsxrandr
in a much slower rate (each 3 seconds it seems by looking at the code), however it is still distracting.I don't know a good solution. Maybe this could be fixable in
xrandr
itself, maybe not. Or there could be another way to query the connected monitors instead of usingxrandr
. Any ideas?The text was updated successfully, but these errors were encountered: