Page 1 of 1

Testing HDMI modes

Posted: Fri Sep 23, 2016 7:32 pm
by ab1jx
I haven't actually tried this, just worked out the parts. In /boot create a file called prefix that contains everything you want in your config.txt except the HDMI mode, like
hdmi_group=2
hdmi_ignore_edid=0xa5000080
hdmi_force_hotplug=1
And create a script like this (in /boot) that's called on every boot (after a cd to /boot)
#!/bin/bash
declare -i mode=1
declare passes=n
if [ -e modefile ]; then mode=`cat modefile`; else mode=1; fi
echo -en "\007" # beep
# This times out in 5 seconds, logs y only if you hit y
read -t 5 -n 1 -p "Press y if mode worked " passes
echo
echo Logging: $mode $passes
echo $mode $passes >> logfile

# Set up for next boot
((mode++))
if [ $mode == 15 ] # mode 15 won't boot
then
((mode++));
fi
# modefile is mode storage through reboots
echo $mode > modefile
# Put everything up to hdmi_mode in a file called prefix
cp prefix config.txt
# Add the hdmi mode to the end
echo "hdmi_mode="$mode >> config.txt

while [[ $mode -lt 87 ]]
do
# uncomment to actually reboot
#reboot
exit
done
Uncomment the reboot to have it actually reboot the machine.

Logfile will look like this after it's done:
1 y
2 n
3 y
4 y
5 n
If you don't see the mode working, don't hit y and it will time out after 5 seconds and not get a y in the log file for that mode.

Re: Testing HDMI modes

Posted: Sat Sep 24, 2016 2:29 am
by ab1jx
OK, so it's not perfect but it's better than nothing. I added tvservice -s to it at the last minute, but it occurred to me there's no return to a known good mode at the end. I let it run for an hour and I could see things changing for a while but then they stopped. Occasionally the warning that the input signal was out of range appeared on the monitor. I saw lots of modes that worked. Mode 57 was what I was using when I started.

But I installed the script the Debian way as a service I guess (update-rc.d) and it ran with no beep when booted or prompt. After an hour I pulled the power plug and stuck the SD card in a reader in another machine to see what happened.

It seemed to stop at mode 73, which might be timing coincidence or maybe that mode wouldn't boot. Obviously I need to call the script at boot a different way. But you can see some modes like 34 where tvservice reports a different mode than what I was trying to use. Ones that were really bad revert to mode 16, which I can't get to work anyway. I kept hitting Y whenever I saw working video hoping they might end up buffered and get through, but none did. Now I have a few hoops to jump through to get my SD card back to normal. I do have a recent clone of it. Got it, no harm done.

Code: Select all

