Posts

Showing posts from April, 2021

setting a custom video mode using DRM/KMS in Linux (tested on raspberry pi 4)

Whether by design or by oversight, it turns out the kms/drm driver architecture used in linux to set the current video mode allows easy selection of custom modes as well. You just stuff the values you want into the mode structure returned by getConnector, and then tell drm to use that mode. Because this is close to the metal you can't just say height, width, and refresh, but need to specify the full timing info like you would using xorg's modelines. In fact, here's some code that takes a xorg compliant modeline and stuffs it into the proper fields of the mode structure. 


drmModeConnector *connector = getConnector(resources);
   connectorId = connector->connector_id;

    // choose a mode (resolution + refresh rate)

    mode_info = connector->modes[modenum]; // array of resolutions and refresh rates supported by this display
    mode = &mode_info;
    dump_mode(mode);

  if (argc == 3)
    {
    mode->type = DRM_MODE_TYPE_USERDEF;

     char flags[5][16] = {0,0,0,0,0};;
   float fclock;
// example: 13.514 720 739 801 858 480 488 494 525 -hsync -vsync interlace dblclk
    sscanf(argv[1], "%f %hd %hd %hd %hd %hd %hd %hd %hd %15s %15s %15s %15s",
   &fclock,
   &mode->hdisplay,
   &mode->hsync_start,
   &mode->hsync_end,
   &mode->htotal,
   &mode->vdisplay,
   &mode->vsync_start,
   &mode->vsync_end,
   &mode->vtotal, flags[0], flags[1], flags[2], flags[3], flags[4]);
   
    mode->clock = fclock * 1000;

         mode->flags = 0;

for (int f = 0; f < 4; f++)  // this could use the array that's used to dump the flags
{
if (strcasecmp(flags[f], "+hsync") == 0)
                mode->flags |= DRM_MODE_FLAG_PHSYNC;
        if (strcasecmp(flags[f], "-hsync") == 0)
                mode->flags |= DRM_MODE_FLAG_NHSYNC;

        if (strcasecmp(flags[f], "+vsync") == 0)
                mode->flags |= DRM_MODE_FLAG_PVSYNC;
        if (strcasecmp(flags[f], "-vsync") == 0)
                mode->flags |= DRM_MODE_FLAG_NVSYNC;

        if (strcasecmp(flags[f], "interlace") == 0)
                mode->flags |= DRM_MODE_FLAG_INTERLACE;

if (strcasecmp(flags[f], "dblclk") == 0)
                mode->flags |= DRM_MODE_FLAG_DBLCLK;
}

  mode->vrefresh = .49 + drm_mode_vrefresh(mode); // looks like this is just for display, since it's an integer it's notused for any real display calculations
snprintf(mode->name, sizeof(mode->name),"%dx%d%c", 
mode->hdisplay, mode->vdisplay,
    (mode->flags & DRM_MODE_FLAG_INTERLACE ? 'i':0)); 

SANYO DP50749 Plasma TV: input lag and upscaling review tested using the piLagTesterPRO

This 720p Plasma TV from 2010 has a nice picture but very high lag, and extremely variable lag. It used to retail for about $1500. 

Overview/Image quality

This is a plasma TV, which generally means at least the following: nearly infinite viewing angles and jaw dropping weight. Both are true in this case as well. The 50" model weights 84lbs. 

1x1 pixel checkerboard at 720p
The TV can be set to only crop a little: 0 pixels off the top/bottom, and only about 5 pixels off the side. This is true for all modes: 480, 720, and 1080.  Sadly, even when set this way there's still noticeable aliasing. In 720p, a checkerboard with 1x1 pixel squares shows very bad aliasing. Honestly, with more natural stimuli it doesn't look so bad, BUT:  There's really no excuse for aliasing on a plasma TV: you know the panel was designed specifically to be a TV. Why not hit 720p exactly?  

Aliasing was less bad in other resolutions. 

As for 480p/i, with 50" to play with they could have at least offered a zoomed out mode with black borders and 1:1 pixel mapping. But no such luck. 

Burn in is a common concern on plasma TVs but I saw absolutely no evidence of it on this set, so I'm guessing SANYO solved that problem. You do see the image occasionally shift a little up/down/left/right which is presumably to prevent burn in. 

It has all the standard inputs, including 3 HDMI, VGA, and 2 yPbPr.  

Measuring Input Lag

This display does have a game "mode". But it does not change the lag any, so I guess it's just for marketing (maybe it changes the color balance or something). In fact I toggled all quality settings and none changed the 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. I measure at the top and bottom of the screen, but as it turns out these produce the same results: the entire frame updates at the nearly same moment, top to bottom. Complicating things significantly, this TV is yet another display that does not actually sync to the input signal - instead it fills its own internal frame buffer from the video input and then draws that with an arbitrary extra delay. To give an example, input lag for 720p varies between 78 and 93ms each time your turn on the set (or change inputs).

Because lag varies over time, I've elected to report the average lag values here, since that seems fairest, but there's no right answer; for more discussion of this issue see the above link.  

Full Input Lag 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 (average)full response1st responsefull responsescan out
480i95.0102.096.0103.01.0
480p86.093.087.094.01.0
720p71.078.072.079.01.0
1080p67.074.068.075.01.0
768p41.048.042.049.01.0

This TV updates every pixel nearly simultaneously, from top to bottom, with at most 1ms more lag at the bottom - but due to the drifting lag it's hard to tell, it could be truly simultaneous. That's one the neat things about plasma displays, and why you really need to compare lag at the bottom of the screen to see how a plasma compares to a traditional LCD. The response time is also very low, around 7ms. 

Unfortunately, all that unique plasma tech can't make up for the fact that the set has a very long lag before it starts drawing at all - 41ms in the fast mode (native resolution 1366x768). So this isn't a good gamer set, unless you just play RPGs and the like. 

It gets progressively slower as you get further away from native resolution, suggesting that upscaling/downscaling makes a significant impact on the speed of this set. Even 720p, which is what this TV is sold as being for, is slower than than the actual native resolution, by a fairly significant 22ms! Of the standard TV resolutions, it's actually fastest downscaling from 1080p, by a small margin. 

It's also particularly bad for 480i content. While the other modes have variable lag of up to 16ms, 480i has variable lag up to 32ms! To put it another way, each time you turn on your tv/console you'll see lag somewhere between 81 and 109ms.  Truly awful.

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 first response at the top of the screen, real lag is the full response at the bottom. The min lag value is really unfair to this set, because it ignores the instantaneous update of the whole screen. I'm sorting here by how long it takes to finish drawing, eg, the true lag. For this TV I'm using it's performance at 1080p, since that's the fastest TV mode it supports, and I doubt anybody would use it for a computer monitor. 

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
Vizio VO370M20101080p2.523.683.049.047.024.35.4715.67
Dell U2410 (game)20101080p4.026.262.228.326.526.56.0016.20
TCL 40S32520211080p6.527.360.629.027.927.76.0014.83
AOC/Envision G19LWK2010900p3.131.239.538.738.437.815.5012.60
Dell E2211H20141080p3.033.634.734.534.133.815.0015.57
Panasonic TH-58PE75U2008720p28.034.034.034.034.034.06.000.00
Dell 1907FPc20081024p3.034.035.934.815.0016.00
Corprit D157 (hdmi)20211080p3.134.534.934.834.633.916.2515.13
Samsung S27C23020141080p2.936.136.636.137.018.2514.97
Vizio E470VL (vga)20111080p22.039.039.039.039.09.008.00
Dell U2410 (sRGB)20101080p20.542.862.445.043.143.16.1316.13
ACER AT326520121080p19.543.862.745.343.843.88.0016.27
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
Emprex HD 32022007720p27.050.5126.051.050.08.5015.00
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 VO22L FHDTV10A2008720p28.061.094.061.061.061.018.0015.00
Vizio VX20L HDTV2007720p28.062.095.062.062.062.018.0016.00
Sharp LC-C3234U2009720p33.064.683.666.664.615.0016.60
Toshiba 46L5200U20131080p55.071.089.076.071.074.08.008.00
Sony 40S20L12007720p48.472.090.172.973.49.6014.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 E470VL (hdmi)20111080p69.086.0128.095.095.086.09.008.00

It's interesting to consider that one of the top performing TV on this list is also a plasma TV (Panasonic TH-58PE75U) and meanwhile this one is near the bottom. So don't get obsessed with the tech; pay attention to the empirical measurements instead!

Conclusion

These days there are a lot of cheap plasma TVs on the used market. But all plasma's are not the same. This one in particular is to be avoided. I don't have any other SANYO LCDs to compare against, but it's not a good sign that a $1500 TV of theirs performed so poorly, so I'd avoid other sets from that era as well unless there are published lag numbers. Although, if this was really made by LG (see below) then who knows how representative this is of other models).

Other models  

I only tested the DP50749.The mainboard for this TV also works in several other models so I suspect they would perform similarly: SANYO DP50719 and SANYO DP50740. Going further, it seems this may have been made by LG (again, overlapping motherboards) and sold under several other names: 50PQ20-UA AUSALHR , 50PQ30-UA AUSLLHR , 50PQ3000-ZA BEKLLJP , 50PQ30C-UA AUSLLHR, and 50PQ6000-ZA BEKLLJP. And also as an ELEMENT ELPCFT501. Again, no input lag warranty expressed or implied on that. I only tested the DP50749.

Email me

Name

Email *

Message *