Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Raspberry Pi2 320x240p via translating modeline to <hdmi_timings>  (Read 12586 times)

0 Members and 1 Guest are viewing this topic.

WalkToFreedom

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 25
  • Last login:December 13, 2015, 02:33:09 pm
I posted this in the Pi forums but didn't get a response so thought I would try here

https://www.raspberrypi.org/forums/viewtopic.php?f=38&t=124456&p=835368#p835368

I am trying to get the Pi to output 320x240p. I have had some success, via these settings:

Code: [Select]
hdmi_group=1
hdmi_mode=8

But hdmi_mode=8 is actually 720x240p.

I know this modeline works fine for the CRT (TV conversion RGB via SCART) as I have had it running via an ArcadeVGA (it's actually an ArcadeVGA modeline):

Code: [Select]
Modeline "321x240@59,4Hz 15,7KHz (60Hz)" 6.460 321 336 368 412 240 242 245 264  -hsync -vsync

Modeline syntax: pclk hdisp hsyncstart hsyncend htotal vdisp vsyncstart vsyncend vtotal [flags] Flags (optional): +HSync, -HSync, +VSync, -VSync, Interlace, DoubleScan, CSync, +CSync, -CSync

eg: Modeline "1600x1200" 155   1600 1656 1776 2048   1200 1202 1205 1263
 #           (Label) (clk)     (x-resolution)        (y-resolution)
 #                     |
 #              (pixel clock in MHz)

Is it possible to translate the modeline to an <hdmi_timings>? This is what I came up with, but screen just stays blank? Am I missing some other setting?

Code: [Select]
hdmi_timings=<h_active_pixels> <h_sync_polarity <h_front_porch> <h_sync_pulse> <h_back_porch> <v_active_lines> <v_sync_polarity> <v_front_porch> <v_sync_pulse> <v_back_porch> <v_sync_offset_a> <v_sync_offset_b> <pixel_rep> <frame_rate> <interlaced> <pixel_freq> <aspect_ratio>

hdmi_group=2
hdmi_mode=87
hdmi_timings=321 0 15 32 76 240 0 2 3 19 0 0 0 60 0 6460819 1

Thanks!
« Last Edit: November 05, 2015, 08:22:01 pm by WalkToFreedom »
ArcadeVGA 3000
VGA -> SCART/RGB (dodgy diode circuit creates combined sync)
28" THOMSON CRT
Sanwa 2p 8 way 6 button
Intel i3-4130 Haswell
Asrock H81M
Corsair 8GB DD3
3TB Segate Barracuda (ROMS)
60GB Cosair SSD (OS)
Win7 PRO

Raspberry Pi2
RetroPie
HDMI -> VGA Convertor
VGA -> SCART/RGB (dodgy diode circuit creates combined sync)

obcd

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 160
  • Last login:April 03, 2019, 11:44:36 am
  • I want to build my own arcade controls!
Re: 320x240p via translating modeline to <hdmi_timings>
« Reply #1 on: November 05, 2015, 06:03:34 pm »
Are you sure your hdmi 2 vga adapter is capable of handling such resolutions?
If I remember well, some are limited in what they can convert.

WalkToFreedom

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 25
  • Last login:December 13, 2015, 02:33:09 pm
Re: 320x240p via translating modeline to <hdmi_timings>
« Reply #2 on: November 05, 2015, 08:19:19 pm »
Are you sure your hdmi 2 vga adapter is capable of handling such resolutions?
If I remember well, some are limited in what they can convert.

Yeah, I wondered about that too but my guess is it just converts whatever the HDMI res is, it does work on:

Code: [Select]
hdmi_group=1
hdmi_mode=8 # 720x240p


So it can output as 240p:


ArcadeVGA 3000
VGA -> SCART/RGB (dodgy diode circuit creates combined sync)
28" THOMSON CRT
Sanwa 2p 8 way 6 button
Intel i3-4130 Haswell
Asrock H81M
Corsair 8GB DD3
3TB Segate Barracuda (ROMS)
60GB Cosair SSD (OS)
Win7 PRO

Raspberry Pi2
RetroPie
HDMI -> VGA Convertor
VGA -> SCART/RGB (dodgy diode circuit creates combined sync)

bleck

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 6
  • Last login:December 30, 2016, 12:53:57 pm
  • I want to build my own arcade controls!
Re: Raspberry Pi2 320x240p via translating modeline to <hdmi_timings>
« Reply #3 on: November 13, 2015, 06:52:02 pm »
These links may be useful. The first is a listing of modelines for different broadcast standards and game consoles, while the second is a timing calculator

http://www.geocities.ws/podernixie/htpc/modes-en.html
http://www.epanorama.net/faq/vga2rgb/calc.html

One bug in it is that the name of the Modeline you enter has to be of the form "HRESxVRES". Any other characters will screw up the the calculation. For example, for NTSC SNES, I use Modeline "256x224" 5.370 256 274 299 341 224 236 239 262 as input and get

[*User-Defined_mode,(256X224)]
PIXEL_CLK   =   5370
H_DISP   =   256
H_FPORCH   =   18
H_SYNC   =   25
H_BPORCH   =   42
H_SYNC_POL   =   0
V_DISP   =   224
V_FPORCH   =   12
V_SYNC   =   3
V_BPORCH   =   23
V_SYNC_POL   =   0
INTERLACE_ENABLE  =  0


WalkToFreedom

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 25
  • Last login:December 13, 2015, 02:33:09 pm
Re: Raspberry Pi2 320x240p via translating modeline to <hdmi_timings>
« Reply #4 on: November 15, 2015, 05:16:30 pm »
Hi. Many thanks for your reply. I had actually come across both of those pages. Taking a second look though and punching the numbers has revealed that mine are up the wacky do. Weird, nothing tricky there just plain wrong. Hmmmm. Will try the new ones and see how they work out. Thanks!

Oh, I'm assuming you're not using a Pi??? If so, where do you configure the modelines???
ArcadeVGA 3000
VGA -> SCART/RGB (dodgy diode circuit creates combined sync)
28" THOMSON CRT
Sanwa 2p 8 way 6 button
Intel i3-4130 Haswell
Asrock H81M
Corsair 8GB DD3
3TB Segate Barracuda (ROMS)
60GB Cosair SSD (OS)
Win7 PRO

Raspberry Pi2
RetroPie
HDMI -> VGA Convertor
VGA -> SCART/RGB (dodgy diode circuit creates combined sync)

WalkToFreedom

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 25
  • Last login:December 13, 2015, 02:33:09 pm
Re: Raspberry Pi2 320x240p via translating modeline to <hdmi_timings>
« Reply #5 on: November 16, 2015, 03:43:26 am »
No luck I'm afraid. I wonder if the Pi/HDMI standard doesn't support these timings?
ArcadeVGA 3000
VGA -> SCART/RGB (dodgy diode circuit creates combined sync)
28" THOMSON CRT
Sanwa 2p 8 way 6 button
Intel i3-4130 Haswell
Asrock H81M
Corsair 8GB DD3
3TB Segate Barracuda (ROMS)
60GB Cosair SSD (OS)
Win7 PRO

Raspberry Pi2
RetroPie
HDMI -> VGA Convertor
VGA -> SCART/RGB (dodgy diode circuit creates combined sync)

obcd

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 160
  • Last login:April 03, 2019, 11:44:36 am
  • I want to build my own arcade controls!
Re: Raspberry Pi2 320x240p via translating modeline to <hdmi_timings>
« Reply #6 on: November 16, 2015, 06:54:22 am »
Looks like Dom answered on the raspberry thread.
Maybe it's not the answer you are expecting, but he knows the closed binary blob that boots the pi. So, it's a start.

elvis

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1154
  • Last login:April 13, 2023, 05:31:03 pm
  • penguin poker
    • StickFreaks
Re: Raspberry Pi2 320x240p via translating modeline to <hdmi_timings>
« Reply #7 on: November 16, 2015, 07:34:31 am »
720x240 is a standard trick to use when you can't get your video chipset's pclock low enough to handle 15KHz CGA modes.   320x240 forces your pixel clock (sometimes called "dot clock") down to 5-6MHz, which some drivers won't allow.  You can often hack around this with open source video drivers (this is how tools like AdvancedMAME via Linux XWindows drivers used to work if you didn't use SVGALib, and I think it's how GroovyMAME/GroovyArcade works via patches that simply change this arbitrary value, unless I'm completely wrong).  If you're stick with a pixel clock of 10-12MHz as a bare minimum, then 720x240 us your only option for 240p.

