Posts

Showing posts from March, 2022

Element ELST5016s review: TV input lag, deinterlacing and upscaling using the piLagTesterPRO

This is a 1080p "smart" TV from 2017. While it's not a standout in any dimension it does everything well, and is a balanced choice for gaming, both modern and retro. The lag is much better than average, and the upscaling is also better than average. It's smart functionality is a bit mediocre, but that's not why you are here, right?

Image quality

Good upscaling is critical for retro gaming. Ideally, all pixels should appear equally sharp and bright (no aliasing), and angled lines should appear smooth, with no jagged, irregular steps. Also important is that the display shows most or all of the pixels it is sent. Often, this is not the case, with some number of pixels cropped from the bottom or top edges. Shockingly, these tests are relevant for modern gaming as well, because even at their native resolution many TVs have aliasing and cropping.

I attempted to adjust the set to minimize cropping and aliasing. On this set scaling and aspect ratio are combined under a single option called "aspect". Your options include a couple way-zoomed-in modes, a just-scan option that does zero cropping but always uses 16:9, and two moderately cropped settings, one 16:9 and the other 4:3. Interestingly, this TV has a somewhat hidden service menu, (press 0 a bunch of times on the main menu) which gives to-the-pixel control over cropping. But unfortunately it doesn't seem to save this over a power cycle, so I didn't use it for the report below. 

resolution quality cropping (side, top)
480p/i A. Mild over sharpening and halos, but the overall result is nearly as good as you ever outside of a dedicated scaler. 10,13
720p A. Pixels get rearranged such that a 1-pixel checkerboard is no longer a checkerboard, but most detail is preserved and there's no aliasing and no cropping. 0,0
1080p A. Even in just-scan there's a tiny bit of aliasing even though there's no cropping. Bizarre, but the effect is very mild. Possibly what I'm really seeing is over sharpening, not aliasing from resizing.  0,0
960p B- (4:3), A-(16:9). This resolution is a favorite with the OSSC crowd, but doesn't look that good on this TV. Might as well use 480p output from the OSSC since this TV does good upscaling at that resolution. 0,0



Overall this set does a good job of upscaling. No resolution is perfect but all are handled pretty well. In fact this might be the best well-rounded TV I've seen. Since it does such a solid job in all standard resolutions, the 960p results, while disappointing, are not a big deal for OSSC users, as they can just use 480p.

The display has 3 HDMI, 1VGA, and 1 yPbPr input. I only tested HDMI.

Input Lag

I used a piLagTesterPRO to measure input lag. This device sends a frame of video over HDMI and measures how long it takes to display it. This display does not have a game mode; not even a game 'color' preset. I toggled all the display quality settings and did not see a consistent effect on lag, however the tests reported are with every "enhancement" set to off.

Input Lag Test Results

I report two kinds of values. 1st response measures how long it takes for the TV to start responding (I use a 5% change in display brightness). This overly optimistic value doesn't tell how long it takes to see anything useful, but matches what other reviewers call input lag. full response is a more realistic measure of lag, and requires the display to reach 80% of full brightness. This combines both input lag and response time, and is closer to what you would actually experience in a game.

topbottom
Resolution1st response full response1st responsefull responsescan out
480i39.647.655.563.515.9
480p22.730.738.446.415.7
720p21.429.437.145.115.7
1080p21.529.537.345.315.8
1080p5028.236.24452.015.8
1080p2455.863.871.579.515.7

This set advertises a huge range of supported modes, and actually it probably supports any reasonable resolution and refresh rate that's sub 1080p60. For progressive sources at 60hz, the input lag (first response) is consistently 22ms, the response time is 8ms, and the scan out is 16ms. Deinterlacing adds 16ms. The TV also supports a number of other refreshes rates. In particular, 1080p PAL (50hz) and film (24hz) are handled perfectly, with no dropped frames or drifting lag. Interestingly, the scanout is the same 60hz rate; the TV just waits longer to start drawing until the required data has been sent over HDMI, but once it starts drawing it goes at the full speed.

The TV also reports that it can support some computer modes that refresh at 72 or 75 hz. This is both a lie and true: it still draws the screen 60hz and thus has to drop frames, but it will at least accept these inputs and display them. I would strongly advise against using these modes as the higher refresh rate in no way improves the lag.  For anybody who cares, here's the raw data for the full response at the bottom of the screen for all supported modes. It's sorted by the average drift in lag per second, so the results at the bottom are modes where the TV cannot actually match the input refresh rate.

mode name res/refreshfull response variability
dmt#83900p6038.10.02ms
dmt#47900p6037.20.04ms
dmt#16768p6037.40.05ms
cea#161080p6037.30.06ms
cea#19720p5043.90.06ms
cea#4720p6037.10.07ms
dmt#39768p60370.07ms
dmt#581050p60370.07ms
cea#51080i6053.80.08ms
cea#17576p5045.30.09ms
cea#18576p5045.20.09ms
cea#321080p2471.50.10ms
cea#6480i6055.40.11ms
dmt#9600p6037.30.12ms
cea#1480p6038.50.14ms
cea#2480p6038.30.14ms
cea#3480p6038.40.14ms
cea#201080i50640.14ms
cea#7480i6055.40.16ms
cea#311080p50440.16ms
dmt#4480p6038.50.16ms
cea#22576i5065.50.23ms
cea#21576i5065.60.24ms
dmt#8600p5646.31.09ms
dmt#5480p7242.72.18ms
dmt#18768p7542.82.82ms
dmt#361024p7541.73.01ms
dmt#17768p7042.73.65ms
dmt#6480p7542.86.70ms
dmt#11600p7542.96.85ms
dmt#10600p7242.18.25ms

Results compared to other displays

To allow quick comparison between many displays I've summarized the results across all the mainstream displays I've personally tested with the piLagTester Pro. Min lag is the time to the first response, measured where the screen starts drawing (typically, the top); real lag is the time to the full response, measured where drawing finishes (usually the screen bottom), i.e. input lag + scan out + response time. Numbers in red denote average values that can vary by up to 8ms between power cycles.

This list is sorted by real lag for each display's native resolution and max refresh rate (usually 1080p60 but some sets are 720p60, and other monitors support > 60hz).


DisplayYear made (TV?)Native Resnative min lagnative real lag480i real lag480p real lag720p real lag1080p real lagnative response timenative scan out
Dell E198FPb20081024p2.720.439.035.05.0012.70
Samsung 2494sw20111080p2.822.726.526.526.58.0013.30
Vizio VO370M20101080p2.523.683.049.047.024.35.4715.67
LG W1953T2010768p2.625.628.728.710.0013.00
Dell U2410 (game)20101080p4.026.262.228.326.526.56.0016.20
TCL 40S32520211080p6.527.360.629.027.927.76.0014.83
TCL 49s40320184k6.130.276.830.930.330.78.0016.13
Dell E2211H20141080p3.033.634.734.534.133.815.0015.57
Panasonic TH-58PE75U2008720p28.034.034.034.034.034.06.000.00
Corprit D157 (hdmi)20211080p3.134.534.934.834.633.916.2515.13
Samsung S27C23020141080p2.936.036.636.136.118.1014.97
Vizio E470VL (vga)20111080p22.039.039.039.039.09.008.00
Samsung LN32D4032012720p20.941.258.942.440.740.75.5014.83
TCL50s42320214k14.042.075.042.042.042.013.0015.00
sony XBR 43X800D20174k24.544.346.546.044.644.75.0014.83
Element elst5016s20171080p21.445.163.546.445.145.38.0015.73
RCA L40FHD4120101080p20.346.665.048.047.046.09.6816.63
Sony 40VL130 (game)20081080p22.847.366.349.047.347.39.0815.43
Philips 42PFL3603D/F720091080p29.050.084.050.050.050.05.0016.00
LG 42LC2D2006720p28.350.654.650.850.46.3015.95
Sony KDL-46EX40020101080p28.052.087.052.052.052.08.0016.00
Toshiba 40L2200U20141080p30.056.074.056.056.056.010.0016.00
Vizio E261VA2012720p19.359.061.160.459.258.925.0014.67
Samsung LN32B3602010720p37.660.062.161.860.560.18.0014.40
Samsung P2570HD20101080p37.062.062.062.062.062.010.0015.00
Sharp LC-C3234U2009720p33.064.683.666.664.615.0016.60
Samsung LN46B61020121080p53.066.082.066.066.066.05.008.00
LG 42PT35020121080p63.567.785.968.967.767.74.200.00
Samsung LN46C63020121080p54.572.190.790.388.572.310.007.63
SANYO DP507492010720p67.075.0103.094.079.075.07.001.00
Samsung HP-T425420111080p69.775.794.176.075.75.001.00
LG 47LW6500-UA20121080p66.680.7149.7149.081.780.92.2711.83
Vizio xvt4735v20111080p67.688.688.889.288.688.69.0012.00

By that standard this TV is in the middle of my results from testing TVs and computer monitors. But when compared against TVs only, it actually is quite a bit above average. And, the ranking alone hides the fact that the faster TVs are not that much faster (at most about 16ms), and the slower TVs are way, way slower (up to 40ms). This is a solid showing from a company that to-date I considered to be a purveyor of generic and middling TVs. It's deinterlacing is also pretty good, using an adaptive algorithm that produces good looking results with only 16ms of extra lag.

Conclusion

If you really care about input lag to the exclusion of all else you can definitely do better with the right TV, and of course all TVs are completely crushed by their smaller cousins the computer monitor. But this is a sold reasonable choice and I would be perfectly happy to use it as my main gaming TV.

Other models

I tested the ELST5016s, which is the 50" version. There is also the  ELST4316s, which is the same specs but in a 43" size. Frankly, I expected more size options, but I didn't find anything else in the --16s line.

DIY webhook for logging shell command outputs to email

The idea here is to be able to run a shell command on a remote linux box and have the results sent to you via email. In this case the linux box doesn't have SMTP so I use a 2nd commercial server that does to operate a HTTP/PHP to email "gateway". This can't be abused for spam even if discovered since the destination is always fixed (a filtered folder in my Gmail account). 

On the linux box:

#!/bin/bash
# syntax hook <whatever>, if pipes used put quotes around it.
# sends user agent as command

echo $@
outp=$(eval "$@" 2>&1)
echo $outp
curl --user-agent "$@" -H "x:`echo "$outp"|gzip|base64 -w0`"  "https://sever.com/hook_URL/"

Replace server.com with your own webserver (not the linux box). The basic idea is to save the output of the command as gziped text that's been base64 encoded so that it's a valid http header (we use a custom header since these seem to be unlimited in size up to 8k, unlike the URL itself).


Then on the server make this php file inside /hook_URL/
<?php
$sender = "hook@server.com";  // sender address used to notify user
$receiver = "me@gmail.com";  // email address to send records to
$command = $_SERVER['HTTP_USER_AGENT']; // we store the command text as the agent

$raw = apache_request_headers()["x"]; // text from custom header

$text = gzdecode( base64_decode($raw) ); // convert from base 64 to binary and then gunzip it to ascii

mail($receiver, // where it gets emailed
$command, // title
$text, // body
    "From: " . $_SERVER['REMOTE_ADDR'] . "_$sender", "-r $sender"); 
?>

then you can put in your cron or whatever:

hook "dmesg | tail"

you might ask why hook takes arguments rather than stdin; the reason is this way it can report what command was run rather than just the text sent to it via a pipe. Downside is you have to quote the command if it involves a pipe.

