Skip to content

2D matrix mapping regression in Nightly #5237

@gunjambi

Description

@gunjambi

What happened?

While testing the nighly, my mapping to a 2D matrix renders incorrectly in the nightly. I observe two issues:

  1. 44 last leds of the last panel remain black
  2. The disabled leds (that are not in the last 44 leds) emit random colors. The random colors flicker between two colors. Smells like garbage in some the double buffered buffer that flips with the frames.

This only happens on the second panel/pin.

To Reproduce Bug

My layout is 2 panels/pins, each being a 24x19 matrix forming a total of 48x19 matrix. The leds are laid out in serpentine order with a sacrifical led at each column. Here's a simplified graph

Image

For the curious, here's the mapping json (4 columns of serpentine, then 44 rows columns (Edit: typo) of serpentine with sacrificial leds). Outputs are panel 1 with 476 leds and panel 2 with 480 leds.

{
    "width":48,
    "height":19,
    "map": [
         0,37,38,75,76,114,116,154,156,194,196,234,236,274,276,314,316,354,356,394,396,434,436,474,476,514,516,554,556,594,596,634,636,674,676,714,716,754,756,794,796,834,836,874,876,914,916,954,
         1,36,39,74,77,113,117,153,157,193,197,233,237,273,277,313,317,353,357,393,397,433,437,473,477,513,517,553,557,593,597,633,637,673,677,713,717,753,757,793,797,833,837,873,877,913,917,953,
         2,35,40,73,78,112,118,152,158,192,198,232,238,272,278,312,318,352,358,392,398,432,438,472,478,512,518,552,558,592,598,632,638,672,678,712,718,752,758,792,798,832,838,872,878,912,918,952,
         3,34,41,72,79,111,119,151,159,191,199,231,239,271,279,311,319,351,359,391,399,431,439,471,479,511,519,551,559,591,599,631,639,671,679,711,719,751,759,791,799,831,839,871,879,911,919,951,
         4,33,42,71,80,110,120,150,160,190,200,230,240,270,280,310,320,350,360,390,400,430,440,470,480,510,520,550,560,590,600,630,640,670,680,710,720,750,760,790,800,830,840,870,880,910,920,950,
         5,32,43,70,81,109,121,149,161,189,201,229,241,269,281,309,321,349,361,389,401,429,441,469,481,509,521,549,561,589,601,629,641,669,681,709,721,749,761,789,801,829,841,869,881,909,921,949,
         6,31,44,69,82,108,122,148,162,188,202,228,242,268,282,308,322,348,362,388,402,428,442,468,482,508,522,548,562,588,602,628,642,668,682,708,722,748,762,788,802,828,842,868,882,908,922,948,
         7,30,45,68,83,107,123,147,163,187,203,227,243,267,283,307,323,347,363,387,403,427,443,467,483,507,523,547,563,587,603,627,643,667,683,707,723,747,763,787,803,827,843,867,883,907,923,947,
         8,29,46,67,84,106,124,146,164,186,204,226,244,266,284,306,324,346,364,386,404,426,444,466,484,506,524,546,564,586,604,626,644,666,684,706,724,746,764,786,804,826,844,866,884,906,924,946,
         9,28,47,66,85,105,125,145,165,185,205,225,245,265,285,305,325,345,365,385,405,425,445,465,485,505,525,545,565,585,605,625,645,665,685,705,725,745,765,785,805,825,845,865,885,905,925,945,
        10,27,48,65,86,104,126,144,166,184,206,224,246,264,286,304,326,344,366,384,406,424,446,464,486,504,526,544,566,584,606,624,646,664,686,704,726,744,766,784,806,824,846,864,886,904,926,944,
        11,26,49,64,87,103,127,143,167,183,207,223,247,263,287,303,327,343,367,383,407,423,447,463,487,503,527,543,567,583,607,623,647,663,687,703,727,743,767,783,807,823,847,863,887,903,927,943,
        12,25,50,63,88,102,128,142,168,182,208,222,248,262,288,302,328,342,368,382,408,422,448,462,488,502,528,542,568,582,608,622,648,662,688,702,728,742,768,782,808,822,848,862,888,902,928,942,
        13,24,51,62,89,101,129,141,169,181,209,221,249,261,289,301,329,341,369,381,409,421,449,461,489,501,529,541,569,581,609,621,649,661,689,701,729,741,769,781,809,821,849,861,889,901,929,941,
        14,23,52,61,90,100,130,140,170,180,210,220,250,260,290,300,330,340,370,380,410,420,450,460,490,500,530,540,570,580,610,620,650,660,690,700,730,740,770,780,810,820,850,860,890,900,930,940,
        15,22,53,60,91, 99,131,139,171,179,211,219,251,259,291,299,331,339,371,379,411,419,451,459,491,499,531,539,571,579,611,619,651,659,691,699,731,739,771,779,811,819,851,859,891,899,931,939,
        16,21,54,59,92, 98,132,138,172,178,212,218,252,258,292,298,332,338,372,378,412,418,452,458,492,498,532,538,572,578,612,618,652,658,692,698,732,738,772,778,812,818,852,858,892,898,932,938,
        17,20,55,58,93, 97,133,137,173,177,213,217,253,257,293,297,333,337,373,377,413,417,453,457,493,497,533,537,573,577,613,617,653,657,693,697,733,737,773,777,813,817,853,857,893,897,933,937,
        18,19,56,57,94, 96,134,136,174,176,214,216,254,256,294,296,334,336,374,376,414,416,454,456,494,496,534,536,574,576,614,616,654,656,694,696,734,736,774,776,814,816,854,856,894,896,934,936
    ]
}

Expected Behavior

In 0.15.3, there are no black leds at the end of the panel 2. The disabled leds remain disabled.

Install Method

Self-Compiled

What version of WLED?

WLED 0.16.0-alpha (build 2412040)

Which microcontroller/board are you seeing the problem on?

ESP32

Relevant log/trace output

Anything else?

I bisected the issue to commit ee9ac94
The commit is too complicated for me to figure out what is wrong there. I'm able to build and test builds if needed.

Since the last 44 leds are missing, which is the the number of sacrificial leds, this makes me thing there is some "if (PhysicalPos > vWidth * vHeight) return" in some pixel setting code. My quick skimming did not find such simple mistake. Also it wouldn't explain why the disabled leds get garbage input. Nor why this only happens on second panel.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugdocumentationdocumentation should be updated to explain behaviour

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions