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

**URL:** <https://emuelec.discourse.group/t/hdmi-240p-tv-crt-with-amlogic-its-possible/2008>\
**Category:** Amlogic Devices\
**Created:** [June 26, 2023, 6:45am UTC](https://emuelec.discourse.group/t/hdmi-240p-tv-crt-with-amlogic-its-possible/2008 "2023-06-26T06:45:24Z")\
**Posts on this page:** 20\
**Page:** 3

<div class="post-metadata">

**Author:** ![LaserPlay](https://yyz2.discourse-cdn.com/free1/user_avatar/emuelec.discourse.group/laserplay/32/527_2.png) [@LaserPlay](https://emuelec.discourse.group/u/LaserPlay)\
**Post date:** [July 30, 2023, 7:29pm UTC](https://emuelec.discourse.group/t/hdmi-240p-tv-crt-with-amlogic-its-possible/2008/41 "2023-07-30T19:29:50Z")

</div>

I manage to apply the command from the terminal but the NATIVE VIDEO OF THE EMULATOR is still in 480i when executing a game… it’s that if I don’t configure emuelec setting or Native Video emulator 480i60hz, I can’t see image on crt tv.

1920x240p takes it if I add 1 pixel 240 (1920x241p)

It also takes 320x240p60hz

EMUELEC:~ # cat mode  
1920x241p60hz  
EMUELEC:~ # echo “320x240p60hz” \> mode  
EMUELEC:~ # cat mode  
320x240p60hz

I keep testing.

---

<div class="post-metadata">

**Author:** ![Langerz82](https://avatars.discourse-cdn.com/v4/letter/l/bc79bd/32.png) [@Langerz82](https://emuelec.discourse.group/u/Langerz82)\
**Post date:** [July 31, 2023, 6:08am UTC](https://emuelec.discourse.group/t/hdmi-240p-tv-crt-with-amlogic-its-possible/2008/42 "2023-07-31T06:08:03Z")

</div>

You have to be in the /sys/class/display directory to change it’s mode file.

```auto
cd /sys/class/display

```

then try:

```auto
echo 320x240p60hz > /sys/class/display/mode

```

edit: here is the dmesg error when trying to set it:

```auto
[402716.251867@2]- vout: vmode set to 320x240p60hz
[402716.251887@2]- vout: error: no matched vout mode, exit

```

---

<div class="post-metadata">

**Author:** ![LaserPlay](https://yyz2.discourse-cdn.com/free1/user_avatar/emuelec.discourse.group/laserplay/32/527_2.png) [@LaserPlay](https://emuelec.discourse.group/u/LaserPlay)\
**Post date:** [July 31, 2023, 5:37pm UTC](https://emuelec.discourse.group/t/hdmi-240p-tv-crt-with-amlogic-its-possible/2008/43 "2023-07-31T17:37:09Z")

</div>

I see, try 1920x240p@60hz to see what happens.

I continue experimenting with framebuffers, the best setting for Emu frame buffer is 1920 240, I modified yours to this and retroarch works better with custom x1 resolution at 240p for example, but then 480i comes out because 480i is configured in ee\_video.

---

<div class="post-metadata">

**Author:** ![LaserPlay](https://yyz2.discourse-cdn.com/free1/user_avatar/emuelec.discourse.group/laserplay/32/527_2.png) [@LaserPlay](https://emuelec.discourse.group/u/LaserPlay)\
**Post date:** [July 31, 2023, 7:47pm UTC](https://emuelec.discourse.group/t/hdmi-240p-tv-crt-with-amlogic-its-possible/2008/44 "2023-07-31T19:47:29Z")

</div>

Another alternative that I would like to explore and experiment with is HDMI CUSTOM MODELINES, but I don’t know how to use them in this project or how to apply them correctly to see changes and thus carry out the necessary tests and variations for the investigation.

I have already created modellines in windows and applied them successfully on laptops with integrated graphics card intel HD3000.

Can you explain to me the way to apply and execute a modeline, even if it is with the one in the config.ini example?

---

<div class="post-metadata">

**Author:** ![Langerz82](https://avatars.discourse-cdn.com/v4/letter/l/bc79bd/32.png) [@Langerz82](https://emuelec.discourse.group/u/Langerz82)\
**Post date:** [August 2, 2023, 5:18am UTC](https://emuelec.discourse.group/t/hdmi-240p-tv-crt-with-amlogic-its-possible/2008/45 "2023-08-02T05:18:40Z")

</div>

Ok you have to do a few things to make this work. I make no garuntee this will work.

In config/flash.ini you need to add the modeline for 320x240:

```auto
#------------------------------------------------------------------------------------------------------
#
# 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'
#
#------------------------------------------------------------------------------------------------------
modeline='320,240,6000,15000,60,320,328,360,400,240,243,247,253,0,1,1'
vout='320x240p60hz'

```

Then you have to use a modified setres.sh file.

```auto
cp /usr/bin/setres.sh /emuelec/bin
nano /emuelec/bin/setres.sh

```

Modify the following in the file:

```auto
[[$MODE != "auto"]] && switch_resolution $MODE

```

comment the line out, so it becomes:

```auto
# [[$MODE != "auto"]] && switch_resolution $MODE

```

You might also need to override the safeguards here:

```auto
# If the display file mode is NOT present, or the video mode supplied is set to
# auto then just exit.
if [[! -f "$FILE_MODE"]] || [[$MODE == "auto"]]; then
  exit 0
fi

```

by commenting them out like so:

```auto
# If the display file mode is NOT present, or the video mode supplied is set to
# auto then just exit.
# if [[! -f "$FILE_MODE"]] || [[$MODE == "auto"]]; then
# exit 0
# fi

```

Then you need to add the es\_emu resolution in emuelec.conf so ES displays better.  
In /emuelec/configs/emuelec.conf:

```auto
nano /emuelec/configs/emuelec.conf

```

Add a new lines to the end:

```auto
ee_es.framebuffer.320x240p60hz=1024 768
ee_es.framebuffer_border.320x240p60hz=0 0 319 239
ee_emu.framebuffer.320x240p60hz=320 240
ee_emu.framebuffer_border.320x240p60hz=0 0 319 239

```

video timings extracted from:  
[https://tomverbeure.github.io/video\_timings\_calculator](https://tomverbeure.github.io/video_timings_calculator)

edit: modeline updated

---

<div class="post-metadata">

**Author:** ![Langerz82](https://avatars.discourse-cdn.com/v4/letter/l/bc79bd/32.png) [@Langerz82](https://emuelec.discourse.group/u/Langerz82)\
**Post date:** [August 7, 2023, 9:00am UTC](https://emuelec.discourse.group/t/hdmi-240p-tv-crt-with-amlogic-its-possible/2008/46 "2023-08-07T09:00:32Z")

</div>

Sorry man some typos:  
in emuelec it should be:

```auto
ee_es.framebuffer_border.320x240p60hz=0 0 319 239

```

I fixed it in the above post.

---

<div class="post-metadata">

**Author:** ![dplc81](https://avatars.discourse-cdn.com/v4/letter/d/958977/32.png) [@dplc81](https://emuelec.discourse.group/u/dplc81)\
**Post date:** [August 8, 2023, 1:10pm UTC](https://emuelec.discourse.group/t/hdmi-240p-tv-crt-with-amlogic-its-possible/2008/47 "2023-08-08T13:10:32Z")

</div>

It’s great to be able to use 480i signal from HDMI out, since the CVBS out is a bit low quality, at least in my X96 X4 device. I also had the screen positioned a bit to the left. It’s worthy mentioning that a simple edit in the “ES frame borders” and “ES frama buffers” settings in “Danger Zone” fixed the issue and the image is now centered.

The 1920x240 resolution mentioned by LaserPlay may be necessary if the HDMI port is unable to send (at least) 25MHz pixelclock in smaller resolution widths like 320x240, resulting in the 15Hz CRT TV unable to display the image. But I think that may not be the case with my device. In addition to 1920x240 being a resolution compatible with CRT SwitchRes in Retroarch (feature not available in Emuelec), it allows for faster real time resolution switch.

I tried the suggestions above, and it seems EmulationStation tries to exhibit something in 240p judging by the low res OSD from my TV screen, but is unable to, and a black screen is presented.

---

<div class="post-metadata">

**Author:** ![LaserPlay](https://yyz2.discourse-cdn.com/free1/user_avatar/emuelec.discourse.group/laserplay/32/527_2.png) [@LaserPlay](https://emuelec.discourse.group/u/LaserPlay)\
**Post date:** [September 3, 2023, 1:46pm UTC](https://emuelec.discourse.group/t/hdmi-240p-tv-crt-with-amlogic-its-possible/2008/49 "2023-09-03T13:46:53Z")

</div>

Thank you very much for participating in this emuelec crt 240p project.

I’ll show you the results so far, unfortunately I only managed to get 480i working but in retroarch it’s in 240p if I’m not mistaken.

Note that I show the aspect ratio retroarch configuration and it is 224 (x1)

Here I share a video: [https://www.youtube.com/shorts/1tjDGQs2tqM](https://www.youtube.com/shorts/1tjDGQs2tqM)

---

<div class="post-metadata">

**Author:** ![dplc81](https://avatars.discourse-cdn.com/v4/letter/d/958977/32.png) [@dplc81](https://emuelec.discourse.group/u/dplc81)\
**Post date:** [September 8, 2023, 9:08pm UTC](https://emuelec.discourse.group/t/hdmi-240p-tv-crt-with-amlogic-its-possible/2008/50 "2023-09-08T21:08:51Z")

</div>

I think you did it! In your video, I assume Retroarch is already displaying 1920x240p (since vertical scaling is 1x). @LaserPlay, when you got the time, would you share the configuration used to achieve?

---

<div class="post-metadata">

**Author:** ![LaserPlay](https://yyz2.discourse-cdn.com/free1/user_avatar/emuelec.discourse.group/laserplay/32/527_2.png) [@LaserPlay](https://emuelec.discourse.group/u/LaserPlay)\
**Post date:** [September 18, 2023, 1:06pm UTC](https://emuelec.discourse.group/t/hdmi-240p-tv-crt-with-amlogic-its-possible/2008/51 "2023-09-18T13:06:47Z")

</div>

What I modified in addition to what was already described here, was to change the emulator frame buffer to 1920x240/1920x224

---

<div class="post-metadata">

**Author:** ![hardtecnica](https://avatars.discourse-cdn.com/v4/letter/h/e0b2c6/32.png) [@hardtecnica](https://emuelec.discourse.group/u/hardtecnica)\
**Post date:** [July 11, 2024, 1:56pm UTC](https://emuelec.discourse.group/t/hdmi-240p-tv-crt-with-amlogic-its-possible/2008/52 "2024-07-11T13:56:27Z")

</div>

Could you please help me about how to insert custom modelines for the CVBS out (also known as Composite) for the old version 3.9 of the Emuelec? I didn’t find the “flash.ini” in this version (Since my box has Amlogic s912 I’m stuck with the 3.9 version, the last one compatible). I have some experience with editing modelines on the CRT Emudriver available for Windows and having such possibility with Emuelec is what I need to get “240p”/progressive very low resolutions from my TV box connected to a CRT TV. I just want what the OP achieved but with the AV OUT (CVBS) instead of HDMI and using that old version of Emuelec.

---

<div class="post-metadata">

**Author:** ![Langerz82](https://avatars.discourse-cdn.com/v4/letter/l/bc79bd/32.png) [@Langerz82](https://emuelec.discourse.group/u/Langerz82)\
**Post date:** [July 12, 2024, 7:26am UTC](https://emuelec.discourse.group/t/hdmi-240p-tv-crt-with-amlogic-its-possible/2008/53 "2024-07-12T07:26:40Z")

</div>

@hardtecnica

Probably the easiest way to achieve cvbs output would be to do this in SSH.

```auto
echo 480cvbs > /storage/.config/EE_VIDEO_MODE

```

Then re-boot.

Internally the device runs at a higher resolution and converts the digital signal into analog. If you want to adjust the borders, you will have to use the setres.sh from newer EmuELEC distros.

---

<div class="post-metadata">

**Author:** ![hardtecnica](https://avatars.discourse-cdn.com/v4/letter/h/e0b2c6/32.png) [@hardtecnica](https://emuelec.discourse.group/u/hardtecnica)\
**Post date:** [July 13, 2024, 12:12am UTC](https://emuelec.discourse.group/t/hdmi-240p-tv-crt-with-amlogic-its-possible/2008/55 "2024-07-13T00:12:56Z")

</div>

I already have 480cvbs output working, but it is 480i and I want progressive signal like 240p. I have setres.sh in 3.9 and changes I made do change the internal resolution, but still 480i is output, there I couldn’t managed to change the resolution for a progressive 240p for the analog out. I think I had to do first this custom modeline for 15KHz CRT TVs aka normal consumer CRT TV, but I don’t know where I could do it.

A custom modeline like that you mentioned here but I don’t know where to add it in 3.9 version for the analog out:

```auto
modeline='320,240,6000,15000,60,320,328,360,400,240,243,247,253,0,1,1'
vout='320x240p60hz'

```

---

<div class="post-metadata">

**Author:** ![Langerz82](https://avatars.discourse-cdn.com/v4/letter/l/bc79bd/32.png) [@Langerz82](https://emuelec.discourse.group/u/Langerz82)\
**Post date:** [July 13, 2024, 12:28am UTC](https://emuelec.discourse.group/t/hdmi-240p-tv-crt-with-amlogic-its-possible/2008/56 "2024-07-13T00:28:44Z")

</div>

Ok at a guess you would need to do the following:

Ok you would need to add the video mode,

```auto
echo 320x240p60hz > /storage/.config/EE_VIDEO_MODE

```

copy the default setres.sh to /emuelec/bin and modify it to have something like this:  
add here: [EmuELEC/packages/sx05re/emuelec/config/emuelec/scripts/setres.sh at v3.9 · EmuELEC/EmuELEC · GitHub](https://github.com/EmuELEC/EmuELEC/blob/v3.9/packages/sx05re/emuelec/config/emuelec/scripts/setres.sh#L35)

```auto
"320x240p60hz")
fbset -fb /dev/fb0 -g 1024 768 1024 1536 $BPP
fbset -fb /dev/fb1 -g $BPP $BPP $BPP $BPP $BPP
echo 0 0 1023 767 > /sys/class/graphics/fb0/free_scale_axis
echo 0 0 319 239 > /sys/class/graphics/fb0/window_axis
echo 320 > /sys/class/graphics/fb0/scale_width
echo 240 > /sys/class/graphics/fb0/scale_height
echo 0x10001 > /sys/class/graphics/fb0/free_scale

```

Make sure /emuelec/bin is added to the default PATH variable. Not sure if EE3.9 does by default.

edit:  
If it does not switch properly. Then add the lines to /storage/.config/custom\_start.sh:

> <https://github.com/EmuELEC/EmuELEC/blob/v3.9/packages/sx05re/emuelec/config/custom_start.sh#L13>

add:

```auto
echo 320x240p60hz > /sys/class/display/mode
fbset -fb /dev/fb0 -g 1024 768 1024 1536 $BPP
fbset -fb /dev/fb1 -g $BPP $BPP $BPP $BPP $BPP
echo 0 0 1023 767 > /sys/class/graphics/fb0/free_scale_axis
echo 0 0 319 239 > /sys/class/graphics/fb0/window_axis
echo 320 > /sys/class/graphics/fb0/scale_width
echo 240 > /sys/class/graphics/fb0/scale_height
echo 0x10001 > /sys/class/graphics/fb0/free_scale

```

---

<div class="post-metadata">

**Author:** ![Langerz82](https://avatars.discourse-cdn.com/v4/letter/l/bc79bd/32.png) [@Langerz82](https://emuelec.discourse.group/u/Langerz82)\
**Post date:** [July 13, 2024, 12:56am UTC](https://emuelec.discourse.group/t/hdmi-240p-tv-crt-with-amlogic-its-possible/2008/57 "2024-07-13T00:56:20Z")

</div>

Hey I just double checked on my device and found that 320x240p60hz is not a valid display mode for amlogic chips, so unfortunately the above would not work. Lowest res it can go is 640x480p60hz.

---

<div class="post-metadata">

**Author:** ![hardtecnica](https://avatars.discourse-cdn.com/v4/letter/h/e0b2c6/32.png) [@hardtecnica](https://emuelec.discourse.group/u/hardtecnica)\
**Post date:** [July 13, 2024, 1:15am UTC](https://emuelec.discourse.group/t/hdmi-240p-tv-crt-with-amlogic-its-possible/2008/58 "2024-07-13T01:15:11Z")

</div>

You mean it’s unsupported for Amlogic for the analog out? Because for the HDMI out the OP proved with a video it worked with 240p after modeline addition.

---

<div class="post-metadata">

**Author:** ![Langerz82](https://avatars.discourse-cdn.com/v4/letter/l/bc79bd/32.png) [@Langerz82](https://emuelec.discourse.group/u/Langerz82)\
**Post date:** [July 13, 2024, 1:36am UTC](https://emuelec.discourse.group/t/hdmi-240p-tv-crt-with-amlogic-its-possible/2008/59 "2024-07-13T01:36:04Z")

</div>

in ssh do:

```auto
cat /sys/class/display/cap

```

if the resolution is not there, it will not allow the changing of mode, I think.

---

<div class="post-metadata">

**Author:** ![hardtecnica](https://avatars.discourse-cdn.com/v4/letter/h/e0b2c6/32.png) [@hardtecnica](https://emuelec.discourse.group/u/hardtecnica)\
**Post date:** [July 13, 2024, 2:14am UTC](https://emuelec.discourse.group/t/hdmi-240p-tv-crt-with-amlogic-its-possible/2008/60 "2024-07-13T02:14:16Z")

</div>

I’m not able to SSH to this OS because the password “emuelec” is not working.

The changes I do in setres.sh do change the internal res but not the external on CVBS which still is 480i, because it’s still getting the default interlaced “modeline”. The OP managed to add it by your custom calculated 240p modeline inserted to config/flash.ini, but I didn’t find flash.ini in this version. I’m sure I need to insert a custom modeline in order for this to work, I’m not sure it will for the CVBS out though. Maybe it’s hardcoded on the Amlogic only interlaced NTSC/PAL output.

---

<div class="post-metadata">

**Author:** ![hardtecnica](https://avatars.discourse-cdn.com/v4/letter/h/e0b2c6/32.png) [@hardtecnica](https://emuelec.discourse.group/u/hardtecnica)\
**Post date:** [July 13, 2024, 2:37am UTC](https://emuelec.discourse.group/t/hdmi-240p-tv-crt-with-amlogic-its-possible/2008/61 "2024-07-13T02:37:50Z")

</div>

This was the file you instructed the OP to modify:

```auto
Ok you have to do a few things to make this work. I make no garuntee this will work.
In config/flash.ini you need to add the modeline for 320x240:

```

```auto
#------------------------------------------------------------------------------------------------------
#
# 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'
#
#------------------------------------------------------------------------------------------------------
modeline='320,240,6000,15000,60,320,328,360,400,240,243,247,253,0,1,1'
vout='320x240p60hz'

```

It’s a HDMI custom mode, probably this file don’t “talk” with the CVBS out, but if it’s possible to insert a custom modeline like this for CVBS out maybe would work. Modelines exactly like that works with analog or digital video output on PC, is what I use to get “240p” and any custom res to work on CRT display.

---

<div class="post-metadata">

**Author:** ![Langerz82](https://avatars.discourse-cdn.com/v4/letter/l/bc79bd/32.png) [@Langerz82](https://emuelec.discourse.group/u/Langerz82)\
**Post date:** [July 13, 2024, 5:00am UTC](https://emuelec.discourse.group/t/hdmi-240p-tv-crt-with-amlogic-its-possible/2008/62 "2024-07-13T05:00:40Z")

</div>

@hardtecnica  
its in /flash/config.ini the above has a typo. But you cannot modify it by default because the flash directory is protected. In ssh you will either have to re-mount it as rw or modify the file by inserting the card into a computer and changing it in the system partition.  
But even if you get it working, ES wont look very good because it’s not designed to work with such low resolutions.

[Previous page](https://emuelec.discourse.group/t/hdmi-240p-tv-crt-with-amlogic-its-possible/2008.md?page=2)

[Next page](https://emuelec.discourse.group/t/hdmi-240p-tv-crt-with-amlogic-its-possible/2008.md?page=4)