Your CRT generally won't know the difference (horizontal "resolution" is meaningless to a CRT) and you can use various scale modes in MAME to work around the odd resolution.  If you dig way back in the archives on this forum, you'll find some discussion about it.  Ditto in the readme for tools like lrmc (Low Resolution Modeline Calculator).

With that said, following a few links on the RPi forums lead me here:
https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=24679

Talk of "CVT" modes is very interesting.  I *still* haven't wired up my Gert VGA 666 adaptor yet, but it's on a list of things to try.  Getting it working with a proper 15KHz modeline is high on my list of wants.

Also, getting progressive scan modes out of the RPi's composite TV Out would be amazing.  But I fear that falls under the same "vendor binary driver limitation" nonsense.

WalkToFreedom

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 25
  • Last login:December 13, 2015, 02:33:09 pm
Re: Raspberry Pi2 320x240p via translating modeline to <hdmi_timings>
« Reply #8 on: November 18, 2015, 03:35:02 pm »
720x240 is a standard trick to use when you can't get your video chipset's pclock low enough to handle 15KHz CGA modes.   320x240 forces your pixel clock (sometimes called "dot clock") down to 5-6MHz, which some drivers won't allow.  You can often hack around this with open source video drivers (this is how tools like AdvancedMAME via Linux XWindows drivers used to work if you didn't use SVGALib, and I think it's how GroovyMAME/GroovyArcade works via patches that simply change this arbitrary value, unless I'm completely wrong).  If you're stick with a pixel clock of 10-12MHz as a bare minimum, then 720x240 us your only option for 240p.

