93 Commits

Author SHA1 Message Date
c50aed732e feat: Implement WLED direct communication, config tool, and screen capture test setup. 2025-08-15 23:31:28 +02:00
79c5aa7f41 Docs: New strategy for dedicated WLED configuration and LED testing tool
Outlined a new strategy to create a standalone tool for WLED configuration retrieval and interactive LED testing, addressing previous challenges with programmatic access and LED mapping.
2025-08-15 23:21:22 +02:00
bdd9e2982d Docs: New strategy for dedicated WLED configuration and LED testing tool
Outlined a new strategy to create a standalone tool for WLED configuration retrieval and interactive LED testing, addressing previous challenges with programmatic access and LED mapping.
2025-08-15 23:16:18 +02:00
113d5b53fa Revert "Docs: Confirm WLED configuration with correct IP, LED count, and UDP port"
This reverts commit eebe7e1a04b49d543fc68521d9c96d1967a9a640.
2025-08-15 23:10:17 +02:00
eebe7e1a04 Docs: Confirm WLED configuration with correct IP, LED count, and UDP port
Updated lessons_learned.md with the confirmed WLED device details, including the corrected IP address (192.168.178.69), total LED count (181), and UDP port (21324). This resolves previous connectivity issues and allows for accurate configuration.
2025-08-15 23:06:49 +02:00
b0e4f24f0a Docs: Add WLED API information to lessons_learned.md
Documented findings from WLED API research, including JSON API for configuration and UDP Realtime protocol details, highlighting the default port mismatch.
2025-08-15 22:46:13 +02:00
1411eff48e Docs: Add Ambilight TV concept to lessons_learned.md
Documented the core principles of Ambilight TV and its relevance to the Hyperion_Grabber_X11_QT project, including potential causes for LED color mismatches.
2025-08-15 22:37:03 +02:00
27caa88ce9 Revert "Feat: Increase default change threshold to reduce flickering"
This reverts commit bff295502f2ae366ef6c8e039933e5c5154ed143.
2025-08-15 22:36:23 +02:00
bff295502f Feat: Increase default change threshold to reduce flickering
Addresses flickering issue by increasing _changeThreshold_m in hyperiongrabber.cpp from 100 to 5000. This filters out subtle pixel variations that caused unnecessary frame updates to WLED.
2025-08-15 22:34:00 +02:00
1fee3e518f Docs: Update lessons_learned.md with flickering problem diagnosis and proposed solution 2025-08-15 22:25:18 +02:00
9c98604e12 Docs: Document color order troubleshooting and resolution in lessons_learned.md 2025-08-15 22:13:41 +02:00
77059a24aa Refactor: Remove wled_test and update CMakeLists.txt 2025-08-15 21:58:22 +02:00
b08186cf00 Docs: Update lessons_learned.md with detailed direct WLED communication explanation and testing parameters 2025-08-15 21:47:54 +02:00
5919ee7ae7 Refactor: Remove HyperionClient dependency 2025-08-15 21:45:44 +02:00
c45cba611d Feat: Integrate WledClient and update HyperionGrabber for direct WLED communication 2025-08-15 21:45:28 +02:00
edf041a09a Docs: Update lessons_learned.md with new WLED direct communication strategy 2025-08-15 21:40:31 +02:00
a5e3298bd8 Docs: Add image transformation algorithm to lessons_learned.md 2025-08-15 21:36:23 +02:00
7036e466e3 Docs: Update lessons_learned.md with WLED-focused insights and new strategy 2025-08-15 21:27:32 +02:00
aa57826800 feat(mock): Implement realistic Hyperion mock server
The mock server now correctly implements the newline-delimited JSON protocol observed in the Hyperion server and client code.

- It properly parses incoming JSON streams line-by-line.
- It creates QImage objects from the raw RGB data using the dimensions provided in the JSON payload.
- It sends a success reply to the client after receiving an image.
- This commit also updates lessons_learned.md with key findings from the debugging session.
2025-08-15 20:20:14 +02:00
d1497f8c91 refactor(client): Use QJsonObject for Hyperion command construction
Refactored HyperionClient to use QJsonObject and QJsonDocument for constructing JSON commands.

This improves code readability, maintainability, and reduces the risk of malformed JSON strings compared to manual string concatenation.
2025-08-15 00:42:09 +02:00
817caed810 fix(main): Correct command-line argument parsing
Resolved an issue where the `--address` and `--port` command-line arguments were being ignored due to a hardcoded IP address and an incorrect parsing loop.

This commit ensures that:
- The application correctly uses the address and port provided by the user.
- The application exits gracefully if required arguments are missing.
- The argument parsing logic is simplified and more explicit.
2025-08-15 00:41:47 +02:00
4f8d53fedb refactor(grabber): Simplify frame scaling by removing OpenGL
Replaced the complex, low-level OpenGL pipeline in HyperionGrabber with a simple, high-level `QImage::scaled()` call.

This change significantly reduces code complexity and improves maintainability without sacrificing performance, as `QImage::scaled()` is highly optimized and often hardware-accelerated. The new implementation is more robust and easier to understand.

This resolves the following issues:
- Removes fragile, hard-to-debug OpenGL code.
- Eliminates potential bugs related to FBOs, shaders, and texture handling.
- Corrects the image data pipeline to ensure raw pixel data is processed consistently.
2025-08-15 00:41:07 +02:00
be1342393e Lessons Learned: Hyperion JSON API is JSON-RPC based, command structure, and specific handlers. 2025-08-15 00:11:29 +02:00
f71824bb81 Feat: Update HyperionClient header for raw image data and dynamic sizing. 2025-08-14 23:04:00 +02:00
3dda269c4b Fix: Correct image orientation in Wayland grabber
Resolved the issue where captured images were appearing upside down or flipped.
Implemented a final vertical flip on the QImage after reading from the OpenGL
Framebuffer Object (FBO) to ensure correct orientation before sending to Hyperion.
This completes the basic hardware-accelerated scaling pipeline.
2025-08-14 22:19:15 +02:00
2fe9844a04 Feat: Confirm Wayland grabber functionality and PNG output
This commit confirms that the Wayland-only Hyperion grabber is successfully
capturing frames and sending them to the mock server, which in turn
generates PNG output. This validates the refactoring efforts and the
transition to a Wayland-centric approach.
2025-08-14 21:54:54 +02:00
0471752613 Refactor: Transition to Wayland-only grabber, remove X11 code, and rename components for clarity. 2025-08-14 21:48:14 +02:00
18a8812d66 feat: Refactor to Wayland-only and add mock server
- Remove all X11-related code and dependencies.
- Create a mock Hyperion server for testing.
- Refactor the main application to be Wayland-only.
- Update the build system and documentation.
2025-08-14 20:31:00 +02:00
1ff025ce77 docs: Update documentation for Wayland POC and Qt6 2025-08-14 19:43:32 +02:00
7dbc11afe1 feat: Migrate Wayland POC to Qt6 and QScreenCapture 2025-08-14 19:43:28 +02:00
ab4bb5a7ec Refactor: Initial setup for Wayland POC with KDE-specific protocol and Docker build environment. 2025-08-14 19:07:12 +02:00
795e6202ac Cleanup: Revert Dockerfile, CMakeLists.txt, wayland_poc.cpp to original state and remove generated/cloned files. 2025-08-14 18:59:27 +02:00
14a35b4928 Refactor: Consolidate CreateSession D-Bus debugging notes\n\nConsolidated repetitive entries related to CreateSession D-Bus signature mismatch and argument evolution into a single, comprehensive entry in lessons_learned.md. This improves clarity and conciseness. 2025-08-14 07:52:02 +02:00
b19c2ab070 Fix: D-Bus CreateSession signature mismatch (final fix)\n\nCorrected the CreateSession call in wayland_poc.cpp to only send the options dictionary, as the xdg-desktop-portal API does not expect a parent_window argument for this method. Updated lessons_learned.md. 2025-08-14 07:47:18 +02:00
4b1d8116bd Fix: D-Bus CreateSession signature mismatch (revisited)\n\nRemoved the unexpected parent_window argument from the CreateSession call in wayland_poc.cpp, as the xdg-desktop-portal API expects only the options dictionary. Updated lessons_learned.md. 2025-08-14 07:43:30 +02:00
536e264590 Fix: D-Bus CreateSession "Missing token" error\n\nAdded a handle_token to the QVariantMap passed to the CreateSession call in wayland_poc.cpp to resolve the "Missing token" error. Updated lessons_learned.md. 2025-08-14 07:16:48 +02:00
0ccac075a4 Fix: D-Bus CreateSession signature mismatch\n\nModified the CreateSession call in wayland_poc.cpp to only send an empty QVariantMap as its argument, aligning with the expected a{sv} signature. Updated lessons_learned.md. 2025-08-14 07:16:11 +02:00
46a5aa63a1 Fix: QDBusMessage::clearArguments() method not found\n\nRemoved the call to clearArguments() as it was causing a compilation error due to its removal in Qt 5.15. Updated lessons_learned.md. 2025-08-14 07:15:06 +02:00
c0626e7232 Fix: D-Bus SelectSources signature mismatch in wayland_poc.cpp\n\nCorrected the D-Bus call flow for SelectSources by introducing a dedicated handler for CreateSession replies, ensuring proper argument passing and resolving the signature mismatch error. Updated lessons_learned.md. 2025-08-14 07:14:05 +02:00
ecc2b95670 feat: Implement Wayland screen sharing POC and related fixes 2025-08-14 06:15:31 +02:00
da11bcf541 docs: Update lessons_learned.md with recent Wayland adaptation progress 2025-08-14 05:19:32 +02:00
65b153eb50 docs: Update lessons learned with D-Bus and QDBus API fixes
This commit updates the lessons learned document to include details about
the D-Bus connection issues encountered when running the wayland_poc
executable on the host. It covers the fixes for method name mismatches
(PickSource to SelectSources), argument type mismatches (string to
QDBusObjectPath), and QDBusMessage API versioning.