Guide: Improving raspberry pi SD card lifetime for remote servers

 Having built two  rPI NAS boxes, I've had a chance to see how well they survive in the wild. The answer: each one has failed within a couple years. 

The first one failed because the power supply was undersized. It worked fine for a while, but eventually the powered hub that served the pi and the external hard drive could no longer support both, which killed the hard drive being used. Solution: but an external hard drive that comes with its own power brick. It had better be enough if they include it in the box. 

The 2nd one failed due to SD card corruption. This can be caused by power issues as well, but I don't think that's what happened. I think the issue is that it was too small, and too old. As with all flash devices there's a limited number of times each cell can be written before they start to fail. On a small SD card the number of cells is likewise small, so there's less space to spread the writes out. I was using a 2gb card, which had enough space to fit a lite pi OS install, but didn't have much spare space left over. I didn't need extra space for building a NAS, but that limited space means that there wasn't room to do write leveling.

Beyond that, it's worth trying to reduce the amount of writes to the SD card so that you don't even get into the point that significant write leveling is need. 

Reduce swapping

Some people think you should eliminate swap all together, but doing that risks causing the out of memory killer shutting software down indiscriminately. Instead, let's reduce the amount of swapping that happens. Linux swaps memory to disk opportunistically in order to maintain extra free memory for immediate use. This keeps your computer more responsive, but some of that swapping will be unnecessary. Let's reduce that as much as possible.

echo vm.swappiness = 0 >  /etc/sysctl.d/00-swappiness.conf

Note this file probably doesn't exist on your computer(yet); the default value is 60, which you can check with cat /proc/sys/vm/swappiness . Note that zero doesn't turn off swap entirely, just reduces opportunist swapping.  You might try running top to see how much swap is being used before you change this value. Don't expect the value to go down until after you reboot. 

RAMDISK logs or reduced logging

Logs can be a constant source of disk access. One option is to store them in ram instead, but then you lose them with each reboot (I like to reboot every week) and logs can be useful for catching configuration problems or failing hardware.

SSH is by far the biggest source of writes, at least on a world-accessible machine. Every 2-3 seconds it writes a new message reporting the latest attempt of somebody to log into your machine (as root, of course) via SSH. You can see this for yourself: 

watch -d ls -l /var/log

In theory this is an important thing to log and keep track of, because OMG, somebody is trying to hack your machine!!! But in reality it's all automated sniffing from botnets around the world and is meaningless noise unless you are building a honeypot. I certainly don't want to wear out my SD card keeping track of it.

Rather than putting all logs in ram, I suggest two less severe mitigations. One is security via obscurity: change your ssh port. You will get a lot less traffic with any port that's above 1024. Or, you can turn off logs of authentication attempts all together, which is my preference. You'd think that editing

/etc/ssh/sshd_config  to include  LogLevel QUIET

would do this, but you still get some messages; you also need to instruct rsyslog to reject all messages from sshd by adding 

 :programname, isequal, "sshd" stop  as the first rule in   /etc/rsyslog.conf

But you are not done; you still get failed logins recorded to a binary file called /var/log/btmp. btmp exists outside the syslog framework, so you can't block it that way. The activity comes from openssh and can only be turned off by recompiling openssh! Yikes, what a dumb choice that is. There's a file system work-around though: you can make btmp immutable:

chattr +i /var/log/btmp

Finally, there's the systemd journal, which is the modern duplicate of syslog. That is to say both should have all the messages you care about in them, but you use different tools to search them. systemd journal has much less options for controlling what gets written to it, and I find that >90% of it is failed logins, even after the tweaks above.  Two options: make it volatile, (entirely stored in memory), or change the rate at which it's flushed to disk (default is every 5 minutes). These options are in /etc/systemd/journald.conf

It seems like by far the easiest option is to change your SSH port.

Stop recording access time

Linux records the last time files were accessed, so a regularly running system is going to incur some writes just from reading configuration files, etc.. There's already an /etc/fstab option that's the default on newer releases of PiOS to keep this to a minimum called noatime, but it's also suggested that adding norelatime would reduce the writes further. Might as well. 