Your CRT generally won't know the difference (horizontal "resolution" is meaningless to a CRT) and you can use various scale modes in MAME to work around the odd resolution.  If you dig way back in the archives on this forum, you'll find some discussion about it.  Ditto in the readme for tools like lrmc (Low Resolution Modeline Calculator).

With that said, following a few links on the RPi forums lead me here:
https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=24679

Talk of "CVT" modes is very interesting.  I *still* haven't wired up my Gert VGA 666 adaptor yet, but it's on a list of things to try.  Getting it working with a proper 15KHz modeline is high on my list of wants.

Also, getting progressive scan modes out of the RPi's composite TV Out would be amazing.  But I fear that falls under the same "vendor binary driver limitation" nonsense.

Ah thanks for the info. Probably relating to the dot clock then. Have made a post in the Raspberry Pi forums too. I know of the Gert VGA666,was considering getting one. I contacted one of the guys who works with Gert and he seems to think it would be possible to get to work at 15Khz - there is some info in the forums about this too.
Code: [Select]
hdmi_mode=1 uses CVT, that is what I was using with
Code: [Select]
hdmi_mode=8 # 720x240p ultimately
Code: [Select]
<hdmi_timings> gives you the most control, but you need to know blanking times etc. I'm pretty sure I've got that right now but still doesnot work so as you say it might be a driver/hdmi restriction
ArcadeVGA 3000
VGA -> SCART/RGB (dodgy diode circuit creates combined sync)
28" THOMSON CRT
Sanwa 2p 8 way 6 button
Intel i3-4130 Haswell
Asrock H81M
Corsair 8GB DD3
3TB Segate Barracuda (ROMS)
60GB Cosair SSD (OS)
Win7 PRO

Raspberry Pi2
RetroPie
HDMI -> VGA Convertor
VGA -> SCART/RGB (dodgy diode circuit creates combined sync)

WalkToFreedom

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 25
  • Last login:December 13, 2015, 02:33:09 pm
Re: Raspberry Pi2 320x240p via translating modeline to <hdmi_timings>
« Reply #9 on: November 18, 2015, 03:40:57 pm »
Looks like Dom answered on the raspberry thread.
Maybe it's not the answer you are expecting, but he knows the closed binary blob that boots the pi. So, it's a start.

Hi. Thanks for the info, which thread are you referring to, the only reply I can see is where he said to remove the #?
ArcadeVGA 3000
VGA -> SCART/RGB (dodgy diode circuit creates combined sync)
28" THOMSON CRT
Sanwa 2p 8 way 6 button
Intel i3-4130 Haswell
Asrock H81M
Corsair 8GB DD3
3TB Segate Barracuda (ROMS)
60GB Cosair SSD (OS)
Win7 PRO

Raspberry Pi2
RetroPie
HDMI -> VGA Convertor
VGA -> SCART/RGB (dodgy diode circuit creates combined sync)

elvis

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1154
  • Last login:April 13, 2023, 05:31:03 pm
  • penguin poker
    • StickFreaks