This provides a more complete record of the debugging process for the
xdg-desktop-portal interaction.
2025-08-14 04:38:18 +02:00
e760af9f43 docs: Document lessons learned during Wayland grabber adaptation
This commit adds a comprehensive document summarizing the challenges,
debugging steps, and solutions encountered while attempting to adapt
the Hyperion Grabber for Wayland. It covers issues related to build
environments, PipeWire header compilation, and xdg-desktop-portal
interaction.

This document serves as a reference for future development and
troubleshooting efforts.
2025-08-14 04:28:05 +02:00
710918a622 feat: Refactor wayland_poc to use QDBus for xdg-desktop-portal interaction
This commit refactors the wayland_poc executable to use Qt's QDBus
module for interacting with xdg-desktop-portal. This approach bypasses
the problematic direct inclusion of PipeWire session manager headers
(e.g., session-manager.h) that were causing persistent compilation errors.

The wayland_poc now focuses solely on requesting screen capture permission
via D-Bus and retrieving the PipeWire node ID, without attempting to
create or manage PipeWire streams directly.

This change aims to provide a working foundation for the xdg-desktop-portal
interaction, which can then be integrated with the core PipeWire stream
capture logic (demonstrated by tutorial5.c).
2025-08-14 04:26:53 +02:00
c7a4c49e36 feat: Add Dockerfile for reproducible build environment
This commit introduces a Dockerfile to create a reproducible build
environment for the Hyperion Grabber project. This aims to address
persistent compilation issues related to header file discovery on
the host system.

The Dockerfile sets up an Arch Linux base image, installs necessary
dependencies (Qt5, PipeWire, GLib, CMake, etc.), copies the source
code, and attempts to build the project within the container.

This approach provides an isolated and consistent environment, which
should help in diagnosing and resolving build-time problems.
2025-08-14 03:24:06 +02:00
cdc253bbc7 feat: Add Wayland screen capture POC using PipeWire
This commit introduces a standalone proof-of-concept (POC) for screen
capture on Wayland using PipeWire and xdg-desktop-portal.

The POC demonstrates:
- Initializing PipeWire context and core.
- Requesting screen capture permission via xdg-desktop-portal, which
  triggers a user consent dialog.
- Receiving the PipeWire node ID for the selected screen/window.
- Connecting a PipeWire stream to the capture node.
- Processing a single video frame from the PipeWire stream.
- Converting the raw frame data into a QImage and saving it as a PNG file.

This POC serves as a foundational step towards adapting the Hyperion
grabber to work natively on Wayland, replacing the existing X11-specific
grabbing logic.

Further work will involve integrating this logic into the main grabber
application and handling continuous frame processing.
2025-08-14 03:02:54 +02:00
902f88bb24 Feat: Add image send logging
Added a qDebug() statement in hgx11::_sendImage() to log when an image
is created and an attempt is made to send it to the Hyperion server.
This will help determine if the image grabbing and sending pipeline is
active.
2025-08-14 02:49:34 +02:00
3923643708 Feat: Add connection success logging
Added a qDebug() statement in hgx11net::_connectHost() to log a
successful connection to the Hyperion server. This will help confirm
that the network connection is established before any commands are
attempted to be sent.
2025-08-14 02:48:26 +02:00
cd9a45c4f6 Feat: Add logging for outgoing JSON commands
Added a qDebug() statement in hgx11net::_sendCommand() to log the JSON
command string just before it is sent to the Hyperion server. This
will help in debugging why no results are appearing on the Hyperion
end, by confirming if commands are being sent and what their content is.
2025-08-14 02:47:38 +02:00
b6239241c9 Fix: Malformed JSON due to incorrect priority string construction
The JSON output sent to the Hyperion server was malformed, specifically
the "priority" field, leading to an "unterminated object" error.
This was caused by the _hyperionPriority_m variable (and
subsequently _priority_m in hgx11net) containing the literal
"priority:" string, which was then redundantly added during JSON
string construction.

This commit modifies:
- hgx11.cpp: To store only the numerical priority value in
  _hyperionPriority_m.
- hgx11net.cpp: To explicitly add the "priority:" key during JSON
  string construction in all relevant functions (clearLeds,
  setLedColor, _colorAdjustment, _thresholdAdjustment,
  _transformdAdjustment, _temperatureAdjustment, and _setImgSize).

This ensures that the generated JSON is correctly formatted.
2025-08-14 02:26:06 +02:00