LG W1953T review: input lag and upscaling using the piLagTesterPRO

This 1366x768 TN PC monitor from 2010 is typical for a TN display: very fast, with nearly no input lag, and a pretty good response time.

Image quality

Good upscaling is critical for retro gaming. Ideally, all pixels should appear equally sharp and bright (no aliasing), and angled lines should appear smooth, with no jagged, irregular steps. Also important is that the display shows most or all of the pixels it is sent. Often, this is not the case, with some number of pixels cropped from the bottom or top edges. Shockingly, these tests are relevant for modern gaming as well, because even at their native resolution many TVs have aliasing and cropping. Monitors tend to show all pixels and never crop, and thus have fewer scaling options.

This monitor has no scaling or cropping options. All you can do is force 4:3, otherwise it always scales so that X and Y fill the screen completely.

resolution aliasing/jaggies
480p very minor jaggies, A- overall
720p noticeable aliasing, B
1366x786 native resolution, pixel perfect
1080p not supported

The display has 1 VGA and 1 DVI. I only tested DVI (over a passive HDMI converter).

Input Lag

I used a piLagTesterPRO to measure input lag. This device sends a frame of video over HDMI and measures how long it takes to display it. This display does not have a game mode; I toggled all the display quality settings and did not see a consistent effect on lag, however the tests reported are with every "enhancement" set to off.

I report two kinds of values. 1st response measures how long it takes for the TV to start responding (I use a 5% change in display brightness). This overly optimistic value doesn't tell how long it takes to see anything useful, but matches what other reviewers call input lag. full response is a more realistic measure of lag, and requires the display to reach 80% of full brightness. This combines both input lag and response time, and is closer to what you would actually experience in a game.

top bottom
Resolution 1st (average) full response 1st response full response scan out
480i N/A      
480p 3.4 13.4 18.7 28.7 15.3
720p 2.6 12.6 18.7 28.7 16.1
1080p N/A      
1366x768@70 2.5 12.5 16.4 26.4 13.9
1366@768@75 2.5 12.5 15.5 25.5 13.0

This display does not support interlaced modes at all. It also doesn't support 1080p. But it does support 70hz and 75hz in addition to the standard 60hz we all know and love.

The first response at the top of the screen was slightly slower for 480p, otherwise it averaged 2.5ms across all resolutions and refresh rates. The 1st response at the bottom of the screen did not depend on resolution, but did depend on refresh rate, as you would expect. The scan out at 60hz was about 16ms, which is about 1/60th a second. Raising the refresh rate to 70hz shaves 1ms off that, and raising it to 75 shaves off another 1ms on top of that. So if you want the lowest input lag overall definitely run at 75hz.

Interestingly the display does not advertise supporting 75hz at the native resolution (only 60hz), so you have tell your video card to force that mode. I saw no problems running it in this mode, however, and the monitor redraw always stayed locked vsync, with no glitches or drifting lag.

The response time of the display averages 10ms. The spec sheet advertises 2ms, which is just a bald-face lie, but is true that you can get the response time down to about 5ms, depending on the transition the LCD has to make. Black to white is fast and fairly clean, whereas other transitions can happen in a 2-step process where the LCD gets close to the desired brightness, pauses for a couple ms, and then steps the rest of the way. I'm sure this two-step process causes some motion artifacts when viewed on a high speed camera, and probably results in moving stimuli looking more muddy to the human eye than they would otherwise. I'm not going to be too hard on the display, however, as this is a common issue.

Results compared to other displays

To allow quick comparison between many displays I've summarized the results across all the displays I've personally tested with the piLagTester Pro. Min lag is the time to the first response, measured where the screen starts drawing (typically, the top); real lag is the time to the full response, measured where drawing finishes (usually the screen bottom), i.e. input lag + scan out + response time. Numbers in red denote average values that can vary by up to 8ms between power cycles.