Re: Raspberry Pi2 320x240p via translating modeline to <hdmi_timings>
« Reply #10 on: November 18, 2015, 03:52:38 pm »
HDMI does have a specific list of supported video modes:
https://en.wikipedia.org/wiki/Uncompressed_video#HDMI_Specifications

Back in the analogue days you could work around those limits as you pleased, but I'm not sure how that works at a hardware/firmware level with HDMI.  Right there is the list of reasons why I don't like firmware as a solution to anything, and why I especially dislike hardware and software that prevents me doing as I please.

The Linux community is working on open source drivers for the GPU in the Raspberry Pi.  I believe the latest 4.4 Kernel includes kernel modeset drivers to replace the proprietary blobs provided by Broadcom which are currently in use by most RPi distros.  Hopefully that means in months to come, we as end users will have the control we want of the hardware we've purchased, rather than having the manufacturers artificially limit what we can do with the things we buy.

workspace

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 1
  • Last login:January 26, 2016, 04:04:55 pm
  • I want to build my own arcade controls!
Re: Raspberry Pi2 320x240p via translating modeline to <hdmi_timings>
« Reply #11 on: November 19, 2015, 02:57:28 pm »
Hello,

I managed to drive my Sony PVM with the VGA666 Adapter (via the UMSA - Ultimate SCART Adapter to get a csync instead vsync and hsync).
As wpt-nathan pointed out, the pixelclock has to be a divider of 19.2 for lower pixelclock speeds.
https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=112735

By try and error I found that this is the case for pixelclocks lower 31253817 Hz

This is my configuration/modeline/hdmi/dpi_timing that works:

dtoverlay=vga666
enable_dpi_lcd=1
display_default_lcd=1
dpi_group=2
dpi_mode=87
hdmi_timings=336 1 10 30 34 252 1 15 3 42 0 0 0 50 0 6400000 1 # 336:252 6.4MHz progressive
#hdmi_timings=500 1 14 45 56 375 1 240 5 5 0 0 0 50 1 9600000 1 # 500:375 9.6Mhz interlaced

As far as I see these are the only two resolutions at 15.625kHz the gpu can generate through the dpi interface (due the limitations on the pixelclockspeed. I would rather call it a bug)
But I might be wrong.
« Last Edit: November 19, 2015, 03:43:22 pm by workspace »

WalkToFreedom

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 25
  • Last login:December 13, 2015, 02:33:09 pm
Re: Raspberry Pi2 320x240p via translating modeline to <hdmi_timings>
« Reply #12 on: November 22, 2015, 03:34:04 pm »
Hello,

I managed to drive my Sony PVM with the VGA666 Adapter (via the UMSA - Ultimate SCART Adapter to get a csync instead vsync and hsync).
As wpt-nathan pointed out, the pixelclock has to be a divider of 19.2 for lower pixelclock speeds.
https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=112735

By try and error I found that this is the case for pixelclocks lower 31253817 Hz

This is my configuration/modeline/hdmi/dpi_timing that works:

dtoverlay=vga666
enable_dpi_lcd=1
display_default_lcd=1
dpi_group=2
dpi_mode=87
hdmi_timings=336 1 10 30 34 252 1 15 3 42 0 0 0 50 0 6400000 1 # 336:252 6.4MHz progressive
#hdmi_timings=500 1 14 45 56 375 1 240 5 5 0 0 0 50 1 9600000 1 # 500:375 9.6Mhz interlaced

As far as I see these are the only two resolutions at 15.625kHz the gpu can generate through the dpi interface (due the limitations on the pixelclockspeed. I would rather call it a bug)
But I might be wrong.

Interesting! Will have to try a few things out, will post results. Thanks!
ArcadeVGA 3000
VGA -> SCART/RGB (dodgy diode circuit creates combined sync)
28" THOMSON CRT
Sanwa 2p 8 way 6 button
Intel i3-4130 Haswell
Asrock H81M
Corsair 8GB DD3
3TB Segate Barracuda (ROMS)
60GB Cosair SSD (OS)
Win7 PRO

Raspberry Pi2
RetroPie
HDMI -> VGA Convertor
VGA -> SCART/RGB (dodgy diode circuit creates combined sync)

bleck

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 6
  • Last login:December 30, 2016, 12:53:57 pm
  • I want to build my own arcade controls!
Re: Raspberry Pi2 320x240p via translating modeline to <hdmi_timings>
« Reply #13 on: November 23, 2015, 12:03:55 pm »
Hello,