1
state 0x12000a [HDMI DMT (57) RGB full 16:10], 1680x1050 @ 60.00Hz, progressive
2
state 0x120006 [DVI DMT (2) RGB full 16:10], 640x400 @ 85.00Hz, progressive
3
state 0x120006 [DVI DMT (3) RGB full unknown AR], 720x400 @ 85.00Hz, progressive
4
state 0x120006 [DVI DMT (4) RGB full 4:3], 640x480 @ 60.00Hz, progressive
5
state 0x120006 [DVI DMT (5) RGB full 4:3], 640x480 @ 72.00Hz, progressive
6
state 0x120006 [DVI DMT (6) RGB full 4:3], 640x480 @ 75.00Hz, progressive
7
state 0x120006 [DVI DMT (7) RGB full 4:3], 640x480 @ 85.00Hz, progressive
8
state 0x120006 [DVI DMT (8) RGB full 4:3], 800x600 @ 56.00Hz, progressive
9
state 0x120006 [DVI DMT (9) RGB full 4:3], 800x600 @ 60.00Hz, progressive
10
state 0x120006 [DVI DMT (10) RGB full 4:3], 800x600 @ 72.00Hz, progressive
11
state 0x120006 [DVI DMT (11) RGB full 4:3], 800x600 @ 75.00Hz, progressive
12
state 0x120006 [DVI DMT (12) RGB full 4:3], 800x600 @ 85.00Hz, progressive
13
state 0x120006 [DVI DMT (13) RGB full 4:3], 800x600 @ 120.00Hz, progressive
14
state 0x120006 [DVI DMT (14) RGB full 16:9], 848x480 @ 60.00Hz, progressive
16
state 0x120006 [DVI DMT (16) RGB full 4:3], 1024x768 @ 60.00Hz, progressive
17
state 0x120006 [DVI DMT (17) RGB full 4:3], 1024x768 @ 70.00Hz, progressive
18
state 0x120006 [DVI DMT (18) RGB full 4:3], 1024x768 @ 75.00Hz, progressive
19
state 0x120006 [DVI DMT (19) RGB full 4:3], 1024x768 @ 85.00Hz, progressive
20
state 0x120006 [DVI DMT (20) RGB full 4:3], 1024x768 @ 120.00Hz, progressive
21
state 0x120006 [DVI DMT (21) RGB full 4:3], 1152x864 @ 75.00Hz, progressive
22
state 0x120006 [DVI DMT (22) RGB full 15:9], 1280x768 @ 60.00Hz, progressive
23
state 0x120006 [DVI DMT (23) RGB full 15:9], 1280x768 @ 60.00Hz, progressive
24
state 0x120006 [DVI DMT (24) RGB full 15:9], 1280x768 @ 75.00Hz, progressive
25
state 0x120006 [DVI DMT (25) RGB full 15:9], 1280x768 @ 85.00Hz, progressive
26
state 0x120006 [DVI DMT (26) RGB full 15:9], 1280x768 @ 120.00Hz, progressive
27
state 0x120006 [DVI DMT (27) RGB full 16:10], 1280x800 @ 60.00Hz, progressive
28
state 0x120006 [DVI DMT (28) RGB full 16:10], 1280x800 @ 60.00Hz, progressive
29
state 0x120006 [DVI DMT (29) RGB full 16:10], 1280x800 @ 75.00Hz, progressive
30
state 0x120006 [DVI DMT (30) RGB full 16:10], 1280x800 @ 85.00Hz, progressive
31
state 0x120006 [DVI DMT (31) RGB full 16:10], 1280x800 @ 120.00Hz, progressive
32
state 0x120006 [DVI DMT (32) RGB full 4:3], 1280x960 @ 60.00Hz, progressive
33
state 0x120006 [DVI DMT (33) RGB full 4:3], 1280x960 @ 85.00Hz, progressive
34
state 0x12000a [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive
35
state 0x120006 [DVI DMT (35) RGB full 5:4], 1280x1024 @ 60.00Hz, progressive
36
state 0x120006 [DVI DMT (36) RGB full 5:4], 1280x1024 @ 75.00Hz, progressive
37
state 0x120006 [DVI DMT (37) RGB full 5:4], 1280x1024 @ 85.00Hz, progressive
38
state 0x12000a [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive
39
state 0x120006 [DVI DMT (39) RGB full 16:9], 1360x768 @ 60.00Hz, progressive
40
state 0x120006 [DVI DMT (40) RGB full 16:9], 1360x768 @ 120.00Hz, progressive
41
state 0x120006 [DVI DMT (41) RGB full 4:3], 1400x1050 @ 60.00Hz, progressive
42
state 0x120006 [DVI DMT (42) RGB full 4:3], 1400x1050 @ 60.00Hz, progressive
43
state 0x120006 [DVI DMT (43) RGB full 4:3], 1400x1050 @ 75.00Hz, progressive
44
state 0x12000a [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive
45
state 0x12000a [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive
46
state 0x120006 [DVI DMT (46) RGB full 16:10], 1440x900 @ 60.00Hz, progressive
47
state 0x120006 [DVI DMT (47) RGB full 16:10], 1440x900 @ 60.00Hz, progressive
48
state 0x120006 [DVI DMT (48) RGB full 16:10], 1440x900 @ 75.00Hz, progressive
49
state 0x120006 [DVI DMT (49) RGB full 16:10], 1440x900 @ 85.00Hz, progressive
50
state 0x12000a [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive
51
state 0x120006 [DVI DMT (51) RGB full 4:3], 1600x1200 @ 60.00Hz, progressive
52
state 0x12000a [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive
53
state 0x12000a [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive
54
state 0x12000a [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive
55
state 0x12000a [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive
56
state 0x12000a [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive
57
state 0x120006 [DVI DMT (57) RGB full 16:10], 1680x1050 @ 60.00Hz, progressive
58
state 0x120006 [DVI DMT (58) RGB full 16:10], 1680x1050 @ 60.00Hz, progressive
59
state 0x12000a [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive
60
state 0x12000a [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive
61
state 0x12000a [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive
62
state 0x12000a [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive
63
state 0x12000a [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive
64
state 0x12000a [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive
65
state 0x12000a [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive
66
state 0x12000a [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive
67
state 0x12000a [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive
68
state 0x120006 [DVI DMT (68) RGB full 16:10], 1920x1200 @ 60.00Hz, progressive
69
state 0x12000a [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive
70
state 0x12000a [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive
71
state 0x12000a [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive
72
state 0x12000a [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive
The version I ran:

Code: Select all

#!/bin/bash
cd /boot
declare -i mode=1
declare passes=n
if [ -e modefile ]; then mode=`cat modefile`; else mode=1; fi
echo -en "\007"  # beep
# This times out in 5 seconds, logs y only if you hit y
read -t 5 -n 1 -p "Press y if mode worked " passes
echo
echo Logging: $mode $passes
echo $mode $passes >> logfile
tvservice -s >> logfile
# Set up for next boot
((mode++))
# Skip over mode 15, won't boot
if [ $mode == 15 ]
then
  ((mode++));
fi

# modefile is mode storage through reboots
echo $mode > modefile
# Put everything up to hdmi_mode in a file called prefix
cp prefix config.txt
# Add the hdmi mode to the end
echo "hdmi_mode="$mode >> config.txt

while [[ $mode -lt 87 ]]
do
# uncomment to actually reboot
reboot
#echo "reboot here"
exit
done

Re: Testing HDMI modes

Posted: Sat Sep 24, 2016 2:38 pm
by ab1jx
The same monitor, xrandr on an OpenBSD machine connected to the DVI input shows
xrandr program version 1.4.3
Screen 0: minimum 640 x 400, current 1920 x 1080, maximum 1920 x 1080
default connected 1920x1080+0+0 0mm x 0mm
1920x1080 60.00*
1400x1050 75.00 60.00
1280x1024 75.00 60.00
1280x960 60.00
1152x864 75.00
1024x768 75.00 60.00 70.00
832x624 75.00
800x600 75.00 60.00 72.00 56.00
640x480 75.00 60.00 73.00
720x400 70.00
I switch to the HDMI input where the Pi is and run xrandr:
Screen 0: minimum 1680 x 1050, current 1680 x 1050, maximum 1680 x 1050
default connected 1680x1050+0+0 (0x1d9) normal (normal) 0mm x 0mm
Identifier: 0x1d8
Timestamp: 38299548
Subpixel: unknown
Clones:
CRTC: 0
CRTCs: 0
Transform: 1.000000 0.000000 0.000000
0.000000 1.000000 0.000000
0.000000 0.000000 1.000000
filter:
1680x1050 (0x1d9) 0.000MHz *current
h: width 1680 start 0 end 0 total 1680 skew 0 clock 0.00KHz
v: height 1050 start 0 end 0 total 1050 clock 0.00Hz
The only mode the Pi sees isn't among the modes OpenBSD sees. All I want is to do the monitor's native 1920x1080 with the Pi. The timing is different or something. Oh, of course, the timing is set by the hdmi_* numbers in config.txt but I can't find a 1920x1080 that works.

I haven't looked at the framebuffer size, hmm.

Re: Testing HDMI modes

Posted: Fri Sep 30, 2016 2:37 pm
by ab1jx
OK, the real final version which mostly works correctly. It continues on past mode 86, but just ctrl-c it to stop it. The first mode isn't logged correctly because modefile has a 1 in it and the current HDMI mode is whatever your previous config.txt says, after the first reboot it's OK.

This version runs as the pi user, so make a dir /home/pi/hdmimodes. With raspi-config or the GUI version set the machine to autologin the pi user to a command line. At the end of pi's .bashrc add the line
/home/pi/hdmimodes/trymodes
.

Inside /home/pi/hdmimodes create modefile with the digit 1 in it (possibly optional). Create a file called prefix which contains
hdmi_group=2
hdmi_ignore_edid=0xa5000080
hdmi_force_hotplug=1
Create the actual script file trymodes which contains

Code: Select all

#!/bin/bash
# This version lives in /home/pi/hdmimodes not /boot
declare -i mode=1
declare passes=n  # Whether mode passed
# Change this to a working mode if you know one
# 57 on my Dell monitor, 35 on my Sony
declare -i good_mode=35
if [ -e /home/pi/hdmimodes/modefile ]; then mode=`cat /home/pi/hdmimodes/modefile`; else mode=1; fi
echo -en "\007"  # beep
# This times out in 5 seconds, logs y only if you hit y
read -t 5 -n 1 -p "Press y if mode worked " passes
echo
echo Logging: $mode $passes
echo $mode $passes >> /home/pi/hdmimodes/logfile
tvservice -s >> /home/pi/hdmimodes/logfile
date >> /home/pi/hdmimodes/logfile
# Set up for next boot
((mode++))
# Skip over mode 15, won't boot
if [ $mode == 15 ]
then
  ((mode++));
fi

# modefile is mode storage through reboots
echo $mode > /home/pi/hdmimodes/modefile
# Put everything up to hdmi_mode in a file called prefix
cp /home/pi/hdmimodes/prefix /home/pi/hdmimodes/config.txt
# Add the hdmi mode to the end
echo "hdmi_mode="$mode >> /home/pi/hdmimodes/config.txt
sudo cp /home/pi/hdmimodes/config.txt /boot/config.txt

while [[ $mode -lt 87 ]]
do
# uncomment to actually reboot
sleep 1  # to allow seeing any error messages
reboot
exit 0
done

# After loop:
# The last mode may not have worked so restore video.
# There should be a return to a known good mode here, like 57
# I use 57 downstairs, 35 upstairs
# Change for your situation or use hdmi_safe=1

cp /home/pi/hdmimodes/prefix /home/pi/hdmimodes/config.txt
echo "hdmi_mode="$good_mode >> /home/pi/hdmimodes/config.txt
sudo cp /home/pi/hdmimodes/config.txt /boot/config.txt
reboot  # one last time
exit 0
chmod trymodes to executable like
chmod +x trymodes
and be sure the pi user owns the directory and the files inside.

Find a free hour or so and reboot to start it. Hit Y if the mode worked, I used N or ? for modes that mostly worked and maybe could have been corrected using the monitor controls. It's just a character that gets logged, it's for your own reference. You could rate them 1 to 5. Don't hit anything if you can't read the screen. About 1995 there used to be a DOS program that essentially did what this does, but in that situation a program could change video modes, here the GPU sets the modes on boot and requires reboots to change them.

My logfile looked like

Code: Select all

1 y
state 0x120006 [DVI DMT (35) RGB full 5:4], 1280x1024 @ 60.00Hz, progressive
Thu Sep 29 13:30:20 EDT 2016
2 y
state 0x120006 [DVI DMT (2) RGB full 16:10], 640x400 @ 85.00Hz, progressive
Thu Sep 29 13:30:46 EDT 2016
3
state 0x120006 [DVI DMT (3) RGB full unknown AR], 720x400 @ 85.00Hz, progressive
Thu Sep 29 13:31:27 EDT 2016
4 y
state 0x120006 [DVI DMT (4) RGB full 4:3], 640x480 @ 60.00Hz, progressive
Thu Sep 29 13:31:52 EDT 2016
5 y
state 0x120006 [DVI DMT (5) RGB full 4:3], 640x480 @ 72.00Hz, progressive
Thu Sep 29 13:33:13 EDT 2016
6 y
state 0x120006 [DVI DMT (6) RGB full 4:3], 640x480 @ 75.00Hz, progressive
Thu Sep 29 13:33:34 EDT 2016
7 y
state 0x120006 [DVI DMT (7) RGB full 4:3], 640x480 @ 85.00Hz, progressive
Thu Sep 29 13:34:20 EDT 2016
8 y
state 0x120006 [DVI DMT (8) RGB full 4:3], 800x600 @ 56.00Hz, progressive
Thu Sep 29 13:34:46 EDT 2016
9 y
state 0x120006 [DVI DMT (9) RGB full 4:3], 800x600 @ 60.00Hz, progressive
Thu Sep 29 13:35:15 EDT 2016
10 y
state 0x120006 [DVI DMT (10) RGB full 4:3], 800x600 @ 72.00Hz, progressive
Thu Sep 29 13:35:45 EDT 2016
11 y
state 0x120006 [DVI DMT (11) RGB full 4:3], 800x600 @ 75.00Hz, progressive
Thu Sep 29 13:36:15 EDT 2016
12 y
state 0x120006 [DVI DMT (12) RGB full 4:3], 800x600 @ 85.00Hz, progressive
Thu Sep 29 13:36:46 EDT 2016
13
state 0x120006 [DVI DMT (13) RGB full 4:3], 800x600 @ 120.00Hz, progressive
Thu Sep 29 13:37:25 EDT 2016
14 y
state 0x120006 [DVI DMT (14) RGB full 16:9], 848x480 @ 60.00Hz, progressive
Thu Sep 29 13:37:51 EDT 2016
16 y
state 0x120006 [DVI DMT (16) RGB full 4:3], 1024x768 @ 60.00Hz, progressive
Thu Sep 29 13:38:18 EDT 2016
17 y
state 0x120006 [DVI DMT (17) RGB full 4:3], 1024x768 @ 70.00Hz, progressive
Thu Sep 29 13:38:35 EDT 2016
18 y
state 0x120006 [DVI DMT (18) RGB full 4:3], 1024x768 @ 75.00Hz, progressive
Thu Sep 29 13:39:09 EDT 2016
19 y
state 0x120006 [DVI DMT (19) RGB full 4:3], 1024x768 @ 85.00Hz, progressive
Thu Sep 29 13:39:36 EDT 2016
20
state 0x120006 [DVI DMT (20) RGB full 4:3], 1024x768 @ 120.00Hz, progressive
Thu Sep 29 13:40:23 EDT 2016
21 y
state 0x120006 [DVI DMT (21) RGB full 4:3], 1152x864 @ 75.00Hz, progressive
Thu Sep 29 13:40:42 EDT 2016
22
state 0x120006 [DVI DMT (22) RGB full 15:9], 1280x768 @ 60.00Hz, progressive
Thu Sep 29 13:41:24 EDT 2016
23 y
state 0x120006 [DVI DMT (23) RGB full 15:9], 1280x768 @ 60.00Hz, progressive
Thu Sep 29 13:41:46 EDT 2016
24 y
state 0x120006 [DVI DMT (24) RGB full 15:9], 1280x768 @ 75.00Hz, progressive
Thu Sep 29 13:42:16 EDT 2016
25 y
state 0x120006 [DVI DMT (25) RGB full 15:9], 1280x768 @ 85.00Hz, progressive
Thu Sep 29 13:42:34 EDT 2016
26
state 0x120006 [DVI DMT (26) RGB full 15:9], 1280x768 @ 120.00Hz, progressive
Thu Sep 29 13:43:24 EDT 2016
27
state 0x120006 [DVI DMT (27) RGB full 16:10], 1280x800 @ 60.00Hz, progressive
Thu Sep 29 13:44:41 EDT 2016
28
state 0x120006 [DVI DMT (28) RGB full 16:10], 1280x800 @ 60.00Hz, progressive
Thu Sep 29 13:45:23 EDT 2016
29 y
state 0x120006 [DVI DMT (29) RGB full 16:10], 1280x800 @ 75.00Hz, progressive
Thu Sep 29 13:45:41 EDT 2016
30
state 0x120006 [DVI DMT (30) RGB full 16:10], 1280x800 @ 85.00Hz, progressive
Thu Sep 29 13:46:24 EDT 2016
31
state 0x120006 [DVI DMT (31) RGB full 16:10], 1280x800 @ 120.00Hz, progressive
Thu Sep 29 13:46:54 EDT 2016
32 y
state 0x120006 [DVI DMT (32) RGB full 4:3], 1280x960 @ 60.00Hz, progressive
Thu Sep 29 13:47:20 EDT 2016
33 y
state 0x120006 [DVI DMT (33) RGB full 4:3], 1280x960 @ 85.00Hz, progressive
Thu Sep 29 13:47:47 EDT 2016
34
state 0x12000a [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive
Thu Sep 29 13:48:26 EDT 2016
35 y
state 0x120006 [DVI DMT (35) RGB full 5:4], 1280x1024 @ 60.00Hz, progressive
Thu Sep 29 13:48:49 EDT 2016
36 y
state 0x120006 [DVI DMT (36) RGB full 5:4], 1280x1024 @ 75.00Hz, progressive
Thu Sep 29 13:49:18 EDT 2016
37 y
state 0x120006 [DVI DMT (37) RGB full 5:4], 1280x1024 @ 85.00Hz, progressive
Thu Sep 29 13:49:43 EDT 2016
38
state 0x12000a [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive
Thu Sep 29 13:50:22 EDT 2016
39 y
state 0x120006 [DVI DMT (39) RGB full 16:9], 1360x768 @ 60.00Hz, progressive
Thu Sep 29 13:50:44 EDT 2016
40
state 0x120006 [DVI DMT (40) RGB full 16:9], 1360x768 @ 120.00Hz, progressive
Thu Sep 29 13:51:26 EDT 2016
41
state 0x120006 [DVI DMT (41) RGB full 4:3], 1400x1050 @ 60.00Hz, progressive
Thu Sep 29 13:51:57 EDT 2016
42 y
state 0x120006 [DVI DMT (42) RGB full 4:3], 1400x1050 @ 60.00Hz, progressive
Thu Sep 29 13:52:27 EDT 2016
43 y
state 0x120006 [DVI DMT (43) RGB full 4:3], 1400x1050 @ 75.00Hz, progressive
Thu Sep 29 13:53:41 EDT 2016
44
state 0x12000a [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive
Thu Sep 29 13:54:23 EDT 2016
45
state 0x12000a [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive
Thu Sep 29 13:54:53 EDT 2016
46 ?
state 0x120006 [DVI DMT (46) RGB full 16:10], 1440x900 @ 60.00Hz, progressive
Thu Sep 29 13:55:15 EDT 2016
47 ?
state 0x120006 [DVI DMT (47) RGB full 16:10], 1440x900 @ 60.00Hz, progressive
Thu Sep 29 13:55:53 EDT 2016
48 ?
state 0x120006 [DVI DMT (48) RGB full 16:10], 1440x900 @ 75.00Hz, progressive
Thu Sep 29 13:56:13 EDT 2016
49 ?
state 0x120006 [DVI DMT (49) RGB full 16:10], 1440x900 @ 85.00Hz, progressive
Thu Sep 29 13:56:42 EDT 2016
50 n
state 0x12000a [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive
Thu Sep 29 13:57:18 EDT 2016
51
state 0x120006 [DVI DMT (51) RGB full 4:3], 1600x1200 @ 60.00Hz, progressive
Thu Sep 29 13:57:50 EDT 2016
52 n
state 0x12000a [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive
Thu Sep 29 13:58:07 EDT 2016
53 n
state 0x12000a [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive
Thu Sep 29 13:58:39 EDT 2016
54
state 0x12000a [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive
Thu Sep 29 13:59:21 EDT 2016
55
state 0x12000a [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive
Thu Sep 29 13:59:51 EDT 2016
56 n
state 0x12000a [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive
Thu Sep 29 14:00:23 EDT 2016
57 n
state 0x120006 [DVI DMT (57) RGB full 16:10], 1680x1050 @ 60.00Hz, progressive
Thu Sep 29 14:00:41 EDT 2016
58
state 0x120006 [DVI DMT (58) RGB full 16:10], 1680x1050 @ 60.00Hz, progressive
Thu Sep 29 14:01:22 EDT 2016
59 n
state 0x12000a [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive
Thu Sep 29 14:01:39 EDT 2016
60
state 0x12000a [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive
Thu Sep 29 14:02:21 EDT 2016
61
state 0x12000a [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive
Thu Sep 29 14:02:52 EDT 2016
62 n
state 0x12000a [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive
Thu Sep 29 14:03:13 EDT 2016
63
state 0x12000a [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive
Thu Sep 29 14:03:52 EDT 2016
64
state 0x12000a [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive
Thu Sep 29 14:04:24 EDT 2016
65
state 0x12000a [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive
Thu Sep 29 14:04:57 EDT 2016
66
state 0x12000a [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive
Thu Sep 29 14:05:28 EDT 2016
67
state 0x12000a [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive
Thu Sep 29 14:06:00 EDT 2016
68
state 0x120006 [DVI DMT (68) RGB full 16:10], 1920x1200 @ 60.00Hz, progressive
Thu Sep 29 14:06:26 EDT 2016
69 n
state 0x12000a [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive
Thu Sep 29 14:06:57 EDT 2016
70 n
state 0x12000a [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive
Thu Sep 29 14:07:22 EDT 2016
71 n
state 0x12000a [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive
Thu Sep 29 14:07:50 EDT 2016
72 n
state 0x12000a [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive
Thu Sep 29 14:08:26 EDT 2016
73
state 0x12000a [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive
Thu Sep 29 14:09:01 EDT 2016
74
state 0x12000a [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive
Thu Sep 29 14:09:33 EDT 2016
75 n
state 0x12000a [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive
Thu Sep 29 14:09:53 EDT 2016
76 n
state 0x12000a [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive
Thu Sep 29 14:10:14 EDT 2016
77 n
state 0x12000a [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive
Thu Sep 29 14:10:51 EDT 2016
78 n
state 0x12000a [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive
Thu Sep 29 14:11:22 EDT 2016
79 n
state 0x12000a [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive
Thu Sep 29 14:11:49 EDT 2016
80 n
state 0x12000a [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive
Thu Sep 29 14:12:17 EDT 2016
81 y
state 0x120006 [DVI DMT (81) RGB full 16:9], 1366x768 @ 60.00Hz, progressive
Thu Sep 29 14:12:44 EDT 2016
82
state 0x120006 [DVI DMT (82) RGB full 16:9], 1920x1080 @ 60.00Hz, progressive
Thu Sep 29 14:13:27 EDT 2016
83 n
state 0x120006 [DVI DMT (83) RGB full 16:9], 1600x900 @ 60.00Hz, progressive
Thu Sep 29 14:13:46 EDT 2016
84
state 0x120006 [DVI DMT (84) RGB full 16:9], 2048x1152 @ 60.00Hz, progressive
Thu Sep 29 14:14:27 EDT 2016
85 y
state 0x120006 [DVI DMT (85) RGB full 16:9], 1280x720 @ 60.00Hz, progressive
Thu Sep 29 14:14:49 EDT 2016
86 n
state 0x120006 [DVI DMT (86) RGB full 16:9], 1366x768 @ 60.00Hz, progressive
Thu Sep 29 14:15:18 EDT 2016
87 y
state 0x120006 [DVI DMT (35) RGB full 5:4], 1280x1024 @ 60.00Hz, progressive
Thu Sep 29 14:15:52 EDT 2016
88 y
state 0x120006 [DVI DMT (35) RGB full 5:4], 1280x1024 @ 60.00Hz, progressive
Thu Sep 29 14:16:17 EDT 2016
89 y
state 0x120006 [DVI DMT (35) RGB full 5:4], 1280x1024 @ 60.00Hz, progressive
Thu Sep 29 14:16:48 EDT 2016
90 y
state 0x120006 [DVI DMT (35) RGB full 5:4], 1280x1024 @ 60.00Hz, progressive
Thu Sep 29 14:17:28 EDT 2016
91 y
state 0x120006 [DVI DMT (35) RGB full 5:4], 1280x1024 @ 60.00Hz, progressive
Thu Sep 29 14:17:46 EDT 2016
Take the /home/pi/hdmimodes/trymodes line out of pi's .bashrc when you're done and turn off autologin with raspi-config. You can use ctrl-alt-F2 to log in at a normal tty once you've done ctrl-C at a prompt to stop the script, it sort of monopolizes tty1.

Re: Testing HDMI modes

Posted: Wed Dec 28, 2016 5:25 pm
by nostromopi
This script is most interesting!!

I noticed i could get almost "pixel perfect" using these HDMI_CVT= in the config.txt under the retropie's /boot but is there no way i can have a game run in a specific mode and when another game is launched that requires a different mode to automatically switch to it??
It would be such a shame as the retro pie is capable of going 1:1 with the games in native resolution.
A fes i have tested on my Sony PVM are:
hdmi_cvt=320 262 60 1 (all neo geo run great with this)
hdmi_cvt=384 262 60 1 (ghouls and ghost arcade runs perfect with this as it near native res)
hdm_cvt=256 262 60 1 (black tiger arcade and chukka arisen arcade near perfect)

If only i could configure a game-specific something that tells the pi to use these modes..

Re: Testing HDMI modes

Posted: Wed Dec 28, 2016 5:54 pm
by ab1jx
The only way I've seen to switch video modes involves rebooting, since as I understand it, the GPU boots first then it boots the CPU. My script rewrites config.txt so on the next boot it comes up in a different mode. It seems conceivable that some tool could directly manipulate the GPU but I don't know of one. Whether this would be worthwhile for just playing games I don't know. I don't play them.

You could always pick up some cheap SD cards and set one up for each different video mode and only put those games on it. I have some of these and they seem OK, there are different sizes. I'd stick with class 10 http://www.gearbest.com/memory-cards/pp_350764.html $6 each

Re: Testing HDMI modes

Posted: Wed Dec 28, 2016 6:47 pm
by rpdom
ab1jx wrote:The only way I've seen to switch video modes involves rebooting, since as I understand it, the GPU boots first then it boots the CPU.
You can switch video modes using the tvservice command.

Code: Select all

[email protected]:/usr/sbin $ tvservice -h
Usage: tvservice [OPTION]...
  -p, --preferred                   Power on HDMI with preferred settings
  -e, --explicit="GROUP MODE DRIVE" Power on HDMI with explicit GROUP (CEA, DMT, CEA_3D_SBS, CEA_3D_TB, CEA_3D_FP, CEA_3D_FS)
                                      MODE (see --modes) and DRIVE (HDMI, DVI)
  -t, --ntsc                        Use NTSC frequency for HDMI mode (e.g. 59.94Hz rather than 60Hz)
  -c, --sdtvon="MODE ASPECT"        Power on SDTV with MODE (PAL or NTSC) and ASPECT (4:3 14:9 or 16:9)
  -o, --off                         Power off the display
  -m, --modes=GROUP                 Get supported modes for GROUP (CEA, DMT)
  -M, --monitor                     Monitor HDMI events
  -s, --status                      Get HDMI status
  -a, --audio                       Get supported audio information
  -d, --dumpedid <filename>         Dump EDID information to file
  -j, --json                        Use JSON format for --modes output
  -n, --name                        Print the device ID from EDID
  -h, --help                        Print this information
You will also need to refresh the framebuffer using fbset, and maybe redraw the GUI using xrefresh if you use a GUI.

Re: Testing HDMI modes

Posted: Wed Dec 28, 2016 7:57 pm
by nostromopi
I feel we are on to something here
So tvservice,framebufferset..could it be possible to pass these arguments along with the start of a game so that these would be executed before the game and thus allow the game to run with the changed resolution?
If this would be possible..man..that would terrific!

Re: Testing HDMI modes

Posted: Wed Dec 28, 2016 7:59 pm
by ab1jx
But how do you use cvt modes with tvservice?