HDMI 240p tv CRT with AMLOGIC it's possible?

I tried several versions of EMUELEC but only with 4.2 did I get 480i from HDMI to hdmi to component converter. I use a tvbox with amlogic s905x3 and a crt tv with ypbpr input, it looks fantastic but i would like to achieve 240p native resolution in arcade games like i do with raspberry pi3 and racalbox achieving 240p signal from hdmi.

Is there the possibility of achieving 240p via hdmi for crt tv with emuelec in amlogic s905x3?

Thank you.

Only if the display driver supports it. For valid resolutions in ssh try:

cat /sys/class/display/cap
1 Like

Thank you for answering Langerz82, your work is excellent.

Emuelec 4.2 works for me configuring 480i but cat /sys/class/display/cap gives an error, , that the file cannot be found.
Then try with emuelec 4.6 test:

EmuELEC (Community - EmuELEC is FREE! NOT FOR SALE!): 4.6-Nexus_devel_2023041219 2728 (Amlogic-ng.aarch64)
Machine model: Amlogic
CoreELEC dt-id: gxl_p281_2g_a95xr2
Amlogic dt-id: gxl_p281_2g

EMUELEC:~ # cat /sys/class/display/cap
480p60hz
576p50hz
720p60hz
1080i60hz
1080p60hz*
720p50hz
1080i50hz
1080p30hz
1080p50hz
1080p25hz
1080p24hz
2160p30hz
2160p25hz
2160p24hz
smpte24hz
640x480p60hz
800x600p60hz
1024x768p60hz
1280x960p60hz
1280x1024p60hz
480cvbs
576cvbs
pal_m
pal_n
ntsc_m
EMUELEC:~ #

Being able to obtain 480i in EMUELEC 4.2. Would it be possible to configure a 240p resolution for mame games through lines of code and keep the 480i of emulationestation?

For example: 1920x240p

If file: /packages/sx05re/emuelec/bin/emuelec-utils in resolutions function would have to be modified and add the custom resolutions.
BEFORE this line:

RESOLUTIONS=($(printf "%s\n" "${RESOLUTIONS[@]}" | sort -u))

add a resolution like so:

RESOLUTIONS+="480i60hz"

If you go any lower you would have to edit setres.sh to accept lower resolutions. This line in particular:

480p*|480i*|576p*|720p*|1080p*|1440p*|2160p*|576i*|720i*|1080i*|1440i*|2160i*)

And you would need to recompile the project. I can add 480i support in future but it might be awhile away.

1 Like

Thank you very much for answering.
My goal is to achieve a resolution of 480i for emulationestation and 240p for arcade games and to be able to connect the amlogic tvbox to a crt 15khz tv through an hdmi to ypbpr converter, the system works 480i by placing an EE_VIDEO_MODE file with 480i in its content on the root of the sd EMUELEC 4.2, but the games are also seen in 480i.
Is there a way to configure setres.sh to achieve this?

I want to get a configuration similar to this one of Recalbox with raspberry but in emuelec with amlogic.
https://wiki.recalbox.com/en/tutorials/video/crt/crt-screen-with-hdmi

Hmm, not without code changes. Give me a day or two and I’ll come up with something. Just note that some emulators may not work like Advance Mame does not like 240p at all lol. Not sure about the others.

1 Like

You are very kind to share your knowledge and time with the retro community, we thank you from the bottom of our hearts, hopefully I can contribute something to this fantastic project… I look forward to your response, once again thank you very much for assisting me.

Ok see here is the experimental file. I must warn you that 320x240 does not look good and weird scan lines which will probably make the converter look worse than better. For this reason I recommend using 480i60hz and the frame buffer 640 480 too.

But if you want to test here is the 320 240 settings, First SSH in then copy/paste 1 line at a time.