I managed to drive my Sony PVM with the VGA666 Adapter (via the UMSA - Ultimate SCART Adapter to get a csync instead vsync and hsync).
As wpt-nathan pointed out, the pixelclock has to be a divider of 19.2 for lower pixelclock speeds.
https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=112735

By try and error I found that this is the case for pixelclocks lower 31253817 Hz

This is my configuration/modeline/hdmi/dpi_timing that works:

dtoverlay=vga666
enable_dpi_lcd=1
display_default_lcd=1
dpi_group=2
dpi_mode=87
hdmi_timings=336 1 10 30 34 252 1 15 3 42 0 0 0 50 0 6400000 1 # 336:252 6.4MHz progressive
#hdmi_timings=500 1 14 45 56 375 1 240 5 5 0 0 0 50 1 9600000 1 # 500:375 9.6Mhz interlaced

As far as I see these are the only two resolutions at 15.625kHz the gpu can generate through the dpi interface (due the limitations on the pixelclockspeed. I would rather call it a bug)
But I might be wrong.

I tried this out on my Raspberry Pi 2 with an HDMI-> VGA adapter and I get a blank screen. So it looks like the VGA666 or something similar is needed to get those resolutions.

I've just been running at 720x240 using CEA mode 8 and setting RetroArch to integer scale and run at a 3:1 aspect ratio. That works for everything except for non-4:3 games and the extra black space is not visible thanks to my TV's overscan.

WalkToFreedom

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 25
  • Last login:December 13, 2015, 02:33:09 pm
Re: Raspberry Pi2 320x240p via translating modeline to <hdmi_timings>
« Reply #14 on: November 23, 2015, 03:09:48 pm »
Hello,

I managed to drive my Sony PVM with the VGA666 Adapter (via the UMSA - Ultimate SCART Adapter to get a csync instead vsync and hsync).
As wpt-nathan pointed out, the pixelclock has to be a divider of 19.2 for lower pixelclock speeds.
https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=112735

By try and error I found that this is the case for pixelclocks lower 31253817 Hz

This is my configuration/modeline/hdmi/dpi_timing that works:

dtoverlay=vga666
enable_dpi_lcd=1
display_default_lcd=1
dpi_group=2
dpi_mode=87
hdmi_timings=336 1 10 30 34 252 1 15 3 42 0 0 0 50 0 6400000 1 # 336:252 6.4MHz progressive
#hdmi_timings=500 1 14 45 56 375 1 240 5 5 0 0 0 50 1 9600000 1 # 500:375 9.6Mhz interlaced

As far as I see these are the only two resolutions at 15.625kHz the gpu can generate through the dpi interface (due the limitations on the pixelclockspeed. I would rather call it a bug)
But I might be wrong.

I tried this out on my Raspberry Pi 2 with an HDMI-> VGA adapter and I get a blank screen. So it looks like the VGA666 or something similar is needed to get those resolutions.

I've just been running at 720x240 using CEA mode 8 and setting RetroArch to integer scale and run at a 3:1 aspect ratio. That works for everything except for non-4:3 games and the extra black space is not visible thanks to my TV's overscan.

Arrrggghhhh, I haven't had a change to try it out yet, but I expect I'll get the same result. You can see in my first post I used the same settings but didn't know about the RetroArch config. Where would I set that? Also, what is your connection to the CRT? HDMI -> VGA to ?
ArcadeVGA 3000
VGA -> SCART/RGB (dodgy diode circuit creates combined sync)
28" THOMSON CRT
Sanwa 2p 8 way 6 button
Intel i3-4130 Haswell
Asrock H81M
Corsair 8GB DD3
3TB Segate Barracuda (ROMS)
60GB Cosair SSD (OS)
Win7 PRO

Raspberry Pi2
RetroPie
HDMI -> VGA Convertor
VGA -> SCART/RGB (dodgy diode circuit creates combined sync)

bleck

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 6
  • Last login:December 30, 2016, 12:53:57 pm
  • I want to build my own arcade controls!
Re: Raspberry Pi2 320x240p via translating modeline to <hdmi_timings>
« Reply #15 on: November 24, 2015, 12:04:16 pm »
My setup is:
     Raspberry Pi 2
-> VicTsing active HDMI to VGA + audio
-> ArcadeForge UMSA VGA to SCART
-> Panasonic PAL CRT TV (supports NTSC and PAL60)

As for the aspect ratio, make sure the option
video_aspect_ratio = 3
is set in
/opt/retropie/configs/all/retroarch.cfg