This list is sorted by real lag for each display's native resolution and max refresh rate (usually 1080p60 but some sets are 720p60, and other monitors like this one support > 60hz).

 

DisplayYear made (TV?)Native Resnative min lagnative real lag480i real lag480p real lag720p real lag1080p real lagnative response timenative scan out
Dell E198FPb20081024p2.720.439.035.05.0012.70
Samsung 2494sw20111080p2.822.726.526.526.58.0013.30
Vizio VO370M20101080p2.523.683.049.047.024.35.4715.67
LG W1953T2010 768p2.625.6 28.728.7 10.0013.00
Dell U2410 (game)20101080p4.026.262.228.326.526.56.0016.20
TCL 40S32520211080p6.527.360.629.027.927.76.0014.83
TCL 49s40320184k6.130.276.830.930.330.78.0016.13
AOC/Envision G19LWK2010900p3.131.239.538.738.437.815.5012.60
Dell E2211H20141080p3.033.634.734.534.133.815.0015.57
Dell 1907FPc20081024p3.034.035.934.815.0016.00
Panasonic TH-58PE75U2008720p28.034.034.034.034.034.06.000.00
Panasonic TH-42PX75U2008720p28.034.034.034.034.034.06.000.00
Panasonic TH-50PZ80U2008720p28.034.034.034.034.034.06.000.00
Corprit D157 (hdmi)20211080p3.134.534.934.834.633.916.2515.13
Samsung S27C23020141080p2.936.036.636.136.118.1014.97
Vizio E470VL (vga)20111080p22.039.039.039.039.09.008.00
Samsung LN32D4032012720p20.941.258.942.440.740.75.5014.83
TCL50s42320214k14.042.075.042.042.042.013.0015.00
Dell U2410 (sRGB)20101080p20.542.862.445.043.143.16.1316.13
ACER AT326520121080p19.543.862.745.343.843.88.0016.27
sony XBR 43X800D20174k24.544.346.546.044.644.75.0014.83
RCA L40FHD4120101080p20.346.665.048.047.046.09.6816.63
Sony 40VL130 (game)20081080p22.847.366.349.047.347.39.0815.43
Polaroid FLM-373B2007720p28.049.082.049.049.049.07.0014.00
Philips 42PFL3603D/F720091080p29.050.084.050.050.050.05.0016.00
Sony KDL-40V300020081080p22.250.168.450.650.549.811.0016.93
LG 42LC2D2006720p28.350.654.650.850.46.3015.95
GPX TDE3245W2016720p28.051.0102.051.051.051.08.0015.00
Sony KDL-46EX40020101080p28.052.087.052.052.052.08.0016.00
Toshiba 40L2200U20141080p30.056.074.056.056.056.010.0016.00
Vizio E261VA2012720p19.359.061.160.459.258.925.0014.67
Emprex HD 32022007720p27.066.0126.051.050.062.024.0015.00
Samsung LN32B3602010720p37.660.062.161.860.560.18.0014.40

Thus sorted this display finds itself near the top of my list, but that's largely because most of my list is TVs (in fact I've discarded the slowest 3rd of my list to keep the length manageable). Computer monitors (particularly TN) are known to be very fast, and this one is no exception. It would be more impressive if it were an IPS screen (such as the Dell U2410, which is nearly as fast, just one spot down on the list). The real take away is that any TN computer monitor will have great lag, and that any PC IPS display, while slower than TN, will still beat the pants off the TVs.

Similar models(?)

I tested the w1953T, which is the 19" version.  There does not appear to be a larger version that is precisely identical. The LG W2053TQ is also a TN display but has 1600x900 resolution. The W2253TQ  is full HD (1080p). But all 3 are TN displays from the same era, so at the least you can assume they have good input lag, and if the model number alone is meaningful, identical lag to this one. The W2453V is an IPS display and thus is almost certainly slower than these displays.

 

Email me

Name

Email *

Message *