cd /emuelec/bin
wget https://gist.githubusercontent.com/Langerz82/c757f4404375a09efae9f84968ee997f/raw/8df418c85365314296d8f8816c9dfa753f4126c3/setres.sh
chmod +x /emuelec/bin/setres.sh
cp /usr/bin/emuelecRunEmu.sh /emuelec/bin
nano /emuelec/bin/emuelecRunEmu.sh

look for the line:

[ ! -z "$VIDEO_EMU" ] && $TBASH $SET_DISPLAY_SH $VIDEO_EMU $PLATFORM # set display

add just above it:

[[ -z $VIDEO_EMU ]] && VIDEO_EMU=$VIDEO

save and close.

Then add the following records to emuelec.conf with the command:

echo "ee_emu.framebuffer.640i60hz=320 240" >> /emuelec/configs/emuelec.conf

I think that should do it. But yeah, my recommendation is that you just settle with 480i60hz.

1 Like

Thanks for helping me, I tried the procedure that you indicated in different versions of Emuelec but I couldn’t see any changes. After applying what was suggested, should I also create an EE_VIDEO_MODE file, select a resolution from the menu or set one in config.ini?
Any particular version of Emuelec to try?

I use a tvbox with amlogic s905x3

Try setting emuelec to 480p60hz then open up the emuelec.conf and edit the line:

ee_emu.framebuffer.640i60hz=320 240

to

ee_emu.framebuffer.640p60hz=320 240

It will be in 480p not 480i, but it will give you an indication of the resolution displaying strange with a 320x240 framebuffer.

1 Like

I’m still trying to achieve 240p with emuelec, I tell you that I’m using a 15khz crt tv with component video input (ypbpr) connecting the tv box from HDMI to a transcoder with which using raspberry pi 3b+ with recalbox 7.2.2 I achieve 240p (1920x240) .
On the other hand, I wanted to ask you what the HDMI custom section of the config.ini is for and how it is used, could you configure a 240p15khz resolution for everything and directly run the boot with retroarch menu rgui?

Here is a video of the method in raspberry that I achieve with the hdmi to video transcoder ypbpr crt tv 15khz:

Thank you.

I don’t think the display mode will support 240p15khz. We support cvbs with an internal buffer of something different, or digital modes. I dont have any idea how such a large width 1920x240 would work in the operating system.

1 Like

Have you got a link to the specifications of the HD converter?

1 Like

It is actually an HDMI to Component Video ypbpr transcoder, it works with low resolutions and 15khz like all the other transcoders I have, the interesting thing is that with raspberry pi 3b+ and recalbox 7.2.2 with configuration modification, 15hkz 240p (1920x240) is achieved ) from the HDMI output and can be connected to 15khz arcade chassis, 240p 15khz transcoder and modrgb tv crt 15khz and all work in 240p.
That’s why I hope I can get 240p with amlogic and emuelec somehow with their help, maybe it would be a great alternative for the retro gamer having an emuelec crt 240p version.

Below I leave the description of the product but I must clarify that there are versions that are transcoders like mine and others that are scalers, unfortunately there is no way to distinguish them until you try them.

Description

Search term:
HDMI to RGB Component (YPbPr) Video, R/L Audio Adapter Converter, HD TV, HD Video Converter, 2 Channel LPCM
Features:
The series of the HDMI Amplifier Converter have many features that enable them to perform in a superior manner. among those features you will find:

  1. Easy to Use: Install in seconds, no need of setting
  2. Conversion:It could convert complete HDMI into YPbPr video and R/L audio output
  3. Supports HDCP1.2
  4. Supports165MHz/1.65Gbps per channel(6.75Gbps all channel)bandwidth for HDMIInput
  5. Supports Analogue Video output up to UXGA and 1080P witch 10-bit DAC.
    Descriptions:
    It is an HDMI converter.
    It converters HDMI input into analog YPbPr Video and R/L audio signal.
    It allows users to enjoy their high definition image and sound when watching movies or playing games on the traditional YPbPr monitors or projectors.
    Specifications:
    Input Video Signal: 0.5-1.0 volts p-p
    Input DDC Signal: 5 Volts p-p (TTL)
    Input connection: HDMI A fememale(19Pin)
    Output connection: YPbPr,R/L
    HDMI video input format: 480i/576i/480p/576p/720p/1080i/1080P
    YPbPr video output format: 480i/576i/480p/576p/720p/1080i/1080P
    Audio output format: 2 channel LPCM
    Vertial Frequency Range: 50/60HZ
    Input Video Amplifier Bandwidth: 1.65Gbps/165MHz
    Color: Black
    Dimensions: 88 * 68 * 25.5mm(L* W * H)
    Plug Type: US Plug
    Package Includes:

1x HDMI Amplifier Converter
1x 5V DC Power Supply Charger

Here is the raspberry and recalbox configuration to output 240p via hdmi to crt tv 15khz.
I use this transcoder and any other rgb to component ypbpr video and it works 240p in arcade games, 8 and 16 bit.

Recalbox boot configuration

The resolutions accepted by this type of screen are different depending on the model, but in general, we want :

  • 480i for EmulationStation (my monitor does not support 480p, and text is unreadable in 240p).
  • 240p for games (output resolution for almost all consoles of that time).

This is what your recalbox-user-config.txt file should look like :

# DMT 87 HDMI custom mode resolution setting for game resolution
hdmi_cvt=1920 240 60 1 1 0 0
# Ignore the EDID of your TV (CRT can send wrong information)
hdmi_ignore_edid=0xa5000080
# Force the pixel encoding mode, 2 corresponds to Full RGB
hdmi_pixel_encoding=2
# Disable safe mode at raspberry pi boot
avoid_safe_mode=1
# Do not disable overscan
disable_overscan=0
# Avoid adapter interference by boosting the HDMI signal
config_hdmi_boost=4
# Force sound on HDMI
hdmi_drive=2
# Selects the HDMI CEA group
hdmi_group=1
# CEA resolution 6 = 480 interlaced
hdmi_mode=6

# Kernel used
kernel=zImage
# Use HDMI mode even if no cable is connected
hdmi_force_hotplug=1
# memory settings
gpu_mem_256=128
gpu_mem_512=256
gpu_mem_1024=512

# Audio related parameters
dtparam=audio=on
# Allows to delay the boot
boot_delay=3

Copy

Some explanations:

  • The Raspberry Pi will boot in hdmi_group=1 and hdmi_mode=6, which corresponds to 480i (interlaced).
  • If the boot is done directly in 240p, the texts of the menus and the games would be unreadable.
  • The line hdmi_cvt=1920 240 60 1 1 0 0 specifies a resolution of 1920 x 240 x 60 Hz, which will not be used for boot, but will be saved as DMT 87 HDMI mode, which we will use later for launching games.

Here is a little more explanation of this line:

hdmi_cvt=<width> <height> <framerate> <aspect> <margins> <interlace> <rb>
width        width in pixels
height       height in pixels
framerate    framerate in Hz
aspect       aspect ratio 1=4:3, 2=14:9, 3=16:9, 4=5:4, 5=16:10, 6=15:9
margins      0=margins disabled, 1=margins enabled
interlace    0=progressive, 1=interlaced
rb           0=normal, 1=reduced blanking

Copy

Recalbox.conf file configuration

Although the Raspberry Pi boots in CEA 6 video mode (via the recalbox-user-config.txt file), it is better to force this configuration for EmulationStation:

system.es.videomode=CEA 6 HDMI

Copy

Next we need to specify the boot resolution for our emulators, globally:

global.videomode=DMT 87 HDMI

Copy

All emulators will be launched in DMT 87 HDMI mode (custom mode) containing via the hdmi_cvt of the recalbox-user-config.txt file, the 1920 x 240x 60Hz resolution.

Small explanation for the 1920 pixels wide :

To make it short, a CRT screen only needs a vertical number of pixels (240 here) and a vertical refresh rate (60 Hz here).

We specify 1920 pixels wide, because 1920 is a multiple of 160, 320, 384… which are often met resolutions.

For resolutions that are not multiples, we will have to calculate with RetroArch the overscan, that is to say the black bands necessary around the screen to keep the original ratio.

Everything must fit in this resolution. But you can specify a different resolution per console, with the following line:

dreamcast.videomode=hdmi_cvt 320 240 60 1 1 0 0

Have you checked out Batocera? It seems that it might have better support see:

480i is the minimum our display mode allows. In config.ini HDMI custom mode it may be possible to set 240p 320x240 with the correct information but I’m not sure our display/mode file will allow it.

edit:
The thing is even if you get it to display 320x240 the font sizes would appear massive in ES themes. Unless you make the framebuffer at least 640x480 instructions I mentioned above.
640x480 is a multiple of 2 for 320x240 so theoretically it should look the same with the transcoder.

The transcoder converts the digital signal to a CRT compatible signal and looking above the lowest digital signal it accepts is 480i. But I would recommend using 480p so it picks up all the correct pixels when converting.

1 Like

I really appreciate your attention, regarding the transcoder, despite the specifications it supports low resolutions like 240p, the same configuration that I achieved with raspberry works by directly connecting the hdmi signal without a transcoder to a crt 15khz rgb input, it must be taken into account that a crt 15kh does not accept resolutions higher than 480i so 480p is not compatible to be displayed on the screen.
In tvbox only emuelec allowed me 480i, although I will try with Batocera.
Regarding the size of the font, the idea is to use 480i for ES and when launching the games that retroarch plays in 240p (1920x240p super resolution) where you have to correct the aspect ratio with custom, you could also use 240p from the start avoiding launching ES and instead boot from retroarch with 240p compatible RGUI menu.
Finally, I reiterate the config.ini query on HDMI CUSTOM, how is it used?

I really appreciate this conversation.

Making a HDMI custom record the variables you need are listed in the comments:

#------------------------------------------------------------------------------------------------------
#
# HDMI custom mode
#   You can use this setting to set a custom video mode
#   modeline "horpixels,verpixels,pixel_clock,hor_freq,ver_freq,hdisp,hsyncstart,hsyncend,htotal,vdisp,
#             vsyncstart,vsyncend,vtotal,hsync_polarity,vsync_polarity,progress_mode"
#
#   Example for 1920x1080p@60hz
# modeline='1920,1080,148500,67500,60,1920,2008,2052,2200,1080,1084,1088,1125,1,1,1'
#
#------------------------------------------------------------------------------------------------------

I think if you look on the net you should be able to find out each value needed for 320x240. This may cause display issues though.

Regading a super resolution, we dont have that, but what we do have is a way to display in 480p, and have the frame buffer in a higher or lower resolution with my new setres.sh script. So you could display ES with something like 1024x768 internally with in /emuelec/configs/emuelec.conf:

ee_es.framebuffer.480p60hz=1024 768

then run games at 320x240 with:

ee_emu.framebuffer.480p60hz=320 240

480p60hz is the output resolution you are using. What it “should” do is basically double the internal output to the display in games, which “should” be very fast (I can’t be sure).
That way it would theoretically emulate what you are looking for.

edit:
You might have to use 480p60hz because 480i60hz is not available as a valid resolution currently.
sorry my bad.

1 Like

It is interesting that the 480i resolution is not supported…since the only way to display emuelec via hdmi on crt with a 480i video output configuration…by placing 480i in config.ini, config/emuelec or EE_VIDEO_MODE in emuelec image is achieved in crt 15khz, and in the emuelec 4.2 vervion it is the only one that the image is correctly centered in 480i, in the others it is displaced to the left.

Here’s how I do it:

Resolutions higher than 480i are not shown on 15khz crt tv.