Skip to content

Conversation

@Lord-Grey
Copy link
Collaborator

@Lord-Grey Lord-Grey commented Oct 26, 2025

Summary

✨ Added

  • Linux: New DRM/KMS screen grabber with plane-based capture - not feature complete yet
  • Logging/Tracing: Introduced qlogging categories to enable dynamic tracing

🔧 Changed

  • Amlogic grabber - Support to switch between DRM & FB-DEV for CoreElec New Order version

  • Web UI: Update panel title uses "Hyperion - "; skip showing the "nightly" tag in releases list

  • Screen grabbers: Commonized base with getDeviceName/getInputDeviceDetails; explicit constructors; improved error handling

  • Framebuffer grabber: Internal cleanup, consistent device naming, safer mmap usage

  • Logger internals: use smart pointers and clean-ups

  • Fixes:

    • UI - Release were not shown on Update page
    • UI - Fixes for input/format selection

🗑️ Removed

Technical

  • Update mbedTLS to v3.6.4, Update flatbuffers to v25.9.23, Update rpi_ws281x library

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Docs
  • Build-related changes
  • Other, please describe:

If changing the UI of web configuration, please provide the before/after screenshot:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing setups:

The PR fulfills these requirements:

  • When resolving a specific issue, it's referenced in the PR's body (e.g. Fixes: #xxx[,#xxx], where "xxx" is the issue number)

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature
  • Related documents have been updated (docs/docs/en)
  • Related tests have been updated

PLEASE DON'T FORGET TO ADD YOUR CHANGES TO CHANGELOG.MD

  • Yes, CHANGELOG.md is also updated

To avoid wasting your time, it's best to open a feature request issue first and wait for approval before working on it.

Other information:

@Lord-Grey Lord-Grey self-assigned this Oct 26, 2025
Comment on lines +332 to +432
switch (fmt)
{
case PixelFormat::NV12:
{
// Pack tightly: Y then interleaved UV
auto const y_stride = (uint32_t)w;
auto const uv_stride = (uint32_t)w; // interleaved, one byte per pixel on luma grid

PlaneInfo y{};
y.bpp = 8;
y.width = w;
y.height = h;
y.stride = (int)y_stride;
y.fbPlaneIdx = 0;
y.srcBaseOffset = fb->offsets[y.fbPlaneIdx];
y.dstBaseOffset = 0;
planes.push_back(y);

PlaneInfo uv{};
uv.bpp = 16; // two 8-bit chroma bytes per 2 luma samples horizontally
uv.width = DIV_ROUND_UP(w, 2);
uv.height = DIV_ROUND_UP(h, 2);
uv.stride = (int)uv_stride;
uv.fbPlaneIdx = 1;
uv.srcBaseOffset = fb->offsets[uv.fbPlaneIdx];
uv.dstBaseOffset = (size_t)w * (size_t)h;
planes.push_back(uv);

totalSize = (uint32_t)((w * h) + (w * h) / 2);
return true;
}

#ifdef DRM_FORMAT_NV21
case PixelFormat::NV21:
{
// Identical plane sizes to NV12; chroma order is VU (handled by resampler)
auto const y_stride = (uint32_t)w;
auto const uv_stride = (uint32_t)w;

PlaneInfo y{};
y.bpp = 8;
y.width = w;
y.height = h;
y.stride = (int)y_stride;
y.fbPlaneIdx = 0;
y.srcBaseOffset = fb->offsets[y.fbPlaneIdx];
y.dstBaseOffset = 0;
planes.push_back(y);

PlaneInfo vu{};
vu.bpp = 16;
vu.width = DIV_ROUND_UP(w, 2);
vu.height = DIV_ROUND_UP(h, 2);
vu.stride = (int)uv_stride;
vu.fbPlaneIdx = 1;
vu.srcBaseOffset = fb->offsets[vu.fbPlaneIdx];
vu.dstBaseOffset = (size_t)w * (size_t)h;
planes.push_back(vu);

totalSize = (uint32_t)((w * h) + (w * h) / 2);
return true;
}
#endif

#ifdef DRM_FORMAT_P030
case PixelFormat::P030:
{
// 10-bit semi-planar: Y in 16-bit words, UV packed 2x10b per 2 luma pixels => 32b per pair
auto const y_stride = (uint32_t)(w * 2);
auto const uv_stride = (uint32_t)(w * 2); // (w/2)*4 bytes == 2*w bytes

PlaneInfo y{};
y.bpp = 16;
y.width = w;
y.height = h;
y.stride = (int)y_stride;
y.fbPlaneIdx = 0;
y.srcBaseOffset = fb->offsets[y.fbPlaneIdx];
y.dstBaseOffset = 0;
planes.push_back(y);

PlaneInfo uv{};
uv.bpp = 32;
uv.width = DIV_ROUND_UP(w, 2);
uv.height = DIV_ROUND_UP(h, 2);
uv.stride = (int)uv_stride;
uv.fbPlaneIdx = 1;
uv.srcBaseOffset = fb->offsets[uv.fbPlaneIdx];
uv.dstBaseOffset = (size_t)w * (size_t)h * 2;
planes.push_back(uv);

totalSize = (uint32_t)((size_t)w * (size_t)h * 3); // Y(2*w*h) + UV(w*h)
return true;
}
#endif

default:
errorString = QString("Broadcom SAND: unsupported PixelFormat %1")
.arg(QSTRING_CSTR(pixelFormatToString(fmt)));
return false;
}

Check notice

Code scanning / CodeQL

Long switch case Note

Switch has at least one case that is too long:
NV21 (62 lines)
.
return getScreenSize(getDeviceName());
}

static QSize findActiveCrtcSize(int drmfd, const drmModeConnector* connector)

Check notice

Code scanning / CodeQL

Unused static function Note

Static function findActiveCrtcSize is unreachable
@Lord-Grey Lord-Grey moved this to In Progress in Core Oct 26, 2025
@Lord-Grey Lord-Grey moved this to In Progress in Web UI Oct 26, 2025
@Lord-Grey Lord-Grey changed the title Drm2 Amlogic DRM support Oct 26, 2025
@Lord-Grey Lord-Grey marked this pull request as ready for review October 26, 2025 12:31
@Lord-Grey Lord-Grey merged commit 6644e30 into hyperion-project:master Nov 2, 2025
22 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Core Nov 2, 2025
@github-project-automation github-project-automation bot moved this from In Progress to Done in Web UI Nov 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done
Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants