@Alphanu @hunterk (and also Nikoh77 and Scanlitzer),
I had a closer look on the reason why the image is shifted to the right (in my case) with CRTSwitchRes v2.0, showing a clearly visible border on the left on my consumer JVC CRT TV, especially because I haven´t had this problem with tons of modelines/hdmi_timings I have tested before.
Furthermore, the system menu of my TV does not allow to move the image thus far to the left - and I also don´t know if it makes sense to change the default global values in general because it also modifies the image shift of all other input sources…
I currently use these retroarch settings:
- crt_switch_center_adjust = “0”
- crt_switch_resolution = “1”
- crt_switch_resolution_super = “1920”
- crt_switch_resolution_use_custom_refresh_rate = “true”
- crt_video_refresh_rate = “60.000000”
I played around with different emulators and roms from different regions, and they all had this shift to the right. This is clear to me, because the horizontal front porch value always stays at 80 (see calculations in lines 324-328 in video_crt_switch.c), e.g.:
- vcgencmd hdmi_timings 1920 1 80 224 465 256 1 20 3 34 0 0 0 50 0 42082848 1 (PSX - EU)
- vcgencmd hdmi_timings 1920 1 80 224 465 224 1 10 3 24 0 0 0 60 0 42179800 1 (NES - World)
- vcgencmd hdmi_timings 1920 1 80 224 465 224 1 10 3 24 0 0 0 59 0 42055520 1 (Genesis - US)
Using the values calculated for the RGUI, I played around with the crt_switch_center_adjust value:
- 0: vcgencmd hdmi_timings 1920 1 80 224 465 240 1 28 3 42 0 0 0 50 0 42082848 1
- -4: vcgencmd hdmi_timings 1920 1 80 240 465 240 1 28 3 42 0 0 0 50 0 42333248 1
- +4: vcgencmd hdmi_timings 1920 1 80 208 465 240 1 28 3 42 0 0 0 50 0 41832448 1
- 40: vcgencmd hdmi_timings 1920 1 80 64 465 240 1 28 3 42 0 0 0 50 0 39578848 1
As you can see, only the horizontal sync signal length is modified by the crt_switch_center_adjust value, but as also Nikoh77 wrote, this does not seem to alter anything regarding the horizontal positioning.
In fact, this approach in fact seems to be wrong, because in my opinion, the front porch and back porch would have to be changed instead.
Therefore, to get a centered picture, I would have to change the front porch and back porch as follows for my TV:
- from: 1920 1 80 224 465 240 1 28 3 42 0 0 0 50 0 42082848 1
- to: 1920 1 195 224 350 240 1 28 3 42 0 0 0 50 0 42082848 1
As you can see, while the sync signal length stays the same, the front porch is increased by 115 while the backporch is lowered by the same value.
This also works for the vertical positioning btw.
For further tests and maybe as a proof that this is the right way to handle this, I found a link to a video timings generator script by Frank Skilton from 2017 at https://drive.google.com/file/d/0B10JEKHkXafmajlWbVcyTEVzdGM (apparently, there is no repository available; linked e.g. from the Pi2Scart website).
With this, you can show a test image (in this case, scale the included align.png e.g. to 1920x240px or alike) and move the output image by using the cursor keys. If you are satisfied with the positioning, you can save the adjusted modeline settings - this is how I found out the correct front-porch/back-porch settings for my TV.
@Alphanu @hunterk
Since I don´t understand how the values in video_crt_switch.c are calculated currently (and even haven´t compiles RetroArch myself yet on the Raspi), I would ask for some bugfix/adjustment regarding this. Should I open a ticket?